From 214fbc2c6b79a3acecdca9fba8340b6ec4213ecc Mon Sep 17 00:00:00 2001 From: jitendrapurohit Date: Thu, 7 Apr 2016 15:41:34 +0530 Subject: [PATCH] CRM-18058: Define cmsRootPath() for Joomla --- CRM/Utils/System/Joomla.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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 */ -- 2.25.1