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

Breadcrumb

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

function ModuleHandler::__construct

Constructs a ModuleHandler object.

Parameters

string $root: The app root.

array $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 $hookImplementationsMap: An array keyed by hook, classname, method and the value is the module.

array $groupIncludes: An array of .inc files to get helpers from.

See also

\Drupal\Core\DrupalKernel

\Drupal\Core\CoreServiceProvider

File

core/lib/Drupal/Core/Extension/ModuleHandler.php, line 87

Class

ModuleHandler
Class that manages modules in a Drupal installation.

Namespace

Drupal\Core\Extension

Code

public function __construct($root, array $module_list, EventDispatcherInterface $eventDispatcher, array $hookImplementationsMap, array $groupIncludes = []) {
    $this->root = $root;
    $this->moduleList = [];
    foreach ($module_list as $name => $module) {
        $this->moduleList[$name] = new Extension($this->root, $module['type'], $module['pathname'], $module['filename']);
    }
}

API Navigation

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