You are here

protected function DrupalKernel::initializeServiceProviders in Zircon Profile 8

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

Registers all service providers to the kernel.

Throws

\LogicException

1 call to DrupalKernel::initializeServiceProviders()
DrupalKernel::compileContainer in core/lib/Drupal/Core/DrupalKernel.php
Compiles a new service container.

File

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

Class

DrupalKernel
The DrupalKernel class is the core of Drupal itself.

Namespace

Drupal\Core

Code

protected function initializeServiceProviders() {
  $this
    ->discoverServiceProviders();
  $this->serviceProviders = array(
    'app' => array(),
    'site' => array(),
  );
  foreach ($this->serviceProviderClasses as $origin => $classes) {
    foreach ($classes as $name => $class) {
      if (!is_object($class)) {
        $this->serviceProviders[$origin][$name] = new $class();
      }
      else {
        $this->serviceProviders[$origin][$name] = $class;
      }
    }
  }
}