diff --git a/common/oatbox/service/ServiceManager.php b/common/oatbox/service/ServiceManager.php index ed35906e9..5d3a414a4 100644 --- a/common/oatbox/service/ServiceManager.php +++ b/common/oatbox/service/ServiceManager.php @@ -265,6 +265,12 @@ public function getContainer(): ContainerInterface return $this->getContainerStarter()->getContainer(); } + public function rebuildContainer(): void + { + $this->getContainerStarter()->getContainerBuilder()->forceBuild(); + $this->containerStarter = null; + } + /** * @TODO ContainerBuilder will be removed from here as soon as we do not need ServiceManager anymore. */ diff --git a/scripts/tools/ContainerCacheWarmup.php b/scripts/tools/ContainerCacheWarmup.php index bf47021e0..39f451135 100644 --- a/scripts/tools/ContainerCacheWarmup.php +++ b/scripts/tools/ContainerCacheWarmup.php @@ -49,7 +49,7 @@ protected function provideDescription(): string protected function run(): Report { - $this->getServiceManager()->getContainerBuilder()->forceBuild(); + $this->getServiceManager()->rebuildContainer(); return Report::createSuccess('Dependency Injection Container cache warmed up!'); }