1 | <?php |
||
21 | class MemoryCache implements CacheInterface |
||
22 | { |
||
23 | private $features = array(); |
||
24 | private $timestamps = array(); |
||
25 | |||
26 | /** |
||
27 | * Checks that cache for feature exists and is fresh. |
||
28 | * |
||
29 | * @param string $path Feature path |
||
30 | * @param integer $timestamp The last time feature was updated |
||
31 | * |
||
32 | * @return Boolean |
||
33 | */ |
||
34 | 3 | public function isFresh($path, $timestamp) |
|
42 | |||
43 | /** |
||
44 | * Reads feature cache from path. |
||
45 | * |
||
46 | * @param string $path Feature path |
||
47 | * |
||
48 | * @return FeatureNode |
||
49 | */ |
||
50 | 1 | public function read($path) |
|
54 | |||
55 | /** |
||
56 | * Caches feature node. |
||
57 | * |
||
58 | * @param string $path Feature path |
||
59 | * @param FeatureNode $feature Feature instance |
||
60 | */ |
||
61 | 3 | public function write($path, FeatureNode $feature) |
|
66 | } |
||
67 |