protected function BootstrapManager::selectBootstrapClass

master BootstrapManager.php protected BootstrapManager::selectBootstrapClass()

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::bootstrapf() will always return the same object.

1 call to BootstrapManager::selectBootstrapClass()
BootstrapManager::bootstrap in lib/Drush/Boot/BootstrapManager.php
Return the bootstrap object in use. This will be the latched bootstrap object if we have started bootstrapping; otherwise, it will be whichever bootstrap object is best for the selected root.

File

lib/Drush/Boot/BootstrapManager.php, line 122

Namespace

Drush\Boot

Class

BootstrapManager

Code

protected function selectBootstrapClass() {
  // 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 = $this->bootstrapObjectForRoot($this->root);
  // If we have not found a bootstrap class by this point,
  // then return our default bootstrap object.  The default bootstrap object
  // should pass through all calls without doing anything that
  // changes state in a CMS-specific way.
  if ($bootstrap == NULL) {
    $bootstrap = $this->defaultBootstrapObject;
  }

  return $bootstrap;
}