diff options
author | Frédéric Guillot <fred@kanboard.net> | 2015-01-02 17:19:13 -0500 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2015-01-02 17:19:13 -0500 |
commit | 3076ba22dd8346725b4e1ad757532c00df5b18d9 (patch) | |
tree | e893c113c34d86c5dc923953754dc68c4b1d842d /app/Core/MemoryCache.php | |
parent | c32567857db9bb1a6dfa339f58d817c97f64db11 (diff) |
Fix bugs, improve perfs and use SimpleLogger instead of Monolog
Diffstat (limited to 'app/Core/MemoryCache.php')
-rw-r--r-- | app/Core/MemoryCache.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/app/Core/MemoryCache.php b/app/Core/MemoryCache.php new file mode 100644 index 00000000..f80a66ef --- /dev/null +++ b/app/Core/MemoryCache.php @@ -0,0 +1,32 @@ +<?php + +namespace Core; + +class MemoryCache extends Cache +{ + private $storage = array(); + + public function init() + { + } + + public function set($key, $value) + { + $this->storage[$key] = $value; + } + + public function get($key) + { + return isset($this->storage[$key]) ? $this->storage[$key] : null; + } + + public function flush() + { + $this->storage = array(); + } + + public function remove($key) + { + unset($this->storage[$key]); + } +} |