From e5b89deea41624be3511132ad38176b78b6c6893 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 29 Apr 2015 13:38:03 +0000 Subject: [PATCH] fix PHP Fatal error "Class APCIterator not found" during installation, caused by for apc.enable_cli=0, but APC(u) installed --- phpgwapi/inc/class.egw_cache_apc.inc.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/phpgwapi/inc/class.egw_cache_apc.inc.php b/phpgwapi/inc/class.egw_cache_apc.inc.php index 4a056f7d02..9bdd2b67f5 100644 --- a/phpgwapi/inc/class.egw_cache_apc.inc.php +++ b/phpgwapi/inc/class.egw_cache_apc.inc.php @@ -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) {