You are here

function adserve_cache_hook in Advertisement 5.2

Same name and namespace in other branches
  1. 6.3 adcache.inc \adserve_cache_hook()
  2. 6.2 adcache.inc \adserve_cache_hook()
  3. 7 adcache.inc \adserve_cache_hook()

Invoke the appropraite hook.

File

./adcache.inc, line 173

Code

function adserve_cache_hook($hook) {
  static $cache = NULL;

  // if we don't have the cache yet, build it
  if (is_null($cache)) {
    $external = adserve_cache('get_cache');
    $cache = adserve_cache('build_hooks', $external);
  }

  // return hook definition, if exists
  if (is_array($cache) && is_array($cache["hook_{$hook}"])) {
    _debug_echo("Invoking hook '{$hook}'.");
    return $cache["hook_{$hook}"];
  }
  _debug_echo("Did not find hook '{$hook}'.");
}