-
-
Notifications
You must be signed in to change notification settings - Fork 159
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
Use ->loadEnv()
instead of ->load()
to support the 'standard' Symfony…
#1974
Use ->loadEnv()
instead of ->load()
to support the 'standard' Symfony…
#1974
Conversation
… way of loading .env files. This means .env.<environment> for environment specific overrides (e.g. .env.prod) and .env.local and .env.<environment>.local to make local changes (keep your .local files out of version control)
Hmm, hold on - Is Bolt currently set up to ignore the .env if APP_ENV is set from somewhere else? In that case my proposed change might be slightly confusing / need more work. |
Why is this change found in bolt/core? Bolt/core should be a component, it is found in dependency of a symfony project for example. So this kind of change should not exist here, because it is related to the project (see bolt/project#31, I have already made a change) and not to the component. And I think you are adding a maintenance overhead for the core for nothing |
@toofff ah, I forgot about bolt/project when working on this. The 'problem' is that developers on bolt/core itself are using the scripts that are in this repository (I do). I'd say as long as the files I made the change to are in bolt/core, this change makes sense here. You are correct that for end-users the change should be made to https://github.com/bolt/project . Ideally these scripts should not be duplicated between the two repositories, but I don't know how that would be handled. Good work on bolt/project/pull/31! I see you're using bootEnv() instead of loadEnv() to include even more fallbacks. |
I think this PR looks good! And indeed, some of these changes overlap in The usecase is slightly different as well:
I have not yet merged @toofff 's PR for 'project', because i need to verify it won't break for people who don't use Docker. :-) @simongroenewolt Do you want to update this PR to use Do the two of you think that makes sense? |
@bobdenotter I find that to make sense. 👍 For my PR on the project, for me it is finished because the container "node" is only necessary for the development of "bolt/assets", so no interest in having it here. (I will answer in this way in the other PR) |
…e latest Symfony -- this allows a .env.local.php as an override that will be loaded if it is present instead of the cascaded loading/overriding from the .env.* files. Updated the comment about overriding Dotenv by setting the APP_ENV environment variable to better match the actual use case instead. The current recommended way to optimize Dotenv for production seems to be creating an .env.local.php file. -- use `composer dump-env prod` to create such a file. None of this really matters a lot for bolt/core, as the typical use of bolt will use the files form bolt/project
@bobdenotter updated to use bootEnv() FYI: bootEnv() picks up the .env.local.php file if it exists, that you can generate with |
Agreed. Let's make changes like these gradually. I'm going to merge this in to the |
->loadEnv()
instead of ->load()
to support the 'standard' Symfony…
… way of loading .env files. This means .env. for environment specific overrides (e.g. .env.prod) and .env.local and .env..local to make local changes (keep your .local files out of version control)
See #1973