vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator.php line 79

Open in your IDE?
  1. <?php
  2. class HTMLPurifier_DefinitionCache_Decorator extends HTMLPurifier_DefinitionCache
  3. {
  4. /**
  5. * Cache object we are decorating
  6. * @type HTMLPurifier_DefinitionCache
  7. */
  8. public $cache;
  9. /**
  10. * The name of the decorator
  11. * @var string
  12. */
  13. public $name;
  14. public function __construct()
  15. {
  16. }
  17. /**
  18. * Lazy decorator function
  19. * @param HTMLPurifier_DefinitionCache $cache Reference to cache object to decorate
  20. * @return HTMLPurifier_DefinitionCache_Decorator
  21. */
  22. public function decorate(&$cache)
  23. {
  24. $decorator = $this->copy();
  25. // reference is necessary for mocks in PHP 4
  26. $decorator->cache =& $cache;
  27. $decorator->type = $cache->type;
  28. return $decorator;
  29. }
  30. /**
  31. * Cross-compatible clone substitute
  32. * @return HTMLPurifier_DefinitionCache_Decorator
  33. */
  34. public function copy()
  35. {
  36. return new HTMLPurifier_DefinitionCache_Decorator();
  37. }
  38. /**
  39. * @param HTMLPurifier_Definition $def
  40. * @param HTMLPurifier_Config $config
  41. * @return mixed
  42. */
  43. public function add($def, $config)
  44. {
  45. return $this->cache->add($def, $config);
  46. }
  47. /**
  48. * @param HTMLPurifier_Definition $def
  49. * @param HTMLPurifier_Config $config
  50. * @return mixed
  51. */
  52. public function set($def, $config)
  53. {
  54. return $this->cache->set($def, $config);
  55. }
  56. /**
  57. * @param HTMLPurifier_Definition $def
  58. * @param HTMLPurifier_Config $config
  59. * @return mixed
  60. */
  61. public function replace($def, $config)
  62. {
  63. return $this->cache->replace($def, $config);
  64. }
  65. /**
  66. * @param HTMLPurifier_Config $config
  67. * @return mixed
  68. */
  69. public function get($config)
  70. {
  71. return $this->cache->get($config);
  72. }
  73. /**
  74. * @param HTMLPurifier_Config $config
  75. * @return mixed
  76. */
  77. public function remove($config)
  78. {
  79. return $this->cache->remove($config);
  80. }
  81. /**
  82. * @param HTMLPurifier_Config $config
  83. * @return mixed
  84. */
  85. public function flush($config)
  86. {
  87. return $this->cache->flush($config);
  88. }
  89. /**
  90. * @param HTMLPurifier_Config $config
  91. * @return mixed
  92. */
  93. public function cleanup($config)
  94. {
  95. return $this->cache->cleanup($config);
  96. }
  97. }
  98. // vim: et sw=4 sts=4