r69882 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69881‎ | r69882 | r69883 >
Date:17:53, 25 July 2010
Author:reedy
Status:reverted (Comments)
Tags:
Comment:
Add some more missing globals
Modified paths:
  • /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
@@ -35,6 +35,7 @@
3636 foreach ( array_keys( Language::getMessagesFor( 'en' ) ) as $key ) {
3737 $messages[$key] = wfMsg( $key );
3838 }
 39+ global $wgVersion;
3940 $this->output( "MediaWiki $wgVersion language file\n" );
4041 $this->output( serialize( $messages ) );
4142 }
Index: trunk/phase3/maintenance/language/writeMessagesArray.inc
@@ -80,6 +80,8 @@
8181 # Load messages
8282 $dir = $prefix ? $prefix : dirname( __FILE__ );
8383
 84+ global $wgMessageStructure, $wgBlockComments, $wgIgnoredMessages, $wgOptionalMessages;
 85+
8486 require( $dir . '/messages.inc' );
8587 self::$messageStructure = $wgMessageStructure;
8688 self::$blockComments = $wgBlockComments;
Index: trunk/phase3/maintenance/language/languages.inc
@@ -32,6 +32,9 @@
3333 */
3434 function __construct( $exif = true ) {
3535 require( dirname(__FILE__) . '/messageTypes.inc' );
 36+
 37+ global $wgIgnoredMessages, $wgOptionalMessages, $wgEXIFMessages;
 38+
3639 $this->mIgnoredMessages = $wgIgnoredMessages;
3740 if ( $exif ) {
3841 $this->mOptionalMessages = array_merge( $wgOptionalMessages );

Follow-up revisions

RevisionCommit summaryAuthorDate
r69967Revert r69841, r69882, r69892, r69896, r69910 in phase3/maintenance/language ...siebrand20:29, 26 July 2010

Comments

#Comment by Nikerabbit (talk | contribs)   09:35, 26 July 2010
 		require( dirname(__FILE__) . '/messageTypes.inc' );
+
+		global $wgIgnoredMessages, $wgOptionalMessages, $wgEXIFMessages;

This and the one above this doesn't look right. They're not actually globals, but just named so and they don't need to exists in global scope. In this one you might accidentally override the correct variables in local scope provided by the require with global versions.

#Comment by Platonides (talk | contribs)   09:44, 26 July 2010

Then they should be renamed to not begin with wg

(that would also fix the error that they are not in DefaultSettings)

Status & tagging log