Skip to content

Commit 18b326d

Browse files
committed
only use argv on console
1 parent cdf07b6 commit 18b326d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Illuminate/Foundation/Application.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,9 @@ public function isProduction()
759759
*/
760760
public function detectEnvironment(Closure $callback)
761761
{
762-
$args = $_SERVER['argv'] ?? null;
762+
$args = $this->runningInConsole() && $_SERVER['argv']
763+
? $_SERVER['argv']
764+
: null;
763765

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

0 commit comments

Comments
 (0)