@@ -21,11 +21,17 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | + /** |
|
| 25 | + * @param string $name |
|
| 26 | + */ |
|
| 24 | 27 | function setCache($name,$data){ |
| 25 | 28 | $this->writeFile($name,json_encode($data)); |
| 26 | 29 | return $data; |
| 27 | 30 | } |
| 28 | 31 | |
| 32 | + /** |
|
| 33 | + * @param string $name |
|
| 34 | + */ |
|
| 29 | 35 | function getCache($name, $expire=null){ |
| 30 | 36 | if(!is_null($expire)){ |
| 31 | 37 | $this->expire = $expire; |
@@ -44,6 +50,9 @@ discard block |
||
| 44 | 50 | return false; |
| 45 | 51 | } |
| 46 | 52 | |
| 53 | + /** |
|
| 54 | + * @param string $content |
|
| 55 | + */ |
|
| 47 | 56 | function writeFile($name, $content){ |
| 48 | 57 | try { |
| 49 | 58 | if(!is_dir($this->cache_path)) { |