File indexing completed on 2025-01-26 05:29:07
0001 <?php 0002 0003 class HTMLPurifier_DefinitionCache_Decorator extends HTMLPurifier_DefinitionCache 0004 { 0005 0006 /** 0007 * Cache object we are decorating 0008 * @type HTMLPurifier_DefinitionCache 0009 */ 0010 public $cache; 0011 0012 /** 0013 * The name of the decorator 0014 * @var string 0015 */ 0016 public $name; 0017 0018 public function __construct() 0019 { 0020 } 0021 0022 /** 0023 * Lazy decorator function 0024 * @param HTMLPurifier_DefinitionCache $cache Reference to cache object to decorate 0025 * @return HTMLPurifier_DefinitionCache_Decorator 0026 */ 0027 public function decorate(&$cache) 0028 { 0029 $decorator = $this->copy(); 0030 // reference is necessary for mocks in PHP 4 0031 $decorator->cache =& $cache; 0032 $decorator->type = $cache->type; 0033 return $decorator; 0034 } 0035 0036 /** 0037 * Cross-compatible clone substitute 0038 * @return HTMLPurifier_DefinitionCache_Decorator 0039 */ 0040 public function copy() 0041 { 0042 return new HTMLPurifier_DefinitionCache_Decorator(); 0043 } 0044 0045 /** 0046 * @param HTMLPurifier_Definition $def 0047 * @param HTMLPurifier_Config $config 0048 * @return mixed 0049 */ 0050 public function add($def, $config) 0051 { 0052 return $this->cache->add($def, $config); 0053 } 0054 0055 /** 0056 * @param HTMLPurifier_Definition $def 0057 * @param HTMLPurifier_Config $config 0058 * @return mixed 0059 */ 0060 public function set($def, $config) 0061 { 0062 return $this->cache->set($def, $config); 0063 } 0064 0065 /** 0066 * @param HTMLPurifier_Definition $def 0067 * @param HTMLPurifier_Config $config 0068 * @return mixed 0069 */ 0070 public function replace($def, $config) 0071 { 0072 return $this->cache->replace($def, $config); 0073 } 0074 0075 /** 0076 * @param HTMLPurifier_Config $config 0077 * @return mixed 0078 */ 0079 public function get($config) 0080 { 0081 return $this->cache->get($config); 0082 } 0083 0084 /** 0085 * @param HTMLPurifier_Config $config 0086 * @return mixed 0087 */ 0088 public function remove($config) 0089 { 0090 return $this->cache->remove($config); 0091 } 0092 0093 /** 0094 * @param HTMLPurifier_Config $config 0095 * @return mixed 0096 */ 0097 public function flush($config) 0098 { 0099 return $this->cache->flush($config); 0100 } 0101 0102 /** 0103 * @param HTMLPurifier_Config $config 0104 * @return mixed 0105 */ 0106 public function cleanup($config) 0107 { 0108 return $this->cache->cleanup($config); 0109 } 0110 } 0111 0112 // vim: et sw=4 sts=4