| Versionen | |
|---|---|
| drupal7 | _module_implements_maintenance($hook, $sort = FALSE) |
This is the maintenance version of module_implements for internal use only.
This function is called whenever MAINTENANCE_MODE is defined and is a safe code path for Drupal installation or upgrade because it does not use the database, instead it uses module_list.
$hook The name of the hook (e.g. "help" or "menu").
$sort By default, modules are ordered by weight and filename, settings this option to TRUE, module list will be ordered by module name.
An array with the names of the modules which are implementing this hook. Only enabled and already loaded modules are taken into consideration.
module_list $fixed_list on how to make module_list also DB independent.
includes/
<?php
function _module_implements_maintenance($hook, $sort = FALSE) {
$implementations = array();
foreach (module_list() as $module) {
$function = $module . '_' . $hook;
if (function_exists($function)) {
$implementations[] = $module;
}
if ($sort) {
sort($implementations);
}
}
return $implementations;
}
?>
Kommentare
Kommentar hinzufügen