function HTMLPurifier_DefinitionCache_Drupal::cleanup in HTML Purifier 7
Same name and namespace in other branches
- 5 HTMLPurifier_DefinitionCache_Drupal.php \HTMLPurifier_DefinitionCache_Drupal::cleanup()
- 6.2 HTMLPurifier_DefinitionCache_Drupal.php \HTMLPurifier_DefinitionCache_Drupal::cleanup()
- 6 HTMLPurifier_DefinitionCache_Drupal.php \HTMLPurifier_DefinitionCache_Drupal::cleanup()
- 7.2 HTMLPurifier_DefinitionCache_Drupal.php \HTMLPurifier_DefinitionCache_Drupal::cleanup()
File
- ./
HTMLPurifier_DefinitionCache_Drupal.php, line 73
Class
Code
function cleanup($config) {
// TODO: This does not work with the pluggable cache system in Drupal 7,
// since it assumes a database cache is being used.
$res = db_query("SELECT cid FROM {cache} WHERE cid LIKE :cid", array(
':cid' => 'htmlpurifier:%',
));
foreach ($res as $row) {
$key = substr($row->cid, 13);
// 13 == strlen('htmlpurifier:')
if ($this
->isOld($key, $config)) {
cache_clear_all($row->cid, 'cache');
}
}
}