Commit 165ba7ec authored by alexpott's avatar alexpott

Issue #2795789 by Fabianx, jibran, dawehner, alexpott: Do not rebuild the container so often in BTB

parent d4f1cb5a
......@@ -383,10 +383,13 @@ protected function initUserSession() {
*/
protected function initKernel(Request $request) {
$this->kernel = DrupalKernel::createFromRequest($request, $this->classLoader, 'prod', TRUE);
$this->kernel->prepareLegacyRequest($request);
// Force the container to be built from scratch instead of loaded from the
// disk. This forces us to not accidentally load the parent site.
return $this->kernel->rebuildContainer();
$this->kernel->invalidateContainer();
$this->kernel->prepareLegacyRequest($request);
return \Drupal::getContainer();
}
/**
......@@ -420,8 +423,8 @@ protected function installModulesFromClassProperty(ContainerInterface $container
// The exception message has all the details.
$this->fail($e->getMessage());
}
$this->rebuildContainer();
// The container was already rebuilt by the ModuleInstaller.
$this->container = \Drupal::getContainer();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment