X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=Civi.php;h=ae5dc6f4b1dda2f1a883542edbb0ec98c17b14dc;hb=eb3c005af5972ed58a354d38c9179f45ee852786;hp=01e1fbbc4d773db0639c0ea61cd20770d09e91df;hpb=18b0e84b295348cc2cc9d4d273a51bb8fd4b0320;p=civicrm-core.git diff --git a/Civi.php b/Civi.php index 01e1fbbc4d..ae5dc6f4b1 100644 --- a/Civi.php +++ b/Civi.php @@ -54,6 +54,22 @@ 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 + */ + public static function lockManager() { + return \Civi\Core\Container::getBootService('lockManager'); + } + /** * @return \Psr\Log\LoggerInterface */ @@ -67,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'); } /** @@ -90,8 +102,8 @@ class Civi { * singletons, containers. */ public static function reset() { - Civi\Core\Container::singleton(TRUE); self::$statics = array(); + Civi\Core\Container::singleton(); } /** @@ -109,7 +121,7 @@ class Civi { * @return \Civi\Core\SettingsBag */ public static function settings($domainID = NULL) { - return Civi\Core\Container::singleton()->get('settings_manager')->getBagByDomain($domainID); + return \Civi\Core\Container::getBootService('settings_manager')->getBagByDomain($domainID); } }