getCustomFieldID switch to API, add caching, add full string return option.
[civicrm-core.git] / Civi.php
index 82f738f271946a27ce244bc3d8b05954a9eb7570..ae5dc6f4b1dda2f1a883542edbb0ec98c17b14dc 100644 (file)
--- 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();
   }
 
   /**