Same name in other branches
- 7.x-2.x advagg.module \advagg_hooks_implemented()
- 8.x-2.x advagg.module \advagg_hooks_implemented()
- 8.x-3.x advagg.module \advagg_hooks_implemented()
- 8.x-4.x advagg.module \advagg_hooks_implemented()
Get back what core asset hooks are implemented.
Return value
array List of hooks and what modules have implemented them.
1 call to advagg_hooks_implemented()
- InfoForm::buildForm in src/
Form/ InfoForm.php
File
-
./
advagg.module, line 215
Code
function advagg_hooks_implemented() {
$module_handler = \Drupal::moduleHandler();
$hooks = [
'js_alter' => [],
'css_alter' => [],
'page_attachments_alter' => [],
];
// Cache module_implements as this will load up .inc files.
$cid = 'advagg_hooks_implemented';
$cache = \Drupal::cache('advagg')->get($cid);
if (!empty($cache->data)) {
return $cache->data;
}
foreach ($hooks as $hook => $values) {
$hooks[$hook] = $module_handler->getImplementations($hook);
}
\Drupal::cache('advagg')->set($cid, $hooks, \Drupal::time()->getRequestTime() + 600);
return $hooks;
}