+ $bootServices['dispatcher.boot'] = new CiviEventDispatcher();
+
+ // Quality control: There should be no pre-boot hooks because they make it harder to understand/support/refactor.
+ // If a pre-boot hook sneaks in, we'll raise an error.
+ $bootDispatchPolicy = [
+ '/^hook_/' => 'not-ready',
+ '/^civi\./' => 'run',
+ ];
+ $mainDispatchPolicy = \CRM_Core_Config::isUpgradeMode() ? \CRM_Upgrade_DispatchPolicy::get('upgrade.main') : NULL;
+ $bootServices['dispatcher.boot']->setDispatchPolicy($bootDispatchPolicy);
+