Skip to content

Commit

Permalink
fix: rebuilding DI container when it was already built during same re…
Browse files Browse the repository at this point in the history
…quest
  • Loading branch information
augustas committed Jun 18, 2024
1 parent a9fc27a commit 991c0e9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions common/oatbox/service/ServiceManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,11 @@ public function getContainer(): ContainerInterface

public function rebuildContainer(): void
{
// if container was already built on same request, it has to be restarted before rebuild
// to avoid fatal error of compiled container modification
$this->containerStarter = null;
$this->getContainerStarter()->getContainerBuilder()->forceBuild();
// after container rebuild this cached starter needs a reset, to avoid using container already cached in memory
$this->containerStarter = null;
}

Expand Down

0 comments on commit 991c0e9

Please sign in to comment.