index.php 821 Bytes
Newer Older
Dries's avatar
 
Dries committed
1
<?php
2
// $Id$
Dries's avatar
Dries committed
3

Dries's avatar
 
Dries committed
4 5 6 7 8 9 10 11
/**
 * @file
 * The PHP page that serves all page requests on a Drupal installation.
 *
 * The routines here dispatch control to the appropriate handler, which then
 * prints the appropriate page.
 */

12
require_once './includes/bootstrap.inc';
13
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
14

Dries's avatar
 
Dries committed
15
$return = menu_execute_active_handler();
16 17 18 19 20 21 22 23 24 25 26 27 28 29

// Menu status constants are integers; page content is a string.
if (is_int($return)) {
  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;
  }
Dries's avatar
 
Dries committed
30
}
31 32 33 34
elseif (isset($return)) {
  // Print any value (including an empty string) except NULL or undefined:
  print theme('page', $return);
}
Dries's avatar
 
Dries committed
35

36
drupal_page_footer();