diff --git a/lib/Cake/Cache/Engine/ApcEngine.php b/lib/Cake/Cache/Engine/ApcEngine.php index a06fbd3f7..301299cc5 100644 --- a/lib/Cake/Cache/Engine/ApcEngine.php +++ b/lib/Cake/Cache/Engine/ApcEngine.php @@ -125,10 +125,17 @@ class ApcEngine extends CacheEngine { if ($check) { return true; } - $info = apc_cache_info('user'); - $cacheKeys = $info['cache_list']; - unset($info); - foreach ($cacheKeys as $key) { + if (class_exists('APCIterator', false)) { + $iterator = new APCIterator( + 'user', + '/^' . preg_quote($this->settings['prefix'], '/') . '/', + APC_ITER_NONE + ); + apc_delete($iterator); + return true; + } + $cache = apc_cache_info('user'); + foreach ($cache['cache_list'] as $key) { if (strpos($key['info'], $this->settings['prefix']) === 0) { apc_delete($key['info']); } diff --git a/lib/Cake/Console/ShellDispatcher.php b/lib/Cake/Console/ShellDispatcher.php index 4cd7ec8bd..636d9ebd9 100644 --- a/lib/Cake/Console/ShellDispatcher.php +++ b/lib/Cake/Console/ShellDispatcher.php @@ -81,6 +81,9 @@ class ShellDispatcher { if (!defined('CAKE_CORE_INCLUDE_PATH')) { define('CAKE_CORE_INCLUDE_PATH', dirname(dirname(dirname(__FILE__)))); define('CAKEPHP_SHELL', true); + if (!defined('DS')) { + define('DS', DIRECTORY_SEPARATOR); + } if (!defined('CORE_PATH')) { define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS); }