diff --git a/core/metamodel.class.php b/core/metamodel.class.php index c939a996b..e31dba553 100644 --- a/core/metamodel.class.php +++ b/core/metamodel.class.php @@ -4786,15 +4786,15 @@ abstract class MetaModel return $oInstance; } - public static function GetCacheEntries(Config $oConfig = null) + public static function GetCacheEntries($sEnvironment = null) { if (!function_exists('apc_cache_info')) return array(); - if (is_null($oConfig)) + if (is_null($sEnvironment)) { - $oConfig = self::GetConfig(); + $sEnvironment = MetaModel::GetEnvironmentId(); } $aCacheUserData = apc_cache_info('user'); - $sPrefix = 'itop-'.MetaModel::GetEnvironmentId().'-'; + $sPrefix = 'itop-'.$sEnvironment.'-'; $aEntries = array(); foreach($aCacheUserData['cache_list'] as $i => $aEntry) @@ -4809,18 +4809,18 @@ abstract class MetaModel return $aEntries; } - public static function ResetCache(Config $oConfig = null) + public static function ResetCache($sEnvironment = null) { if (!function_exists('apc_delete')) return; - if (is_null($oConfig)) + if (is_null($sEnvironment)) { - $oConfig = self::GetConfig(); + $sEnvironment = MetaModel::GetEnvironmentId(); } - $sAppIdentity = 'itop-'.MetaModel::GetEnvironmentId(); + $sAppIdentity = 'itop-'.$sEnvironment; Dict::ResetCache($sAppIdentity); - foreach(self::GetCacheEntries($oConfig) as $sKey => $aAPCInfo) + foreach(self::GetCacheEntries($sEnvironment) as $sKey => $aAPCInfo) { $sAPCKey = $aAPCInfo['info']; apc_delete($sAPCKey); diff --git a/setup/runtimeenv.class.inc.php b/setup/runtimeenv.class.inc.php index 3edfa65d3..7d803e8ff 100644 --- a/setup/runtimeenv.class.inc.php +++ b/setup/runtimeenv.class.inc.php @@ -79,7 +79,7 @@ class RunTimeEnvironment if (!$bUseCache) { // Reset the cache for the first use ! - MetaModel::ResetCache($oConfig); + MetaModel::ResetCache($this->sTargetEnv); } MetaModel::Startup($oConfig, $bModelOnly, $bUseCache);