| 1 |
<?php |
<?php |
| 2 |
// $Id: bootstrap.inc,v 1.327 2009/11/19 04:00:47 webchick Exp $ |
// $Id: bootstrap.inc,v 1.328 2009/11/20 06:12:45 webchick Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 1465 |
* |
* |
| 1466 |
*/ |
*/ |
| 1467 |
function drupal_bootstrap($phase = NULL, $new_phase = TRUE) { |
function drupal_bootstrap($phase = NULL, $new_phase = TRUE) { |
| 1468 |
$final_phase = &drupal_static(__FUNCTION__ . '_final_phase'); |
// Not drupal_static(), because does not depend on any run-time information. |
| 1469 |
// When not recursing, store the phase name so it's not forgotten while |
static $phases = array( |
|
// recursing. |
|
|
if ($new_phase) { |
|
|
$final_phase = $phase; |
|
|
} |
|
|
$phases = &drupal_static(__FUNCTION__ . '_phases', array( |
|
| 1470 |
DRUPAL_BOOTSTRAP_CONFIGURATION, |
DRUPAL_BOOTSTRAP_CONFIGURATION, |
| 1471 |
DRUPAL_BOOTSTRAP_PAGE_CACHE, |
DRUPAL_BOOTSTRAP_PAGE_CACHE, |
| 1472 |
DRUPAL_BOOTSTRAP_DATABASE, |
DRUPAL_BOOTSTRAP_DATABASE, |
| 1475 |
DRUPAL_BOOTSTRAP_PAGE_HEADER, |
DRUPAL_BOOTSTRAP_PAGE_HEADER, |
| 1476 |
DRUPAL_BOOTSTRAP_LANGUAGE, |
DRUPAL_BOOTSTRAP_LANGUAGE, |
| 1477 |
DRUPAL_BOOTSTRAP_FULL, |
DRUPAL_BOOTSTRAP_FULL, |
| 1478 |
)); |
); |
| 1479 |
$completed_phase = &drupal_static(__FUNCTION__ . '_completed_phase', -1); |
// Not drupal_static(), because the only legitimate API to control this is to |
| 1480 |
|
// call drupal_bootstrap() with a new phase parameter. |
| 1481 |
|
static $final_phase; |
| 1482 |
|
// Not drupal_static(), because it's impossible to roll back to an earlier |
| 1483 |
|
// bootstrap state. |
| 1484 |
|
static $completed_phase = -1; |
| 1485 |
|
|
| 1486 |
|
// When not recursing, store the phase name so it's not forgotten while |
| 1487 |
|
// recursing. |
| 1488 |
|
if ($new_phase) { |
| 1489 |
|
$final_phase = $phase; |
| 1490 |
|
} |
| 1491 |
if (isset($phase)) { |
if (isset($phase)) { |
| 1492 |
// Call a phase if it has not been called before and is below the requested |
// Call a phase if it has not been called before and is below the requested |
| 1493 |
// phase. |
// phase. |