]> git.pld-linux.org Git - packages/eventum.git/commitdiff
- some vars not avail from cli
authorElan Ruusamäe <glen@pld-linux.org>
Thu, 15 Mar 2007 17:37:30 +0000 (17:37 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    eventum-errorhandler.patch -> 1.5

eventum-errorhandler.patch

index f394435cc0e806d3e3f7b038cf90d981f7855b60..53a6c3c84693c34f204b220f43a5ea08505aa7f3 100644 (file)
@@ -15,8 +15,8 @@
              return $res;
          } else {
              return true;
---- include/class.error_handler.php    (working copy)
-+++ include/class.error_handler.php    2007-03-14 00:15:44.804500919 +0200
+--- include/class.error_handler.php    2007-03-14 00:15:44.804500919 +0200
++++ include/class.error_handler.php    2007-03-15 19:22:20.000000000 +0200
 @@ -32,8 +32,6 @@
  require_once(APP_INC_PATH . "class.mail.php");
  require_once(APP_INC_PATH . "class.setup.php");
@@ -26,7 +26,7 @@
  /**
   * Class to manage all tasks related to error conditions of the site, such as
   * logging facilities or alert notifications to the site administrators.
-@@ -45,126 +43,167 @@
+@@ -45,126 +43,171 @@
  class Error_Handler
  {
      /**
 -            $msg .= "'" . $error_msg[0] . "'\n\n";
 -            $msg .= "A more detailed error message follows:\n\n";
 -            $msg .= "'" . $error_msg[1] . "'\n\n";
+-        } else {
+-            $msg .= "'$error_msg'\n\n";
 +        $msg .= $notify_msg;
-+        $msg .= "That happened on page '" . $_SERVER['SCRIPT_NAME'] . "' from IP Address '" . $_SERVER['REMOTE_ADDR'] . "' coming from the page (referrer) '" . $_SERVER['HTTP_REFERER'] . "'.\n\n";
-+        $msg .= "The user agent given was '" . $_SERVER['HTTP_USER_AGENT'] . "'.\n\n";
-+        $msg .= "-- \nSincerely yours,\nAutomated Error_Handler Class";
 +
-+        // query database for 'max_allowed_packet'
-+        $stmt = "show variables like 'max_allowed_packet'";
-+        $res =& $GLOBALS['db_api']->dbh->query($stmt);
-+        if (PEAR::isError($res)) {
-+            // we failed, assume 8M
-+            $max_allowed_packet = 8387584;
-         } else {
--            $msg .= "'$error_msg'\n\n";
-+            $arr = $res->fetchRow(DB_FETCHMODE_ORDERED);
-+            $max_allowed_packet = $arr[1];
-+            $res->free();
++        // this checks that we're not running from commandline (cron for example)
++        if (isset($_SERVER['REMOTE_ADDR'])) {
++            $msg .= "That happened on page '" . $_SERVER['SCRIPT_NAME'] . "' from IP Address '" . $_SERVER['REMOTE_ADDR'] . "' coming from the page (referrer) '" . $_SERVER['HTTP_REFERER'] . "'.\n\n";
++            $msg .= "The user agent given was '" . $_SERVER['HTTP_USER_AGENT'] . "'.\n\n";
          }
 -        @$msg .= "That happened on page '" . $_SERVER["PHP_SELF"] . "' from IP Address '" . $_SERVER['REMOTE_ADDR'] . "' coming from the page (referrer) '" . $_SERVER['HTTP_REFERER'] . "'.\n\n";
 -        @$msg .= "The user agent given was '" . $_SERVER['HTTP_USER_AGENT'] . "'.\n\n";
--        $msg .= "-- \nSincerely yours,\nAutomated Error_Handler Class";
+         $msg .= "-- \nSincerely yours,\nAutomated Error_Handler Class";
 -        // only try to include the backtrace if we are on PHP 4.3.0 or later
 -        if (version_compare(phpversion(), "4.3.0", ">=")) {
 -            $msg .= "\n\nA backtrace is available:\n\n";
 -        // client libraries)
 -        if (strlen($msg) > 16777216) {
 +
++        // query database for 'max_allowed_packet'
++        $stmt = "show variables like 'max_allowed_packet'";
++        $res =& $GLOBALS['db_api']->dbh->query($stmt);
++        if (PEAR::isError($res)) {
++            // we failed, assume 8M
++            $max_allowed_packet = 8387584;
++        } else {
++            $arr = $res->fetchRow(DB_FETCHMODE_ORDERED);
++            $max_allowed_packet = $arr[1];
++            $res->free();
++        }
++
 +        // skip error details of an email notification about a query that
 +        // was bigger than max_allowed_packet + 1024
 +        if (strlen($msg) > $max_allowed_packet + 1024) {
This page took 0.106396 seconds and 4 git commands to generate.