From e29aefb46d5d191183ddb7574ab958e131c355ee Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 22 May 2013 21:06:10 -0400 Subject: [PATCH] CRM-12683 - Load extensions in "vendor" directory ---------------------------------------- * CRM-12683: Load extensions in "vendor" directory http://issues.civicrm.org/jira/browse/CRM-12683 --- CRM/Extension/System.php | 9 +++++++++ CRM/Utils/System/Base.php | 7 +++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CRM/Extension/System.php b/CRM/Extension/System.php index 6317cd9f81..6abee986f5 100644 --- a/CRM/Extension/System.php +++ b/CRM/Extension/System.php @@ -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, $this->getCache(), 'cmsvendor'); + } + } + $this->fullContainer = new CRM_Extension_Container_Collection($containers, $this->getCache(), 'full'); } return $this->fullContainer; diff --git a/CRM/Utils/System/Base.php b/CRM/Utils/System/Base.php index 5f7f1b7859..cc084af667 100644 --- a/CRM/Utils/System/Base.php +++ b/CRM/Utils/System/Base.php @@ -87,10 +87,13 @@ abstract class CRM_Utils_System_Base { return $url; } - /* - * Currently this is just helping out the test class as defaults is calling it - maybe move fix to defaults + /** + * Determine the location of the CMS root. + * + * @return string|NULL local file system path to CMS root, or NULL if it cannot be determined */ function cmsRootPath() { + return NULL; } /** -- 2.25.1