You are here

public function ModuleHandler::setModuleList in Service Container 7.2

Same name and namespace in other branches
  1. 7 src/Extension/ModuleHandler.php \Drupal\service_container\Extension\ModuleHandler::setModuleList()

Sets an explicit list of currently active modules.

Parameters

\Drupal\Core\Extension\Extension[] $module_list: An associative array whose keys are the names of the modules and whose values are Extension objects.

Overrides ModuleHandlerInterface::setModuleList

File

src/Extension/ModuleHandler.php, line 107
Contains Drupal\service_container\Extension\ModuleHandler.

Class

ModuleHandler
Class that manages modules in a Drupal installation.

Namespace

Drupal\service_container\Extension

Code

public function setModuleList(array $module_list = array()) {

  // Convert an array of module filenames to an array of module info, keyed by
  // module name.
  foreach ($module_list as $module_name => $filename) {
    $module_list[$module_name] = array(
      'filename' => $filename,
    );
  }
  $this->drupal7
    ->module_list(FALSE, FALSE, FALSE, $module_list);
}