function drush_bootstrap_to_phase

8.0.x drush_bootstrap_to_phase($max_phase_index)
6.x drush_bootstrap_to_phase($max_phase_index)
7.x drush_bootstrap_to_phase($max_phase_index)
4.x drush_bootstrap_to_phase($max_phase_index)
5.x drush_bootstrap_to_phase($max_phase_index)
master drush_bootstrap_to_phase($max_phase_index)

Bootstrap to the specified phase.


$max_phase_index: Only attempt bootstrap to the specified level.

5 calls to drush_bootstrap_to_phase()
BaseBoot::bootstrap_and_dispatch in lib/Drush/Boot/BaseBoot.php
Main entrypoint to bootstrap the selected CMS and execute the selected command.
drush_core_quick_drupal in commands/core/
Callback for core-quick-drupal command.
update_main in commands/core/drupal/
_drush_core_directory in commands/core/
Given a target (e.g. @site:%modules), return the evaluated directory path.
_update_batch_command in commands/core/drupal/


includes/, line 406


function drush_bootstrap_to_phase($max_phase_index) {
  // If $max_phase_index is DRUSH_BOOTSTRAP_MAX, then
  // we will bootstrap as far as we can.  drush_bootstrap_max
  // is different than drush_bootstrap_to_phase in that
  // it is not an error if DRUSH_BOOTSTRAP_LOGIN is not reached.
  if ($max_phase_index == DRUSH_BOOTSTRAP_MAX) {
    return TRUE;

  drush_log(dt("Bootstrap to phase !phase.", array('!phase' => $max_phase_index)), LogLevel::BOOTSTRAP);
  $phases = _drush_bootstrap_phases();
  $result = TRUE;

  // Try to bootstrap to the maximum possible level, without generating errors
  foreach ($phases as $phase_index) {
    if ($phase_index > $max_phase_index) {
      // Stop trying, since we achieved what was specified.

    if (drush_bootstrap_validate($phase_index)) {
      if ($phase_index > drush_get_context('DRUSH_BOOTSTRAP_PHASE', DRUSH_BOOTSTRAP_NONE)) {
        $result = drush_bootstrap($phase_index, $max_phase_index);
    else {
      $result = FALSE;

  return $result;