Commit f8296b7
committed
bug symfony#59136 [DependencyInjection] Reset env vars with
This PR was merged into the 7.1 branch.
Discussion
----------
[DependencyInjection] Reset env vars with `kernel.reset`
| Q | A
| ------------- | ---
| Branch? | 7.1
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | Fix symfony#59128
| License | MIT
As mentioned in symfony#59128 and symfony#54666 (comment) (and proceeding comments), EnvVarProcessor isn't tagged with kernel.reset, hence its reset method is never called in ServicesResetter.
Another issue was that env vars are cached high up in stack (in Container class) and even if EnvVarProcessor's cached env vars are cleared, env var loaders still won't be called as env var loaders are called only for missing env keys.
This PR fixes symfony#59128 by adding the missing tag and also clears "env cache" of Container in `EnvVarProcessor::reset()` method (i.e. whenever env vars of EnvVarProcessor are cleared). This is a safe change and won't break existing apps using symfony messenger.
cc `@bendavies`
Commits
-------
4c9e1a4 fix(dependency-injection): reset env vars with kernel.resetkernel.reset (faizanakram99)File tree
3 files changed
+13
-0
lines changed- src/Symfony
- Bundle/FrameworkBundle/Resources/config
- Component/DependencyInjection
3 files changed
+13
-0
lines changedLines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| 198 | + | |
198 | 199 | | |
199 | 200 | | |
200 | 201 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
293 | 301 | | |
294 | 302 | | |
295 | 303 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
377 | 381 | | |
378 | 382 | | |
0 commit comments