4 * Auto-register "settings/*.setting.php" files.
6 * @mixinName setting-php
10 * @param CRM_Extension_MixInfo $mixInfo
11 * On newer deployments, this will be an instance of MixInfo. On older deployments, Civix may polyfill with a work-a-like.
12 * @param \CRM_Extension_BootCache $bootCache
13 * On newer deployments, this will be an instance of MixInfo. On older deployments, Civix may polyfill with a work-a-like.
15 return function ($mixInfo, $bootCache) {
18 * @param \Civi\Core\Event\GenericHookEvent $e
19 * @see CRM_Utils_Hook::alterSettingsFolders()
21 Civi
::dispatcher()->addListener('hook_civicrm_alterSettingsFolders', function ($e) use ($mixInfo) {
22 // When deactivating on a polyfill/pre-mixin system, listeners may not cleanup automatically.
23 if (!$mixInfo->isActive()) {
27 $settingsDir = $mixInfo->getPath('settings');
28 if (!in_array($settingsDir, $e->settingsFolders
) && is_dir($settingsDir)) {
29 $e->settingsFolders
[] = $settingsDir;