function drush_bootstrap_class_for_root

8.0.x bootstrap.inc drush_bootstrap_class_for_root($path)
7.x bootstrap.inc drush_bootstrap_class_for_root($path)

Look up the best bootstrap class for the given location from the set of available candidates.

3 calls to drush_bootstrap_class_for_root()
drush_drupal_version in includes/drupal.inc
Detects the version number of the current Drupal installation, if any. Returns FALSE if there is no current Drupal installation, or it is somehow broken.
drush_select_bootstrap_class in includes/bootstrap.inc
Select the bootstrap class to use. If this is called multiple times, the bootstrap class returned might change on subsequent calls, if the root directory changes. Once the bootstrap object starts changing the state of the system, however, it will be…
drush_valid_root in includes/environment.inc
Checks whether given path qualifies as a Drupal root.

File

includes/bootstrap.inc, line 168

Code

function drush_bootstrap_class_for_root($path) {
  drush_load_bootstrap_commandfile_at_path($path);
  $candidates = drush_get_bootstrap_candidates();
  foreach ($candidates as $candidate) {
    if ($candidate->valid_root($path)) {
      return $candidate;
    }
  }
  return NULL;
}