-
-
Notifications
You must be signed in to change notification settings - Fork 498
Allow changing environement when .env.local.php
exists.
#647
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request passes validation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request passes validation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request passes validation.
This prevents surprises when you have generated the file, and then run your tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request passes validation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works for me
this PR assumes we do this in docker: all env vars are provided by real env vars. I'll submit a PR when i get a moment. |
I'm not sure if this is useful for other people - but I'm sharing it, and you can just reject it if not :)
I got here because I'm building a docker image, with all my code, and optimising it for prod run time, so I've run
composer dump-env prod
- but I want to use the same image to run my tests - so I'm testing in the prod system. But actually this is easy to repeat in your dev environment, if you dump prod, and leave it there, you no longer get.env.dev
loaded.Basically if
.env.local.php
exists, the environment no longer properly switches, as the.env.$env
files are not used. This PR changes this so that the correct env is always loaded.