public function ModuleHandler::getHookInfo

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

Overrides ModuleHandlerInterface::getHookInfo

3 calls to ModuleHandler::getHookInfo()
CachedModuleHandler::getHookInfo in drupal/core/lib/Drupal/Core/Extension/CachedModuleHandler.php
Overrides \Drupal\Core\Extension\ModuleHandler::getHookInfo().
ModuleHandler::getImplementationInfo in drupal/core/lib/Drupal/Core/Extension/ModuleHandler.php
Provides information about modules' implementations of a hook.
ModuleHandler::implementsHook in drupal/core/lib/Drupal/Core/Extension/ModuleHandler.php
Implements \Drupal\Core\Extension\ModuleHandlerInterface::implementsHook().
1 method overrides ModuleHandler::getHookInfo()

File

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

Class

ModuleHandler
Class that manages enabled modules in a Drupal installation.

Namespace

Drupal\Core\Extension

Code

public function getHookInfo() {
  if (isset($this->hookInfo)) {
    return $this->hookInfo;
  }
  $this->hookInfo = array();

  // We can't use $this->invokeAll() here or it would cause an infinite
  // loop.
  // Make sure that the modules are loaded before checking.
  $this
    ->reload();
  foreach ($this->moduleList as $module => $filename) {
    $function = $module . '_hook_info';
    if (function_exists($function)) {
      $result = $function();
      if (isset($result) && is_array($result)) {
        $this->hookInfo = NestedArray::mergeDeep($this->hookInfo, $result);
      }
    }
  }
  return $this->hookInfo;
}