Total Complexity | 8 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
7 | class JsonFileCacheProvider implements CacheProvider{ |
||
8 | private $cacheDir = null; |
||
9 | |||
10 | public function __construct($cacheDir = null){ |
||
11 | if(!$cacheDir) $this->cacheDir = __DIR__; |
||
12 | else $this->cacheDir = $cacheDir; |
||
13 | } |
||
14 | |||
15 | public function set($key,$jsonobj,$expireAt){ |
||
22 | } |
||
23 | |||
24 | public function get($key){ |
||
25 | $file = "{$this->cacheDir}/{$key}.json"; |
||
26 | $cache = null; |
||
27 | if(file_exists($file)){ |
||
28 | $cache = json_decode(file_get_contents($file)); |
||
29 | } |
||
30 | return $cache; |
||
31 | } |
||
32 | |||
33 | public function clear($key){ |
||
37 | } |
||
38 | } |
||
39 | } |