Merge pull request #1641 from PalanteJon/CRM-13396
[civicrm-core.git] / CRM / Extension / System.php
index 8da0688d51d53edc601ed7cbfb2fc2b828e03000..d1ee9468312deeee0adbd86de609bdff204086a0 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.3                                                |
+ | CiviCRM version 4.4                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2013                                |
  +--------------------------------------------------------------------+
@@ -103,6 +103,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;
@@ -222,12 +231,7 @@ class CRM_Extension_System {
         $this->_repoUrl = false;
       }
       else {
-        $vars = array(
-          '{ver}' => CRM_Utils_System::version(),
-          '{uf}' => $config->userFramework,
-          '{php}' => phpversion(),
-        );
-        $this->_repoUrl = strtr($url, $vars);
+        $this->_repoUrl = CRM_Utils_System::evalUrl($url);
       }
     }
     return $this->_repoUrl;