From 19034efb6da286747f1bcfb54c86de7c9247fac4 Mon Sep 17 00:00:00 2001 From: rurban Date: Fri, 5 Nov 2004 18:04:20 +0000 Subject: [PATCH] print errno only if _DEBUG_VERBOSE git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@4092 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- lib/ErrorManager.php | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/lib/ErrorManager.php b/lib/ErrorManager.php index 79eb43a23..99a24dd9f 100644 --- a/lib/ErrorManager.php +++ b/lib/ErrorManager.php @@ -1,4 +1,4 @@ -errfile); $lines = explode("\n", $this->errstr); - - $msg = sprintf("%s:%d: %s[%d]: %s", - $errfile, $this->errline, - $this->getDescription(), $this->errno, - array_shift($lines)); + if (DEBUG & _DEBUG_VERBOSE) { + $msg = sprintf("%s:%d: %s[%d]: %s", + $errfile, $this->errline, + $this->getDescription(), $this->errno, + array_shift($lines)); + } else { + $msg = sprintf("%s:%d: %s: \"%s\"", + $errfile, $this->errline, + $this->getDescription(), + array_shift($lines)); + } //$html = HTML::div(array('class' => $this->getHtmlClass()), HTML::p($msg)); // The class is now used for the div container. @@ -571,9 +577,11 @@ class PhpErrorOnce extends PhpError { $dir .= '/'; $errfile = preg_replace('|^' . preg_quote($dir) . '|', '', $this->errfile); $lines = explode("\n", $this->errstr); - $msg = sprintf("%s:%d: %s[%d]: %s %s", + $errtype = (DEBUG & _DEBUG_VERBOSE) ? sprintf("%s[%d]", $this->getDescription(), $this->errno) + : sprintf("%s", $this->getDescription()); + $msg = sprintf("%s:%d: %s: %s %s", $errfile, $this->errline, - $this->getDescription(), $this->errno, + $errtype, array_shift($lines), $count > 1 ? sprintf(" (...repeated %d times)",$count) : "" ); @@ -597,6 +605,9 @@ if (!isset($GLOBALS['ErrorManager'])) { } // $Log: not supported by cvs2svn $ +// Revision 1.38 2004/10/19 17:34:55 rurban +// <4.3 fix +// // Revision 1.37 2004/10/14 19:23:58 rurban // remove debugging prints // -- 2.45.0