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.5] Do not continue checking APP_ENV if environment file path has being set #22753

Merged
merged 1 commit into from
Jan 12, 2018

Conversation

tianhe1986
Copy link
Contributor

It is a very interesting case our team just encountered.

There are two files, .env.local and .env.testing in the project. And in a developing server, it adds export APP_ENV=local in /etc/profile to define the environment.

One of team member copied .env.local to .env.testing.local. Then another person run a command with testing environment using

php artisan XXX --env testing

and found the result was not as expected.

After setting environment file path .env.testing with --env option, it continued to checking the global APP_ENV definition and tried to set the file path .env.testing.local again. At last, it was the later file being loaded.

It may be a rare case, however, I think this PR is mainly meaning "--env option has higher priority than the global definition".

… successfully with `--env` option.

Signed-off-by: tianhe1986 <w1s2j3229@163.com>
@taylorotwell taylorotwell merged commit 197a7c3 into laravel:5.5 Jan 12, 2018
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.

2 participants