You are here

function boost_crawler_expire_cache in Boost 7

Implements hook_expire_cache (from the 'expire' module)

File

boost_crawler/boost_crawler.module, line 43
Minimal crawler to regenerate the cache as pages are expired.

Code

function boost_crawler_expire_cache($urls) {
  global $base_root;
  if (variable_get('boost_crawl_on_cron', FALSE)) {
    foreach ($urls as $url) {

      // Put URLs in a queue for processing by cron
      // http://drupal.org/node/1074080#comment-4590150
      $queue = DrupalQueue::get('boost_crawler');

      // Check if the URL to be flushed matches our base URL.
      if (!empty($url) && strpos($base_root, $url) == 0) {
        $queue
          ->createItem($url);
      }
    }
  }
}