Skip to content

Commit

Permalink
Refactored environment file
Browse files Browse the repository at this point in the history
  • Loading branch information
jongravois committed Apr 15, 2015
1 parent 1d86b64 commit 013bb2c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion bootstrap/start.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@
$app = new Illuminate\Foundation\Application;

$env = $app->detectEnvironment( function () {
return getenv('APP_ENV') ?: 'local';

// Defined in the server configuration
if ( isset( $_SERVER['APP_ENVIRONMENT'] ) ) {
return $_SERVER['APP_ENVIRONMENT'];

// Look for ./environment.php
} elseif ( file_exists( __DIR__ . '/environment.php' ) ) {
return include __DIR__ . '/environment.php';
}

});

$app->bindInstallPaths(require __DIR__.'/paths.php');
Expand Down

0 comments on commit 013bb2c

Please sign in to comment.