Skip to content

Commit

Permalink
deprecated service
Browse files Browse the repository at this point in the history
  • Loading branch information
demeritcowboy committed Apr 22, 2022
1 parent 4455e97 commit 3bb9d47
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions setup/src/Setup/DrupalUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ public static function isDrush() {
}

/**
* I believe this function is here and not part of CRM_Utils_System
* because it really only applies to Drupal, although it is different for
* different versions of Drupal. It's only called from the init plugin for
* Drupal 7/8.
*
* @param $cmsPath
*
* @return string
Expand All @@ -25,13 +20,7 @@ public static function getDrupalSiteDir($cmsPath) {
return basename(conf_path());
}
elseif (class_exists('Drupal')) {
try {
// try the newer method first, but fall back since it fails on older versions
return \Drupal::getContainer()->getParameter('site.path');
}
catch (\Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException $e) {
return \Drupal::service('site.path');
}
return \Drupal::getContainer()->getParameter('site.path');
}
else {
throw new \Exception('Cannot detect path under Drupal "sites/".');
Expand Down

0 comments on commit 3bb9d47

Please sign in to comment.