r109402 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109401‎ | r109402 | r109403 >
Date:17:12, 18 January 2012
Author:siebrand
Status:resolved (Comments)
Tags:backcompat, languagegetmagic 
Comment:
Remove use of deprecated LanguageGetMagic hook.
Add FIXMEs hackish uses.
Some misc. whitespace updates.
Modified paths:
  • /trunk/extensions/HeaderTabs/HeaderTabs.i18n.magic.php (added) (history)
  • /trunk/extensions/HeaderTabs/HeaderTabs.php (modified) (history)
  • /trunk/extensions/IncludeWP/IncludeWP.class.php (modified) (history)
  • /trunk/extensions/IncludeWP/IncludeWP.i18n.magic.php (added) (history)
  • /trunk/extensions/IncludeWP/IncludeWP.php (modified) (history)
  • /trunk/extensions/IndexFunction/IndexFunction.i18n.magic.php (added) (history)
  • /trunk/extensions/IndexFunction/IndexFunction.php (modified) (history)
  • /trunk/extensions/IndexFunction/IndexFunction_body.php (modified) (history)
  • /trunk/extensions/InteractiveBlockMessage/InteractiveBlockMessage.i18n.magic.php (added) (history)
  • /trunk/extensions/InteractiveBlockMessage/InteractiveBlockMessage.php (modified) (history)
  • /trunk/extensions/InteractiveBlockMessage/InteractiveBlockMessageHooks.php (modified) (history)
  • /trunk/extensions/Interlanguage/InterlanguageExtension.php (modified) (history)
  • /trunk/extensions/LabeledSectionTransclusion/lst.php (modified) (history)
  • /trunk/extensions/LiveTranslate/LiveTranslate.hooks.php (modified) (history)
  • /trunk/extensions/LiveTranslate/LiveTranslate.php (modified) (history)
  • /trunk/extensions/Livelets/Livelets.i18n.magic.php (added) (history)
  • /trunk/extensions/Livelets/Livelets.php (modified) (history)
  • /trunk/extensions/LogoFunctions/LogoFunctions.i18n.magic.php (added) (history)
  • /trunk/extensions/LogoFunctions/LogoFunctions.php (modified) (history)
  • /trunk/extensions/Lua/Lua.hooks.php (modified) (history)
  • /trunk/extensions/Lua/Lua.i18n.magic.php (added) (history)
  • /trunk/extensions/Lua/Lua.php (modified) (history)
  • /trunk/extensions/Maps/Maps.php (modified) (history)
  • /trunk/extensions/Maps/includes/parserHooks/Maps_Coordinates.php (modified) (history)
  • /trunk/extensions/Maps/includes/parserHooks/Maps_DisplayMap.php (modified) (history)
  • /trunk/extensions/Maps/includes/parserHooks/Maps_DisplayPoint.php (modified) (history)
  • /trunk/extensions/Maps/includes/parserHooks/Maps_Distance.php (modified) (history)
  • /trunk/extensions/Maps/includes/parserHooks/Maps_Finddestination.php (modified) (history)
  • /trunk/extensions/Maps/includes/parserHooks/Maps_Geocode.php (modified) (history)
  • /trunk/extensions/Maps/includes/parserHooks/Maps_Geodistance.php (modified) (history)
  • /trunk/extensions/Maps/includes/parserHooks/Maps_MapsDoc.php (modified) (history)
  • /trunk/extensions/MetavidWiki/includes/MV_GlobalFunctions.php (modified) (history)
  • /trunk/extensions/Notificator/Notificator.i18n.magic.php (added) (history)
  • /trunk/extensions/Notificator/Notificator.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/Maps.php
@@ -170,28 +170,20 @@
171171
172172 # Required for #coordinates.
173173 $wgHooks['ParserFirstCallInit'][] = 'MapsCoordinates::staticInit';
174 - $wgHooks['LanguageGetMagic'][] = 'MapsCoordinates::staticMagic';
175174 # Required for #display_map.
176175 $wgHooks['ParserFirstCallInit'][] = 'MapsDisplayMap::staticInit';
177 - $wgHooks['LanguageGetMagic'][] = 'MapsDisplayMap::staticMagic';
178176 # Required for #display_point.
179177 $wgHooks['ParserFirstCallInit'][] = 'MapsDisplayPoint::staticInit';
180 - $wgHooks['LanguageGetMagic'][] = 'MapsDisplayPoint::staticMagic';
181178 # Required for #distance.
182179 $wgHooks['ParserFirstCallInit'][] = 'MapsDistance::staticInit';
183 - $wgHooks['LanguageGetMagic'][] = 'MapsDistance::staticMagic';
184180 # Required for #finddestination.
185181 $wgHooks['ParserFirstCallInit'][] = 'MapsFinddestination::staticInit';
186 - $wgHooks['LanguageGetMagic'][] = 'MapsFinddestination::staticMagic';
187182 # Required for #geocode.
188183 $wgHooks['ParserFirstCallInit'][] = 'MapsGeocode::staticInit';
189 - $wgHooks['LanguageGetMagic'][] = 'MapsGeocode::staticMagic';
190184 # Required for #geodistance.
191185 $wgHooks['ParserFirstCallInit'][] = 'MapsGeodistance::staticInit';
192 - $wgHooks['LanguageGetMagic'][] = 'MapsGeodistance::staticMagic';
193186 # Required for #mapsdoc.
194187 $wgHooks['ParserFirstCallInit'][] = 'MapsMapsDoc::staticInit';
195 - $wgHooks['LanguageGetMagic'][] = 'MapsMapsDoc::staticMagic';
196188
197189 # Geocoders
198190
Index: trunk/extensions/Maps/includes/parserHooks/Maps_Coordinates.php
@@ -13,19 +13,9 @@
1414 * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1515 */
1616 class MapsCoordinates extends ParserHook {
17 -
1817 /**
1918 * No LSB in pre-5.3 PHP *sigh*.
2019 * This is to be refactored as soon as php >=5.3 becomes acceptable.
21 - */
22 - public static function staticMagic( array &$magicWords, $langCode ) {
23 - $instance = new self;
24 - return $instance->magic( $magicWords, $langCode );
25 - }
26 -
27 - /**
28 - * No LSB in pre-5.3 PHP *sigh*.
29 - * This is to be refactored as soon as php >=5.3 becomes acceptable.
3020 */
3121 public static function staticInit( Parser &$parser ) {
3222 $instance = new self;
Index: trunk/extensions/Maps/includes/parserHooks/Maps_Distance.php
@@ -13,19 +13,9 @@
1414 * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1515 */
1616 class MapsDistance extends ParserHook {
17 -
1817 /**
1918 * No LSB in pre-5.3 PHP *sigh*.
2019 * This is to be refactored as soon as php >=5.3 becomes acceptable.
21 - */
22 - public static function staticMagic( array &$magicWords, $langCode ) {
23 - $instance = new self;
24 - return $instance->magic( $magicWords, $langCode );
25 - }
26 -
27 - /**
28 - * No LSB in pre-5.3 PHP *sigh*.
29 - * This is to be refactored as soon as php >=5.3 becomes acceptable.
3020 */
3121 public static function staticInit( Parser &$parser ) {
3222 $instance = new self;
Index: trunk/extensions/Maps/includes/parserHooks/Maps_DisplayPoint.php
@@ -12,19 +12,9 @@
1313 * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1414 */
1515 class MapsDisplayPoint 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/Maps/includes/parserHooks/Maps_Finddestination.php
@@ -13,19 +13,9 @@
1414 * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1515 */
1616 class MapsFinddestination extends ParserHook {
17 -
1817 /**
1918 * No LSB in pre-5.3 PHP *sigh*.
2019 * This is to be refactored as soon as php >=5.3 becomes acceptable.
21 - */
22 - public static function staticMagic( array &$magicWords, $langCode ) {
23 - $instance = new self;
24 - return $instance->magic( $magicWords, $langCode );
25 - }
26 -
27 - /**
28 - * No LSB in pre-5.3 PHP *sigh*.
29 - * This is to be refactored as soon as php >=5.3 becomes acceptable.
3020 */
3121 public static function staticInit( Parser &$parser ) {
3222 $instance = new self;
Index: trunk/extensions/Maps/includes/parserHooks/Maps_DisplayMap.php
@@ -12,19 +12,9 @@
1313 * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1414 */
1515 class MapsDisplayMap 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/Maps/includes/parserHooks/Maps_Geocode.php
@@ -13,19 +13,9 @@
1414 * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1515 */
1616 class MapsGeocode extends ParserHook {
17 -
1817 /**
1918 * No LSB in pre-5.3 PHP *sigh*.
2019 * This is to be refactored as soon as php >=5.3 becomes acceptable.
21 - */
22 - public static function staticMagic( array &$magicWords, $langCode ) {
23 - $instance = new self;
24 - return $instance->magic( $magicWords, $langCode );
25 - }
26 -
27 - /**
28 - * No LSB in pre-5.3 PHP *sigh*.
29 - * This is to be refactored as soon as php >=5.3 becomes acceptable.
3020 */
3121 public static function staticInit( Parser &$parser ) {
3222 $instance = new self;
Index: trunk/extensions/Maps/includes/parserHooks/Maps_Geodistance.php
@@ -13,19 +13,9 @@
1414 * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1515 */
1616 class MapsGeodistance extends ParserHook {
17 -
1817 /**
1918 * No LSB in pre-5.3 PHP *sigh*.
2019 * This is to be refactored as soon as php >=5.3 becomes acceptable.
21 - */
22 - public static function staticMagic( array &$magicWords, $langCode ) {
23 - $instance = new self;
24 - return $instance->magic( $magicWords, $langCode );
25 - }
26 -
27 - /**
28 - * No LSB in pre-5.3 PHP *sigh*.
29 - * This is to be refactored as soon as php >=5.3 becomes acceptable.
3020 */
3121 public static function staticInit( Parser &$parser ) {
3222 $instance = new self;
Index: trunk/extensions/Maps/includes/parserHooks/Maps_MapsDoc.php
@@ -27,15 +27,6 @@
2828 * No LSB in pre-5.3 PHP *sigh*.
2929 * This is to be refactored as soon as php >=5.3 becomes acceptable.
3030 */
31 - public static function staticMagic( array &$magicWords, $langCode ) {
32 - $instance = new self;
33 - return $instance->magic( $magicWords, $langCode );
34 - }
35 -
36 - /**
37 - * No LSB in pre-5.3 PHP *sigh*.
38 - * This is to be refactored as soon as php >=5.3 becomes acceptable.
39 - */
4031 public static function staticInit( Parser &$parser ) {
4132 $instance = new self;
4233 return $instance->init( $parser );
Index: trunk/extensions/Livelets/Livelets.i18n.magic.php
@@ -0,0 +1,11 @@
 2+<?php
 3+/**
 4+ * Magic words for extension.
 5+ */
 6+
 7+$magicWords = array();
 8+
 9+/** English (English) */
 10+$magicWords['en'] = array(
 11+ 'live' => array( 0, 'live' ),
 12+);
Property changes on: trunk/extensions/Livelets/Livelets.i18n.magic.php
___________________________________________________________________
Added: svn:eol-style
113 + native
Added: svn:keywords
214 + Id
Index: trunk/extensions/Livelets/Livelets.php
@@ -9,8 +9,13 @@
1010 * Started: 2007-10-06
1111 * 1.0: 2010-08-25
1212 */
13 -define( 'LIVELETS_VERSION', '1.0.4, 2010-09-05' );
1413
 14+if( !defined( 'MEDIAWIKI' ) ) {
 15+ die( 'This is not a valid entry point to MediaWiki.' );
 16+}
 17+
 18+define( 'LIVELETS_VERSION', '1.1.0, 2012-01-18' );
 19+
1520 # the parser-function name for doing live-transclusions
1621 $wgLiveletsMagic = 'live';
1722
@@ -29,7 +34,9 @@
3035 );
3136 $dir = dirname( __FILE__ );
3237 $wgExtensionMessagesFiles['Livelets'] = "$dir/Livelets.i18n.php";
 38+$wgExtensionMessagesFiles['LiveletsMagic'] = "$dir/Livelets.i18n.magic.php";
3339
 40+// @todo FIXME: Move class to a separate file.
3441 class Livelets {
3542
3643 var $container_id = 0;
@@ -38,9 +45,6 @@
3946 function __construct() {
4047 global $wgHooks, $wgExtensionFunctions;
4148
42 - # Activate the parser-function
43 - $wgHooks['LanguageGetMagic'][] = $this;
44 -
4549 # Call the setup method at extension setup time
4650 $wgExtensionFunctions[] = array( $this, 'setup' );
4751
@@ -55,7 +59,6 @@
5660
5761 # Add a hook to replace the wikitext with just the requested livelet's content
5862 $wgHooks['ArticleAfterFetchContent'][] = $this;
59 -
6063 }
6164 }
6265
@@ -74,10 +77,7 @@
7578 $wgOut->addHTML("<object type=\"application/x-shockwave-flash\" data=\"$swf\" width=\"1\" height=\"1\">
7679 <param name=\"movie\" value=\"$swf\" /><param name=\"bgcolor\" value=\"$wgLiveletsSwfBg\"/></object>");
7780 }
78 -
7981 }
80 -
81 -
8282 # Render livelet container
8383 function renderContainer( &$parser ) {
8484 global $wgTitle, $wgJsMimeType, $wgLiveletsDefaultContent;
@@ -114,7 +114,6 @@
115115 return true;
116116 }
117117
118 -
119118 # Extract recursive braces belonging to templates and parserfunctions
120119 function examineBraces( &$content ) {
121120 $braces = array();
@@ -137,17 +136,7 @@
138137 }
139138 return $braces;
140139 }
141 -
142 -
143 - # Set up magic word
144 - function onLanguageGetMagic( &$magicWords, $langCode = 0 ) {
145 - global $wgLiveletsMagic;
146 - $magicWords[$wgLiveletsMagic] = array( $langCode, $wgLiveletsMagic );
147 - return true;
148 - }
149140 }
150141
151142 # Instantiate a global instance of the extension
152143 $wgLivelets = new Livelets();
153 -
154 -
Index: trunk/extensions/LogoFunctions/LogoFunctions.php
@@ -27,9 +27,9 @@
2828
2929 // internationalization
3030 $wgExtensionMessagesFiles['LogoFunctions'] = $dir . 'LogoFunctions.i18n.php';
 31+$wgExtensionMessagesFiles['LogoFunctionsMagic'] = $dir . 'LogoFunctions.i18n.magic.php';
3132
3233 $wgHooks['ParserFirstCallInit'][] = 'efLogoFunctions_Setup';
33 -$wgHooks['LanguageGetMagic'][] = 'efLogoFunctions_Magic';
3434
3535 function efLogoFunctions_Setup( &$parser ) {
3636 $parser->setFunctionHook( 'setlogo', 'efSetLogo_Render' );
@@ -37,15 +37,6 @@
3838 return true;
3939 }
4040
41 -/**
42 - * @todo: i18n the magic word
43 -*/
44 -function efLogoFunctions_Magic( &$magicWords, $langCode ) {
45 - $magicWords['setlogo'] = array( 0, 'setlogo' );
46 - $magicWords['getlogo'] = array( 0, 'getlogo' );
47 - return true;
48 -}
49 -
5041 function efSetLogo_Render( $parser, $logo = '' ) {
5142 global $wgLogo;
5243 $imageobj = wfFindFile( $logo );
Index: trunk/extensions/LogoFunctions/LogoFunctions.i18n.magic.php
@@ -0,0 +1,12 @@
 2+<?php
 3+/**
 4+ * Magic words for extension.
 5+ */
 6+
 7+$magicWords = array();
 8+
 9+/** English (English) */
 10+$magicWords['en'] = array(
 11+ 'getlogo' => array( 0, 'getlogo' ),
 12+ 'setlogo' => array( 0, 'setlogo' ),
 13+);
Property changes on: trunk/extensions/LogoFunctions/LogoFunctions.i18n.magic.php
___________________________________________________________________
Added: svn:eol-style
114 + native
Added: svn:keywords
215 + Id
Index: trunk/extensions/Notificator/Notificator.i18n.magic.php
@@ -0,0 +1,11 @@
 2+<?php
 3+/**
 4+ * Magic words for extension.
 5+ */
 6+
 7+$magicWords = array();
 8+
 9+/** English (English) */
 10+$magicWords['en'] = array(
 11+ 'notificator' => array( 0, 'notificator' ),
 12+);
Property changes on: trunk/extensions/Notificator/Notificator.i18n.magic.php
___________________________________________________________________
Added: svn:eol-style
113 + native
Added: svn:keywords
214 + Id
Index: trunk/extensions/Notificator/Notificator.php
@@ -9,7 +9,7 @@
1010 'path' => __FILE__, // Magic so that svn revision number can be shown
1111 'name' => 'Notificator',
1212 'descriptionmsg' => 'notificator-desc',
13 - 'version' => '1.1',
 13+ 'version' => '1.2',
1414 'author' => 'Patrick Nagel',
1515 'url' => "http://www.mediawiki.org/wiki/Extension:Notificator",
1616 );
@@ -21,12 +21,12 @@
2222 $wgHooks['LoadExtensionSchemaUpdates'][] = 'notificator_AddDatabaseTable';
2323 $wgHooks['ParserTestTables'][] = 'notificator_ParserTestTables';
2424 $wgHooks['ParserFirstCallInit'][] = 'notificator_Setup';
25 -$wgHooks['LanguageGetMagic'][] = 'notificator_Magic';
2625
2726 $wgSpecialPages['Notificator'] = 'SpecialNotificator';
2827
2928 $wgExtensionMessagesFiles['Notificator'] = $dir . '/Notificator.i18n.php';
3029 $wgExtensionMessagesFiles['NotificatorAlias'] = $dir . '/Notificator.alias.php';
 30+$wgExtensionMessagesFiles['NotificatorMagic'] = $dir . '/Notificator.i18n.magic.php';
3131
3232 // Setting default here, to avoid register_globals vulnerabilites
3333 $ngFromAddress = $wgPasswordSenderName . '<' . $wgPasswordSender . '>';
@@ -40,16 +40,11 @@
4141 }
4242
4343 function notificator_ParserTestTables( &$tables ) {
44 - $tables[] = 'notificator';
45 - return true;
 44+ $tables[] = 'notificator';
 45+ return true;
4646 }
4747
4848 function notificator_Setup( &$parser ) {
4949 $parser->setFunctionHook( 'notificator', 'Notificator::notificator_Render' );
5050 return true;
5151 }
52 -
53 -function notificator_Magic( &$magicWords, $langCode ) {
54 - $magicWords['notificator'] = array( 0, 'notificator' );
55 - return true;
56 -}
Index: trunk/extensions/HeaderTabs/HeaderTabs.i18n.magic.php
@@ -0,0 +1,11 @@
 2+<?php
 3+/**
 4+ * Magic words for extension.
 5+ */
 6+
 7+$magicWords = array();
 8+
 9+/** English (English) */
 10+$magicWords['en'] = array(
 11+ 'switchtablink' => array( 0, 'switchtablink' ),
 12+);
Property changes on: trunk/extensions/HeaderTabs/HeaderTabs.i18n.magic.php
___________________________________________________________________
Added: svn:eol-style
113 + native
Added: svn:keywords
214 + Id
Index: trunk/extensions/HeaderTabs/HeaderTabs.php
@@ -30,6 +30,14 @@
3131
3232 // Translations
3333 $wgExtensionMessagesFiles['HeaderTabs'] = $dir . '/HeaderTabs.i18n.php';
 34+//! @todo implement in tab parsing code instead... but problems like nowiki (2011-12-12, ofb)
 35+// if you make them here, it will be article wide instead of tab-wide
 36+// __NOTABTOC__, __TABTOC__, __NOEDITTAB__
 37+// and one day with a special page: __NEWTABLINK__, __NONEWTABLINK__
 38+// and one day if we can force toc generation: __FORCETABTOC__
 39+//! @todo make this load a custom name from i18n file (2011-12-12, ofb)
 40+// ensure to keep this name too for backwards compat
 41+$wgExtensionMessagesFiles['HeaderTabsMagic'] = $dir . '/HeaderTabs.i18n.magic.php';
3442
3543 // Config
3644 $htUseHistory = true;
@@ -71,7 +79,6 @@
7280
7381 // used by both jQuery and YUI
7482 $wgHooks['ParserFirstCallInit'][] = 'headerTabsParserFunctions';
75 -$wgHooks['LanguageGetMagic'][] = 'headerTabsLanguageGetMagic';
7683 $wgHooks['BeforePageDisplay'][] = 'HeaderTabs::addHTMLHeader';
7784 $wgHooks['ParserAfterTidy'][] = 'HeaderTabs::replaceFirstLevelHeaders';
7885
@@ -95,33 +102,15 @@
96103 'localBasePath' => dirname( __FILE__ ),
97104 'remoteExtPath' => 'HeaderTabs',
98105 );
99 -
100106 } else { // if ! $useJQuery
101107 $wgAutoloadClasses['HeaderTabs'] = "$dir/HeaderTabs_body.yui.php";
102108 }
103109
104110 # Parser function to insert a link changing a tab:
105111 function headerTabsParserFunctions( $parser ) {
106 -
107112 //! @todo make this load a custom name from i18n file (2011-12-12, ofb)
108113 // ensure to keep this name too for backwards compat
109114 $parser->setHook( 'headertabs', array( 'HeaderTabs', 'tag' ) );
110115 $parser->setFunctionHook( 'switchtablink', array( 'HeaderTabs', 'renderSwitchTabLink' ) );
111116 return true;
112117 }
113 -
114 -function headerTabsLanguageGetMagic( &$magicWords, $langCode = "en" ) {
115 - //! @todo implement in tab parsing code instead... but problems like nowiki (2011-12-12, ofb)
116 - // if you make them here, it will be article wide instead of tab-wide
117 - // __NOTABTOC__, __TABTOC__, __NOEDITTAB__
118 - // and one day with a special page: __NEWTABLINK__, __NONEWTABLINK__
119 - // and one day if we can force toc generation: __FORCETABTOC__
120 -
121 - //! @todo make this load a custom name from i18n file (2011-12-12, ofb)
122 - // ensure to keep this name too for backwards compat
123 - switch ( $langCode ) {
124 - default:
125 - $magicWords['switchtablink'] = array ( 0, 'switchtablink' );
126 - }
127 - return true;
128 -}
Index: trunk/extensions/IncludeWP/IncludeWP.php
@@ -1,5 +1,4 @@
22 <?php
3 -
43 /**
54 * Initialization file for the Include WP extension.
65 *
@@ -55,12 +54,12 @@
5655 $egIncWPScriptPath = $wgExtensionAssetsPath === false ? $wgScriptPath . '/extensions/IncludeWP' : $wgExtensionAssetsPath . '/IncludeWP';
5756
5857 $wgExtensionMessagesFiles['IncludeWP'] = dirname( __FILE__ ) . '/IncludeWP.i18n.php';
 58+$wgExtensionMessagesFiles['IncludeWPMagic'] = dirname( __FILE__ ) . '/IncludeWP.i18n.magic.php';
5959
6060 $wgAutoloadClasses['IncludeWP'] = dirname( __FILE__ ) . '/IncludeWP.class.php';
6161 $wgAutoloadClasses['ApiIncludeWP'] = dirname( __FILE__ ) . '/api/ApiIncludeWP.php';
6262
6363 $wgHooks['ParserFirstCallInit'][] = 'IncludeWP::staticInit';
64 -$wgHooks['LanguageGetMagic'][] = 'IncludeWP::staticMagic';
6564
6665 $wgAPIModules['includewp'] = 'ApiIncludeWP';
6766
Index: trunk/extensions/IncludeWP/IncludeWP.class.php
@@ -15,20 +15,9 @@
1616 * @copyright © 2008 James McCormack, preceding version Martin Schallnahs, original Rob Church
1717 */
1818 final class IncludeWP extends ParserHook {
19 -
2019 /**
2120 * No LSB in pre-5.3 PHP *sigh*.
2221 * This is to be refactored as soon as php >=5.3 becomes acceptable.
23 - */
24 - public static function staticMagic( array &$magicWords, $langCode ) {
25 - $className = __CLASS__;
26 - $instance = new $className();
27 - return $instance->magic( $magicWords, $langCode );
28 - }
29 -
30 - /**
31 - * No LSB in pre-5.3 PHP *sigh*.
32 - * This is to be refactored as soon as php >=5.3 becomes acceptable.
3322 */
3423 public static function staticInit( Parser &$parser ) {
3524 $className = __CLASS__;
Index: trunk/extensions/IncludeWP/IncludeWP.i18n.magic.php
@@ -0,0 +1,11 @@
 2+<?php
 3+/**
 4+ * Magic words for extension.
 5+ */
 6+
 7+$magicWords = array();
 8+
 9+/** English (English) */
 10+$magicWords['en'] = array(
 11+ 'IncludeWP' => array( 0, 'includewp' ),
 12+);
Property changes on: trunk/extensions/IncludeWP/IncludeWP.i18n.magic.php
___________________________________________________________________
Added: svn:eol-style
113 + native
Added: svn:keywords
214 + Id
Index: trunk/extensions/LiveTranslate/LiveTranslate.php
@@ -75,7 +75,6 @@
7676 $wgHooks['ArticleViewHeader'][] = 'LiveTranslateHooks::onArticleViewHeader';
7777 $wgHooks['LoadExtensionSchemaUpdates'][] = 'LiveTranslateHooks::onSchemaUpdate';
7878 $wgHooks['ArticleSaveComplete'][] = 'LiveTranslateHooks::onArticleSaveComplete';
79 -$wgHooks['LanguageGetMagic'][] = 'LiveTranslateHooks::addMagicWords';
8079 $wgHooks['InternalParseBeforeLinks'][] = 'LiveTranslateHooks::stripMagicWords';
8180 $wgHooks['OutputPageParserOutput'][] = 'LiveTranslateHooks::onOutputPageParserOutput';
8281
Index: trunk/extensions/LiveTranslate/LiveTranslate.hooks.php
@@ -295,27 +295,6 @@
296296 }
297297
298298 /**
299 - * Registers the magic words to show and hide the translation control.
300 - *
301 - * TODO: apparently there is some new way of doing this for quite a while,
302 - * which is not linked in the docs. If someone cares to explain the new stuff,
303 - * I'll be happy to update this.
304 - *
305 - * @since 0.6
306 - *
307 - * @param array &$magicWords
308 - * @param string $langCode
309 - *
310 - * @return true
311 - */
312 - public static function addMagicWords( array &$magicWords, $langCode ) {
313 - $magicWords['LT_NOTRANSLATIONCONTROL'] = array( 0, '__NOTRANSLATIONCONTROL__' );
314 - $magicWords['LT_SHOWTRANSLATIONCONTROL'] =array( 0, '__SHOWTRANSLATIONCONTROL__' );
315 -
316 - return true;
317 - }
318 -
319 - /**
320299 * Strips the magic words added by Live Translate from the page text.
321300 *
322301 * @since 0.6
Index: trunk/extensions/Lua/Lua.i18n.magic.php
@@ -0,0 +1,11 @@
 2+<?php
 3+/**
 4+ * Magic words for extension.
 5+ */
 6+
 7+$magicWords = array();
 8+
 9+/** English (English) */
 10+$magicWords['en'] = array(
 11+ 'luaexpr' => array( 0, 'luaexpr' ),
 12+);
Property changes on: trunk/extensions/Lua/Lua.i18n.magic.php
___________________________________________________________________
Added: svn:eol-style
113 + native
Added: svn:keywords
214 + Id
Index: trunk/extensions/Lua/Lua.php
@@ -18,6 +18,7 @@
1919
2020 $dir = dirname(__FILE__) . '/';
2121 $wgExtensionMessagesFiles['Lua'] = $dir . 'Lua.i18n.php';
 22+$wgExtensionMessagesFiles['LuaMagic'] = $dir . 'Lua.i18n.magic.php';
2223 $wgAutoloadClasses['LuaHooks'] = $dir . 'Lua.hooks.php';
2324 $wgAutoloadClasses['LuaError'] = $dir . 'Lua.wrapper.php';
2425 $wgAutoloadClasses['LuaWrapper'] = $dir . 'Lua.wrapper.php';
@@ -31,5 +32,4 @@
3233
3334
3435 $wgHooks['ParserFirstCallInit'][] = 'LuaHooks::parserInit';
35 -$wgHooks['LanguageGetMagic'][] = 'LuaHooks::magic';
3636 $wgHooks['ParserBeforeTidy'][] = 'LuaHooks::beforeTidy';
Index: trunk/extensions/Lua/Lua.hooks.php
@@ -16,12 +16,6 @@
1717 return true;
1818 }
1919
20 - /** LanguageGetMagic hook */
21 - public static function magic(&$magicWords, $langCode) {
22 - $magicWords['luaexpr'] = array(0, 'luaexpr');
23 - return true;
24 - }
25 -
2620 /** ParserBeforeTidy hook */
2721 public static function beforeTidy(&$parser, &$text) {
2822 global $wgLua;
Index: trunk/extensions/Interlanguage/InterlanguageExtension.php
@@ -25,23 +25,12 @@
2626 */
2727
2828 class InterlanguageExtension {
29 -
3029 /**
3130 * @var DatabaseBase
3231 */
3332 var $foreignDbr = false;
3433
3534 /**
36 - * @param $magicWords array
37 - * @param $langCode string
38 - * @return bool
39 - */
40 - function onLanguageGetMagic( &$magicWords, $langCode ) {
41 - $magicWords['interlanguage'] = array(0, 'interlanguage');
42 - return true;
43 - }
44 -
45 - /**
4635 * The meat of the extension, the function that handles {{interlanguage:}} magic.
4736 *
4837 * @param $parser Parser standard Parser object.
Index: trunk/extensions/LabeledSectionTransclusion/lst.php
@@ -22,6 +22,8 @@
2323 ##
2424
2525 $wgHooks['ParserFirstCallInit'][] = 'LabeledSectionTransclusion::setup';
 26+// @todo FIXME: LanguageGetMagic is obsolete, but LabeledSectionTransclusion::setupMagic()
 27+// contains magic hack that $magicWords cannot handle.
2628 $wgHooks['LanguageGetMagic'][] = 'LabeledSectionTransclusion::setupMagic';
2729
2830 $wgExtensionCredits['parserhook'][] = array(
@@ -37,8 +39,8 @@
3840 // Must be set now to avoid injection via register_globals
3941 $wgLstLocal = null;
4042
 43+// @todo FIXME: move to a separate file.
4144 class LabeledSectionTransclusion {
42 -
4345 static function setup( $parser ) {
4446 $parser->setHook( 'section', array( __CLASS__, 'noop' ) );
4547 $parser->setFunctionHook( 'lst', array( __CLASS__, 'pfuncIncludeObj' ), SFH_OBJECT_ARGS );
Index: trunk/extensions/MetavidWiki/includes/MV_GlobalFunctions.php
@@ -230,6 +230,7 @@
231231 $wgAutoloadClasses['mvOggHandler'] = dirname( __FILE__ ) . '/MV_OggHandler.php';
232232 $wgMediaHandlers['application/ogg']='mvOggHandler';
233233 $wgParserOutputHooks['OggHandler'] = array( 'mvOggHandler', 'outputHook' );
 234+ // @todo FIXME: LanguageGetMagic is deprecated. Need to find another solution.
234235 foreach($wgHooks['LanguageGetMagic'] as & $hook_function){
235236 if($hook_function=='OggHandler::registerMagicWords'){
236237 $hook_function='mvOggHandler::registerMagicWords';
@@ -267,6 +268,7 @@
268269 );
269270 }
270271 # Define a setup function
 272+// @todo FIXME LanguageGetMagic is deprecated. Need to find another solution.
271273 # Add a hook to initialize the magic word
272274 $wgHooks['LanguageGetMagic'][] = 'mvMagicParserFunction_Magic';
273275
Index: trunk/extensions/IndexFunction/IndexFunction.i18n.magic.php
@@ -0,0 +1,11 @@
 2+<?php
 3+/**
 4+ * Magic words for extension.
 5+ */
 6+
 7+$magicWords = array();
 8+
 9+/** English (English) */
 10+$magicWords['en'] = array(
 11+ 'index-func' => array( 0, 'index' ),
 12+);
Property changes on: trunk/extensions/IndexFunction/IndexFunction.i18n.magic.php
___________________________________________________________________
Added: svn:eol-style
113 + native
Added: svn:keywords
214 + Id
Index: trunk/extensions/IndexFunction/IndexFunction_body.php
@@ -183,13 +183,6 @@
184184 return true;
185185 }
186186
187 - // Register the function name
188 - static function addIndexFunction( &$magicWords, $langCode ) {
189 - $magicWords['index-func'] = array( 0, 'index' );
190 -
191 - return true;
192 - }
193 -
194187 // Function called to render the parser function
195188 // Output is an empty string unless there are errors
196189 static function indexRender( &$parser ) {
Index: trunk/extensions/IndexFunction/IndexFunction.php
@@ -13,7 +13,6 @@
1414
1515 # Register function
1616 $wgHooks['ParserFirstCallInit'][] = 'efIndexSetup';
17 -$wgHooks['LanguageGetMagic'][] = 'IndexFunctionHooks::addIndexFunction';
1817 # Add to database
1918 $wgHooks['OutputPageParserOutput'][] = 'IndexFunctionHooks::doIndexes';
2019 # Make links to indexes blue
@@ -41,6 +40,7 @@
4241 # i18n
4342 $wgExtensionMessagesFiles['IndexFunctionAlias'] = $dir . 'IndexFunction.alias.php';
4443 $wgExtensionMessagesFiles['IndexFunction'] = $dir . 'IndexFunction.i18n.php';
 44+$wgExtensionMessagesFiles['IndexFunctionMagic'] = $dir . 'IndexFunction.i18n.magic.php';
4545
4646 # Register classes with the autoloader
4747 $wgAutoloadClasses['SpecialIndex'] = $dir . 'SpecialIndex.php';
Index: trunk/extensions/InteractiveBlockMessage/InteractiveBlockMessage.i18n.magic.php
@@ -0,0 +1,11 @@
 2+<?php
 3+/**
 4+ * Magic words for extension.
 5+ */
 6+
 7+$magicWords = array();
 8+
 9+/** English (English) */
 10+$magicWords['en'] = array(
 11+ 'USERBLOCKED' => array( 1, 'USERBLOCKED' ),
 12+);
Property changes on: trunk/extensions/InteractiveBlockMessage/InteractiveBlockMessage.i18n.magic.php
___________________________________________________________________
Added: svn:eol-style
113 + native
Added: svn:keywords
214 + Id
Index: trunk/extensions/InteractiveBlockMessage/InteractiveBlockMessage.php
@@ -28,7 +28,7 @@
2929 $wgAutoloadClasses['InteractiveBlockMessageHooks'] = "$dir/InteractiveBlockMessageHooks.php";
3030
3131 $wgExtensionMessagesFiles['InteractiveBlockMessage'] = "$dir/InteractiveBlockMessage.i18n.php";
 32+$wgExtensionMessagesFiles['InteractiveBlockMessageMagic'] = "$dir/InteractiveBlockMessage.i18n.magic.php";
3233
33 -$wgHooks['LanguageGetMagic'][] = 'InteractiveBlockMessageHooks::magicWordVar';
3434 $wgHooks['MagicWordwgVariableIDs'][] = 'InteractiveBlockMessageHooks::magicWordSet';
3535 $wgHooks['ParserGetVariableValueSwitch'][] = 'InteractiveBlockMessageHooks::parserGetVariable';
Index: trunk/extensions/InteractiveBlockMessage/InteractiveBlockMessageHooks.php
@@ -7,16 +7,6 @@
88 */
99 class InteractiveBlockMessageHooks {
1010 /**
11 - * @param $magicWords array
12 - * @param $ln string (language)
13 - * @return bool
14 - */
15 - public static function magicWordVar( array &$magicWords, $ln ) {
16 - $magicWords['USERBLOCKED'] = array( 1, 'USERBLOCKED' );
17 - return true;
18 - }
19 -
20 - /**
2111 * @param $vars array
2212 * @return bool
2313 */

Follow-up revisions

RevisionCommit summaryAuthorDate
r109405Follow-up r109402: Forgot to commit added magic word and a whitespace update.siebrand17:20, 18 January 2012
r109515Follow-up r109402: remove use of $wgLiveletsMagic and just use the string per...siebrand10:41, 19 January 2012
r109516Follow-up r109402: Remove obsolete comments.siebrand10:43, 19 January 2012

Comments

#Comment by Nikerabbit (talk | contribs)   08:42, 19 January 2012
___________________________________________________________________
Added: svn:keywords
  + Id

Not needed I think.

+//! @todo make this load a custom name from i18n file (2011-12-12, ofb)
+// ensure to keep this name too for backwards compat

Didn't you just fix it now?

$wgLiveletsMagic was not fully removed.

#Comment by Siebrand (talk | contribs)   09:33, 19 January 2012

For some other work I'm using the SVN property keywords, so it's in my auto-props for the past few years. It doesn't harm, does it?

I'll remove that comment in a follow-up rev.

The global is used elsewhere, so i was planning on letting that be. Do you think it should be replaced with a string everywhere and taken out?

#Comment by Nikerabbit (talk | contribs)   10:16, 19 January 2012

If the other use places of that global expect it to change the magic word (or be the magic word), then it should be get rid of. And it will confuse users who think they can change the magic word by changing that variable.

Status & tagging log