Fix in detecting production env

By default `detectEnvironment()` returns `production` when environment is not detected.

However when `Closure` is passed the value returned by it will be set as environment.  
In this case returning `null` means that Laravel won't recognize any environment. In such situation any `production` configs won't be loaded.
This commit is contained in:
Radosław Mejer 2014-06-20 11:37:47 +02:00
parent df25c5d9f7
commit a21b12d502

View File

@ -25,7 +25,7 @@ $app = new Illuminate\Foundation\Application;
*/
$env = $app->detectEnvironment(function(){
return isset($_SERVER['CMS_ENV']) ? $_SERVER['CMS_ENV'] : null;
return isset($_SERVER['CMS_ENV']) ? $_SERVER['CMS_ENV'] : 'production';
});
/*