aboutsummaryrefslogtreecommitdiff
path: root/lib/classes/StudipMemcachedCache.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/classes/StudipMemcachedCache.php')
-rw-r--r--lib/classes/StudipMemcachedCache.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/classes/StudipMemcachedCache.php b/lib/classes/StudipMemcachedCache.php
index 0e44dd5..57ffa7b 100644
--- a/lib/classes/StudipMemcachedCache.php
+++ b/lib/classes/StudipMemcachedCache.php
@@ -95,7 +95,9 @@ class StudipMemcachedCache implements StudipCache
public function read($arg)
{
$key = $this->getCacheKey($arg);
- return $this->memcache->get($key);
+ $result = $this->memcache->get($key);
+
+ return ($result === null) ? null : unserialize($result);
}
/**
@@ -111,7 +113,7 @@ class StudipMemcachedCache implements StudipCache
public function write($arg, $content, $expire = self::DEFAULT_EXPIRATION)
{
$key = $this->getCacheKey($arg);
- return $this->memcache->set($key, $content, $expire);
+ return $this->memcache->set($key, serialize($content), $expire);
}
/**