Skip to content

Commit 695097c

Browse files
committed
check if running in console
1 parent dc2e925 commit 695097c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Illuminate/Foundation/Application.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,9 @@ public function isProduction()
609609
*/
610610
public function detectEnvironment(Closure $callback)
611611
{
612-
$args = $_SERVER['argv'] ?? null;
612+
$args = $this->runningInConsole() && $_SERVER['argv']
613+
? $_SERVER['argv']
614+
: null;
613615

614616
return $this['env'] = (new EnvironmentDetector)->detect($callback, $args);
615617
}

0 commit comments

Comments
 (0)