Skip to content

Commit

Permalink
Fixes acquia#4011 to resolve non-bootstraped environment detection.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemadison13 committed Feb 14, 2020
1 parent 515589f commit 1469de5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Robo/Common/EnvironmentDetector.php
Original file line number Diff line number Diff line change
Expand Up @@ -349,10 +349,12 @@ public static function getAcsfDbName() {
*/
private static function getSubclassResults($functionName) {
if (!defined('DRUPAL_ROOT')) {
// Do nothing if called outside of a Drupal bootstrap.
return [];
$path = __DIR__ . "../../../../../../../docroot";
}
$autoloader = require DRUPAL_ROOT . '/autoload.php';
else {
$path = DRUPAL_ROOT;
}
$autoloader = require $path . "/autoload.php";
$classMap = $autoloader->getClassMap();
$detectors = array_filter($classMap, function ($classPath) {
return strpos($classPath, 'Blt/Plugin/EnvironmentDetector') !== FALSE;
Expand Down

0 comments on commit 1469de5

Please sign in to comment.