r70401 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70400‎ | r70401 | r70402 >
Date:19:15, 3 August 2010
Author:platonides
Status:ok (Comments)
Tags:
Comment:
Remove all calls to $wgMessageCache->loadAllMessages()
Deprecated and empty since r52503
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/EditPage.php (modified) (history)
  • /trunk/phase3/includes/LogPage.php (modified) (history)
  • /trunk/phase3/includes/RevisionDelete.php (modified) (history)
  • /trunk/phase3/includes/User.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialListgrouprights.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialTags.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialVersion.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/User.php
@@ -3200,8 +3200,6 @@
32013201 * @return \string Localized descriptive group name
32023202 */
32033203 static function getGroupName( $group ) {
3204 - global $wgMessageCache;
3205 - $wgMessageCache->loadAllMessages();
32063204 $key = "group-$group";
32073205 $name = wfMsg( $key );
32083206 return $name == '' || wfEmptyMsg( $key, $name )
@@ -3216,8 +3214,6 @@
32173215 * @return \string Localized name for group member
32183216 */
32193217 static function getGroupMember( $group ) {
3220 - global $wgMessageCache;
3221 - $wgMessageCache->loadAllMessages();
32223218 $key = "group-$group-member";
32233219 $name = wfMsg( $key );
32243220 return $name == '' || wfEmptyMsg( $key, $name )
@@ -3274,8 +3270,6 @@
32753271 * @return \types{\type{Title},\bool} Title of the page if it exists, false otherwise
32763272 */
32773273 static function getGroupPage( $group ) {
3278 - global $wgMessageCache;
3279 - $wgMessageCache->loadAllMessages();
32803274 $page = wfMsgForContent( 'grouppage-' . $group );
32813275 if( !wfEmptyMsg( 'grouppage-' . $group, $page ) ) {
32823276 $title = Title::newFromText( $page );
@@ -3488,8 +3482,6 @@
34893483 * @return \string Localized description of the right
34903484 */
34913485 static function getRightDescription( $right ) {
3492 - global $wgMessageCache;
3493 - $wgMessageCache->loadAllMessages();
34943486 $key = "right-$right";
34953487 $name = wfMsg( $key );
34963488 return $name == '' || wfEmptyMsg( $key, $name )
Index: trunk/phase3/includes/Article.php
@@ -260,7 +260,6 @@
261261 if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
262262 # If this is a system message, get the default text.
263263 list( $message, $lang ) = $wgMessageCache->figureMessage( $wgContLang->lcfirst( $this->mTitle->getText() ) );
264 - $wgMessageCache->loadAllMessages( $lang );
265264 $text = wfMsgGetKey( $message, false, $lang, false );
266265
267266 if ( wfEmptyMsg( $message, $text ) )
Index: trunk/phase3/includes/EditPage.php
@@ -143,7 +143,6 @@
144144 if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
145145 # If this is a system message, get the default text.
146146 list( $message, $lang ) = $wgMessageCache->figureMessage( $wgContLang->lcfirst( $this->mTitle->getText() ) );
147 - $wgMessageCache->loadAllMessages( $lang );
148147 $text = wfMsgGetKey( $message, false, $lang, false );
149148 if( wfEmptyMsg( $message, $text ) )
150149 $text = $this->getPreloadedText( $preload );
Index: trunk/phase3/includes/specials/SpecialListgrouprights.php
@@ -41,10 +41,9 @@
4242 * Show the special page
4343 */
4444 public function execute( $par ) {
45 - global $wgOut, $wgImplicitGroups, $wgMessageCache;
 45+ global $wgOut, $wgImplicitGroups;
4646 global $wgGroupPermissions, $wgRevokePermissions, $wgAddGroups, $wgRemoveGroups;
4747 global $wgGroupsAddToSelf, $wgGroupsRemoveFromSelf;
48 - $wgMessageCache->loadAllMessages();
4948
5049 $this->setHeaders();
5150 $this->outputHeader();
Index: trunk/phase3/includes/specials/SpecialVersion.php
@@ -44,10 +44,8 @@
4545 * main()
4646 */
4747 function execute( $par ) {
48 - global $wgOut, $wgMessageCache, $wgSpecialVersionShowHooks, $wgContLang;
 48+ global $wgOut, $wgSpecialVersionShowHooks, $wgContLang;
4949
50 - $wgMessageCache->loadAllMessages();
51 -
5250 $this->setHeaders();
5351 $this->outputHeader();
5452
@@ -568,4 +566,4 @@
569567 }
570568 }
571569
572 -}
\ No newline at end of file
 570+}
Index: trunk/phase3/includes/specials/SpecialTags.php
@@ -27,10 +27,8 @@
2828 }
2929
3030 function execute( $par ) {
31 - global $wgOut, $wgMessageCache;
 31+ global $wgOut;
3232
33 - $wgMessageCache->loadAllMessages();
34 -
3533 $wgOut->setPageTitle( wfMsg( 'tags-title' ) );
3634 $wgOut->wrapWikiMsg( "<div class='mw-tags-intro'>\n$1\n</div>", 'tags-intro' );
3735
@@ -88,4 +86,4 @@
8987
9088 return Xml::tags( 'tr', null, $newRow ) . "\n";
9189 }
92 -}
\ No newline at end of file
 90+}
Index: trunk/phase3/includes/LogPage.php
@@ -147,10 +147,9 @@
148148 * @return String: log name
149149 */
150150 public static function logName( $type ) {
151 - global $wgLogNames, $wgMessageCache;
 151+ global $wgLogNames;
152152
153153 if( isset( $wgLogNames[$type] ) ) {
154 - $wgMessageCache->loadAllMessages();
155154 return str_replace( '_', ' ', wfMsg( $wgLogNames[$type] ) );
156155 } else {
157156 // Bogus log types? Perhaps an extension was removed.
@@ -166,8 +165,7 @@
167166 * @return String: headertext of this logtype
168167 */
169168 public static function logHeader( $type ) {
170 - global $wgLogHeaders, $wgMessageCache;
171 - $wgMessageCache->loadAllMessages();
 169+ global $wgLogHeaders;
172170 return wfMsgExt($wgLogHeaders[$type], array( 'parseinline' ) );
173171 }
174172
@@ -186,9 +184,8 @@
187185 public static function actionText( $type, $action, $title = null, $skin = null,
188186 $params = array(), $filterWikilinks = false )
189187 {
190 - global $wgLang, $wgContLang, $wgLogActions, $wgMessageCache;
 188+ global $wgLang, $wgContLang, $wgLogActions;
191189
192 - $wgMessageCache->loadAllMessages();
193190 $key = "$type/$action";
194191 # Defer patrol log to PatrolLog class
195192 if( $key == 'patrol/patrol' ) {
Index: trunk/phase3/includes/RevisionDelete.php
@@ -1302,8 +1302,6 @@
13031303 var $authorNameField = 'log_user_text';
13041304
13051305 public function doQuery( $db ) {
1306 - global $wgMessageCache;
1307 - $wgMessageCache->loadAllMessages();
13081306 $ids = array_map( 'intval', $this->ids );
13091307 return $db->select( 'logging', '*',
13101308 array( 'log_id' => $ids ),

Follow-up revisions

RevisionCommit summaryAuthorDate
r70403Follow-up to r70401: remove loadAllMessages() from an extension toomaxsem19:25, 3 August 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r52503* Introduced a new system for localisation caching. The system is based aroun...tstarling07:11, 28 June 2009

Comments

#Comment by Nikerabbit (talk | contribs)   19:17, 3 August 2010

Yay less globals :)

Status & tagging log