Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.8] Allow console environment argument to be separated with a space #28869

Merged
merged 1 commit into from
Jun 17, 2019
Merged

[5.8] Allow console environment argument to be separated with a space #28869

merged 1 commit into from
Jun 17, 2019

Conversation

ThibaudDauce
Copy link
Contributor

Following explanations are from @matt-allan in the issue #28831:

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:

$ 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.

Fixes #28831

@taylorotwell taylorotwell merged commit 85137e0 into laravel:5.8 Jun 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EnvironmentDetector doesn't parse options separated with a space
2 participants