r50124 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50123‎ | r50124 | r50125 >
Date:09:56, 2 May 2009
Author:nikerabbit
Status:ok
Tags:
Comment:
Rename $wgOut to $output to avoid collision, wfDebug expects $wgOut to be OutputPage object
Modified paths:
  • /trunk/phase3/maintenance/language/transstat.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/transstat.php
@@ -48,16 +48,16 @@
4949 # Select an output engine
5050 switch ( $options['output'] ) {
5151 case 'wiki':
52 - $wgOut = new wikiStatsOutput();
 52+ $output = new wikiStatsOutput();
5353 break;
5454 case 'metawiki':
55 - $wgOut = new metawikiStatsOutput();
 55+ $output = new metawikiStatsOutput();
5656 break;
5757 case 'text':
58 - $wgOut = new textStatsOutput();
 58+ $output = new textStatsOutput();
5959 break;
6060 case 'csv':
61 - $wgOut = new csvStatsOutput();
 61+ $output = new csvStatsOutput();
6262 break;
6363 default:
6464 showUsage();
@@ -67,17 +67,17 @@
6868 $wgLanguages = new languages();
6969
7070 # Header
71 -$wgOut->heading();
72 -$wgOut->blockstart();
73 -$wgOut->element( 'Language', true );
74 -$wgOut->element( 'Code', true );
75 -$wgOut->element( 'Translated', true );
76 -$wgOut->element( '%', true );
77 -$wgOut->element( 'Obsolete', true );
78 -$wgOut->element( '%', true );
79 -$wgOut->element( 'Problematic', true );
80 -$wgOut->element( '%', true );
81 -$wgOut->blockend();
 71+$output->heading();
 72+$output->blockstart();
 73+$output->element( 'Language', true );
 74+$output->element( 'Code', true );
 75+$output->element( 'Translated', true );
 76+$output->element( '%', true );
 77+$output->element( 'Obsolete', true );
 78+$output->element( '%', true );
 79+$output->element( 'Problematic', true );
 80+$output->element( '%', true );
 81+$output->blockend();
8282
8383 $wgGeneralMessages = $wgLanguages->getGeneralMessages();
8484 $wgRequiredMessagesNumber = count( $wgGeneralMessages['required'] );
@@ -93,31 +93,31 @@
9494 $messages = $wgLanguages->getMessages( $code );
9595 $messagesNumber = count( $messages['translated'] );
9696 $requiredMessagesNumber = count( $messages['required'] );
97 - $requiredMessagesPercent = $wgOut->formatPercent( $requiredMessagesNumber, $wgRequiredMessagesNumber );
 97+ $requiredMessagesPercent = $output->formatPercent( $requiredMessagesNumber, $wgRequiredMessagesNumber );
9898 $obsoleteMessagesNumber = count( $messages['obsolete'] );
99 - $obsoleteMessagesPercent = $wgOut->formatPercent( $obsoleteMessagesNumber, $messagesNumber, true );
 99+ $obsoleteMessagesPercent = $output->formatPercent( $obsoleteMessagesNumber, $messagesNumber, true );
100100 $messagesWithMismatchVariables = $wgLanguages->getMessagesWithMismatchVariables( $code );
101101 $emptyMessages = $wgLanguages->getEmptyMessages( $code );
102102 $messagesWithWhitespace = $wgLanguages->getMessagesWithWhitespace( $code );
103103 $nonXHTMLMessages = $wgLanguages->getNonXHTMLMessages( $code );
104104 $messagesWithWrongChars = $wgLanguages->getMessagesWithWrongChars( $code );
105105 $problematicMessagesNumber = count( array_unique( array_merge( $messagesWithMismatchVariables, $emptyMessages, $messagesWithWhitespace, $nonXHTMLMessages, $messagesWithWrongChars ) ) );
106 - $problematicMessagesPercent = $wgOut->formatPercent( $problematicMessagesNumber, $messagesNumber, true );
 106+ $problematicMessagesPercent = $output->formatPercent( $problematicMessagesNumber, $messagesNumber, true );
107107
108108 # Output them
109 - $wgOut->blockstart();
110 - $wgOut->element( "$language" );
111 - $wgOut->element( "$code" );
112 - $wgOut->element( "$requiredMessagesNumber/$wgRequiredMessagesNumber" );
113 - $wgOut->element( $requiredMessagesPercent );
114 - $wgOut->element( "$obsoleteMessagesNumber/$messagesNumber" );
115 - $wgOut->element( $obsoleteMessagesPercent );
116 - $wgOut->element( "$problematicMessagesNumber/$messagesNumber" );
117 - $wgOut->element( $problematicMessagesPercent );
118 - $wgOut->blockend();
 109+ $output->blockstart();
 110+ $output->element( "$language" );
 111+ $output->element( "$code" );
 112+ $output->element( "$requiredMessagesNumber/$wgRequiredMessagesNumber" );
 113+ $output->element( $requiredMessagesPercent );
 114+ $output->element( "$obsoleteMessagesNumber/$messagesNumber" );
 115+ $output->element( $obsoleteMessagesPercent );
 116+ $output->element( "$problematicMessagesNumber/$messagesNumber" );
 117+ $output->element( $problematicMessagesPercent );
 118+ $output->blockend();
119119 }
120120
121121 # Footer
122 -$wgOut->footer();
 122+$output->footer();
123123
124124

Status & tagging log