Do not define xcache_unset_by_prefix() if it does not exist.
The defined function is not compatible with the function provided by xcache because it does not honor the prefix parameter. Thus defining it like this is a bad idea.
This commit is contained in:
parent
c84171cec0
commit
fb2761a203
|
@ -37,7 +37,12 @@ class XCache extends Cache {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function clear($prefix='') {
|
public function clear($prefix='') {
|
||||||
xcache_unset_by_prefix($this->getNamespace().$prefix);
|
if (function_exists('xcache_unset_by_prefix')) {
|
||||||
|
xcache_unset_by_prefix($this->getNamespace().$prefix);
|
||||||
|
} else {
|
||||||
|
// Since we can not clear by prefix, we just clear the whole cache.
|
||||||
|
xcache_clear_cache(\XC_TYPE_VAR, 0);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,10 +61,3 @@ class XCache extends Cache {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue