Skip to content

Commit

Permalink
Merge branch 'env-check' into 11.x
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Nov 12, 2024
2 parents 4500be3 + 18b326d commit 6d53774
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Illuminate/Foundation/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,9 @@ public function isProduction()
*/
public function detectEnvironment(Closure $callback)
{
$args = $_SERVER['argv'] ?? null;
$args = $this->runningInConsole() && $_SERVER['argv']
? $_SERVER['argv']
: null;

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

0 comments on commit 6d53774

Please sign in to comment.