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] Stop considering empty env vars as populated#48705
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
06668f7 to9690fb8Compare9690fb8 toa8f8903Comparenicolas-grekas commentedDec 28, 2022
PR rebased on 6.3 |
fabpot commentedDec 28, 2022
Thank you@nicolas-grekas. |
PhilETaylor commentedApr 20, 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.
Just a question on this. Prior to 6.3 it was common to have things like in the returnstaticfunction (ContainerConfigurator$containerConfigurator):void {$containerConfigurator->extension('sentry', ['dsn' =>env('SENTRY_DSN'), ] );}; or in the Is it the intention of this PR to introduce a b/c break where this would work in 6.2, but after upgrading to Symfony 6.3, this would now throw an If it was your intention for this to not be backward compatible, then cool - it worked :) Just trying to work out if it's on purpose or a bug introduced. |
nicolas-grekas commentedApr 20, 2023
Did you experience this exception or are you just wondering? If you're wondering, can you give it a try? |
PhilETaylor commentedApr 20, 2023
I've experienced it on multiple projects upgrading to 6.3.x-dev sorry Will dig deeper tomorrow and find a minimal reproducer for you |
PhilETaylor commentedApr 21, 2023
As promised, a scaled down reproducer is detailed here for you#50094 |
…:list (nicolas-grekas)This PR was merged into the 6.3 branch.Discussion----------[FrameworkBundle] Ignore vars from dotenv files in secrets:list| Q | A| ------------- | ---| Branch? | 6.3| Bug fix? | yes| New feature? | no| Deprecations? | no| Tickets | -| License | MIT| Doc PR | -Sidekick of#48705Commits-------8561045 [FrameworkBundle] Ignore vars from dotenv files in secrets:list
…vars (Okhoshi)This PR was merged into the 6.3 branch.Discussion----------[DependencyInjection] Fix support for `false` boolean env vars| Q | A| ------------- | ---| Branch? | 6.3| Bug fix? | yes| New feature? | no| Deprecations? | no| Tickets | -| License | MIT| Doc PR | -After upgrading `symfony/dependency-injection` package 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 `$_SERVER` directly. However, since version 6.3 of the DependencyInjection component, setting an env var to `false` (the boolean value, like in the snippet below) doesn't work anymore, and Symfony reports that the variable cannot be found.```php$_SERVER['FOO'] = false;```It seems to be a side effect of the changes made in#48705.Commits-------5101d18 [DependencyInjection] Fix support for `false` boolean env vars
Uh oh!
There was an error while loading.Please reload this page.
When a
.envfile declares an empty var (egFOO=), env-var loaders are skipped.This is a foot gun that has hit me many times when using secrets and that I consider a DX bug.
This PR fixes the issue by ensuring that env vars defined as empty strings don't prevent loaders from being called.