summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/bootstrap.inc23
1 files changed, 11 insertions, 12 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index f7e9b2655..e6bdaa736 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -1020,17 +1020,17 @@ function drupal_anonymous_user($session = '') {
* DRUPAL_BOOTSTRAP_PATH: set $_GET['q'] to Drupal path of request.
* DRUPAL_BOOTSTRAP_FULL: Drupal is fully loaded, validate and fix input data.
*/
-function drupal_bootstrap($phase) {
- static $phases = array(DRUPAL_BOOTSTRAP_CONFIGURATION, DRUPAL_BOOTSTRAP_EARLY_PAGE_CACHE, DRUPAL_BOOTSTRAP_DATABASE, DRUPAL_BOOTSTRAP_ACCESS, DRUPAL_BOOTSTRAP_SESSION, DRUPAL_BOOTSTRAP_LATE_PAGE_CACHE, DRUPAL_BOOTSTRAP_LANGUAGE, DRUPAL_BOOTSTRAP_PATH, DRUPAL_BOOTSTRAP_FULL), $phase_index = 0;
-
- while ($phase >= $phase_index && isset($phases[$phase_index])) {
- $current_phase = $phases[$phase_index];
- unset($phases[$phase_index++]);
- _drupal_bootstrap($current_phase);
-
- global $_drupal_current_bootstrap_phase;
- $_drupal_current_bootstrap_phase = $current_phase;
+function drupal_bootstrap($phase = NULL) {
+ static $phases = array(DRUPAL_BOOTSTRAP_CONFIGURATION, DRUPAL_BOOTSTRAP_EARLY_PAGE_CACHE, DRUPAL_BOOTSTRAP_DATABASE, DRUPAL_BOOTSTRAP_ACCESS, DRUPAL_BOOTSTRAP_SESSION, DRUPAL_BOOTSTRAP_LATE_PAGE_CACHE, DRUPAL_BOOTSTRAP_LANGUAGE, DRUPAL_BOOTSTRAP_PATH, DRUPAL_BOOTSTRAP_FULL), $completed_phase = -1;
+
+ if (isset($phase) && $phase > $completed_phase) {
+ while ($phases) {
+ $current_phase = array_shift($phases);
+ _drupal_bootstrap($current_phase);
+ $completed_phase = $current_phase;
+ }
}
+ return $completed_phase;
}
/**
@@ -1041,8 +1041,7 @@ function drupal_bootstrap($phase) {
* @see drupal_bootstrap
*/
function drupal_get_bootstrap_phase() {
- global $_drupal_current_bootstrap_phase;
- return $_drupal_current_bootstrap_phase;
+ return drupal_bootstrap();
}
function _drupal_bootstrap($phase) {