public function ModuleHandler::load

Implements \Drupal\Core\Extension\ModuleHandlerInterface::load().

Overrides ModuleHandlerInterface::load

4 calls to ModuleHandler::load()
ModuleHandler::enable in drupal/core/lib/Drupal/Core/Extension/ModuleHandler.php
Enables or installs a given list of modules.
ModuleHandler::loadAll in drupal/core/lib/Drupal/Core/Extension/ModuleHandler.php
Implements \Drupal\Core\Extension\ModuleHandlerInterface::loadAll().
ModuleHandler::loadBootstrapModules in drupal/core/lib/Drupal/Core/Extension/ModuleHandler.php
Implements \Drupal\Core\Extension\ModuleHandlerInterface::loadBootstrapModules().
UpdateModuleHandler::enable in drupal/core/lib/Drupal/Core/Extension/UpdateModuleHandler.php
Enables or installs a given list of modules.

File

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

Class

ModuleHandler
Class that manages enabled modules in a Drupal installation.

Namespace

Drupal\Core\Extension

Code

public function load($name) {
  if (isset($this->loadedFiles[$name])) {
    return TRUE;
  }
  if (isset($this->moduleList[$name])) {
    $filename = $this->moduleList[$name];
    include_once DRUPAL_ROOT . '/' . $filename;
    $this->loadedFiles[$name] = TRUE;
    return TRUE;
  }
  return FALSE;
}