mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-18 06:48:50 +02:00
Compiler and co: fixed issue with the reset of the APC cache
SVN:trunk[1990]
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user