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
getenv() and _ENV/_SERVER not in sync #47
Comments
If you allow mutability do the variables loaded through phpdotenv show up in _ENV and _SERVER? If so, I'd say continue doing what you're doing. |
Yes it does, but this means I could never overrule any of the values in .env using a server configured environment variable (like from nginx). |
@alcohol well, I believe this is supposed to replace nginx config as a storeage for environment variables and introduce a single storage for environemnt variable for both CLI and web application -- and if not completely replace, then at least pull common values out of it. Do you really need to keep a certain varibale in both nginx config and .env? |
There's no need, I was merely trying to find out if this is just the way it works or if there might be room for change. I suppose not. So I have nothing further to add :-) |
I'm trying to use a
.env
file together with a minimal Symfony project.My problem is as follows:
What would be the best solution here?
Currently I just always set the state to mutable before calling
load()
.See also https://github.com/php/php-src/blob/master/php.ini-production#L166
and http://symfony.com/doc/current/cookbook/configuration/external_parameters.html#environment-variables
I know I can also change the ini setting, but I am not sure if that is a desirable approach.
Would it be acceptable for dotenv to sync any values from getenv() to _ENV/_SERVER if the former returns a value but the latter has no value for given key?
The text was updated successfully, but these errors were encountered: