Browse Source

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
mark_story 14 years ago
parent
commit
d7155d374b

+ 1 - 1
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';
 }
 

+ 1 - 1
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');
 	}
 
 /**

+ 1 - 1
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';
 }