When all of us have read the excellent doc: Drupal's page serving mechanism , We did got much clear views of the drupal starting process, but for 4.7 beta, the case changed much, as a beginner ,Trying to figure it out is not a easy thing,but it's good that we have source codes in hand,so i'll do my best to catch any clue in order to study and promote drupal. Let's begin:
when we type "http://www.example.com/a/b/c" in our browser, The apache server (or others) begin serving the index.php in drupal base dir to us, that is , drupal begin to emerge itself out, the index.php has only few lines codes,let's check it out first.
require_once './includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
$return = menu_execute_active_handler();
switch ($return) {
case MENU_NOT_FOUND:
drupal_not_found();
break;
case MENU_ACCESS_DENIED:
drupal_access_denied();
break;
case MENU_SITE_OFFLINE:
drupal_site_offline();
break;
default:
// Print any value (including an empty string) except NULL or undefined:
if (isset($return)) {
print theme('page', $return);
}
break;
}
drupal_page_footer();
The outline process is there,let's dive much deeply into the index.php:
- 1
require_once './includes/bootstrap.inc';
- This line is much easy, just uploading the drupal bootstrap functions, do nothing else: