diff --git a/core/lib/Drupal/Core/CoreBundle.php b/core/lib/Drupal/Core/CoreBundle.php index c98df21..43bf208 100644 --- a/core/lib/Drupal/Core/CoreBundle.php +++ b/core/lib/Drupal/Core/CoreBundle.php @@ -34,7 +34,6 @@ class CoreBundle extends Bundle { */ public function build(ContainerBuilder $container) { - $container->setParameter('extension_handler.class', 'Drupal\Core\ExtensionHandler'); // Register active configuration storage. $container ->register('config.cachedstorage.storage', 'Drupal\Core\Config\FileStorage') @@ -114,12 +113,11 @@ public function build(ContainerBuilder $container) { // The ExtensionHandler manages enabled modules and provides the ability to // invoke hooks in all enabled modules. - $container->register('extension_handler', '%extension_handler.class%') + $container->register('extension_handler', 'Drupal\Core\ExtensionHandler') ->addArgument('%container.modules%') ->addArgument(new Reference('keyvalue')) - ->addArgument(new Reference('cache.cache')) ->addArgument(new Reference('cache.bootstrap')); - + $container->register('resolver', 'Drupal\Core\ControllerResolver') ->addArgument(new Reference('service_container')); $container->register('http_kernel', 'Drupal\Core\HttpKernel') diff --git a/core/lib/Drupal/Core/ExtensionHandler.php b/core/lib/Drupal/Core/ExtensionHandler.php index dd74b3f..3db1347 100644 --- a/core/lib/Drupal/Core/ExtensionHandler.php +++ b/core/lib/Drupal/Core/ExtensionHandler.php @@ -15,14 +15,11 @@ class ExtensionHandler implements ExtensionHandlerInterface { /** - * Database connection object. - */ - protected $connection; - - /** - * Cache backend that stores system info. + * State key/value store. + * + * @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface */ - protected $cache; + protected $state; /** * Cache backend for storing enabled modules. @@ -69,10 +66,9 @@ class ExtensionHandler implements ExtensionHandlerInterface { /** * Constructor. */ - public function __construct(array $module_list, KeyValueFactory $key_value, CacheBackendInterface $cache, CacheBackendInterface $bootstrapCache) { + public function __construct(array $module_list, KeyValueFactory $key_value, CacheBackendInterface $bootstrapCache) { $this->moduleList = $module_list; $this->state = $key_value->get('state'); - $this->cache = $cache; $this->bootstrapCache = $bootstrapCache; } @@ -156,8 +152,7 @@ public function getBootstrapModules() { $bootstrap_list = $this->state->get('system.module.bootstrap') ?: array(); $this->bootstrapCache->set('bootstrap_modules', $bootstrap_list); } - // We only return the module names here since getModuleList() doesn't need - // the filename itself. + $this->bootstrapModules = array_keys($bootstrap_list); return $this->bootstrapModules; } diff --git a/core/lib/Drupal/Core/ExtensionHandlerInterface.php b/core/lib/Drupal/Core/ExtensionHandlerInterface.php index 670fcef..2ca8bd2 100644 --- a/core/lib/Drupal/Core/ExtensionHandlerInterface.php +++ b/core/lib/Drupal/Core/ExtensionHandlerInterface.php @@ -42,6 +42,11 @@ public function loadBootstrap(); public function isLoaded(); /** + * Reloads all enabled modules. + */ + public function reloadModules(); + + /** * Returns a list of currently active modules. * * Acts as a wrapper around systemList(), returning either a list of all