W3cubDocs

/Drupal 8

protected function ModuleHandler::buildHookInfo

protected ModuleHandler::buildHookInfo()

Builds hook_hook_info() information.

See also

\Drupal\Core\Extension\ModuleHandler::getHookInfo()

File

core/lib/Drupal/Core/Extension/ModuleHandler.php, line 307

Class

ModuleHandler
Class that manages modules in a Drupal installation.

Namespace

Drupal\Core\Extension

Code

protected function buildHookInfo() {
  $this->hookInfo = array();
  // Make sure that the modules are loaded before checking.
  $this->reload();
  // $this->invokeAll() would cause an infinite recursion.
  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);
      }
    }
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Extension!ModuleHandler.php/function/ModuleHandler::buildHookInfo/8.1.x