Merge pull request #12120 from eileenmcnaughton/fgb
[civicrm-core.git] / Civi.php
index 01e1fbbc4d773db0639c0ea61cd20770d09e91df..ae5dc6f4b1dda2f1a883542edbb0ec98c17b14dc 100644 (file)
--- 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);
   }
 
 }