Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
39 | public function fetch($key) |
||
40 | { |
||
41 | if (file_exists($this->cachePath.DIRECTORY_SEPARATOR.$key.'.cache')) { |
||
42 | list($expire, $data) = unserialize(file_get_contents($this->cachePath.DIRECTORY_SEPARATOR.$key.'.cache')); |
||
43 | if (filemtime($this->cachePath.DIRECTORY_SEPARATOR.$key.'.cache') <= $expire) { |
||
44 | return $data; |
||
45 | } |
||
46 | unlink($this->cachePath.DIRECTORY_SEPARATOR.$key.'.cache'); |
||
47 | } |
||
48 | |||
49 | return false; |
||
50 | } |
||
51 | |||
77 |