Skip to content
Snippets Groups Projects
Unverified Commit a4e1ab2e authored by Eileen McNaughton's avatar Eileen McNaughton Committed by GitHub
Browse files

Merge pull request #23900 from totten/5.51-sticky-classloader

(#3660) CRM_Extension_ClassLoader - Defend against redundant refreshes
parents 253af5eb ef935da5
No related branches found
No related tags found
No related merge requests found
......@@ -21,6 +21,14 @@ class CRM_Extension_ClassLoader {
*/
const FEATURES = ',psr0,psr4,';
/**
* A list of recently-activated extensions. This list is retained
* even if some ill-advised part of the installer does a `ClassLoader::refresh()`.
*
* @var array
*/
private static $newExtensions = [];
/**
* @var CRM_Extension_Mapper
*/
......@@ -97,6 +105,9 @@ class CRM_Extension_ClassLoader {
}
self::loadExtension($loader, $this->mapper->keyToInfo($key), $this->mapper->keyToBasePath($key));
}
foreach (static::$newExtensions as $record) {
static::loadExtension($loader, $record[0], $record[1]);
}
return $loader;
}
......@@ -130,6 +141,7 @@ class CRM_Extension_ClassLoader {
if (file_exists($file)) {
unlink($file);
}
static::$newExtensions[] = [$info, $path];
if ($this->loader) {
self::loadExtension($this->loader, $info, $path);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment