bootstrap.inc

  1. 6.x bootstrap.inc
  2. 4.x bootstrap.inc
  3. 5.x bootstrap.inc

This file should be included by every public-facing page of FlightPath. It will include all the classes, as well as settings and function files, and modules.

File

bootstrap.inc
View source
  1. <?php
  2. /**
  3. * @file
  4. * This file should be included by every public-facing page of FlightPath.
  5. * It will include all the classes, as well as settings and function files, and modules.
  6. *
  7. */
  8. // Note: $levels_deep will have been set (or not) by another script. This
  9. // is so that you can send "../../" or whatever if you need to. Currently
  10. // used in routines/routines.php.
  11. if (!isset($levels_deep)) $levels_deep = "";
  12. // Load the includes files, for common functions.
  13. require_once("$levels_deep" . "includes/theme.inc");
  14. require_once("$levels_deep" . "includes/misc.inc");
  15. require_once("$levels_deep" . "includes/render.inc");
  16. require_once("$levels_deep" . "includes/menu.inc");
  17. require_once("$levels_deep" . "includes/db.inc");
  18. require_once("$levels_deep" . "includes/password.inc");
  19. // Should we load the settings file? This variable should be
  20. // set prior to including this bootstrap file.
  21. if (!isset($skip_flightpath_settings) || $skip_flightpath_settings != TRUE) {
  22. // Load the global system settings file.
  23. require_once("$levels_deep" . "custom/settings.php");
  24. }
  25. // Load all of the classes, as well as the custom classes.
  26. require_once("$levels_deep" . "classes/all_classes.php");
  27. // Define our custom error handler, so we can intercept PHP warnings and notices,
  28. // and decide if we want to display them, log them to file, etc.
  29. set_error_handler('_fp_error_handler'); // located in includes/misc.inc
  30. // Should we load the settings file? This variable should be
  31. // set prior to including this bootstrap file.
  32. if (!isset($skip_flightpath_modules) || $skip_flightpath_modules != TRUE) {
  33. // Include all of the enabled modules
  34. foreach ($GLOBALS["fp_system_settings"]["modules"] as $module => $value) {
  35. if (isset($value["enabled"]) && $value["enabled"] != "1") {
  36. // Module is not enabled. Skip it.
  37. continue;
  38. }
  39. include_module($module, FALSE); // simply include the module, do not call hook_init yet.
  40. }
  41. }
  42. // Now, invoke all modules which implement hook_init.
  43. invoke_hook('init');
  44. // Constants
  45. define('FLIGHTPATH_VERSION', '%FP_VERSION%'); // will be replaced automatically by getflightpath.com.
  46. define('FLIGHTPATH_CORE', '5.x'); // hard-coded core version.
  47. define ('WATCHDOG_NOTICE', 5);
  48. define ('WATCHDOG_ALERT', 1);
  49. define ('WATCHDOG_ERROR', 3);
  50. define ('WATCHDOG_DEBUG', 7);
  51. define("MENU_TYPE_NORMAL_ITEM", 1);
  52. define("MENU_TYPE_CALLBACK", 2);
  53. define("MENU_TYPE_TAB", 3);
  54. define("MENU_TYPE_SUB_TAB", 4);
  55. define("MENU_ACCESS_DENIED", 61);
  56. define("MENU_NOT_FOUND", 62);
  57. // Set a global variable which confirms the bootstrap has been loaded.
  58. $GLOBALS["fp_bootstrap_loaded"] = TRUE;

Constants