Followup r105123, fix for MWDebug logging SQL queries on command line mode
authorJohn Du Hart <johnduhart@users.mediawiki.org>
Tue, 21 Feb 2012 16:48:46 +0000 (16:48 +0000)
committerJohn Du Hart <johnduhart@users.mediawiki.org>
Tue, 21 Feb 2012 16:48:46 +0000 (16:48 +0000)
includes/Setup.php

index c704d29..b858dba 100644 (file)
@@ -361,7 +361,10 @@ if ( $wgCookieSecure === 'detect' ) {
        $wgCookieSecure = ( substr( $wgServer, 0, 6 ) === 'https:' );
 }
 
-if ( $wgDebugToolbar ) {
+// Disable MWDebug for command line mode, this prevents MWDebug from eating up
+// all the memory from logging SQL queries on maintenance scripts
+global $wgCommandLineMode;
+if ( $wgDebugToolbar && !$wgCommandLineMode ) {
        MWDebug::init();
 }
 
@@ -410,7 +413,6 @@ if( is_null( $wgLocalTZoffset ) ) {
 }
 
 # Useful debug output
-global $wgCommandLineMode;
 if ( $wgCommandLineMode ) {
        $wgRequest = new FauxRequest( array() );