function InstallerKernel::attachSynthetic

Attach synthetic values on to kernel.

Parameters

\Symfony\Component\DependencyInjection\ContainerInterface $container: Container object.

Return value

\Symfony\Component\DependencyInjection\ContainerInterface The container object with the kernel and the class loader added.

Overrides DrupalKernel::attachSynthetic

File

core/lib/Drupal/Core/Installer/InstallerKernel.php, line 90

Class

InstallerKernel
Extend DrupalKernel to handle force some kernel behaviors.

Namespace

Drupal\Core\Installer

Code

protected function attachSynthetic(ContainerInterface $container) : void {
  parent::attachSynthetic($container);
  // Reset any existing container in order to avoid holding on to old object
  // references, otherwise memory usage grows exponentially with each rebuild
  // when multiple modules are being installed.
  // @todo Move this to the parent class after https://www.drupal.org/i/2066993
  $this->container?->reset();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.