* (bug 11993) Remove contentsub "revision history"
* (bug 11952) Ensure we quote_ident() all schema names as needed
inside of the DatabasePostgres.php file.
+* (bug 12184) Exceptions now sent to stderr instead of stdout for command-line
+ scripts, making for cleaner reporting during batch jobs. PHP errors will also
+ be redirected in most cases on PHP 5.2.4 and later, switching 'display_errors'
+ to 'stderr' at runtime.
+
== Parser changes in 1.12 ==
/** Print the exception report using text */
function reportText() {
- echo $this->getText();
+ fwrite( STDERR, $this->getText() );
}
/* Output a report about the exception and takes care of formatting.
$e2->__toString() . "\n";
if ( !empty( $GLOBALS['wgCommandLineMode'] ) ) {
- echo $message;
+ fwrite( STDERR, $message );
} else {
echo nl2br( htmlspecialchars( $message ) ). "\n";
}
function dump( $history, $text = MW_EXPORT_TEXT ) {
# Notice messages will foul up your XML output even if they're
# relatively harmless.
- ini_set( 'display_errors', false );
+ if( ini_get( 'display_errors' ) )
+ ini_set( 'display_errors', 'stderr' );
$this->initProgress( $history );
ini_set( 'memory_limit', -1 );
+if( version_compare( phpversion(), '5.2.4' ) >= 0 ) {
+ // Send PHP warnings and errors to stderr instead of stdout.
+ // This aids in diagnosing problems, while keeping messages
+ // out of redirected output.
+ if( ini_get( 'display_errors' ) ) {
+ ini_set( 'display_errors', 'stderr' );
+ }
+
+ // Don't touch the setting on earlier versions of PHP,
+ // as setting it would disable output if you'd wanted it.
+
+ // Note that exceptions are also sent to stderr when
+ // command-line mode is on, regardless of PHP version.
+}
$wgShowSQLErrors = true;
require_once( "$IP/includes/Setup.php" );
# Notice messages will foul up your XML output even if they're
# relatively harmless.
-// ini_set( 'display_errors', false );
+ if( ini_get( 'display_errors' ) )
+ ini_set( 'display_errors', 'stderr' );
$this->initProgress( $this->history );