From: Alexander Ebert Date: Sun, 27 Jan 2013 14:56:35 +0000 (+0100) Subject: Fixed Memcached implementation X-Git-Tag: 2.0.0_Beta_1~535^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ea2cd45dc8a11360e97eba02e34779744d54719a;p=GitHub%2FWoltLab%2FWCF.git Fixed Memcached implementation Thanks to @TimWolla --- diff --git a/wcfsetup/install/files/lib/system/cache/source/MemcachedAdapter.class.php b/wcfsetup/install/files/lib/system/cache/source/MemcachedAdapter.class.php index 36e235bd31..357b395d46 100644 --- a/wcfsetup/install/files/lib/system/cache/source/MemcachedAdapter.class.php +++ b/wcfsetup/install/files/lib/system/cache/source/MemcachedAdapter.class.php @@ -31,7 +31,7 @@ class MemcachedAdapter extends SingletonFactory { // init memcached if (CACHE_SOURCE_MEMCACHED_USE_PCONNECT) { - $this->memcached = new \Memcached('wcf_memcached'); + $this->memcached = new \Memcached('wcf'.WCF_N.'_memcached'); } else { $this->memcached = new \Memcached(); diff --git a/wcfsetup/install/files/lib/system/cache/source/MemcachedCacheSource.class.php b/wcfsetup/install/files/lib/system/cache/source/MemcachedCacheSource.class.php index 16d7fe19fc..c7d9d07fd2 100644 --- a/wcfsetup/install/files/lib/system/cache/source/MemcachedCacheSource.class.php +++ b/wcfsetup/install/files/lib/system/cache/source/MemcachedCacheSource.class.php @@ -48,7 +48,7 @@ class MemcachedCacheSource implements ICacheSource { /** * Returns the memcached adapter. * - * @return \MemcachedAdapter + * @return wcf\system\cache\source\MemcachedAdapter */ public function getAdapter() { return $this->adapter; @@ -127,7 +127,13 @@ class MemcachedCacheSource implements ICacheSource { */ public function get(array $cacheResource) { $value = $this->getAdapter()->getMemcached()->get($cacheResource['file']); - if ($value === false) return null; + if ($value === false) { + // check if result code if return values is a boolean value instead of no result + if ($this->getAdapter()->getMemcached()->getResultCode() == \Memcached::RES_NOTFOUND) { + return null; + } + } + return $value; }