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.

4 calls to drush_bootstrap_to_phase()
drush_core_quick_drupal in commands/core/
Callback for core-quick-drupal command.
drush_main in ./drush.php
The main Drush function.
_drush_bootstrap_and_dispatch in ./drush.php
_drush_core_directory in commands/core/
Given a target (e.g. @site:%modules), return the evaluated directory path.


includes/, line 285
Drush bootstrapping code.


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)), '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')) {
        $result = drush_bootstrap($phase_index, $max_phase_index);
    else {
      $result = FALSE;

  return $result;