From: Maximilian Mader Date: Wed, 31 Dec 2014 15:59:59 +0000 (+0100) Subject: Implement RedisCacheSource::flush() X-Git-Tag: 3.0.0_Beta_1~2305^2~3 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=378047a59d76302ede98e396698ceeecf1d31814;p=GitHub%2FWoltLab%2FWCF.git Implement RedisCacheSource::flush() --- diff --git a/wcfsetup/install/files/lib/system/cache/source/RedisCacheSource.class.php b/wcfsetup/install/files/lib/system/cache/source/RedisCacheSource.class.php index 597f2fb233..b12c578503 100644 --- a/wcfsetup/install/files/lib/system/cache/source/RedisCacheSource.class.php +++ b/wcfsetup/install/files/lib/system/cache/source/RedisCacheSource.class.php @@ -66,7 +66,22 @@ class RedisCacheSource implements ICacheSource { * @see \wcf\system\cache\source\ICacheSource::flush() */ public function flush($cacheName, $useWildcard) { + $parts = explode('-', $cacheName, 2); + // check if the key is saved in a hashset + if (isset($parts[1])) { + if ($useWildcard) { + // delete the complete hashset + $this->redis->del($this->getCacheName($parts[0])); + } + else { + // delete the specified key from the hashset + $this->redis->hdel($this->getCacheName($parts[0]), $parts[1]); + } + } + else { + $this->redis->del($this->getCacheName($cacheName)); + } } /**