From 449ee32451f5e4771086ba35a0b5ffe9104a36b0 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sat, 29 Mar 2014 11:52:07 +0100 Subject: [PATCH] Add missing line breaks to wfDebug() calls Also removed true as second parameter to it from CloneDatabase.php since it is the default value of that parameter. Change-Id: I727ebae2bd4df0e26019985ce8c7ce73381c5642 --- includes/Collation.php | 2 +- includes/SkinTemplate.php | 3 ++- includes/WikiFilePage.php | 2 +- includes/actions/Action.php | 2 +- includes/api/ApiUpload.php | 2 +- includes/cache/LocalisationCache.php | 4 ++-- includes/clientpool/RedisConnectionPool.php | 4 ++-- includes/db/CloneDatabase.php | 4 ++-- includes/deferred/DataUpdate.php | 3 ++- includes/externalstore/ExternalStoreDB.php | 4 ++-- includes/filerepo/file/File.php | 2 +- includes/jobqueue/JobQueueDB.php | 4 ++-- includes/parser/Parser.php | 5 +++-- includes/specials/SpecialContributions.php | 2 +- includes/specials/SpecialUpload.php | 2 +- includes/specials/SpecialUploadStash.php | 2 +- includes/specials/SpecialUserrights.php | 4 ++-- languages/utils/CLDRPluralRuleEvaluator.php | 2 +- 18 files changed, 28 insertions(+), 25 deletions(-) diff --git a/includes/Collation.php b/includes/Collation.php index d2a5797f9f..987f3a7b88 100644 --- a/includes/Collation.php +++ b/includes/Collation.php @@ -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. } diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 32f0ed3e37..50739138b0 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -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; } diff --git a/includes/WikiFilePage.php b/includes/WikiFilePage.php index 817f0fa7eb..3e8a1ce6f1 100644 --- a/includes/WikiFilePage.php +++ b/includes/WikiFilePage.php @@ -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() ) ); } diff --git a/includes/actions/Action.php b/includes/actions/Action.php index 1180c5e57a..07a5c2454f 100644 --- a/includes/actions/Action.php +++ b/includes/actions/Action.php @@ -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(); } diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php index c54e8baad3..30f8adbac2 100644 --- a/includes/api/ApiUpload.php +++ b/includes/api/ApiUpload.php @@ -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(); } diff --git a/includes/cache/LocalisationCache.php b/includes/cache/LocalisationCache.php index c56111f85e..8b78e8e0ac 100644 --- a/includes/cache/LocalisationCache.php +++ b/includes/cache/LocalisationCache.php @@ -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; diff --git a/includes/clientpool/RedisConnectionPool.php b/includes/clientpool/RedisConnectionPool.php index 9e702e30ad..5db814d387 100644 --- a/includes/clientpool/RedisConnectionPool.php +++ b/includes/clientpool/RedisConnectionPool.php @@ -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; } diff --git a/includes/db/CloneDatabase.php b/includes/db/CloneDatabase.php index 08e1885867..536d721fb2 100644 --- a/includes/db/CloneDatabase.php +++ b/includes/db/CloneDatabase.php @@ -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 ); } } diff --git a/includes/deferred/DataUpdate.php b/includes/deferred/DataUpdate.php index 986a1f7558..53990bf784 100644 --- a/includes/deferred/DataUpdate.php +++ b/includes/deferred/DataUpdate.php @@ -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 diff --git a/includes/externalstore/ExternalStoreDB.php b/includes/externalstore/ExternalStoreDB.php index 5e7b32389c..9de81e060b 100644 --- a/includes/externalstore/ExternalStoreDB.php +++ b/includes/externalstore/ExternalStoreDB.php @@ -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 ); diff --git a/includes/filerepo/file/File.php b/includes/filerepo/file/File.php index c19a51df2c..edf574f773 100644 --- a/includes/filerepo/file/File.php +++ b/includes/filerepo/file/File.php @@ -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. diff --git a/includes/jobqueue/JobQueueDB.php b/includes/jobqueue/JobQueueDB.php index 6097d31287..e83c26d58f 100644 --- a/includes/jobqueue/JobQueueDB.php +++ b/includes/jobqueue/JobQueueDB.php @@ -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 diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index f2c4fbff7c..f845ecd01b 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -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; } } diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index af4f8523b4..51606b72fb 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -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 = "\n"; } else { $ret = Html::rawElement( 'li', array( 'class' => $classes ), $ret ) . "\n"; diff --git a/includes/specials/SpecialUpload.php b/includes/specials/SpecialUpload.php index 4887dafc60..b46f942e2a 100644 --- a/includes/specials/SpecialUpload.php +++ b/includes/specials/SpecialUpload.php @@ -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; } diff --git a/includes/specials/SpecialUploadStash.php b/includes/specials/SpecialUploadStash.php index 964bea1138..33883b0d01 100644 --- a/includes/specials/SpecialUploadStash.php +++ b/includes/specials/SpecialUploadStash.php @@ -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' ); diff --git a/includes/specials/SpecialUserrights.php b/includes/specials/SpecialUserrights.php index 2a54ad7db9..db9a9927e3 100644 --- a/includes/specials/SpecialUserrights.php +++ b/includes/specials/SpecialUserrights.php @@ -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 ) { diff --git a/languages/utils/CLDRPluralRuleEvaluator.php b/languages/utils/CLDRPluralRuleEvaluator.php index e9b7e02bad..e420cb2d40 100644 --- a/languages/utils/CLDRPluralRuleEvaluator.php +++ b/languages/utils/CLDRPluralRuleEvaluator.php @@ -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] ) ) { -- 2.20.1