X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=Civi.php;h=ae5dc6f4b1dda2f1a883542edbb0ec98c17b14dc;hb=f2e906d7aa52512762a30f9cae4b5bdd3ea8f6b7;hp=d4fe840ce686748d75395e73409542f7051c8a47;hpb=7b5937feec104d6843290f2c4822799b7c3d9fe2;p=civicrm-core.git diff --git a/Civi.php b/Civi.php index d4fe840ce6..ae5dc6f4b1 100644 --- a/Civi.php +++ b/Civi.php @@ -54,6 +54,38 @@ 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 + */ + public static function log() { + 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. * @@ -70,8 +102,26 @@ 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(); + } + + /** + * Obtain the domain settings. + * + * @param int|null $domainID + * For the default domain, leave $domainID as NULL. + * @return \Civi\Core\SettingsBag + */ + public static function settings($domainID = NULL) { + return \Civi\Core\Container::getBootService('settings_manager')->getBagByDomain($domainID); } }