You are here

function HTMLPurifier_DefinitionCache_Drupal::cleanup in HTML Purifier 6

Same name and namespace in other branches
  1. 5 HTMLPurifier_DefinitionCache_Drupal.php \HTMLPurifier_DefinitionCache_Drupal::cleanup()
  2. 6.2 HTMLPurifier_DefinitionCache_Drupal.php \HTMLPurifier_DefinitionCache_Drupal::cleanup()
  3. 7.2 HTMLPurifier_DefinitionCache_Drupal.php \HTMLPurifier_DefinitionCache_Drupal::cleanup()
  4. 7 HTMLPurifier_DefinitionCache_Drupal.php \HTMLPurifier_DefinitionCache_Drupal::cleanup()

File

./HTMLPurifier_DefinitionCache_Drupal.php, line 74

Class

HTMLPurifier_DefinitionCache_Drupal
Cache handler that stores all data in drupals builtin cache

Code

function cleanup($config) {
  $res = db_query("SELECT cid FROM {cache} WHERE cid LIKE '%s%%'", 'htmlpurifier:');
  while ($row = db_fetch_object($res)) {
    $key = substr($row->cid, 13);

    // 13 == strlen('htmlpurifier:')
    if ($this
      ->isOld($key, $config)) {
      cache_clear_all($row->cid, 'cache');
    }
  }
}