Add missing line breaks to wfDebug() calls
authorAlexandre Emsenhuber <mediawiki@emsenhuber.ch>
Sat, 29 Mar 2014 10:52:07 +0000 (11:52 +0100)
committerAlexandre Emsenhuber <mediawiki@emsenhuber.ch>
Sat, 29 Mar 2014 10:52:07 +0000 (11:52 +0100)
Also removed true as second parameter to it from CloneDatabase.php
since it is the default value of that parameter.

Change-Id: I727ebae2bd4df0e26019985ce8c7ce73381c5642

18 files changed:
includes/Collation.php
includes/SkinTemplate.php
includes/WikiFilePage.php
includes/actions/Action.php
includes/api/ApiUpload.php
includes/cache/LocalisationCache.php
includes/clientpool/RedisConnectionPool.php
includes/db/CloneDatabase.php
includes/deferred/DataUpdate.php
includes/externalstore/ExternalStoreDB.php
includes/filerepo/file/File.php
includes/jobqueue/JobQueueDB.php
includes/parser/Parser.php
includes/specials/SpecialContributions.php
includes/specials/SpecialUpload.php
includes/specials/SpecialUploadStash.php
includes/specials/SpecialUserrights.php
languages/utils/CLDRPluralRuleEvaluator.php

index d2a5797..987f3a7 100644 (file)
@@ -470,7 +470,7 @@ class IcuCollation extends Collation {
                        $prev = $trimmedKey;
                }
                foreach ( $duplicatePrefixes as $badKey ) {
-                       wfDebug( "Removing '{$letterMap[$badKey]}' from first letters." );
+                       wfDebug( "Removing '{$letterMap[$badKey]}' from first letters.\n" );
                        unset( $letterMap[$badKey] );
                        // This code assumes that unsetting does not change sort order.
                }
index 32f0ed3..5073913 100644 (file)
@@ -1202,7 +1202,8 @@ class SkinTemplate extends Skin {
                                }
 
                                if ( isset( $content_actions[$key] ) ) {
-                                       wfDebug( __METHOD__ . ": Found a duplicate key for $key while flattening content_navigation into content_actions." );
+                                       wfDebug( __METHOD__ . ": Found a duplicate key for $key while flattening " .
+                                               "content_navigation into content_actions.\n" );
                                        continue;
                                }
 
index 817f0fa..3e8a1ce 100644 (file)
@@ -207,7 +207,7 @@ class WikiFilePage extends WikiPage {
                $file = $this->mFile;
 
                if ( ! $file instanceof LocalFile ) {
-                       wfDebug( __CLASS__ . '::' . __METHOD__ . ' is not supported for this file' );
+                       wfDebug( __CLASS__ . '::' . __METHOD__ . " is not supported for this file\n" );
                        return TitleArray::newFromResult( new FakeResultWrapper( array() ) );
                }
 
index 1180c5e..07a5c24 100644 (file)
@@ -169,7 +169,7 @@ abstract class Action {
                        return $this->context;
                } elseif ( $this->page instanceof Article ) {
                        // NOTE: $this->page can be a WikiPage, which does not have a context.
-                       wfDebug( __METHOD__ . ': no context known, falling back to Article\'s context.' );
+                       wfDebug( __METHOD__ . ": no context known, falling back to Article's context.\n" );
                        return $this->page->getContext();
                }
 
index c54e8ba..30f8adb 100644 (file)
@@ -92,7 +92,7 @@ class ApiUpload extends ApiBase {
                } elseif ( $this->mParams['async'] && $this->mParams['filekey'] ) {
                        // defer verification to background process
                } else {
-                       wfDebug( __METHOD__ . 'about to verify' );
+                       wfDebug( __METHOD__ . " about to verify\n" );
                        $this->verifyUpload();
                }
 
index c56111f..8b78e8e 100644 (file)
@@ -1281,7 +1281,7 @@ class LCStoreCDB implements LCStore {
                                try {
                                        $this->readers[$code] = CdbReader::open( $fileName );
                                } catch ( CdbException $e ) {
-                                       wfDebug( __METHOD__ . ": unable to open cdb file for reading" );
+                                       wfDebug( __METHOD__ . ": unable to open cdb file for reading\n" );
                                }
                        }
                }
@@ -1294,7 +1294,7 @@ class LCStoreCDB implements LCStore {
                                $value = $this->readers[$code]->get( $key );
                        } catch ( CdbException $e ) {
                                wfDebug( __METHOD__ . ": CdbException caught, error message was "
-                                       . $e->getMessage() );
+                                       . $e->getMessage() . "\n" );
                        }
                        if ( $value === false ) {
                                return null;
index 9e702e3..5db814d 100644 (file)
@@ -127,7 +127,7 @@ class RedisConnectionPool {
                // Initialize the object at the hash as needed...
                if ( !isset( self::$instances[$id] ) ) {
                        self::$instances[$id] = new self( $options );
-                       wfDebug( "Creating a new " . __CLASS__ . " instance with id $id." );
+                       wfDebug( "Creating a new " . __CLASS__ . " instance with id $id.\n" );
                }
 
                return self::$instances[$id];
@@ -153,7 +153,7 @@ class RedisConnectionPool {
                        } else {
                                // Server is dead
                                wfDebug( "server $server is marked down for another " .
-                                       ( $this->downServers[$server] - $now ) . " seconds, can't get connection" );
+                                       ( $this->downServers[$server] - $now ) . " seconds, can't get connection\n" );
 
                                return false;
                        }
index 08e1885..536d721 100644 (file)
@@ -86,12 +86,12 @@ class CloneDatabase {
                                && !in_array( $this->db->getType(), array( 'postgres', 'oracle' ) )
                        ) {
                                $this->db->dropTable( $tbl, __METHOD__ );
-                               wfDebug( __METHOD__ . " dropping {$newTableName}\n", true );
+                               wfDebug( __METHOD__ . " dropping {$newTableName}\n" );
                                //Dropping the oldTable because the prefix was changed
                        }
 
                        # Create new table
-                       wfDebug( __METHOD__ . " duplicating $oldTableName to $newTableName\n", true );
+                       wfDebug( __METHOD__ . " duplicating $oldTableName to $newTableName\n" );
                        $this->db->duplicateTableStructure( $oldTableName, $newTableName, $this->useTemporaryTables );
                }
        }
index 986a1f7..53990bf 100644 (file)
@@ -108,7 +108,8 @@ abstract class DataUpdate implements DeferrableUpdate {
                        }
                } catch ( Exception $ex ) {
                        $exception = $ex;
-                       wfDebug( "Caught exception, will rethrow after rollback: " . $ex->getMessage() );
+                       wfDebug( "Caught exception, will rethrow after rollback: " .
+                               $ex->getMessage() . "\n" );
                }
 
                // rollback remaining transactions
index 5e7b323..9de81e0 100644 (file)
@@ -128,10 +128,10 @@ class ExternalStoreDB extends ExternalStoreMedium {
                $lb = $this->getLoadBalancer( $cluster );
 
                if ( !in_array( "DB://" . $cluster, (array)$wgDefaultExternalStore ) ) {
-                       wfDebug( "read only external store" );
+                       wfDebug( "read only external store\n" );
                        $lb->allowLagged( true );
                } else {
-                       wfDebug( "writable external store" );
+                       wfDebug( "writable external store\n" );
                }
 
                return $lb->getConnection( DB_SLAVE, array(), $wiki );
index c19a51d..edf574f 100644 (file)
@@ -980,7 +980,7 @@ abstract class File {
                        if ( $this->repo ) {
                                // Defer rendering if a 404 handler is set up...
                                if ( $this->repo->canTransformVia404() && !( $flags & self::RENDER_NOW ) ) {
-                                       wfDebug( __METHOD__ . " transformation deferred." );
+                                       wfDebug( __METHOD__ . " transformation deferred.\n" );
                                        // XXX: Pass in the storage path even though we are not rendering anything
                                        // and the path is supposed to be an FS path. This is due to getScalerType()
                                        // getting called on the path and clobbering $thumb->getUrl() if it's false.
index 6097d31..e83c26d 100644 (file)
@@ -318,7 +318,7 @@ class JobQueueDB extends JobQueue {
                                $title = Title::makeTitleSafe( $row->job_namespace, $row->job_title );
                                if ( !$title ) {
                                        $dbw->delete( 'job', array( 'job_id' => $row->job_id ), __METHOD__ );
-                                       wfDebug( "Row has invalid title '{$row->job_title}'." );
+                                       wfDebug( "Row has invalid title '{$row->job_title}'.\n" );
                                        continue; // try again
                                }
                                $job = Job::factory( $row->job_cmd, $title,
@@ -463,7 +463,7 @@ class JobQueueDB extends JobQueue {
                                        array( 'job_cmd' => $this->type, 'job_token' => $uuid ), __METHOD__
                                );
                                if ( !$row ) { // raced out by duplicate job removal
-                                       wfDebug( "Row deleted as duplicate by another process." );
+                                       wfDebug( "Row deleted as duplicate by another process.\n" );
                                }
                        } else {
                                break; // nothing to do
index f2c4fbf..f845ecd 100644 (file)
@@ -3416,7 +3416,8 @@ class Parser {
                                        }
                                } elseif ( MWNamespace::isNonincludable( $title->getNamespace() ) ) {
                                        $found = false; # access denied
-                                       wfDebug( __METHOD__ . ": template inclusion denied for " . $title->getPrefixedDBkey() );
+                                       wfDebug( __METHOD__ . ": template inclusion denied for " .
+                                               $title->getPrefixedDBkey() . "\n" );
                                } else {
                                        list( $text, $title ) = $this->getTemplateDom( $title );
                                        if ( $text !== false ) {
@@ -5206,7 +5207,7 @@ class Parser {
                                                                $handlerOptions[$paramName] = $match;
                                                        } else {
                                                                // Guess not. Append it to the caption.
-                                                               wfDebug( "$parameterMatch failed parameter validation" );
+                                                               wfDebug( "$parameterMatch failed parameter validation\n" );
                                                                $label .= '|' . $parameterMatch;
                                                        }
                                                }
index af4f852..51606b7 100644 (file)
@@ -1095,7 +1095,7 @@ class ContribsPager extends ReverseChronologicalPager {
                wfRunHooks( 'ContributionsLineEnding', array( $this, &$ret, $row, &$classes ) );
 
                if ( $classes === array() && $ret === '' ) {
-                       wfDebug( 'Dropping Special:Contribution row that could not be formatted' );
+                       wfDebug( "Dropping Special:Contribution row that could not be formatted\n" );
                        $ret = "<!-- Could not format Special:Contribution row. -->\n";
                } else {
                        $ret = Html::rawElement( 'li', array( 'class' => $classes ), $ret ) . "\n";
index 4887daf..b46f942 100644 (file)
@@ -186,7 +186,7 @@ class SpecialUpload extends SpecialPage {
                } else {
                        # Backwards compatibility hook
                        if ( !wfRunHooks( 'UploadForm:initial', array( &$this ) ) ) {
-                               wfDebug( "Hook 'UploadForm:initial' broke output of the upload form" );
+                               wfDebug( "Hook 'UploadForm:initial' broke output of the upload form\n" );
 
                                return;
                        }
index 964bea1..33883b0 100644 (file)
@@ -339,7 +339,7 @@ class SpecialUploadStash extends UnlistedSpecialPage {
        public static function tryClearStashedUploads( $formData ) {
                if ( isset( $formData['Clear'] ) ) {
                        $stash = RepoGroup::singleton()->getLocalRepo()->getUploadStash();
-                       wfDebug( "stash has: " . print_r( $stash->listFiles(), true ) );
+                       wfDebug( 'stash has: ' . print_r( $stash->listFiles(), true ) . "\n" );
 
                        if ( !$stash->clear() ) {
                                return Status::newFatal( 'uploadstash-errclear' );
index 2a54ad7..db9a992 100644 (file)
@@ -265,8 +265,8 @@ class UserrightsPage extends SpecialPage {
                // update groups in external authentication database
                $wgAuth->updateExternalDBGroups( $user, $add, $remove );
 
-               wfDebug( 'oldGroups: ' . print_r( $oldGroups, true ) );
-               wfDebug( 'newGroups: ' . print_r( $newGroups, true ) );
+               wfDebug( 'oldGroups: ' . print_r( $oldGroups, true ) . "\n" );
+               wfDebug( 'newGroups: ' . print_r( $newGroups, true ) . "\n" );
                wfRunHooks( 'UserRights', array( &$user, $add, $remove ) );
 
                if ( $newGroups != $oldGroups ) {
index e9b7e02..e420cb2 100644 (file)
@@ -73,7 +73,7 @@ class CLDRPluralRuleEvaluator {
                // Calculate the values of the operand symbols
                $number = strval( $number );
                if ( !preg_match( '/^ -? ( ([0-9]+) (?: \. ([0-9]+) )? )$/x', $number, $m ) ) {
-                       wfDebug( __METHOD__ . ': invalid number input, returning "other"' );
+                       wfDebug( __METHOD__ . ": invalid number input, returning 'other'\n" );
                        return count( $rules );
                }
                if ( !isset( $m[3] ) ) {