Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[DependencyInjection] Fix support forfalse boolean env vars#50530
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
stof commentedJun 1, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
environment variables are always strings though. What you are covering in tests is not something compatible with actual environment variables (or with the DotEnv component). |
okhoshi commentedJun 1, 2023
Because you can set any scalar value from PHP code, and they won't be converted to strings nor anything will prevent you to set them in the first place. FWIW, we've never had any troubles so far, be it with Symfony or DotEnv component. I'm covering with tests because it was a supported behaviour that has been broken with 6.3 release. If you think it shouldn't have been supported from the start, and thus that this is not a bug, I'm also fine with that, feel free to let me know and close this PR. |
stof commentedJun 1, 2023
It was not asupported behavior. It was anundefined behavior that happened to work. |
nicolas-grekas left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Works for me, I'm fine keeping the behavior from 6.2.
nicolas-grekas commentedJun 9, 2023
Thank you@okhoshi. |
After upgrading
symfony/dependency-injectionpackage to version 6.3, some of our env vars couldn't be found anymore.For some scripts, we are providing an adhoc default value to env vars by setting
$_SERVERdirectly. However, since version 6.3 of the DependencyInjection component, setting an env var tofalse(the boolean value, like in the snippet below) doesn't work anymore, and Symfony reports that the variable cannot be found.It seems to be a side effect of the changes made in#48705.