Skip to content

Commit

Permalink
add env override for running in console
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Nov 21, 2018
1 parent 3298b53 commit a36906a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Illuminate/Foundation/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,10 @@ public function detectEnvironment(Closure $callback)
*/
public function runningInConsole()
{
return php_sapi_name() === 'cli' || php_sapi_name() === 'phpdbg';
return env(
'LARAVEL_RUNNING_IN_CONSOLE',
php_sapi_name() === 'cli' || php_sapi_name() === 'phpdbg'
);
}

/**
Expand Down

0 comments on commit a36906a

Please sign in to comment.