X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=Civi.php;h=ae5dc6f4b1dda2f1a883542edbb0ec98c17b14dc;hb=49471b7478b55bc3868f791830c1a86b68da5fdf;hp=82f738f271946a27ce244bc3d8b05954a9eb7570;hpb=836178864b970fe12e529f1f3e43047cfa185d68;p=civicrm-core.git diff --git a/Civi.php b/Civi.php index 82f738f271..ae5dc6f4b1 100644 --- a/Civi.php +++ b/Civi.php @@ -54,6 +54,15 @@ class Civi { return Civi\Core\Container::singleton(); } + /** + * Get the event dispatcher. + * + * @return \Symfony\Component\EventDispatcher\EventDispatcherInterface + */ + public static function dispatcher() { + return Civi\Core\Container::singleton()->get('dispatcher'); + } + /** * @return \Civi\Core\Lock\LockManager */ @@ -74,11 +83,7 @@ class Civi { * @return \Civi\Core\Paths */ public static function paths() { - // Paths must be available before container can boot. - if (!isset(Civi::$statics[__CLASS__]['paths'])) { - Civi::$statics[__CLASS__]['paths'] = new \Civi\Core\Paths(); - } - return Civi::$statics[__CLASS__]['paths']; + return \Civi\Core\Container::getBootService('paths'); } /** @@ -98,8 +103,7 @@ class Civi { */ public static function reset() { self::$statics = array(); - Civi\Core\Container::getBootServices(); - Civi\Core\Container::singleton(TRUE); + Civi\Core\Container::singleton(); } /**