Same name and namespace in other branches
  1. 7.x-2.x advagg.module \advagg_hooks_implemented() 1 commentaire
  2. 8.x-2.x advagg.module \advagg_hooks_implemented() 1 commentaire
  3. 8.x-3.x advagg.module \advagg_hooks_implemented() 1 commentaire
  4. 8.x-4.x advagg.module \advagg_hooks_implemented() 1 commentaire

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 dans src/Form/InfoForm.php

Fichier

./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;
}