Skip to content

Commit

Permalink
fix(dependency-injection): reset env vars with kernel.reset
Browse files Browse the repository at this point in the history
- fixes #59128
  • Loading branch information
faizanakram99 committed Jan 10, 2025
1 parent 900d2ea commit 5ebf7d4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,14 @@ public function reset(): void
$this->envCache = $this->services = $this->factories = $this->privates = [];
}

/**
* @internal
*/
public function resetEnvCache(): void
{
$this->envCache = [];
}

/**
* Gets all service ids.
*
Expand Down
4 changes: 4 additions & 0 deletions EnvVarProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -374,5 +374,9 @@ public function reset(): void
{
$this->loadedVars = [];
$this->loaders = $this->originalLoaders;

if ($this->container instanceof Container) {
$this->container->resetEnvCache();
}
}
}

0 comments on commit 5ebf7d4

Please sign in to comment.