summaryrefslogtreecommitdiffstats
path: root/lib/public/icache.php
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2013-09-17 17:46:33 +0200
committerThomas Tanghus <thomas@tanghus.net>2013-09-17 17:46:33 +0200
commitfe86182dac387817258942a46905f2b801862d4d (patch)
tree80f233a9994a52e350938058b99f46a527f427da /lib/public/icache.php
parent9b420e8660404de27e3af629bfca188ae90cf7bd (diff)
downloadnextcloud-server-fe86182dac387817258942a46905f2b801862d4d.tar.gz
nextcloud-server-fe86182dac387817258942a46905f2b801862d4d.zip
OC_Cache namespace changes and add UserCache to server container.
Refs #4863
Diffstat (limited to 'lib/public/icache.php')
-rw-r--r--lib/public/icache.php55
1 files changed, 55 insertions, 0 deletions
diff --git a/lib/public/icache.php b/lib/public/icache.php
new file mode 100644
index 00000000000..202459f7c24
--- /dev/null
+++ b/lib/public/icache.php
@@ -0,0 +1,55 @@
+<?php
+/**
+ * Copyright (c) 2013 Thomas Tanghus (thomas@tanghus.net)
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+namespace OCP;
+
+/**
+ * This interface defines method for accessing the file based user cache.
+ */
+interface ICache {
+
+ /**
+ * Get a value from the user cache
+ *
+ * @param string $key
+ * @return mixed
+ */
+ public function get($key);
+
+ /**
+ * Set a value in the user cache
+ *
+ * @param string $key
+ * @param mixed $value
+ * @param int $ttl Time To Live in seconds. Defaults to 60*60*24
+ * @return bool
+ */
+ public function set($key, $value, $ttl = 0);
+
+ /**
+ * Check if a value is set in the user cache
+ *
+ * @param string $key
+ * @return bool
+ */
+ public function hasKey($key);
+
+ /**
+ * Remove an item from the user cache
+ *
+ * @param string $key
+ * @return bool
+ */
+ public function remove($key);
+
+ /**
+ * clear the user cache of all entries starting with a prefix
+ * @param string prefix (optional)
+ * @return bool
+ */
+ public function clear($prefix = '');
+}