You are here

public function ModuleHandler::__construct in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Extension/ModuleHandler.php \Drupal\Core\Extension\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.

\Drupal\Core\Cache\CacheBackendInterface $cache_backend: Cache backend for storing module hook implementation information.

See also

\Drupal\Core\DrupalKernel

\Drupal\Core\CoreServiceProvider

File

core/lib/Drupal/Core/Extension/ModuleHandler.php, line 107
Contains \Drupal\Core\Extension\ModuleHandler.

Class

ModuleHandler
Class that manages modules in a Drupal installation.

Namespace

Drupal\Core\Extension

Code

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