protected ModuleHandler::getImplementationInfo($hook)
Provides information about modules' implementations of a hook.
string $hook: The name of the hook (e.g. "help" or "menu").
mixed[] An array whose keys are the names of the modules which are implementing this hook and whose values are either a string identifying a file in which the implementation is to be found, or FALSE, if the implementation is in the module file.
protected function getImplementationInfo($hook) { if (!isset($this->implementations)) { $this->implementations = array(); $this->verified = array(); if ($cache = $this->cacheBackend->get('module_implements')) { $this->implementations = $cache->data; } } if (!isset($this->implementations[$hook])) { // The hook is not cached, so ensure that whether or not it has // implementations, the cache is updated at the end of the request. $this->cacheNeedsWriting = TRUE; // Discover implementations. $this->implementations[$hook] = $this->buildImplementationInfo($hook); // Implementations are always "verified" as part of the discovery. $this->verified[$hook] = TRUE; } elseif (!isset($this->verified[$hook])) { if (!$this->verifyImplementations($this->implementations[$hook], $hook)) { // One or more of the implementations did not exist and need to be // removed in the cache. $this->cacheNeedsWriting = TRUE; } $this->verified[$hook] = TRUE; } return $this->implementations[$hook]; }
© 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::getImplementationInfo/8.1.x