* (bug 5355) Include skin name and style JS settings in page source;
fixes regression where Opera 6/7 and KHTML CSS fixes weren't applied
when wikibits.js was moved up before user JS inclusion.
+* Added $wgColorErrors: if set, database error messages will be highlighted
+ when running command-line scripts in a Unix terminal.
=== Caveats ===
* @param bool $tempIgnore
*/
function reportQueryError( $error, $errno, $sql, $fname, $tempIgnore = false ) {
- global $wgCommandLineMode, $wgFullyInitialised;
+ global $wgCommandLineMode, $wgFullyInitialised, $wgColorErrors;
# Ignore errors during error handling to avoid infinite recursion
$ignore = $this->ignoreErrors( true );
++$this->mErrorCount;
if ( !$wgCommandLineMode ) {
$message = nl2br( $message );
}
+ if( $wgCommandLineMode && $wgColorErrors && !wfIsWindows() && posix_isatty(1) ) {
+ $color = 31; // bright red!
+ $message = "\x1b[1;{$color}m{$message}\x1b[0m";
+ }
wfDebugDieBacktrace( $message );
} else {
// this calls wfAbruptExit()
*/
$wgShowSQLErrors = false;
+/**
+ * If true, some error messages will be colorized when running scripts on the
+ * command line; this can aid picking important things out when debugging.
+ * Ignored when running on Windows or when output is redirected to a file.
+ */
+$wgColorErrors = true;
+
/**
* disable experimental dmoz-like category browsing. Output things like:
* Encyclopedia > Music > Style of Music > Jazz