-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[RFC][Dotenv] Introduce DOTENV_OVERLOAD #29170
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
Comments
Another idea: load .env.dist when .env is not found, in loadEnv(). Would it make sense? |
hm 🤔 i need .env.local to be loaded :) Currently flex still generates both .env and .env.dist with the same contents, and AFAIK for the same purpose - to be committed in VCS. Im still stuck wi 8000 th the vars from .env being loaded as real envs / pre-bootstrap. |
See #29171 for an alternative. I think it solves the issue without introducing radically new idiomatism. |
got ya, it would work yes. I simply remove .env then is there some Flex WIP going on still? Or will it always generate both now the same, for the user to decide what to keep and what not. |
The plan is to remove |
…nd (nicolas-grekas) This PR was merged into the 4.2-dev branch. Discussion ---------- [Dotenv] load .env.dist when it exists and .env is not found | Q | A | ------------- | --- | Branch? | 4.2 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #29170 | License | MIT | Doc PR | - As illustrated in #29170, it can be useful to opt out from the `.env` convention and fall back to defining env vars in `.env.dist` instead. This PR allows that by loading `.env.dist` when it exists and `.env` is not found. Needs symfony/flex#434 to work seamlessly when using Flex. Commits ------- 841185b [Dotenv] load .env.dist when it exists and .env is not found
Description
Now .env is the new .env.dist, im kinda stuck with local infrastructure.
The setup auto-detects .env and creates real envs as such in the container being spinned up. This totally breaks things as .env.local is not being loaded at this point.
To keep things simple (i cant really control this yet - lando/lando#994) it would be nice to control overloading for now with a new
DOTENV_OVERLOAD=1
var.It would be auto-detected in
Dotenv::loadEnv()
and togglesload()
vsoverload()
as such.Thoughts?
The text was updated successfully, but these errors were encountered: