From 8b77f5745ddeddf42e464408e7490d6b334736ef Mon Sep 17 00:00:00 2001 From: Maximilian Mader Date: Fri, 29 May 2015 03:02:07 +0200 Subject: [PATCH] Add version number to RedisCacheSource in CacheListPage --- CHANGELOG.md | 1 + .../files/lib/acp/page/CacheListPage.class.php | 5 +++++ .../system/cache/source/RedisCacheSource.class.php | 11 +++++++++++ 3 files changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0db772df3..992913aef8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,3 +19,4 @@ * `wcf\system\event\listener\PreParserAtUserListener` removed. * `wcf\action\AJAXProxyAction::getData()` removed. * Version system removed. +* `wcf\system\cache\source\RedisCacheSource` added. diff --git a/wcfsetup/install/files/lib/acp/page/CacheListPage.class.php b/wcfsetup/install/files/lib/acp/page/CacheListPage.class.php index 493e5b022d..ea7a7f5a62 100755 --- a/wcfsetup/install/files/lib/acp/page/CacheListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/CacheListPage.class.php @@ -82,6 +82,11 @@ class CacheListPage extends AbstractPage { // set version $this->cacheData['version'] = WCF_VERSION; break; + + case 'wcf\system\cache\source\RedisCacheSource': + // set version + $this->cacheData['version'] = 'Redis '.CacheHandler::getInstance()->getCacheSource()->getRedisVersion(); + break; } $this->readCacheFiles('language', FileUtil::unifyDirSeparator(WCF_DIR.'language')); 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 209d181c27..5c373e5ecb 100644 --- a/wcfsetup/install/files/lib/system/cache/source/RedisCacheSource.class.php +++ b/wcfsetup/install/files/lib/system/cache/source/RedisCacheSource.class.php @@ -184,4 +184,15 @@ class RedisCacheSource implements ICacheSource { return $flush.':'.$cacheName; } + + /** + * Returns the Redis server version + * + * @return string + */ + public function getRedisVersion() { + $info = $this->redis->info('server'); + + return $info['redis_version']; + } } -- 2.20.1