3 require_once 'HTMLPurifier/DefinitionCache.php';
5 class HTMLPurifier_DefinitionCache_Decorator
extends HTMLPurifier_DefinitionCache
9 * Cache object we are decorating
13 function HTMLPurifier_DefinitionCache_Decorator() {}
16 * Lazy decorator function
17 * @param $cache Reference to cache object to decorate
19 function decorate(&$cache) {
20 $decorator = $this->copy();
21 // reference is necessary for mocks in PHP 4
22 $decorator->cache
=& $cache;
23 $decorator->type
= $cache->type
;
28 * Cross-compatible clone substitute
31 return new HTMLPurifier_DefinitionCache_Decorator();
34 function add($def, $config) {
35 return $this->cache
->add($def, $config);
38 function set($def, $config) {
39 return $this->cache
->set($def, $config);
42 function replace($def, $config) {
43 return $this->cache
->replace($def, $config);
46 function get($config) {
47 return $this->cache
->get($config);
50 function flush($config) {
51 return $this->cache
->flush($config);
54 function cleanup($config) {
55 return $this->cache
->cleanup($config);