Skip to content

Commit

Permalink
Fixes acquia#3994: Get environment detector subclass results on boots…
Browse files Browse the repository at this point in the history
…trap.
  • Loading branch information
danepowell committed Feb 19, 2020
1 parent 515589f commit c596873
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/Robo/Common/EnvironmentDetector.php
Original file line number Diff line number Diff line change
Expand Up @@ -348,11 +348,9 @@ public static function getAcsfDbName() {
* @throws \ReflectionException
*/
private static function getSubclassResults($functionName) {
if (!defined('DRUPAL_ROOT')) {
// Do nothing if called outside of a Drupal bootstrap.
return [];
}
$autoloader = require DRUPAL_ROOT . '/autoload.php';
// phpcs:ignore
global $repo_root;
$autoloader = require $repo_root . '/vendor/autoload.php';
$classMap = $autoloader->getClassMap();
$detectors = array_filter($classMap, function ($classPath) {
return strpos($classPath, 'Blt/Plugin/EnvironmentDetector') !== FALSE;
Expand Down

0 comments on commit c596873

Please sign in to comment.