You are here

function boost_cache_prune_node_relationship in Boost 6

Given hash of url delete any old relationships.

Parameters

$hash_url:

1 call to boost_cache_prune_node_relationship()
boost_cache_set_node_relationships in ./boost.module
Creates a parent child relationship for pages like views.

File

./boost.module, line 4068
Provides static file caching for Drupal text output. Pages, Feeds, ect...

Code

function boost_cache_prune_node_relationship($hash_url) {

  // Grab all entires related to this URL; find ones that don't match the latest
  // timestamp and remove them.
  $records = 0;
  $result = db_query("SELECT hash, timestamp FROM {boost_cache_relationships} WHERE hash_url = '%s' ORDER BY timestamp DESC", $hash_url);
  while ($info = db_fetch_array($result)) {
    if ($info['timestamp'] < BOOST_TIME) {
      db_query("DELETE FROM {boost_cache_relationships} WHERE hash = '%s'", $info['hash']);
      $records++;
    }
  }
  return $records;
}