You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a Symfony application in which I want to load all the .env files for local development, but not in the production environment, in which I handle those differently by using some tools offered by the cloud provider. So what I've ended up with is adding the following lines in public/index.php and in bin/console:
I find this quite cumbersome and it leads to duplicated code. Therefore I would suggest to introduce an environment variable, which is handled somehow by Symfony (e.g. the Runtime component). Then I could just set this variable in our cloud environment. I would also be open to contribute this myself after receiving at least some guidance.
Example
I would suggest that instead of the above code I can set an environment variable to disable loading .env files. E.g. something like this:
APP_DISABLE_DOTENV=1
With that variable being set to 1.env files would not be loaded, if it is set to 0 they are being loaded.
The text was updated successfully, but these errors were encountered:
Description
I have a Symfony application in which I want to load all the
.env
files for local development, but not in the production environment, in which I handle those differently by using some tools offered by the cloud provider. So what I've ended up with is adding the following lines inpublic/index.php
and inbin/console
:I find this quite cumbersome and it leads to duplicated code. Therefore I would suggest to introduce an environment variable, which is handled somehow by Symfony (e.g. the
Runtime
component). Then I could just set this variable in our cloud environment. I would also be open to contribute this myself after receiving at least some guidance.Example
I would suggest that instead of the above code I can set an environment variable to disable loading
.env
files. E.g. something like this:With that variable being set to
1
.env
files would not be loaded, if it is set to0
they are being loaded.The text was updated successfully, but these errors were encountered: