From 013bb2c28aa664b643eafeed275808875452ff4a Mon Sep 17 00:00:00 2001 From: Jon Gravois Date: Wed, 15 Apr 2015 11:07:59 -0500 Subject: [PATCH] Refactored environment file --- bootstrap/start.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bootstrap/start.php b/bootstrap/start.php index ed9cfbbb..866ccc61 100644 --- a/bootstrap/start.php +++ b/bootstrap/start.php @@ -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');