fix PHP Fatal error "Class APCIterator not found" during installation, caused by for apc.enable_cli=0, but APC(u) installed

This commit is contained in:
Ralf Becker 2015-04-29 13:38:03 +00:00
parent 17b804695a
commit e5b89deea4

View File

@ -134,6 +134,13 @@ class egw_cache_apc extends egw_cache_provider_check implements egw_cache_provid
*/
function flush(array $keys)
{
// APC >= 3.1.1, but also seems to be missing if apc is disabled eg. for cli
if (!class_exists('APCIterator'))
{
if (function_exists('apc_clear_cache')) apc_clear_cache ('user');
return false;
}
//error_log(__METHOD__."(".array2string($keys).")");
foreach(new APCIterator('user', $preg='/^'.preg_quote(self::key($keys).'/')) as $item)
{