r69967 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69966‎ | r69967 | r69968 >
Date:20:29, 26 July 2010
Author:siebrand
Status:ok (Comments)
Tags:
Comment:
Revert r69841, r69882, r69892, r69896, r69910 in phase3/maintenance/language because rebuildLanguage.php was broken.

This prevented message updates by Raymond from translatewiki.net.

Reported issues:
* Warning: in_array() expects parameter 2 to be array, null given in maintenance\language\languages.inc on line 173
* Warning: in_array() expects parameter 2 to be array, null given in maintenance\language\languages.inc on line 175
* Warning: in_array(): Wrong datatype for second argument in phase3\maintenance\language\languages.inc on line 175
Modified paths:
  • /trunk/phase3/maintenance/language/StatOutputs.php (modified) (history)
  • /trunk/phase3/maintenance/language/checkLanguage.inc (modified) (history)
  • /trunk/phase3/maintenance/language/diffLanguage.php (modified) (history)
  • /trunk/phase3/maintenance/language/dumpMessages.php (modified) (history)
  • /trunk/phase3/maintenance/language/languages.inc (modified) (history)
  • /trunk/phase3/maintenance/language/writeMessagesArray.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/dumpMessages.php
@@ -31,7 +31,6 @@
3232 }
3333
3434 public function execute() {
35 - global $wgVersion;
3635 $messages = array();
3736 foreach ( array_keys( Language::getMessagesFor( 'en' ) ) as $key ) {
3837 $messages[$key] = wfMsg( $key );
Index: trunk/phase3/maintenance/language/writeMessagesArray.inc
@@ -80,8 +80,6 @@
8181 # Load messages
8282 $dir = $prefix ? $prefix : dirname( __FILE__ );
8383
84 - global $wgMessageStructure, $wgBlockComments, $wgIgnoredMessages, $wgOptionalMessages;
85 -
8684 require( $dir . '/messages.inc' );
8785 self::$messageStructure = $wgMessageStructure;
8886 self::$blockComments = $wgBlockComments;
Index: trunk/phase3/maintenance/language/checkLanguage.inc
@@ -383,7 +383,7 @@
384384 * @return The checks results as wiki text.
385385 */
386386 function outputWiki() {
387 - global $wgContLang;
 387+ global $wgContLang, $IP;
388388 $detailText = '';
389389 $rows[] = '! Language !! Code !! Total !! ' . implode( ' !! ', array_diff( $this->checks, $this->nonMessageChecks() ) );
390390 foreach ( $this->results as $code => $results ) {
Index: trunk/phase3/maintenance/language/diffLanguage.php
@@ -75,6 +75,7 @@
7676
7777 $foo = "wgAllMessages$languageCode";
7878 global $$foo;
 79+ global $wgSkinNamesEn; // potentially unused global declaration?
7980
8081 // it might already be loaded in LocalSettings.php
8182 if ( !isset( $$foo ) ) {
Index: trunk/phase3/maintenance/language/StatOutputs.php
@@ -31,6 +31,7 @@
3232 /** Outputs WikiText */
3333 class wikiStatsOutput extends statsOutput {
3434 function heading() {
 35+ global $IP;
3536 $version = SpecialVersion::getVersion( 'nodb' );
3637 echo "'''Statistics are based on:''' <code>" . $version . "</code>\n\n";
3738 echo "'''Note:''' These statistics can be generated by running <code>php maintenance/language/transstat.php</code>.\n\n";
@@ -66,7 +67,7 @@
6768 $blue = '00';
6869 $color = $red . $green . $blue;
6970
70 - $percent = parent::formatPercent( $subset, $total, $revert, $accuracy );
 71+ $percent = statsOutput::formatPercent( $subset, $total, $revert, $accuracy );
7172 return 'bgcolor="#' . $color . '"|' . $percent;
7273 }
7374 }
Index: trunk/phase3/maintenance/language/languages.inc
@@ -32,9 +32,6 @@
3333 */
3434 function __construct( $exif = true ) {
3535 require( dirname(__FILE__) . '/messageTypes.inc' );
36 -
37 - global $wgIgnoredMessages, $wgOptionalMessages, $wgEXIFMessages;
38 -
3936 $this->mIgnoredMessages = $wgIgnoredMessages;
4037 if ( $exif ) {
4138 $this->mOptionalMessages = array_merge( $wgOptionalMessages );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r69841Fix typo in deleteArchivedFiles.inc...reedy20:01, 24 July 2010
r69882Add some more missing globalsreedy17:53, 25 July 2010
r69892Add a few globals.platonides18:39, 25 July 2010
r69896Remove unused globals.platonides19:36, 25 July 2010
r69910Change some more to parent::reedy21:02, 25 July 2010

Comments

#Comment by Reedy (talk | contribs)   20:54, 26 July 2010

Per Platonides on irc this morning, these look VERY much like globals.. Maybe they should be renamed?

Special:Code/MediaWiki/69882#c7953

Status & tagging log