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

[HttpKernel] Normalize "SYMFONY__" environment parameters #18905

Closed
seeeppp opened this Issue May 28, 2016 · 3 comments

Comments

Projects
None yet
4 participants
@seeeppp

seeeppp commented May 28, 2016

I'm currently working on a Symfony 2.8 based project where i ran into an issue using a .env file and vlucas/phpdotenv for setting the environment parameters. For now it's not possible to use a boolean or numeric parameter in the .env file because those parameters aren't normalized and always will be a string.
For my project i added a simple method to the AppKernel that normalizes the .env parameter before setting it to the symfony environment.

I'm not quiet sure if that is a problem that should be fixed in vlucas/phpdotenv or a feature that should be added to the HttpKernel; especially for a 12-factor app?

I created a fork of the standard edition to recreate the problem. Just remove the call of my normalizeEnvValue method in AppKernel::getEnvParameters.

I also would be very glad if someone has a better way solving my problem :-)

@peterrehm

This comment has been minimized.

Show comment
Hide comment
@peterrehm

peterrehm May 29, 2016

Contributor

There is a discussion around this matter here: vlucas/phpdotenv#104

However such normalization could easily be added to SF itself, I do not know if this is wanted, IMHO it would make sense.

Contributor

peterrehm commented May 29, 2016

There is a discussion around this matter here: vlucas/phpdotenv#104

However such normalization could easily be added to SF itself, I do not know if this is wanted, IMHO it would make sense.

@vershnik

This comment has been minimized.

Show comment
Hide comment
@vershnik

vershnik Jun 9, 2016

This should be solved in SF, as environment variable not necessary loaded from .env file using vlucas/phpdotenv

I use ENV instruction in Dockerfile and --env-file option when running container, and I'm getting strings instead of booleans.

vershnik commented Jun 9, 2016

This should be solved in SF, as environment variable not necessary loaded from .env file using vlucas/phpdotenv

I use ENV instruction in Dockerfile and --env-file option when running container, and I'm getting strings instead of booleans.

@javiereguiluz

This comment has been minimized.

Show comment
Hide comment
@javiereguiluz

javiereguiluz Oct 24, 2016

Member

To give some context on why this issue was closed ... there is a proposal to deprecate these variables entirely (and remove them in future Symfony versions): #20089

Member

javiereguiluz commented Oct 24, 2016

To give some context on why this issue was closed ... there is a proposal to deprecate these variables entirely (and remove them in future Symfony versions): #20089

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment