diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php index b5953f1..db55db8 100644 --- a/core/lib/Drupal/Core/DrupalKernel.php +++ b/core/lib/Drupal/Core/DrupalKernel.php @@ -7,9 +7,9 @@ namespace Drupal\Core; +use Drupal\Component\Utility\Settings; use Drupal\Component\PhpStorage\PhpStorageFactory; use Drupal\Core\Config\BootstrapConfigStorageFactory; -use Drupal\Core\CoreServiceProvider; use Drupal\Core\DependencyInjection\ContainerBuilder; use Drupal\Core\DependencyInjection\ServiceProviderInterface; use Drupal\Core\DependencyInjection\YamlFileLoader; @@ -200,6 +200,15 @@ public function getContainer() { } /** + * Gets the settings instance. + * + * @return \Drupal\Component\Utility\Settings + */ + protected function settings() { + return Settings::getSingleton(); + } + + /** * {@inheritdoc} */ public function discoverServiceProviders() { @@ -222,8 +231,8 @@ public function discoverServiceProviders() { $this->registerNamespaces($this->getModuleNamespaces($module_filenames)); // Add site specific or test namespaces. - if (!empty($GLOBALS['settings']['container_namespaces'])) { - $this->registerNamespaces($GLOBALS['settings']['container_namespaces']); + if ($autoload_namespaces = $this->settings()->get('autoload_namespaces', array())) { + $this->registerNamespaces($autoload_namespaces); } // Load each module's serviceProvider class.