X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=Civi.php;h=f916756883ed7ae8c40756847a70a471576490df;hb=bac2c5e42fb9a4d21f74d5bb41e0b51a9a8af7c0;hp=95009e35c3fd3df36ba03e43dca7b844d78b9818;hpb=cff1a9a188e65033ecb79f19f4bb73ef8e0254de;p=civicrm-core.git diff --git a/Civi.php b/Civi.php index 95009e35c3..f916756883 100644 --- a/Civi.php +++ b/Civi.php @@ -64,7 +64,14 @@ class Civi { * @return \Symfony\Component\EventDispatcher\EventDispatcherInterface */ public static function dispatcher() { - return Civi\Core\Container::singleton()->get('dispatcher'); + // NOTE: The dispatcher object is initially created as a boot service + // (ie `dispatcher.boot`). For compatibility with the container (eg + // `RegisterListenersPass` and `createEventDispatcher` addons), + // it is also available as the `dispatcher` service. + // + // The 'dispatcher.boot' and 'dispatcher' services are the same object, + // but 'dispatcher.boot' is resolvable earlier during bootstrap. + return Civi\Core\Container::getBootService('dispatcher.boot'); } /**