ModuleHandler::__construct

public ModuleHandler::__construct($root, array $module_list = array(), CacheBackendInterface $cache_backend)

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 109

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;
}
doc_Drupal
2016-10-29 09:29:18
Comments
Leave a Comment

Please login to continue.