"MDL-12304, fix double text"
[moodle-linuxchix.git] / lib / htmlpurifier / HTMLPurifier / DefinitionCache / Decorator.php
blob14fca85974486027f8c4f801f8d681cf8c5ed794
1 <?php
3 require_once 'HTMLPurifier/DefinitionCache.php';
5 class HTMLPurifier_DefinitionCache_Decorator extends HTMLPurifier_DefinitionCache
8 /**
9 * Cache object we are decorating
11 var $cache;
13 function HTMLPurifier_DefinitionCache_Decorator() {}
15 /**
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;
24 return $decorator;
27 /**
28 * Cross-compatible clone substitute
30 function copy() {
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);