Skip to content

Commit

Permalink
use env super global
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Nov 21, 2018
1 parent a36906a commit 19f2245
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Illuminate/Foundation/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}

/**
Expand Down

0 comments on commit 19f2245

Please sign in to comment.