protected function DrupalKernel::buildContainer

Builds the service container.

Return value

ContainerBuilder The compiled service container

Overrides Kernel::buildContainer

1 call to DrupalKernel::buildContainer()
DrupalKernel::initializeContainer in drupal/core/lib/Drupal/Core/DrupalKernel.php
Initializes the service container.

File

drupal/core/lib/Drupal/Core/DrupalKernel.php, line 329
Definition of Drupal\Core\DrupalKernel.

Class

DrupalKernel
The DrupalKernel class is the core of Drupal itself.

Namespace

Drupal\Core

Code

protected function buildContainer() {
  $this
    ->initializeBundles();
  $container = $this
    ->getContainerBuilder();
  $container
    ->setParameter('container.bundles', $this->bundleClasses);
  $container
    ->setParameter('container.modules', $this
    ->getModuleFileNames());

  // Register the class loader as a synthetic service.
  $container
    ->register('class_loader', 'Symfony\\Component\\ClassLoader\\UniversalClassLoader')
    ->setSynthetic(TRUE);
  foreach ($this->bundles as $bundle) {
    $bundle
      ->build($container);
  }
  $container
    ->compile();
  return $container;
}