X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=Civi.php;h=ae5dc6f4b1dda2f1a883542edbb0ec98c17b14dc;hb=d0e1473097276e24e69e28c58ea339df2bf32a75;hp=c88efd0268cad606a856804373f91078a2943a41;hpb=6e5ad5eeebdd8f764b5f617d28a20c645a782932;p=civicrm-core.git diff --git a/Civi.php b/Civi.php index c88efd0268..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 */ @@ -61,6 +77,15 @@ class Civi { return Civi\Core\Container::singleton()->get('psr_log'); } + /** + * Obtain the core file/path mapper. + * + * @return \Civi\Core\Paths + */ + public static function paths() { + return \Civi\Core\Container::getBootService('paths'); + } + /** * Fetch a service from the container. * @@ -77,8 +102,15 @@ class Civi { * singletons, containers. */ public static function reset() { - Civi\Core\Container::singleton(TRUE); self::$statics = array(); + Civi\Core\Container::singleton(); + } + + /** + * @return CRM_Core_Resources + */ + public static function resources() { + return CRM_Core_Resources::singleton(); } /** @@ -89,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); } }