summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2015-01-20 10:51:27 +0100
committerJoas Schilling <nickvergessen@gmx.de>2015-01-20 10:51:27 +0100
commite25998df0f469969c4afdb2b926b3e8ef1d2fee0 (patch)
tree8df1635882db180085cc5437f6c379b17564da81
parent7eb8404040c35bf120019973d67f89b3a9fb33df (diff)
downloadnextcloud-server-e25998df0f469969c4afdb2b926b3e8ef1d2fee0.tar.gz
nextcloud-server-e25998df0f469969c4afdb2b926b3e8ef1d2fee0.zip
Json_(en|de)code values on redis to be able to cache arrays
-rw-r--r--lib/private/memcache/redis.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/private/memcache/redis.php b/lib/private/memcache/redis.php
index f21619887d0..78ddd081338 100644
--- a/lib/private/memcache/redis.php
+++ b/lib/private/memcache/redis.php
@@ -49,18 +49,18 @@ class Redis extends Cache {
public function get($key) {
$result = self::$cache->get($this->getNamespace() . $key);
- if ($result === false and ! self::$cache->exists($this->getNamespace() . $key)) {
+ if ($result === false && !self::$cache->exists($this->getNamespace() . $key)) {
return null;
} else {
- return $result;
+ return json_decode($result, true);
}
}
public function set($key, $value, $ttl = 0) {
if ($ttl > 0) {
- return self::$cache->setex($this->getNamespace() . $key, $ttl, $value);
+ return self::$cache->setex($this->getNamespace() . $key, $ttl, json_encode($value));
} else {
- return self::$cache->set($this->getNamespace() . $key, $value);
+ return self::$cache->set($this->getNamespace() . $key, json_encode($value));
}
}