function drush_get_bootstrap_candidate_classnames

8.0.x bootstrap.inc drush_get_bootstrap_candidate_classnames()
7.x bootstrap.inc drush_get_bootstrap_candidate_classnames()

Find the list of bootstrap classnames available for initializing a CMS with Drush.

Return value

array

1 call to drush_get_bootstrap_candidate_classnames()
drush_get_bootstrap_candidates in includes/bootstrap.inc
Return the list of bootstrap objects that are available for initializing a CMS with Drush. We insure that any given candidate class is instantiated only once.

File

includes/bootstrap.inc, line 144

Code

function drush_get_bootstrap_candidate_classnames() {
  // Give all commandfiles a chance to return candidates.  They should
  // return STRINGS with the class name of the bootstrap object they provide.
  $candidates = drush_command_invoke_all('bootstrap_candidates');
  // If a bootstrap class was specified on the command line, consider it first.
  $bootstrap_class = drush_get_option('bootstrap_class', FALSE);
  if ($bootstrap_class) {
    array_unshift($candidates, $bootstrap_class);
  }
  // Add candidate bootstrap classes for Drupal
  foreach (array('8', '7', '6') as $version) {
    $drupal_bootstrap_class = 'Drush\Boot\DrupalBoot' . $version;
    $candidates[] = $drupal_bootstrap_class;
  }
  // Always consider our default bootstrap class last.
  $candidates[] = 'Drush\Boot\EmptyBoot';

  return $candidates;
}