From: jitendrapurohit Date: Thu, 7 Apr 2016 10:11:34 +0000 (+0530) Subject: CRM-18058: Define cmsRootPath() for Joomla X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=214fbc2c6b79a3acecdca9fba8340b6ec4213ecc;p=civicrm-core.git CRM-18058: Define cmsRootPath() for Joomla --- diff --git a/CRM/Utils/System/Joomla.php b/CRM/Utils/System/Joomla.php index a609430659..14e6f6aa7e 100644 --- a/CRM/Utils/System/Joomla.php +++ b/CRM/Utils/System/Joomla.php @@ -677,6 +677,21 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { return $destination; } + /** + * Determine the location of the CMS root. + * + * @return string|NULL + * local file system path to CMS root, or NULL if it cannot be determined + */ + public function cmsRootPath() { + list($url, $siteName, $siteRoot) = $this->getDefaultSiteSettings(); + $includePath = "$siteRoot/libraries/cms/version"; + if (file_exists("$includePath/version.php")) { + return $siteRoot; + } + return NULL; + } + /** * @inheritDoc */