r109518 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109517‎ | r109518 | r109519 >
Date:10:46, 19 January 2012
Author:siebrand
Status:ok
Tags:backcompat, languagegetmagic 
Comment:
Remove use of deprecated LanguageGetMagic hook.
Modified paths:
  • /trunk/extensions/NumberOfWikis/NumberOfWikis.i18n.magic.php (modified) (history)
  • /trunk/extensions/NumberOfWikis/NumberOfWikis.php (modified) (history)
  • /trunk/extensions/OnlineStatusBar/OnlineStatusBar.hooks.php (modified) (history)
  • /trunk/extensions/OnlineStatusBar/OnlineStatusBar.i18n.magic.php (added) (history)
  • /trunk/extensions/OnlineStatusBar/OnlineStatusBar.php (modified) (history)
  • /trunk/extensions/PAMELA/PAMELA.i18n.magic.php (added) (history)
  • /trunk/extensions/PAMELA/PAMELA.php (modified) (history)
  • /trunk/extensions/PAMELA/includes/PAMELA_ListPeople.php (modified) (history)
  • /trunk/extensions/PAMELA/includes/PAMELA_OpenWidget.php (modified) (history)
  • /trunk/extensions/PAMELA/includes/PAMELA_PersonStatus.php (modified) (history)

Diff [purge]

Index: trunk/extensions/NumberOfWikis/NumberOfWikis.i18n.magic.php
@@ -10,40 +10,40 @@
1111
1212 /** English (English) */
1313 $magicWords['en'] = array(
14 - 'numberofwikis' => array( 0, 'NUMBEROFWIKIS' ),
 14+ 'NUMBEROFWIKIS' => array( 0, 'NUMBEROFWIKIS' ),
1515 );
1616
1717 /** German (Deutsch) */
1818 $magicWords['de'] = array(
19 - 'numberofwikis' => array( 0, 'ANZAHLDERWIKIS' ),
 19+ 'NUMBEROFWIKIS' => array( 0, 'ANZAHLDERWIKIS' ),
2020 );
2121
2222 /** Finnish (Suomi) */
2323 $magicWords['fi'] = array(
24 - 'numberofwikis' => array( 0, 'WIKIENLUKUMÄÄRÄ' ),
 24+ 'NUMBEROFWIKIS' => array( 0, 'WIKIENLUKUMÄÄRÄ' ),
2525 );
2626
2727 /** French (Français) */
2828 $magicWords['fr'] = array(
29 - 'numberofwikis' => array( 0, 'NOMBREWIKIS' ),
 29+ 'NUMBEROFWIKIS' => array( 0, 'NOMBREWIKIS' ),
3030 );
3131
3232 /** Dutch (Nederlands) */
3333 $magicWords['nl'] = array(
34 - 'numberofwikis' => array( 0, 'AANTALWIKIS' ),
 34+ 'NUMBEROFWIKIS' => array( 0, 'AANTALWIKIS' ),
3535 );
3636
3737 /** Polish (Polski) */
3838 $magicWords['pl'] = array(
39 - 'numberofwikis' => array( 0, 'LICZBAWIKI' ),
 39+ 'NUMBEROFWIKIS' => array( 0, 'LICZBAWIKI' ),
4040 );
4141
4242 /** Portuguese (Português) */
4343 $magicWords['pt'] = array(
44 - 'numberofwikis' => array( 0, 'NUMERODEWIKIS' ),
 44+ 'NUMBEROFWIKIS' => array( 0, 'NUMERODEWIKIS' ),
4545 );
4646
4747 /** Swedish (Svenska) */
4848 $magicWords['sv'] = array(
49 - 'numberofwikis' => array( 0, 'ANTALWIKIS' ),
 49+ 'NUMBEROFWIKIS' => array( 0, 'ANTALWIKIS' ),
5050 );
Index: trunk/extensions/NumberOfWikis/NumberOfWikis.php
@@ -17,24 +17,15 @@
1818 // Extension credits that will show up on Special:Version
1919 $wgExtensionCredits['variable'][] = array(
2020 'name' => 'Number of wikis',
21 - 'version' => '0.2',
 21+ 'version' => '0.3',
2222 'author' => 'Jack Phoenix',
2323 'description' => 'Adds <nowiki>{{NUMBEROFWIKIS}}</nowiki> magic word to show the number of wikis on ShoutWiki',
2424 );
2525
2626 // Translations for {{NUMBEROFWIKIS}}
2727 $dir = dirname( __FILE__ ) . '/';
28 -$wgExtensionMessagesFiles['NumberOfWikis'] = $dir . 'NumberOfWikis.i18n.magic.php';
 28+$wgExtensionMessagesFiles['NumberOfWikisMagic'] = $dir . 'NumberOfWikis.i18n.magic.php';
2929
30 -$wgHooks['LanguageGetMagic'][] = 'wfNumberOfWikisMagicWord';
31 -function wfNumberOfWikisMagicWord( &$magicWords, $langID ) {
32 - // tell MediaWiki that {{NUMBEROFWIKIS}} and all case variants found in
33 - // wiki text should be mapped to magic ID 'NUMBEROFWIKIS'
34 - // (0 means case-insensitive)
35 - $magicWords['NUMBEROFWIKIS'] = array( 0, 'NUMBEROFWIKIS' );
36 - return true;
37 -}
38 -
3930 $wgHooks['ParserGetVariableValueSwitch'][] = 'wfNumberOfWikisAssignValue';
4031 function wfNumberOfWikisAssignValue( &$parser, &$cache, &$magicWordId, &$ret ) {
4132 global $wgMemc;
@@ -76,4 +67,4 @@
7768 function wfNumberOfWikisVariableIds( &$variableIds ) {
7869 $variableIds[] = 'NUMBEROFWIKIS';
7970 return true;
80 -}
\ No newline at end of file
 71+}
Index: trunk/extensions/OnlineStatusBar/OnlineStatusBar.i18n.magic.php
@@ -0,0 +1,14 @@
 2+<?php
 3+/**
 4+ * Internationalization file for extension.
 5+ *
 6+ * @file
 7+ * @ingroup Extensions
 8+ */
 9+
 10+$magicWords = array();
 11+
 12+/** English (English) */
 13+$magicWords['en'] = array(
 14+ 'ISONLINE' => array( 1, 'ISONLINE' ),
 15+);
Property changes on: trunk/extensions/OnlineStatusBar/OnlineStatusBar.i18n.magic.php
___________________________________________________________________
Added: svn:eol-style
116 + native
Added: svn:keywords
217 + Id
Index: trunk/extensions/OnlineStatusBar/OnlineStatusBar.php
@@ -25,6 +25,7 @@
2626
2727 $dir = dirname( __FILE__ );
2828 $wgExtensionMessagesFiles['OnlineStatusBar'] = "$dir/OnlineStatusBar.i18n.php";
 29+$wgExtensionMessagesFiles['OnlineStatusBarMagic'] = "$dir/OnlineStatusBar.i18n.magic.php";
2930
3031 $wgResourceModules['ext.OnlineStatusBar'] = array (
3132 'skinStyles' => array (
@@ -63,7 +64,6 @@
6465 define( 'ONLINESTATUSBAR_CK_DELAYED', 1 );
6566 define( 'ONLINESTATUSBAR_CK_AWAY', 2 );
6667
67 -
6868 // Configuration
6969 // Those values can be overriden in LocalSettings, do not change it here
7070 // default for anonymous and uknown users
@@ -99,14 +99,12 @@
100100 'offline' => 'statusred.png',
101101 );
102102
103 -
104103 $wgHooks['LoadExtensionSchemaUpdates'][] = 'OnlineStatusBarHooks::ckSchema';
105104 $wgHooks['UserLogout'][] = 'OnlineStatusBarHooks::logout';
106105 $wgHooks['ArticleViewHeader'][] = 'OnlineStatusBarHooks::renderBar';
107106 $wgHooks['UserLoginComplete'][] = 'OnlineStatusBarHooks::updateStatus';
108107 $wgHooks['GetPreferences'][] = 'OnlineStatusBarHooks::preferencesHook';
109108 $wgHooks['UserGetDefaultOptions'][] = 'OnlineStatusBarHooks::setDefaultOptions';
110 -$wgHooks['LanguageGetMagic'][] = 'OnlineStatusBarHooks::magicWordVar';
111109 $wgHooks['BeforePageDisplay'][] = 'OnlineStatusBarHooks::stylePage';
112110 $wgHooks['MagicWordwgVariableIDs'][] = 'OnlineStatusBarHooks::magicWordSet';
113111 $wgHooks['ParserGetVariableValueSwitch'][] = 'OnlineStatusBarHooks::parserGetVariable';
Index: trunk/extensions/OnlineStatusBar/OnlineStatusBar.hooks.php
@@ -138,16 +138,6 @@
139139 }
140140
141141 /**
142 - * @param $magicWords array
143 - * @param $ln string (language)
144 - * @return bool
145 - */
146 - public static function magicWordVar( array &$magicWords, $ln ) {
147 - $magicWords['ISONLINE'] = array( 1, 'ISONLINE' );
148 - return true;
149 - }
150 -
151 - /**
152142 * @param $out OutputPage
153143 * @param $skin Skin
154144 * @return bool
Index: trunk/extensions/PAMELA/PAMELA.i18n.magic.php
@@ -0,0 +1,16 @@
 2+<?php
 3+/**
 4+ * Internationalization file for extension.
 5+ *
 6+ * @file
 7+ * @ingroup Extensions
 8+ */
 9+
 10+$magicWords = array();
 11+
 12+/** English (English) */
 13+$magicWords['en'] = array(
 14+ 'listpeople' => array( 0, 'listpeople' ),
 15+ 'openwidget' => array( 0, 'openwidget' ),
 16+ 'personstatus' => array( 0, 'personstatus' ),
 17+);
Property changes on: trunk/extensions/PAMELA/PAMELA.i18n.magic.php
___________________________________________________________________
Added: svn:eol-style
118 + native
Added: svn:keywords
219 + Id
Index: trunk/extensions/PAMELA/PAMELA.php
@@ -104,14 +104,12 @@
105105
106106 # Required for #listpeople.
107107 $wgHooks['ParserFirstCallInit'][] = 'PAMELAListPeople::staticInit';
108 -$wgHooks['LanguageGetMagic'][] = 'PAMELAListPeople::staticMagic';
109108 # Required for #personstatus.
110109 $wgHooks['ParserFirstCallInit'][] = 'PAMELAPersonStatus::staticInit';
111 -$wgHooks['LanguageGetMagic'][] = 'PAMELAPersonStatus::staticMagic';
112110 # Required for #openwidget.
113111 $wgHooks['ParserFirstCallInit'][] = 'PAMELAOpenWidget::staticInit';
114 -$wgHooks['LanguageGetMagic'][] = 'PAMELAOpenWidget::staticMagic';
115112
116113 $wgExtensionMessagesFiles['PAMELA'] = dirname( __FILE__ ) . '/PAMELA.i18n.php';
 114+$wgExtensionMessagesFiles['PAMELAMagic'] = dirname( __FILE__ ) . '/PAMELA.i18n.magic.php';
117115
118116 require_once 'PAMELA.settings.php';
Index: trunk/extensions/PAMELA/includes/PAMELA_PersonStatus.php
@@ -12,19 +12,9 @@
1313 * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1414 */
1515 class PAMELAPersonStatus extends ParserHook {
16 -
1716 /**
1817 * No LSB in pre-5.3 PHP *sigh*.
1918 * This is to be refactored as soon as php >=5.3 becomes acceptable.
20 - */
21 - public static function staticMagic( array &$magicWords, $langCode ) {
22 - $instance = new self;
23 - return $instance->magic( $magicWords, $langCode );
24 - }
25 -
26 - /**
27 - * No LSB in pre-5.3 PHP *sigh*.
28 - * This is to be refactored as soon as php >=5.3 becomes acceptable.
2919 */
3020 public static function staticInit( Parser &$parser ) {
3121 $instance = new self;
Index: trunk/extensions/PAMELA/includes/PAMELA_ListPeople.php
@@ -12,19 +12,9 @@
1313 * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1414 */
1515 class PAMELAListPeople extends ParserHook {
16 -
1716 /**
1817 * No LSB in pre-5.3 PHP *sigh*.
1918 * This is to be refactored as soon as php >=5.3 becomes acceptable.
20 - */
21 - public static function staticMagic( array &$magicWords, $langCode ) {
22 - $instance = new self;
23 - return $instance->magic( $magicWords, $langCode );
24 - }
25 -
26 - /**
27 - * No LSB in pre-5.3 PHP *sigh*.
28 - * This is to be refactored as soon as php >=5.3 becomes acceptable.
2919 */
3020 public static function staticInit( Parser &$parser ) {
3121 $instance = new self;
Index: trunk/extensions/PAMELA/includes/PAMELA_OpenWidget.php
@@ -12,19 +12,9 @@
1313 * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1414 */
1515 class PAMELAOpenWidget extends ParserHook {
16 -
1716 /**
1817 * No LSB in pre-5.3 PHP *sigh*.
1918 * This is to be refactored as soon as php >=5.3 becomes acceptable.
20 - */
21 - public static function staticMagic( array &$magicWords, $langCode ) {
22 - $instance = new self;
23 - return $instance->magic( $magicWords, $langCode );
24 - }
25 -
26 - /**
27 - * No LSB in pre-5.3 PHP *sigh*.
28 - * This is to be refactored as soon as php >=5.3 becomes acceptable.
2919 */
3020 public static function staticInit( Parser &$parser ) {
3121 $instance = new self;

Status & tagging log