summaryrefslogtreecommitdiff
path: root/app/Core/MemoryCache.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Core/MemoryCache.php')
-rw-r--r--app/Core/MemoryCache.php32
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]);
+ }
+}