diff options
author | Dries Buytaert <dries@buytaert.net> | 2001-05-06 17:19:58 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2001-05-06 17:19:58 +0000 |
commit | 25c379fb6114ce990d239db607f628e283064a27 (patch) | |
tree | f51f08a211f745e609065899ae73c93a76bb5221 /includes/common.inc | |
parent | be8e898d23a3f9ca515f59fbcc8d82e112ed7ee8 (diff) | |
download | brdo-25c379fb6114ce990d239db607f628e283064a27.tar.gz brdo-25c379fb6114ce990d239db607f628e283064a27.tar.bz2 |
- Added custom PHP error handler to track down warnings and errors.
(Jeroen: let's sit back and wait until that warning bites again.)
- Simplified drupal.module. We still need a feature list, anyone?
Diffstat (limited to 'includes/common.inc')
-rw-r--r-- | includes/common.inc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/includes/common.inc b/includes/common.inc index ca942f5d2..5efe00f5a 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -12,6 +12,15 @@ function conf_init() { return $file; } +function error_handler($errno, $message, $filename, $line, $variables) { + $types = array(1 => "error", 2 => "warning", 4 => "parse error", 8 => "notice", 16 => "core error", 32 => "core warning", 64 => "compile error", 128 => "compile warning", 256 => "user error", 512 => "user warning", 1024 => "user notice"); + $entry = $types[$errno] .": $message in $filename on line $line."; + if ($errno == 1 || $errno == 2 || $errno == 4) { + watchdog("error", $types[$errno] .": $message in $filename on line $line."); + print $entry; + } +} + function watchdog($type, $message) { global $user, $watchdog, $PHP_SELF; $link = ($mod) ? $mod : substr(strrchr($PHP_SELF, "/"), 1, strrchr($PHP_SELF, "/") - 4); @@ -195,10 +204,22 @@ include_once "includes/theme.inc"; include_once "includes/user.inc"; include_once "includes/node.inc"; +// initialize user session: user_init(); + +// initialize installed modules: module_init(); + +// initialize localization system: $locale = locale_init(); + +// initialize configuration variables: $conf = variable_init(); + +// initialize theme: $theme = theme_init(); +// set error handler: +set_error_handler("error_handler"); + ?>
\ No newline at end of file |