You are here

function amazon_flush_caches in Amazon Product Advertisement API 7

Same name and namespace in other branches
  1. 7.2 amazon.module \amazon_flush_caches()

Implements hook_flush_caches().

File

./amazon.module, line 967

Code

function amazon_flush_caches() {

  // Determine what function is actually causing this hook to fire
  $trace = debug_backtrace(FALSE);
  while (in_array($trace[0]['function'], array(
    'amazon_flush_caches',
    'call_user_func_array',
    'module_invoke_all',
    'drupal_flush_all_caches',
  ))) {
    $foo = array_shift($trace);
  }

  // If this hook was not fired by a cron run expire items.
  if ($trace[0]['function'] != 'system_cron') {
    amazon_expire_items();
  }
  return array();
}