summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'includes')
-rw-r--r--includes/common.inc21
-rw-r--r--includes/theme.inc6
2 files changed, 24 insertions, 3 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
diff --git a/includes/theme.inc b/includes/theme.inc
index 8af929744..b7e996342 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -7,7 +7,7 @@ function theme_init() {
include_once $themes[$user->theme][0];
}
else {
- include_once $themes[variable_get(theme_default, key($themes))][0];
+ include_once $themes[variable_get("theme_default", key($themes))][0];
}
return new Theme();
}
@@ -32,7 +32,7 @@ function theme_account($theme) {
// Display account settings:
$content .= "<LI><A HREF=\"account.php?op=track&topic=comments\">". t("track your comments") ."</A></LI>\n";
$content .= "<LI><A HREF=\"account.php?op=track&topic=nodes\">". t("track your nodes") ."</A></LI>\n";
- $content .= "<LI><A HREF=\"account.php?op=track&topic=site\">". strtr(t("track %a"), array("%a" => variable_get(site_name, "drupal"))) ."</A></LI>\n";
+ $content .= "<LI><A HREF=\"account.php?op=track&topic=site\">". strtr(t("track %a"), array("%a" => variable_get("site_name", "drupal"))) ."</A></LI>\n";
$content .= "<P>\n";
$content .= "<LI><A HREF=\"account.php?op=edit&topic=user\">". t("edit your information") ."</A></LI>\n";
$content .= "<LI><A HREF=\"account.php?op=edit&topic=site\">". t("edit your preferences") ."</A></LI>\n";
@@ -40,7 +40,7 @@ function theme_account($theme) {
$content .= "<P>\n";
if (user_access($user)) {
- $content .= "<LI><A HREF=\"admin.php\">administer ". variable_get(site_name, "drupal") ."</A></LI>\n";
+ $content .= "<LI><A HREF=\"admin.php\">administer ". variable_get("site_name", "drupal") ."</A></LI>\n";
$content .= "<P>\n";
}