You are here

function esi_get_components in ESI: Edge Side Includes 7.3

List all the modules which implement hook_esi_component_info().

1 call to esi_get_components()
esi_component_load in ./esi.module
Menu-wildcard loader for %esi_component.

File

./esi.module, line 298
Adds support for ESI (Edge-Side-Include) integration, allowing components\ to be delivered by ESI, with support for per-component cache times.

Code

function esi_get_components() {
  if ($result = cache_get('esi_component_info')) {
    return $result->data;
  }
  else {
    $components = array();

    // Invoke hook_esi_component_info().
    foreach (module_implements('esi_component_info') as $module) {
      foreach (module_invoke($module, 'esi_component_info') as $key => $component) {

        // Modules may specify an include file.
        // Provide a default include path (if the module doesn't provide one).
        if (!empty($component['file']) && empty($component['filepath'])) {
          $component['filepath'] = drupal_get_path('module', $module);
        }

        // Use the key supplied by the module, rather than the module name.
        // This allows modules to override other implementations if required.
        $components[$key] = $component;
      }
    }
    drupal_alter('esi_component_info', $components);
    cache_set('esi_component_info', $components);
    return $components;
  }
}