From cd1c14a7f85b904c8259928eb2a393026e725824 Mon Sep 17 00:00:00 2001 From: RouL Date: Thu, 14 Jul 2011 21:40:54 +0200 Subject: [PATCH] Made the ApcCacheSource compatible with Debian Squeeze Debian still uses APC 3.1.3-pl2, "apc_exists" was introduced in 3.1.4, so i made a workaround with apc_fetch (returns false if nothing found). --- .../files/lib/system/cache/source/ApcCacheSource.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wcfsetup/install/files/lib/system/cache/source/ApcCacheSource.class.php b/wcfsetup/install/files/lib/system/cache/source/ApcCacheSource.class.php index adc3bec53b..518e541ee5 100644 --- a/wcfsetup/install/files/lib/system/cache/source/ApcCacheSource.class.php +++ b/wcfsetup/install/files/lib/system/cache/source/ApcCacheSource.class.php @@ -18,7 +18,7 @@ class ApcCacheSource implements CacheSource { * Creates a new ApcCacheSource object. */ public function __construct() { - if (!function_exists('apc_exists')) { + if (!function_exists('apc_store')) { throw new SystemException('APC support is not enabled.'); } } @@ -27,11 +27,11 @@ class ApcCacheSource implements CacheSource { * @see CacheSource::get() */ public function get($cacheResource) { - if (!apc_exists($cacheResource['file'])) { + if (false === $data = apc_fetch($cacheResource['file'])) { return null; } - return apc_fetch($cacheResource['file']); + return $data; } /** -- 2.20.1