You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ php artisan serve --port=9090
Laravel development server started: <http://127.0.0.1:9090>
$ php artisan serve --port 9090
Laravel development server started: <http://127.0.0.1:9090>
However, the --env option is only parsed correctly if you use an equals sign. If you use a space app()->environment() will return false.
This inconsistency is pretty confusing and difficult to debug. If you dump $this->option('env') in a command it will return the expected value but $app()->environment() will return false.
Steps To Reproduce:
Pass the --env flag to tinker, i.e. `php artisan tinker --env testing
This appears to be happening because the environment detector uses $_SERVER['argv'] and $_SERVER['argv'] splits the options into two separate array elements if you use a space instead of an equals sign, and the EnvironmentDetectorexpects a single element to contain both the name and the value.
Description:
The Symfony console component that is used by the Artisan console allows separating option names and values with either a space or an equals (
=
) sign. For example:However, the
--env
option is only parsed correctly if you use an equals sign. If you use a spaceapp()->environment()
will return false.This inconsistency is pretty confusing and difficult to debug. If you dump
$this->option('env')
in a command it will return the expected value but$app()->environment()
will return false.Steps To Reproduce:
--env
flag totinker
, i.e. `php artisan tinker --env testingapp()->environment()
in the tinker shellThis appears to be happening because the environment detector uses
$_SERVER['argv']
and$_SERVER['argv']
splits the options into two separate array elements if you use a space instead of an equals sign, and theEnvironmentDetector
expects a single element to contain both the name and the value.The text was updated successfully, but these errors were encountered: