CRM_Core_BAO_ConfigSetting -- Add disableComponent($componentName)
[civicrm-core.git] / CRM / Extension / System.php
index 6317cd9f811408a21efdc896f5e59cedff5758a0..3d531807fc6c2bb35f7bde01b76352cdd412a4c4 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.3                                                |
+ | CiviCRM version 4.5                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013                                |
+ | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -30,7 +30,7 @@
  * system.
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
  *
  */
@@ -53,6 +53,8 @@ class CRM_Extension_System {
   private $_repoUrl = NULL;
 
   /**
+   * @param bool $fresh
+   *
    * @return CRM_Extension_System
    */
   public static function singleton($fresh = FALSE) {
@@ -66,10 +68,16 @@ class CRM_Extension_System {
     return self::$singleton;
   }
 
+  /**
+   * @param CRM_Extension_System $singleton
+   */
   public static function setSingleton(CRM_Extension_System $singleton) {
     self::$singleton = $singleton;
   }
 
+  /**
+   * @param array $parameters
+   */
   public function __construct($parameters = array()) {
     $config = CRM_Core_Config::singleton();
     if (!array_key_exists('extensionsDir', $parameters)) {
@@ -103,6 +111,15 @@ class CRM_Extension_System {
       // TODO: CRM_Extension_Container_Basic( /modules )
       // TODO: CRM_Extension_Container_Basic( /vendors )
 
+      // At time of writing, D6, D7, and WP support cmsRootPath() but J does not
+      $cmsRootPath = $config->userSystem->cmsRootPath();
+      if (NULL !== $cmsRootPath) {
+        $vendorPath = $cmsRootPath . DIRECTORY_SEPARATOR . 'vendor';
+        if (is_dir($vendorPath)) {
+          $containers['cmsvendor'] = new CRM_Extension_Container_Basic($vendorPath, $config->userFrameworkBaseURL  . DIRECTORY_SEPARATOR . 'vendor', $this->getCache(), 'cmsvendor');
+        }
+      }
+
       $this->fullContainer = new CRM_Extension_Container_Collection($containers, $this->getCache(), 'full');
     }
     return $this->fullContainer;