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
This commit is contained in:
mark_story 2011-10-18 20:48:58 -04:00
parent beac58188c
commit d7155d374b
3 changed files with 3 additions and 3 deletions

View file

@ -297,7 +297,7 @@
* *
*/ */
$engine = 'File'; $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'; $engine = 'Apc';
} }

View file

@ -37,7 +37,7 @@ class ApcEngine extends CacheEngine {
*/ */
public function init($settings = array()) { public function init($settings = array()) {
parent::init(array_merge(array('engine' => 'Apc', 'prefix' => Inflector::slug(APP_DIR) . '_'), $settings)); parent::init(array_merge(array('engine' => 'Apc', 'prefix' => Inflector::slug(APP_DIR) . '_'), $settings));
return function_exists('apc_cache_info'); return function_exists('apc_dec');
} }
/** /**

View file

@ -297,7 +297,7 @@
* *
*/ */
$engine = 'File'; $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'; $engine = 'Apc';
} }