-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Look for a .env.local for specific overrides. #586
Conversation
🤔 I like parts of this idea. Though overall I find it a bit weird to have a @austinpray what do you think |
👍 to having a local override option, 👎 to committing the |
|
I wouldn't say they are useless defaults. The idea would be that you would put useful defaults in there and then if something needed to be reconfigured you would add it to the .env.local I find it strange that .env.example is automatically copied to .env during a composer install. If a developer creates a new ENV var then anyone who already has the project setup won't automatically get these variables which could then cause an exception in the application. |
I vote for following
Use case: |
Here is another solution: #587 Don't commit .env and just load .env.example first. If .env exists it will override project defaults. |
@trsteel88 thanks for proposing this and getting us thinking. #595 and #594 are the changes that will come out of all this discussion |
This is a different approach to override ENV variables (one that the Symfony framework follows).
Rather than executing a script from composer.json, .env becomes the default (and is committed).
Then, if you want to override specific variables, you would create a .env.local on the relevant environment. The .env.local is not committed.
This also solves an issue where ENV variables don't exist. e.g. if a dev creates a new ENV variable in .env.example. This isn't automatically appended to any other developers .env variables.
If they were to commit .env with a suitable default, then any other developers using the codebase will automatically use the suitable default defined.