Skip to content

Commit 5ebf7d4

Browse files
committed
fix(dependency-injection): reset env vars with kernel.reset
- fixes #59128
1 parent 900d2ea commit 5ebf7d4

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Container.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,14 @@ public function reset(): void
290290
$this->envCache = $this->services = $this->factories = $this->privates = [];
291291
}
292292

293+
/**
294+
* @internal
295+
*/
296+
public function resetEnvCache(): void
297+
{
298+
$this->envCache = [];
299+
}
300+
293301
/**
294302
* Gets all service ids.
295303
*

EnvVarProcessor.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,5 +374,9 @@ public function reset(): void
374374
{
375375
$this->loadedVars = [];
376376
$this->loaders = $this->originalLoaders;
377+
378+
if ($this->container instanceof Container) {
379+
$this->container->resetEnvCache();
380+
}
377381
}
378382
}

0 commit comments

Comments
 (0)