Skip to content

Commit 6d53774

Browse files
committed
Merge branch 'env-check' into 11.x
2 parents 4500be3 + 18b326d commit 6d53774

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)