function ModuleHandler::__construct
Same name and namespace in other branches
- 9 core/lib/Drupal/Core/Extension/ModuleHandler.php \Drupal\Core\Extension\ModuleHandler::__construct()
- 8.9.x core/lib/Drupal/Core/Extension/ModuleHandler.php \Drupal\Core\Extension\ModuleHandler::__construct()
- 10 core/lib/Drupal/Core/Extension/ModuleHandler.php \Drupal\Core\Extension\ModuleHandler::__construct()
Constructs a ModuleHandler object.
Parameters
string $root: The app root.
array<string, array{type: string, pathname: string, filename: string}> $module_list: An associative array whose keys are the names of installed modules and whose values are Extension class parameters. This is normally the %container.modules% parameter being set up by DrupalKernel.
\Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher: The event dispatcher.
array<string, array<class-string, array<string, string>>> $hookImplementationsMap: An array keyed by hook, classname, method and the value is the module.
array<string, list<string>> $groupIncludes: Lists of *.inc file paths that contain procedural implementations, keyed by hook name.
array<string, list<string>> $packedOrderOperations: Ordering rules by hook name, serialized.
See also
\Drupal\Core\CoreServiceProvider
File
-
core/
lib/ Drupal/ Core/ Extension/ ModuleHandler.php, line 119
Class
- ModuleHandler
- Class that manages modules in a Drupal installation.
Namespace
Drupal\Core\ExtensionCode
public function __construct($root, array $module_list, protected EventDispatcherInterface $eventDispatcher, protected array $hookImplementationsMap, protected array $groupIncludes = [], protected array $packedOrderOperations = []) {
$this->root = $root;
$this->moduleList = [];
foreach ($module_list as $name => $module) {
$this->moduleList[$name] = new Extension($this->root, $module['type'], $module['pathname'], $module['filename']);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.