r45717 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45716‎ | r45717 | r45718 >
Date:20:28, 13 January 2009
Author:mrzman
Status:ok (Comments)
Tags:
Comment:
adding newline to end of wfDebug calls where it was missing.
Modified paths:
  • /trunk/phase3/includes/AutoLoader.php (modified) (history)
  • /trunk/phase3/includes/Block.php (modified) (history)
  • /trunk/phase3/includes/EditPage.php (modified) (history)
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)
  • /trunk/phase3/includes/Linker.php (modified) (history)
  • /trunk/phase3/includes/RawPage.php (modified) (history)
  • /trunk/phase3/includes/SearchPostgres.php (modified) (history)
  • /trunk/phase3/includes/SkinTemplate.php (modified) (history)
  • /trunk/phase3/includes/UploadBase.php (modified) (history)
  • /trunk/phase3/includes/filerepo/LocalFile.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUpload.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -431,7 +431,7 @@
432432 return Language::factory( $langcode );
433433
434434 # $langcode is a string, but not a valid language code; use content language.
435 - wfDebug( 'Invalid language code passed to wfGetLangObj, falling back to content language.' );
 435+ wfDebug( "Invalid language code passed to wfGetLangObj, falling back to content language.\n" );
436436 return $wgContLang;
437437 }
438438
@@ -771,7 +771,7 @@
772772 wfDebug("WARNING: Abrupt exit in $file at line $line\n");
773773 }
774774 } else {
775 - wfDebug('WARNING: Abrupt exit\n');
 775+ wfDebug("WARNING: Abrupt exit\n");
776776 }
777777
778778 wfLogProfilingData();
@@ -1837,7 +1837,7 @@
18381838 $parserMemc->set( $key, array( 'html' => $parsed, 'hash' => md5( $notice ) ), 600 );
18391839 $notice = $parsed;
18401840 } else {
1841 - wfDebug( 'wfGetCachedNotice called for ' . $name . ' with no $wgOut available' );
 1841+ wfDebug( 'wfGetCachedNotice called for ' . $name . ' with no $wgOut available'."\n" );
18421842 $notice = '';
18431843 }
18441844 }
Index: trunk/phase3/includes/Linker.php
@@ -618,7 +618,7 @@
619619 $img = '';
620620 $success = wfRunHooks('LinkerMakeExternalImage', array( &$url, &$alt, &$img ) );
621621 if(!$success) {
622 - wfDebug("Hook LinkerMakeExternalImage changed the output of external image with url {$url} and alt text {$alt} to {$img}", true);
 622+ wfDebug("Hook LinkerMakeExternalImage changed the output of external image with url {$url} and alt text {$alt} to {$img}\n", true);
623623 return $img;
624624 }
625625 return Xml::element( 'img',
@@ -1020,7 +1020,7 @@
10211021 $link = '';
10221022 $success = wfRunHooks('LinkerMakeExternalLink', array( &$url, &$text, &$link ) );
10231023 if(!$success) {
1024 - wfDebug("Hook LinkerMakeExternalLink changed the output of link with url {$url} and text {$text} to {$link}", true);
 1024+ wfDebug("Hook LinkerMakeExternalLink changed the output of link with url {$url} and text {$text} to {$link}\n", true);
10251025 return $link;
10261026 }
10271027 return '<a href="'.$url.'"'.$attribsText.'>'.$text.'</a>';
Index: trunk/phase3/includes/filerepo/LocalFile.php
@@ -1760,12 +1760,12 @@
17611761 $oldName = $row->oi_archive_name;
17621762 $bits = explode( '!', $oldName, 2 );
17631763 if( count( $bits ) != 2 ) {
1764 - wfDebug( 'Invalid old file name: ' . $oldName );
 1764+ wfDebug( "Invalid old file name: $oldName \n" );
17651765 continue;
17661766 }
17671767 list( $timestamp, $filename ) = $bits;
17681768 if( $this->oldName != $filename ) {
1769 - wfDebug( 'Invalid old file name:' . $oldName );
 1769+ wfDebug( "Invalid old file name: $oldName \n" );
17701770 continue;
17711771 }
17721772 $this->oldCount++;
Index: trunk/phase3/includes/EditPage.php
@@ -744,7 +744,7 @@
745745
746746 if ( !wfRunHooks( 'EditPage::attemptSave', array( &$this ) ) )
747747 {
748 - wfDebug( "Hook 'EditPage::attemptSave' aborted article saving" );
 748+ wfDebug( "Hook 'EditPage::attemptSave' aborted article saving\n" );
749749 return self::AS_HOOK_ERROR;
750750 }
751751
Index: trunk/phase3/includes/SearchPostgres.php
@@ -70,7 +70,7 @@
7171 */
7272 function parseQuery( $term ) {
7373
74 - wfDebug( "parseQuery received: $term" );
 74+ wfDebug( "parseQuery received: $term \n" );
7575
7676 ## No backslashes allowed
7777 $term = preg_replace('/\\\/', '', $term);
@@ -122,7 +122,7 @@
123123 ## Quote the whole thing
124124 $searchstring = $this->db->addQuotes($searchstring);
125125
126 - wfDebug( "parseQuery returned: $searchstring" );
 126+ wfDebug( "parseQuery returned: $searchstring \n" );
127127
128128 return $searchstring;
129129
@@ -194,7 +194,7 @@
195195
196196 $query .= $this->db->limitResult( '', $this->limit, $this->offset );
197197
198 - wfDebug( "searchQuery returned: $query" );
 198+ wfDebug( "searchQuery returned: $query \n" );
199199
200200 return $query;
201201 }
Index: trunk/phase3/includes/AutoLoader.php
@@ -556,7 +556,7 @@
557557 }
558558 if ( !$filename ) {
559559 if( function_exists( 'wfDebug' ) )
560 - wfDebug( "Class {$className} not found; skipped loading" );
 560+ wfDebug( "Class {$className} not found; skipped loading\n" );
561561 # Give up
562562 return false;
563563 }
Index: trunk/phase3/includes/RawPage.php
@@ -164,7 +164,7 @@
165165 $text = $this->getRawText();
166166
167167 if( !wfRunHooks( 'RawPageViewBeforeOutput', array( &$this, &$text ) ) ) {
168 - wfDebug( __METHOD__ . ': RawPageViewBeforeOutput hook broke raw page output.' );
 168+ wfDebug( __METHOD__ . ": RawPageViewBeforeOutput hook broke raw page output.\n" );
169169 }
170170
171171 echo $text;
Index: trunk/phase3/includes/SkinTemplate.php
@@ -454,7 +454,7 @@
455455
456456 // original version by hansm
457457 if( !wfRunHooks( 'SkinTemplateOutputPageBeforeExec', array( &$this, &$tpl ) ) ) {
458 - wfDebug( __METHOD__ . ': Hook SkinTemplateOutputPageBeforeExec broke outputPage execution!' );
 458+ wfDebug( __METHOD__ . ": Hook SkinTemplateOutputPageBeforeExec broke outputPage execution!\n" );
459459 }
460460
461461 // allow extensions adding stuff after the page content.
Index: trunk/phase3/includes/specials/SpecialUpload.php
@@ -372,7 +372,7 @@
373373
374374 if( !wfRunHooks( 'UploadForm:BeforeProcessing', array( &$this ) ) )
375375 {
376 - wfDebug( "Hook 'UploadForm:BeforeProcessing' broke processing the file." );
 376+ wfDebug( "Hook 'UploadForm:BeforeProcessing' broke processing the file.\n" );
377377 return self::BEFORE_PROCESSING;
378378 }
379379
@@ -957,7 +957,7 @@
958958
959959 if( !wfRunHooks( 'UploadForm:initial', array( &$this ) ) )
960960 {
961 - wfDebug( "Hook 'UploadForm:initial' broke output of the upload form" );
 961+ wfDebug( "Hook 'UploadForm:initial' broke output of the upload form\n" );
962962 return false;
963963 }
964964
@@ -1658,7 +1658,7 @@
16591659 }
16601660 }
16611661
1662 - wfDebug( __METHOD__.": FOUND VIRUS! scanner feedback: $output" );
 1662+ wfDebug( __METHOD__.": FOUND VIRUS! scanner feedback: $output \n" );
16631663 return $output;
16641664 }
16651665 }
Index: trunk/phase3/includes/Block.php
@@ -570,7 +570,7 @@
571571
572572 ## Allow hooks to cancel the autoblock.
573573 if (!wfRunHooks( 'AbortAutoblock', array( $autoblockIP, &$this ) )) {
574 - wfDebug( "Autoblock aborted by hook." );
 574+ wfDebug( "Autoblock aborted by hook.\n" );
575575 return false;
576576 }
577577
Index: trunk/phase3/includes/UploadBase.php
@@ -711,7 +711,7 @@
712712 }
713713 }
714714
715 - wfDebug( __METHOD__.": FOUND VIRUS! scanner feedback: $output" );
 715+ wfDebug( __METHOD__.": FOUND VIRUS! scanner feedback: $output \n" );
716716 return $output;
717717 }
718718 }

Comments

#Comment by Simetrical (talk | contribs)   21:12, 13 January 2009

Maybe it would be better to just have wfDebug() add these itself if they're missing?

#Comment by Aaron Schulz (talk | contribs)   21:54, 13 January 2009

Probably

#Comment by Mr.Z-man (talk | contribs)   22:45, 13 January 2009

Perhaps, but there are a few cases where it's purposely not added to put 2 things on the same line. Though I think I found only 2 or 3 of those; it would be fairly trivial to change them.

Status & tagging log