r52680 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52679‎ | r52680 | r52681 >
Date:06:54, 2 July 2009
Author:tstarling
Status:deferred
Tags:
Comment:
Removed nasty cache-destroying feature which puts messages from the mediawiki namespace into $wgMessageCache->addMessages() so that Special:Allmessages can be even slower and uglier than it already was. It's not really practical to support this with the new LocalisationCache.
Modified paths:
  • /trunk/extensions/Gadgets/Gadgets.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Gadgets/Gadgets.php
@@ -29,7 +29,6 @@
3030 $wgHooks['GetPreferences'][] = 'wfGadgetsGetPreferences';
3131 $wgHooks['BeforePageDisplay'][] = 'wfGadgetsBeforePageDisplay';
3232 $wgHooks['ArticleSaveComplete'][] = 'wfGadgetsArticleSaveComplete';
33 -$wgHooks['LoadAllMessages'][] = 'wfGadgetsInjectMessages';
3433
3534 $dir = dirname(__FILE__) . '/';
3635 $wgExtensionMessagesFiles['Gadgets'] = $dir . 'Gadgets.i18n.php';
@@ -208,33 +207,3 @@
209208 }
210209 }
211210
212 -/**
213 -* inject descriptions into system messages, so they show on Special:Allmessages
214 -*/
215 -function wfGadgetsInjectMessages( $msgCache ) {
216 - $gadgets = wfLoadGadgetsStructured();
217 - if ( !$gadgets ) return true;
218 -
219 - $args = array();
220 - $messages = array();
221 -
222 - foreach ( $gadgets as $section => $entries ) {
223 - if ( $section !== false && $section !== '' ) {
224 - $tname = "gadget-section-$section";
225 - $ttext = wfMsgReal( $tname, $args, true, false, false );
226 - if ( wfEmptyMsg( $tname, $ttext ) ) $ttext = $section;
227 - $messages[$tname] = $ttext;
228 - }
229 -
230 - foreach ( $entries as $gname => $code ) {
231 - $tname = "gadget-$gname";
232 - $ttext = wfMsgReal( $tname, $args, true, false, false );
233 - if ( wfEmptyMsg( $tname, $ttext ) ) $ttext = $gname;
234 - $messages[$tname] = $ttext;
235 - }
236 - }
237 -
238 - $msgCache->addMessages( $messages );
239 - return true;
240 -}
241 -

Status & tagging log