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

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.
13 14
 */

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

require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
21
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
22
$return = menu_execute_active_handler();
23

24
// Menu status constants are integers; page content is a string or array.
25 26 27 28 29 30 31 32 33 34 35 36
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
elseif (isset($return)) {
39 40
  // Print anything besides a menu constant, assuming it's not NULL or undefined.
  print drupal_render_page($return);
41
}
42

43
drupal_page_footer();