function HTMLPurifier_DefinitionCache_Drupal::add in HTML Purifier 7
Same name and namespace in other branches
- 5 HTMLPurifier_DefinitionCache_Drupal.php \HTMLPurifier_DefinitionCache_Drupal::add()
- 6.2 HTMLPurifier_DefinitionCache_Drupal.php \HTMLPurifier_DefinitionCache_Drupal::add()
- 6 HTMLPurifier_DefinitionCache_Drupal.php \HTMLPurifier_DefinitionCache_Drupal::add()
- 7.2 HTMLPurifier_DefinitionCache_Drupal.php \HTMLPurifier_DefinitionCache_Drupal::add()
Add an object to the cache without overwriting
File
- ./
HTMLPurifier_DefinitionCache_Drupal.php, line 12
Class
Code
function add($def, $config) {
if (!$this
->checkDefType($def)) {
return;
}
$key = $this
->generateKey($config);
if ($this
->fetchFromDrupalCache($key)) {
// already cached
return FALSE;
}
$this
->storeInDrupalCache($def, $key);
return TRUE;
}