You are here

function HTMLPurifier_DefinitionCache_Drupal::replace in HTML Purifier 6.2

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

Replace an object that already exists in the cache.

File

./HTMLPurifier_DefinitionCache_Drupal.php, line 39

Class

HTMLPurifier_DefinitionCache_Drupal
Cache handler that stores all data in drupals builtin cache

Code

function replace($def, $config) {
  if (!$this
    ->checkDefType($def)) {
    return;
  }
  $key = $this
    ->generateKey($config);
  if (!$this
    ->fetchFromDrupalCache($key)) {

    // object does not exist in cache
    return false;
  }
  $this
    ->storeInDrupalCache($def, $key);
  return true;
}