3 class HTMLPurifier_DefinitionCache_Decorator
extends HTMLPurifier_DefinitionCache
7 * Cache object we are decorating
8 * @var HTMLPurifier_DefinitionCache
13 * The name of the decorator
18 public function __construct() {}
21 * Lazy decorator function
23 * @param HTMLPurifier_DefinitionCache $cache Reference to cache object to decorate
25 * @return HTMLPurifier_DefinitionCache_Decorator
27 public function decorate(&$cache)
29 $decorator = $this->copy();
30 // reference is necessary for mocks in PHP 4
31 $decorator->cache
=& $cache;
32 $decorator->type
= $cache->type
;
37 * Cross-compatible clone substitute
39 public function copy()
41 return new HTMLPurifier_DefinitionCache_Decorator();
44 public function add($def, $config)
46 return $this->cache
->add($def, $config);
49 public function set($def, $config)
51 return $this->cache
->set($def, $config);
54 public function replace($def, $config)
56 return $this->cache
->replace($def, $config);
59 public function get($config)
61 return $this->cache
->get($config);
64 public function remove($config)
66 return $this->cache
->remove($config);
69 public function flush($config)
71 return $this->cache
->flush($config);
74 public function cleanup($config)
76 return $this->cache
->cleanup($config);