protected function DrupalKernel::initializeServiceProviders in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/DrupalKernel.php \Drupal\Core\DrupalKernel::initializeServiceProviders()
- 9 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 1266
Class
- DrupalKernel
- The DrupalKernel class is the core of Drupal itself.
Namespace
Drupal\CoreCode
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;
}
}
}
}