Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. DrupalKernel.php

function 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 1389

Class

DrupalKernel
The DrupalKernel class is the core of Drupal itself.

Namespace

Drupal\Core

Code

protected function initializeServiceProviders() {
    $this->discoverServiceProviders();
    $this->serviceProviders = [
        'app' => [],
        'site' => [],
    ];
    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;
            }
        }
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal