From d7155d374b9a10af08ec93955d03aa664093026a Mon Sep 17 00:00:00 2001 From: mark_story Date: Tue, 18 Oct 2011 20:48:58 -0400 Subject: [PATCH] Making apc feature test rely on apc_dec. ZCS comes with a busted apc, and we need apc_dec to properly use the ApcEngine anyways. Fixes #2105 --- app/Config/core.php | 2 +- lib/Cake/Cache/Engine/ApcEngine.php | 2 +- lib/Cake/Console/Templates/skel/Config/core.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Config/core.php b/app/Config/core.php index 2b03097dc..552349006 100644 --- a/app/Config/core.php +++ b/app/Config/core.php @@ -297,7 +297,7 @@ * */ $engine = 'File'; -if (extension_loaded('apc') && (php_sapi_name() !== 'cli' || ini_get('apc.enable_cli'))) { +if (extension_loaded('apc') && function_exists('apc_dec') && (php_sapi_name() !== 'cli' || ini_get('apc.enable_cli'))) { $engine = 'Apc'; } diff --git a/lib/Cake/Cache/Engine/ApcEngine.php b/lib/Cake/Cache/Engine/ApcEngine.php index 37cfde201..a6ca486fd 100644 --- a/lib/Cake/Cache/Engine/ApcEngine.php +++ b/lib/Cake/Cache/Engine/ApcEngine.php @@ -37,7 +37,7 @@ class ApcEngine extends CacheEngine { */ public function init($settings = array()) { parent::init(array_merge(array('engine' => 'Apc', 'prefix' => Inflector::slug(APP_DIR) . '_'), $settings)); - return function_exists('apc_cache_info'); + return function_exists('apc_dec'); } /** diff --git a/lib/Cake/Console/Templates/skel/Config/core.php b/lib/Cake/Console/Templates/skel/Config/core.php index 2b03097dc..552349006 100644 --- a/lib/Cake/Console/Templates/skel/Config/core.php +++ b/lib/Cake/Console/Templates/skel/Config/core.php @@ -297,7 +297,7 @@ * */ $engine = 'File'; -if (extension_loaded('apc') && (php_sapi_name() !== 'cli' || ini_get('apc.enable_cli'))) { +if (extension_loaded('apc') && function_exists('apc_dec') && (php_sapi_name() !== 'cli' || ini_get('apc.enable_cli'))) { $engine = 'Apc'; }