class DrupalBootLevels (View source)

A value class with bootstrap levels.

Constants

MAX

This constant is only usable as the value of the 'bootstrap' item of a command object, or as the parameter to drush_bootstrap_to_phase. It is not a real bootstrap state.

NONE

No bootstrap.

Commands that only preflight, but do not bootstrap, should use a bootstrap level of NONE.

ROOT

Set up and test for a valid drupal root, either through the -r/--root options, or evaluated based on the current working directory.

Any code that interacts with an entire Drupal installation, and not a specific site on the Drupal installation should use this bootstrap phase.

SITE

Set up a Drupal site directory and the correct environment variables to allow Drupal to find the configuration file.

If no site is specified with the -l / --uri options, Drush will assume the site is 'default', which mimics Drupal's behaviour.

If you want to avoid this behaviour, it is recommended that you use the ROOT bootstrap phase instead.

Any code that needs to modify or interact with a specific Drupal site's settings.php file should bootstrap to this phase.

CONFIGURATION

Load the settings from the Drupal sites directory.

This phase is analagous to the DRUPAL_BOOTSTRAP_CONFIGURATION bootstrap phase in Drupal itself, and this is also the first step where Drupal specific code is included.

This phase is commonly used for code that interacts with the Drupal install API, as both install.php and update.php start at this phase.

DATABASE

Connect to the Drupal database using the database credentials loaded during the previous bootstrap phase.

This phase is analogous to the DRUPAL_BOOTSTRAP_DATABASE bootstrap phase in Drupal.

Any code that needs to interact with the Drupal database API needs to be bootstrapped to at least this phase.

FULL

Fully initialize Drupal.

This is analogous to the DRUPAL_BOOTSTRAP_FULL bootstrap phase in Drupal.

Any code that interacts with the general Drupal API should be bootstrapped to this phase.

Methods

static string
getPhaseName($index)

No description

Details

static string getPhaseName($index)

No description

Parameters

$index

Return Value

string