diff --git a/core/apc-compat.php b/core/apc-compat.php index 4af4c2fa5..00f8ff991 100644 --- a/core/apc-compat.php +++ b/core/apc-compat.php @@ -1,5 +1,5 @@ getNumberOfParameters() != 2) + { + // Beware: APCu behaves slightly differently from APC !! + // Worse: the compatibility layer integrated into APC differs from apcu-bc (testing the number of parameters is a must) + // In CLI mode (PHP > 7) apc_cache_info returns null and outputs an error message. + $aCacheUserData = @apc_cache_info(); + } + else + { + $aCacheUserData = @apc_cache_info('user'); + } + return $aCacheUserData; +} \ No newline at end of file diff --git a/core/metamodel.class.php b/core/metamodel.class.php index eb0978e4c..75b1a3934 100644 --- a/core/metamodel.class.php +++ b/core/metamodel.class.php @@ -5226,21 +5226,12 @@ abstract class MetaModel public static function GetCacheEntries($sEnvironment = null) { - if (!function_exists('apc_cache_info')) return array(); if (is_null($sEnvironment)) { $sEnvironment = MetaModel::GetEnvironmentId(); } $aEntries = array(); - if (extension_loaded('apcu')) - { - // Beware: APCu behaves slightly differently from APC !! - $aCacheUserData = @apc_cache_info(); - } - else - { - $aCacheUserData = @apc_cache_info('user'); - } + $aCacheUserData = apc_cache_info_compat(); if (is_array($aCacheUserData) && isset($aCacheUserData['cache_list'])) { $sPrefix = 'itop-'.$sEnvironment.'-';