function HTMLPurifier_DefinitionCache_Drupal::add in HTML Purifier 6.2
Same name and namespace in other branches
- 5 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()
- 7 HTMLPurifier_DefinitionCache_Drupal.php \HTMLPurifier_DefinitionCache_Drupal::add()
Add an object to the cache without overwriting
File
- ./
HTMLPurifier_DefinitionCache_Drupal.php, line 13
Class
- HTMLPurifier_DefinitionCache_Drupal
- Cache handler that stores all data in drupals builtin cache
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;
}