diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-05-24 16:02:25 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-05-24 16:02:25 -0400 |
commit | eeac2329baab1fdae7cbf6c707ed2ffd8beb4c1b (patch) | |
tree | 511c2fe47f8fbb1ea90e59e7a7a7f5e3530aa9ed /app/Core/FileCache.php | |
parent | 65e9e5d1bed9f88ecfd43eb2c1e780a7c22c151f (diff) |
Helpers refactoring
Diffstat (limited to 'app/Core/FileCache.php')
-rw-r--r-- | app/Core/FileCache.php | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/app/Core/FileCache.php b/app/Core/FileCache.php deleted file mode 100644 index 2037f271..00000000 --- a/app/Core/FileCache.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -namespace Core; - -class FileCache extends Cache -{ - const CACHE_FOLDER = 'data/cache/'; - - public function init() - { - if (! is_dir(self::CACHE_FOLDER)) { - mkdir(self::CACHE_FOLDER); - } - } - - public function set($key, $value) - { - file_put_contents(self::CACHE_FOLDER.$key, json_encode($value)); - } - - public function get($key) - { - if (file_exists(self::CACHE_FOLDER.$key)) { - return json_decode(file_get_contents(self::CACHE_FOLDER.$key), true); - } - - return null; - } - - public function flush() - { - foreach (glob(self::CACHE_FOLDER.'*') as $filename) { - @unlink($filename); - } - } - - public function remove($key) - { - @unlink(self::CACHE_FOLDER.$key); - } -} |