From 957707335de345698396a2922594656b4d3e2740 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 18 Jan 2023 15:59:18 -0800 Subject: [PATCH] (dev/core#4055) ClassLoader - Use separate cache IDs for different configurations of modules --- CRM/Extension/ClassLoader.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CRM/Extension/ClassLoader.php b/CRM/Extension/ClassLoader.php index 9ca81638bf..7f84b083a9 100644 --- a/CRM/Extension/ClassLoader.php +++ b/CRM/Extension/ClassLoader.php @@ -179,7 +179,12 @@ class CRM_Extension_ClassLoader { * @return string */ protected function getCacheFile() { - $envId = \CRM_Core_Config_Runtime::getId(); + $envId = md5(implode(',', array_merge( + [\CRM_Core_Config_Runtime::getId()], + array_column($this->mapper->getActiveModuleFiles(), 'prefix') + // dev/core#4055 - When toggling ext's on systems with opcode caching, you may get stale reads for a moment. + // New cache key ensures new data-set. + ))); $file = \Civi::paths()->getPath("[civicrm.compile]/CachedExtLoader.{$envId}.php"); return $file; } -- 2.25.1