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

Support 'standard' Symfony .env options #1973

Closed
simongroenewolt opened this issue Oct 9, 2020 · 1 comment · Fixed by #2082
Closed

Support 'standard' Symfony .env options #1973

simongroenewolt opened this issue Oct 9, 2020 · 1 comment · Fixed by #2082

Comments

@simongroenewolt
Copy link
Contributor

At the moment Bolt 4 only supports one file for environment variables configuration: .env

Symfony supports overriding/extending .env based on the environment (.env.prod / env.test), and allows additional .local suffix for local changes not meant to be checked in to version control. This is really convenient.

See:

https://symfony.com/doc/current/configuration.html#configuring-environment-variables-in-env-files

https://symfony.com/doc/current/configuration.html#overriding-environment-values-via-env-local

I'd think supporting this wouldn't make anyone's existing config to break, but it will enable lots of developers with Symfony experience to use env files like they are used to.

How can you help?

I can create a pull request, It looks like this could even be a 1 line change.

@simongroenewolt
Copy link
Contributor Author

simongroenewolt commented Oct 9, 2020

Hmm, I just noticed:

// The check is to ensure we don't use .env in production
if (! isset($_SERVER['APP_ENV'])) {

This doesn't mean this change will not work, and I don't see the setting of APP_ENV specified in the documentation. But it needs a second look - maybe it's only the comment that needs a change, like:

// The check is to ensure you can completely disable Dotenv loading by setting APP_ENV externally.
if (! isset($_SERVER['APP_ENV'])) {

Then it would be correct again. I've marked the PR as 'Draft' for the moment.

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 a pull request may close this issue.

1 participant