From 19f2245c6d7c87daf784f94b169f0dd4d98f0ca4 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 20 Nov 2018 22:00:03 -0600 Subject: [PATCH] use env super global --- src/Illuminate/Foundation/Application.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Illuminate/Foundation/Application.php b/src/Illuminate/Foundation/Application.php index 5b7299251e19..f2e832c3cbae 100755 --- a/src/Illuminate/Foundation/Application.php +++ b/src/Illuminate/Foundation/Application.php @@ -515,10 +515,11 @@ public function detectEnvironment(Closure $callback) */ public function runningInConsole() { - return env( - 'LARAVEL_RUNNING_IN_CONSOLE', - php_sapi_name() === 'cli' || php_sapi_name() === 'phpdbg' - ); + if (isset($_ENV['APP_RUNNING_IN_CONSOLE'])) { + return $_ENV['APP_RUNNING_IN_CONSOLE'] === 'true'; + } + + return php_sapi_name() === 'cli' || php_sapi_name() === 'phpdbg'; } /**