You are here

function HTMLPurifier_DefinitionCache_Drupal::replace in HTML Purifier 7

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

Replace an object that already exists in the cache.

File

./HTMLPurifier_DefinitionCache_Drupal.php, line 38

Class

HTMLPurifier_DefinitionCache_Drupal

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;
}