Fix two minor bugs, updating Phorum and removing unused $dir variable.
[htmlpurifier/darkodev.git] / library / HTMLPurifier / DefinitionCache / Decorator / Cleanup.php
blobd4cc35c4bc1cd7e16a94742f03b72b1586c16532
1 <?php
3 /**
4 * Definition cache decorator class that cleans up the cache
5 * whenever there is a cache miss.
6 */
7 class HTMLPurifier_DefinitionCache_Decorator_Cleanup extends
8 HTMLPurifier_DefinitionCache_Decorator
11 public $name = 'Cleanup';
13 public function copy() {
14 return new HTMLPurifier_DefinitionCache_Decorator_Cleanup();
17 public function add($def, $config) {
18 $status = parent::add($def, $config);
19 if (!$status) parent::cleanup($config);
20 return $status;
23 public function set($def, $config) {
24 $status = parent::set($def, $config);
25 if (!$status) parent::cleanup($config);
26 return $status;
29 public function replace($def, $config) {
30 $status = parent::replace($def, $config);
31 if (!$status) parent::cleanup($config);
32 return $status;
35 public function get($config) {
36 $ret = parent::get($config);
37 if (!$ret) parent::cleanup($config);
38 return $ret;
43 // vim: et sw=4 sts=4