You are here

protected function DrupalKernel::attachSynthetic in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/DrupalKernel.php \Drupal\Core\DrupalKernel::attachSynthetic()

Attach synthetic values on to kernel.

Parameters

ContainerInterface $container: Container object

Return value

ContainerInterface

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

File

core/lib/Drupal/Core/DrupalKernel.php, line 1088
Contains \Drupal\Core\DrupalKernel.

Class

DrupalKernel
The DrupalKernel class is the core of Drupal itself.

Namespace

Drupal\Core

Code

protected function attachSynthetic(ContainerInterface $container) {
  $persist = array();
  if (isset($this->container)) {
    $persist = $this
      ->getServicesToPersist($this->container);
  }
  $this
    ->persistServices($container, $persist);

  // All namespaces must be registered before we attempt to use any service
  // from the container.
  $this
    ->classLoaderAddMultiplePsr4($container
    ->getParameter('container.namespaces'));
  $container
    ->set('kernel', $this);

  // Set the class loader which was registered as a synthetic service.
  $container
    ->set('class_loader', $this->classLoader);
  return $container;
}