summaryrefslogtreecommitdiff
path: root/app/Core/Cache/CacheInterface.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Core/Cache/CacheInterface.php')
-rw-r--r--app/Core/Cache/CacheInterface.php45
1 files changed, 45 insertions, 0 deletions
diff --git a/app/Core/Cache/CacheInterface.php b/app/Core/Cache/CacheInterface.php
new file mode 100644
index 00000000..8675ef8e
--- /dev/null
+++ b/app/Core/Cache/CacheInterface.php
@@ -0,0 +1,45 @@
+<?php
+
+namespace Core\Cache;
+
+/**
+ * Cache Interface
+ *
+ * @package cache
+ * @author Frederic Guillot
+ */
+interface CacheInterface
+{
+ /**
+ * Save a new value in the cache
+ *
+ * @access public
+ * @param string $key
+ * @param string $value
+ */
+ public function set($key, $value);
+
+ /**
+ * Fetch value from cache
+ *
+ * @access public
+ * @param string $key
+ * @return mixed Null when not found, cached value otherwise
+ */
+ public function get($key);
+
+ /**
+ * Clear all cache
+ *
+ * @access public
+ */
+ public function flush();
+
+ /**
+ * Remove cached value
+ *
+ * @access public
+ * @param string $key
+ */
+ public function remove($key);
+}