1 | <?php |
||
8 | class CacheParser extends Cache |
||
9 | { |
||
10 | |||
11 | public $file = ''; // source file for cache |
||
12 | public $mode = ''; // input mode (represents the processing the input file will undergo) |
||
13 | public $page = ''; |
||
14 | |||
15 | public $_event = 'PARSER_CACHE_USE'; |
||
16 | |||
17 | /** |
||
18 | * |
||
19 | * @param string $id page id |
||
20 | * @param string $file source file for cache |
||
21 | * @param string $mode input mode |
||
22 | */ |
||
23 | public function __construct($id, $file, $mode) |
||
33 | |||
34 | /** |
||
35 | * method contains cache use decision logic |
||
36 | * |
||
37 | * @return bool see useCache() |
||
38 | */ |
||
39 | public function makeDefaultCacheDecision() |
||
40 | { |
||
41 | |||
42 | if (!file_exists($this->file)) { |
||
43 | return false; |
||
44 | } // source exists? |
||
45 | return parent::makeDefaultCacheDecision(); |
||
46 | } |
||
47 | |||
48 | protected function addDependencies() |
||
64 | |||
65 | } |
||
66 |