summaryrefslogtreecommitdiffstats
path: root/lib/memcache
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2013-07-16 16:06:00 +0200
committerRobin Appelman <icewind@owncloud.com>2013-07-16 16:06:00 +0200
commit504089940de88220a425db21e8e133582fe15c30 (patch)
tree7a2eec110b5e967981f1670f84df23e3f0f85845 /lib/memcache
parent8ad148feaf975481815b3f2413fc1fa34b3e8be7 (diff)
downloadnextcloud-server-504089940de88220a425db21e8e133582fe15c30.tar.gz
nextcloud-server-504089940de88220a425db21e8e133582fe15c30.zip
mamcache: implement the ArrayAccess interface
Diffstat (limited to 'lib/memcache')
-rw-r--r--lib/memcache/cache.php20
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/memcache/cache.php b/lib/memcache/cache.php
index 9db69ae4104..0ad1cc7ec03 100644
--- a/lib/memcache/cache.php
+++ b/lib/memcache/cache.php
@@ -8,7 +8,7 @@
namespace OC\Memcache;
-abstract class Cache {
+abstract class Cache implements \ArrayAccess {
/**
* @var string $prefix
*/
@@ -56,4 +56,22 @@ abstract class Cache {
* @return mixed
*/
abstract public function clear($prefix = '');
+
+ //implement the ArrayAccess interface
+
+ public function offsetExists($offset) {
+ return $this->hasKey($offset);
+ }
+
+ public function offsetSet($offset, $value) {
+ $this->set($offset, $value);
+ }
+
+ public function offsetGet($offset) {
+ return $this->get($offset);
+ }
+
+ public function offsetUnset($offset) {
+ $this->remove($offset);
+ }
}