aboutsummaryrefslogtreecommitdiffstats
path: root/lib/cache/xcache.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/cache/xcache.php')
-rw-r--r--lib/cache/xcache.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/cache/xcache.php b/lib/cache/xcache.php
index 0739e4a2fa2..9f380f870b9 100644
--- a/lib/cache/xcache.php
+++ b/lib/cache/xcache.php
@@ -29,9 +29,9 @@ class OC_Cache_XCache {
public function set($key, $value, $ttl=0) {
if($ttl>0) {
- return xcache_set($this->getNamespace().$key,$value,$ttl);
+ return xcache_set($this->getNamespace().$key, $value, $ttl);
}else{
- return xcache_set($this->getNamespace().$key,$value);
+ return xcache_set($this->getNamespace().$key, $value);
}
}
@@ -44,6 +44,12 @@ class OC_Cache_XCache {
}
public function clear($prefix='') {
+ if(!function_exists('xcache_unset_by_prefix')) {
+ function xcache_unset_by_prefix($prefix) {
+ // Since we can't clear targetted cache, we'll clear all. :(
+ xcache_clear_cache(XC_TYPE_VAR, 0);
+ }
+ }
xcache_unset_by_prefix($this->getNamespace().$prefix);
return true;
}