function _drush_bootstrap_phases

8.0.x bootstrap.inc _drush_bootstrap_phases($function_names = FALSE)
6.x bootstrap.inc _drush_bootstrap_phases($function_names = FALSE, $init_phases_only = FALSE)
7.x bootstrap.inc _drush_bootstrap_phases($function_names = FALSE)
3.x environment.inc _drush_bootstrap_phases($function_names = FALSE)
4.x environment.inc _drush_bootstrap_phases($function_names = FALSE, $init_phases_only = FALSE)
5.x bootstrap.inc _drush_bootstrap_phases($function_names = FALSE, $init_phases_only = FALSE)
master bootstrap.inc _drush_bootstrap_phases($function_names = FALSE)

Helper function listing phases.

For commands that need to iterate through the phases, such as help

5 calls to _drush_bootstrap_phases()
drush_bootstrap in includes/environment.inc
Bootstrap Drush to the desired phase.
drush_bootstrap_max in includes/environment.inc
Bootstrap to the highest level possible, without triggering any errors.
drush_bootstrap_to_phase in includes/environment.inc
Bootstrap to the specified phase.
drush_bootstrap_validate in includes/environment.inc
Validate whether a bootstrap phases can be reached.
drush_main in ./drush.php
The main Drush function.

File

includes/environment.inc, line 136
Functions used by drush to query the environment and setting the current configuration.

Code

function _drush_bootstrap_phases($function_names = FALSE, $init_phases_only = FALSE) {
  static $functions = array(
    DRUSH_BOOTSTRAP_DRUSH => '_drush_bootstrap_drush',
    DRUSH_BOOTSTRAP_DRUPAL_ROOT => '_drush_bootstrap_drupal_root',
    DRUSH_BOOTSTRAP_DRUPAL_SITE => '_drush_bootstrap_drupal_site',
    DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION => '_drush_bootstrap_drupal_configuration',
    DRUSH_BOOTSTRAP_DRUPAL_DATABASE => '_drush_bootstrap_drupal_database',
    DRUSH_BOOTSTRAP_DRUPAL_FULL => '_drush_bootstrap_drupal_full',
    DRUSH_BOOTSTRAP_DRUPAL_LOGIN => '_drush_bootstrap_drupal_login',
  );

  $result = array();
  if ($init_phases_only) {
    foreach (array(DRUSH_BOOTSTRAP_DRUSH, DRUSH_BOOTSTRAP_DRUPAL_FULL) as $phase) {
      $result[$phase] = $functions[$phase];
    }
  }
  else {
    $result = $functions;
  }
  if (!$function_names) {
    $result = array_keys($result);
  }
  return $result;
}