index.php 1.02 KB
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
/**
 * @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.
10 11 12
 *
 * All Drupal code is released under the GNU General Public License.
 * See COPYRIGHT.txt and LICENSE.txt.
Dries's avatar
 
Dries committed
13 14
 */

15 16 17 18 19 20
/**
 * Root directory of Drupal installation.
 */
define('DRUPAL_ROOT', dirname(realpath(__FILE__)));

require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
21
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
Dries's avatar
 
Dries committed
22
$return = menu_execute_active_handler();
23 24 25 26 27 28 29 30 31 32 33 34 35 36

// 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
37
}
38 39 40 41
elseif (isset($return)) {
  // Print any value (including an empty string) except NULL or undefined:
  print theme('page', $return);
}
Dries's avatar
 
Dries committed
42

43
drupal_page_footer();