function DrupalKernel::rebuildContainer

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/DrupalKernel.php \Drupal\Core\DrupalKernel::rebuildContainer()
  2. 10 core/lib/Drupal/Core/DrupalKernel.php \Drupal\Core\DrupalKernel::rebuildContainer()
  3. 9 core/lib/Drupal/Core/DrupalKernel.php \Drupal\Core\DrupalKernel::rebuildContainer()
  4. 8.9.x core/lib/Drupal/Core/DrupalKernel.php \Drupal\Core\DrupalKernel::rebuildContainer()

File

core/lib/Drupal/Core/DrupalKernel.php, line 1260

Class

DrupalKernel
The DrupalKernel class is the core of Drupal itself.

Namespace

Drupal\Core

Code

public function rebuildContainer() {
  // Empty module properties and for them to be reloaded from scratch.
  $this->moduleList = NULL;
  $this->moduleData = [];
  $this->themeList = NULL;
  $this->themeExtensions = [];
  $this->containerNeedsRebuild = TRUE;
  $container = $this->initializeContainer();
  // ThemeManager::render() fails without this. Normally ::preHandle() has
  // a ->loadAll() call.
  $container->get('module_handler')
    ->loadAll();
  return $container;
}

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