@@ 264-276 (lines=13) @@ | ||
261 | * @param mixed $val |
|
262 | * @return $this |
|
263 | */ |
|
264 | public function CacheSetFile ($key, $val) { |
|
265 | $s_file = $this->CacheFilePath($key); |
|
266 | $s_cache = json_encode($val); |
|
267 | ||
268 | // Create each level dir if not exists |
|
269 | $s_dir = DirName1($s_file); |
|
270 | if (!file_exists($s_dir)) |
|
271 | mkdir($s_dir, 0755, true); |
|
272 | ||
273 | // Finally write file |
|
274 | file_put_contents($s_file, $s_cache, LOCK_EX); |
|
275 | return $this; |
|
276 | } // end of func CacheSetFile |
|
277 | ||
278 | ||
279 | /** |
@@ 285-298 (lines=14) @@ | ||
282 | * @param int $lifetime |
|
283 | * @return $this |
|
284 | */ |
|
285 | public function Set ($key, $val, $lifetime = NULL) { |
|
286 | $s_file = $this->FilePath($key); |
|
287 | $s_cache = $this->ValEncode($val); |
|
288 | ||
289 | // Create each level dir if not exists |
|
290 | $s_dir = DirName1($s_file); |
|
291 | if (!file_exists($s_dir)) |
|
292 | mkdir($s_dir, 0755, true); |
|
293 | ||
294 | // Finally write file |
|
295 | file_put_contents($s_file, $s_cache, LOCK_EX); |
|
296 | ||
297 | return $this; |
|
298 | } // end of func Set |
|
299 | ||
300 | ||
301 | /** |