function drush_select_bootstrap_class

8.0.x drush_select_bootstrap_class()
7.x drush_select_bootstrap_class()

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 'latched', and further calls to drush_select_bootstrap_class() will always return the same object.

3 calls to drush_select_bootstrap_class()
drush_complete_process_argv in includes/
This function resets the raw arguments so that Drush can parse the command as if it was run directly. The shell complete command passes the full command line as an argument, and the --early and --complete-debug options have to come before that, and…
drush_get_bootstrap_object in includes/
Get the appropriate bootstrap object. We'll search for a new bootstrap object every time someone asks for one until we start bootstrapping; then we'll returned the same cached one every time.
drush_preflight in includes/
During the initialization of Drush, this is the first step where we load our configuration and commandfiles, and select the site we are going to operate on; however, we take no irreversible actions (e.g. site bootstrapping). This allows commands that…


includes/, line 182


function drush_select_bootstrap_class() {
  $root = drush_get_context('DRUSH_SELECTED_DRUPAL_ROOT');

  // Once we have selected a Drupal root, we will reduce our bootstrap
  // candidates down to just the one used to select this site root.
  $bootstrap = drush_bootstrap_class_for_root($root);
  // If we have not found a bootstrap class by this point,
  // then take the last one and use it.  This should be our
  // default bootstrap class.  The default bootstrap class
  // should pass through all calls without doing anything that
  // changes state in a CMS-specific way.
  if ($bootstrap == NULL) {
    $candidates = drush_get_bootstrap_candidates();
    $bootstrap = array_pop($candidates);

  return $bootstrap;