Skip to content

Commit

Permalink
Ensure that class-index is up-to-date after toggling extensions (A-Mo…
Browse files Browse the repository at this point in the history
…dule Handler)
  • Loading branch information
totten authored and eileenmcnaughton committed Oct 20, 2022
1 parent 9f7635d commit 7ad97da
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions CRM/Extension/Manager/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ public function onPreInstall(CRM_Extension_Info $info) {
$this->callHook($info, 'enable');
}

public function onPostInstall(CRM_Extension_Info $info) {
\Civi\Core\ClassScanner::cache('index')->flush();
}

/**
* @param CRM_Extension_Info $info
*/
Expand Down Expand Up @@ -80,6 +84,7 @@ public function onPreUninstall(CRM_Extension_Info $info) {
* @param CRM_Extension_Info $info
*/
public function onPostUninstall(CRM_Extension_Info $info) {
\Civi\Core\ClassScanner::cache('index')->flush();
}

/**
Expand All @@ -89,6 +94,10 @@ public function onPreDisable(CRM_Extension_Info $info) {
$this->callHook($info, 'disable');
}

public function onPostDisable(CRM_Extension_Info $info) {
\Civi\Core\ClassScanner::cache('index')->flush();
}

/**
* @param CRM_Extension_Info $info
*/
Expand All @@ -97,6 +106,10 @@ public function onPreEnable(CRM_Extension_Info $info) {
$this->callHook($info, 'enable');
}

public function onPostEnable(CRM_Extension_Info $info) {
\Civi\Core\ClassScanner::cache('index')->flush();
}

public function onPostReplace(CRM_Extension_Info $oldInfo, CRM_Extension_Info $newInfo) {
// Like everything, ClassScanner is probably affected by pre-existing/long-standing issue dev/core#3686.
// This may mitigate a couple edge-cases. But really #3686 needs a different+deeper fix.
Expand Down

0 comments on commit 7ad97da

Please sign in to comment.