Skip to content

Deprecate accessing environment variables prefixed by SYMFONY__ as parameters #21997

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

Closed
wants to merge 1 commit into from

Conversation

chalasr
Copy link
Member

@chalasr chalasr commented Mar 14, 2017

Q A
Branch? master
Bug fix? no
New feature? no
BC breaks? no
Deprecations? yes
Tests pass? yes
Fixed tickets #20089
License MIT
Doc PR n/a

Replaces #21889

@nicolas-grekas
Copy link
Member

nicolas-grekas commented Mar 14, 2017

I don't fully agree with the reasoning presented in #21889 (comment) but let's be OK for now.
Adding a check like done here in ParameterBag looks wrong to me. ParameterBag does not deal with env vars, why should it care at all now? There is a responsibility mismatch to me.
I'd way better go with #21889 for now (the deprecation of getEnvParameters is nice and should be kept.)

@nicolas-grekas nicolas-grekas added this to the 3.3 milestone Mar 14, 2017
@chalasr
Copy link
Member Author

chalasr commented Mar 14, 2017

Getting parameters automatically created from SYMFONY__ env vars is what we are deprecating to me. How would you detect that the user is relying on the fact we transform env vars into parameters than doing this check in ParameterBag::get()? We could store the env-related params in a prop when setting them from Kernel::getEnvParameters() instead of reversing the transformation, but it would still involve to do this check here.

@nicolas-grekas
Copy link
Member

I don't know yet, but right now, the drawback of this implem (SRP break) is worse than the drawback of the implem in #21889 (a theoretical false positive).

@chalasr
Copy link
Member Author

chalasr commented Mar 14, 2017

We'll remove this check in 4.0 as well as the practice, IMHO we don't care but of course I would go for any better alternative.

@chalasr chalasr closed this Mar 14, 2017
@chalasr chalasr deleted the deprec-sf__-vars branch March 14, 2017 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants