'run', '/^hook_civicrm_(pre|post)$/' => 'drop', '/^hook_civicrm_/' => $strict ? 'warn-drop' : 'drop', '/^civi\./' => 'run', '/./' => $strict ? 'warn-drop' : 'drop', ]; // The "upgrade.finish" policy applies at the end while performing the final clear/rebuild. // It's more permissive, allowing more data-structures to rehydrate correctly. $policies['upgrade.finish'] = [ '/^hook_civicrm_(pre|post)$/' => 'drop', '/./' => 'run', ]; // For comparison, "upgrade.old" is an estimation of the previous policy. It // was applied at all times during the upgrade. $policies['upgrade.old'] = [ 'hook_civicrm_alterSettingsFolders' => 'run', 'hook_civicrm_alterSettingsMetaData' => 'run', 'hook_civicrm_triggerInfo' => 'run', 'hook_civicrm_alterLogTables' => 'run', 'hook_civicrm_container' => 'run', 'hook_civicrm_permission' => 'run', 'hook_civicrm_managed' => 'run', 'hook_civicrm_config' => 'run', '/^hook_civicrm_(pre|post)$/' => 'drop', '/^hook_civicrm_/' => 'drop', '/^civi\./' => 'run', '/./' => 'run', ]; return $policies['upgrade.old']; // return $policies[$phase]; } }