Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM-20780 Add drupal option to define CMS_ROOT #10574

Merged
merged 3 commits into from
Jun 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CRM/Utils/System/Backdrop.php
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,11 @@ public function loadBootStrap($params = array(), $loadUser = TRUE, $throwError =
* @inheritDoc
*/
public function cmsRootPath($scriptFilename = NULL) {
global $civicrm_paths;
if (!empty($civicrm_paths['cms.root']['path'])) {
return $civicrm_paths['cms.root']['path'];
}

$cmsRoot = NULL;
$valid = NULL;

Expand Down
6 changes: 6 additions & 0 deletions CRM/Utils/System/Drupal.php
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,12 @@ public function cmsRootPath($scriptFilename = NULL) {
// drush anyway takes care of multisite install etc
return drush_get_context('DRUSH_DRUPAL_ROOT');
}

global $civicrm_paths;
if (!empty($civicrm_paths['cms.root']['path'])) {
return $civicrm_paths['cms.root']['path'];
}

// CRM-7582
$pathVars = explode('/',
str_replace('//', '/',
Expand Down
6 changes: 6 additions & 0 deletions CRM/Utils/System/Drupal6.php
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,12 @@ public function cmsRootPath($scriptFilename = NULL) {
// drush anyway takes care of multisite install etc
return drush_get_context('DRUSH_DRUPAL_ROOT');
}

global $civicrm_paths;
if (!empty($civicrm_paths['cms.root']['path'])) {
return $civicrm_paths['cms.root']['path'];
}

// CRM-7582
$pathVars = explode('/',
str_replace('//', '/',
Expand Down
5 changes: 5 additions & 0 deletions CRM/Utils/System/Drupal8.php
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,11 @@ public function loadBootStrap($params = array(), $loadUser = TRUE, $throwError =
* @return NULL|string
*/
public function cmsRootPath($path = NULL) {
global $civicrm_paths;
if (!empty($civicrm_paths['cms.root']['path'])) {
return $civicrm_paths['cms.root']['path'];
}

if (defined('DRUPAL_ROOT')) {
return DRUPAL_ROOT;
}
Expand Down
5 changes: 5 additions & 0 deletions CRM/Utils/System/Joomla.php
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,11 @@ public function getLoginDestination(&$form) {
* local file system path to CMS root, or NULL if it cannot be determined
*/
public function cmsRootPath() {
global $civicrm_paths;
if (!empty($civicrm_paths['cms.root']['path'])) {
return $civicrm_paths['cms.root']['path'];
}

list($url, $siteName, $siteRoot) = $this->getDefaultSiteSettings();
$includePath = "$siteRoot/libraries/cms/version";
if (file_exists("$includePath/version.php")) {
Expand Down
5 changes: 5 additions & 0 deletions CRM/Utils/System/WordPress.php
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,11 @@ public function validInstallDir($dir) {
* local file system path to CMS root, or NULL if it cannot be determined
*/
public function cmsRootPath() {
global $civicrm_paths;
if (!empty($civicrm_paths['cms.root']['path'])) {
return $civicrm_paths['cms.root']['path'];
}

$cmsRoot = $valid = NULL;
if (defined('CIVICRM_CMSDIR')) {
if ($this->validInstallDir(CIVICRM_CMSDIR)) {
Expand Down