From a8eb2a3fffddb93ee2c06cfbb35373e14d4950fb Mon Sep 17 00:00:00 2001 From: Eric Espie Date: Tue, 1 Sep 2026 14:04:33 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B010019=20-=20APC=20cache=20not=20erased?= =?UTF-8?q?=20after=20MTP=20(online=20and=20offline),=20unattended=20insta?= =?UTF-8?q?ll?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/metamodel.class.php | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/core/metamodel.class.php b/core/metamodel.class.php index 9e942f9bd4..b8b7b84f04 100644 --- a/core/metamodel.class.php +++ b/core/metamodel.class.php @@ -6866,10 +6866,24 @@ abstract class MetaModel require_once(APPROOT.'/core/dict.class.inc.php'); Dict::ResetCache($sAppIdentity); + $iApcDeleteFailureCount = 0; if (function_exists('apc_delete')) { foreach (self::GetCacheEntries($sEnvironmentId) as $sKey => $aAPCInfo) { $sAPCKey = $aAPCInfo['info']; - apc_delete($sAPCKey); + if (!apc_delete($sAPCKey)) { + $iApcDeleteFailureCount++; + } + } + } + + if ($iApcDeleteFailureCount > 0) { + SetupLog::Warning("apc_delete failed for $iApcDeleteFailureCount entries for env $sEnvironment"); + } + + if (function_exists('apc_clear_cache')) { + // old style APC + if (!apc_clear_cache()) { + SetupLog::Warning("apc_clear_cache failed for env $sEnvironment"); } } @@ -6879,7 +6893,9 @@ abstract class MetaModel // Reset the opcache since otherwise the PHP "model" files may still be cached !! if (function_exists('opcache_reset')) { // Zend opcode cache - opcache_reset(); + if (!opcache_reset()) { + SetupLog::Warning("opcache_reset failed for env $sEnvironment"); + } } require_once(APPROOT.'setup/setuputils.class.inc.php');