r108574 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108573‎ | r108574 | r108575 >
Date:00:23, 11 January 2012
Author:siebrand
Status:ok (Comments)
Tags:
Comment:
Don't include files with $magicWords, but use $wgExtensionMessagesFiles.

Inspired by r108558.
Modified paths:
  • /trunk/extensions/Icon/Icon.i18n.php (modified) (history)
  • /trunk/extensions/Icon/Icon.php (modified) (history)
  • /trunk/extensions/Interlanguage/Interlanguage.i18n.php (modified) (history)
  • /trunk/extensions/Interlanguage/Interlanguage.php (modified) (history)
  • /trunk/extensions/MathStatFunctions/MathStatFunctions.i18n.php (modified) (history)
  • /trunk/extensions/MathStatFunctions/MathStatFunctions.php (modified) (history)
  • /trunk/extensions/MediaFunctions/MediaFunctions.i18n.php (modified) (history)
  • /trunk/extensions/MediaFunctions/MediaFunctions.php (modified) (history)
  • /trunk/extensions/Negref/Negref.i18n.php (modified) (history)
  • /trunk/extensions/Negref/Negref.php (modified) (history)
  • /trunk/extensions/Plotters/Plotters.i18n.php (modified) (history)
  • /trunk/extensions/Plotters/Plotters.php (modified) (history)
  • /trunk/extensions/ReplaceSet/ReplaceSet.i18n.php (modified) (history)
  • /trunk/extensions/ReplaceSet/ReplaceSet.php (modified) (history)
  • /trunk/extensions/SemanticCompoundQueries/SemanticCompoundQueries.i18n.php (modified) (history)
  • /trunk/extensions/SemanticCompoundQueries/SemanticCompoundQueries.php (modified) (history)
  • /trunk/extensions/SemanticInternalObjects/SemanticInternalObjects.i18n.php (modified) (history)
  • /trunk/extensions/SemanticInternalObjects/SemanticInternalObjects.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/languages/SMW_Messages.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/SRF_Messages.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/SRF_ParserFunctions.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/SemanticResultFormats.php (modified) (history)
  • /trunk/extensions/WikiArticleFeeds/WikiArticleFeeds.i18n.php (modified) (history)
  • /trunk/extensions/WikiArticleFeeds/WikiArticleFeeds.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Interlanguage/Interlanguage.i18n.php
@@ -6,8 +6,6 @@
77 * @ingroup Extensions
88 */
99
10 -require_once( dirname(__FILE__) . '/Interlanguage.i18n.magic.php' );
11 -
1210 $messages = array();
1311
1412 $messages['en'] = array(
Index: trunk/extensions/Interlanguage/Interlanguage.php
@@ -62,4 +62,4 @@
6363 $parser->setFunctionHook( 'interlanguage', array( $wgInterlanguageExtension, 'interlanguage' ), SFH_NO_HASH );
6464 }
6565 return true;
66 -}
\ No newline at end of file
 66+}
Index: trunk/extensions/SemanticCompoundQueries/SemanticCompoundQueries.i18n.php
@@ -6,9 +6,6 @@
77 * @ingroup Extensions
88 */
99
10 -// FIXME: Can be enabled when new-style magic words are used (introduced in r52503)
11 -// require_once( dirname( __FILE__ ) . '/SemanticCompoundQueries.i18n.magic.php' );
12 -
1310 $messages = array();
1411
1512 /** English
Index: trunk/extensions/SemanticCompoundQueries/SemanticCompoundQueries.php
@@ -17,7 +17,7 @@
1818
1919 if ( !defined( 'MEDIAWIKI' ) ) die();
2020
21 -define( 'SCQ_VERSION', '0.3.1' );
 21+define( 'SCQ_VERSION', '0.3.2' );
2222
2323 $wgExtensionCredits[defined( 'SEMANTIC_EXTENSION_TYPE' ) ? 'semantic' : 'parserhook'][] = array(
2424 'path' => __FILE__,
@@ -29,10 +29,9 @@
3030 );
3131
3232 $wgExtensionMessagesFiles['SemanticCompoundQueries'] = dirname( __FILE__ ) . '/SemanticCompoundQueries.i18n.php';
 33+$wgExtensionMessagesFiles['SemanticCompoundQueriesMagic'] = dirname( __FILE__ ) . '/SemanticCompoundQueries.i18n.magic.php';
3334
3435 $wgHooks['ParserFirstCallInit'][] = 'scqgRegisterParser';
35 -// FIXME: Can be removed when new-style magic words are used (introduced in r52503)
36 -$wgHooks['LanguageGetMagic'][] = 'scqgLanguageGetMagic';
3736
3837 $wgAutoloadClasses['SCQQueryProcessor'] = dirname( __FILE__ ) . '/SCQ_QueryProcessor.php';
3938 $wgAutoloadClasses['SCQQueryResult'] = dirname( __FILE__ ) . '/SCQ_QueryResult.php';
@@ -41,12 +40,3 @@
4241 $parser->setFunctionHook( 'compound_query', array( 'SCQQueryProcessor', 'doCompoundQuery' ) );
4342 return true; // always return true, in order not to stop MW's hook processing!
4443 }
45 -
46 -// FIXME: Can be removed when new-style magic words are used (introduced in r52503)
47 -function scqgLanguageGetMagic( &$magicWords, $langCode = 'en' ) {
48 - switch ( $langCode ) {
49 - default:
50 - $magicWords['compound_query'] = array ( 0, 'compound_query' );
51 - }
52 - return true;
53 -}
Index: trunk/extensions/MathStatFunctions/MathStatFunctions.i18n.php
@@ -6,8 +6,6 @@
77 * @ingroup Extensions
88 */
99
10 -require_once( dirname( __FILE__ ) . '/MathStatFunctions.i18n.magic.php' );
11 -
1210 $messages = array();
1311
1412 $messages['en'] = array(
Index: trunk/extensions/MathStatFunctions/MathStatFunctions.php
@@ -14,6 +14,8 @@
1515 );
1616
1717 $wgExtensionMessagesFiles['MathStatFunctions'] = dirname( __FILE__ ) . '/MathStatFunctions.i18n.php';
 18+$wgExtensionMessagesFiles['MathStatFunctionsMagic'] = dirname( __FILE__ ) . '/MathStatFunctions.i18n.magic.php';
 19+
1820 $wgHooks['ParserFirstCallInit'][] = 'wfSetupMathStatFunctions';
1921
2022 $wgExtMathStatFunctions = null;
@@ -28,7 +30,6 @@
2931 }
3032
3133 class ExtMathStatFunctions {
32 -
3334 public function __construct() {
3435 if ( !class_exists( 'ExtParserFunctions' ) )
3536 throw new ParserFunctionsNotFoundException;
Index: trunk/extensions/ReplaceSet/ReplaceSet.i18n.php
@@ -22,8 +22,6 @@
2323 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2424 */
2525
26 -require_once( dirname(__FILE__) . '/ReplaceSet.i18n.magic.php' );
27 -
2826 $messages = array();
2927
3028 $messages['en'] = array(
Index: trunk/extensions/ReplaceSet/ReplaceSet.php
@@ -27,7 +27,7 @@
2828 $wgExtensionCredits['parserhook'][] = array (
2929 'name' => 'ReplaceSet',
3030 'url' => 'http://mediawiki.org/wiki/Extension:ReplaceSet',
31 - 'version' => '1.1',
 31+ 'version' => '1.2',
3232 'author' => "[http://mediawiki.org/wiki/User:Dantman Daniel Friesen]",
3333 'descriptionmsg' => 'replaceset-desc',
3434 );
@@ -37,6 +37,7 @@
3838 $dir = dirname( __FILE__ ) . '/';
3939 $wgAutoloadClasses['ReplaceSet'] = $dir . 'ReplaceSet.class.php';
4040 $wgExtensionMessagesFiles['ReplaceSet'] = $dir . 'ReplaceSet.i18n.php';
 41+$wgExtensionMessagesFiles['ReplaceSetMagic'] = $dir . 'ReplaceSet.i18n.magic.php';
4142
4243 function efReplaceSetRegisterParser( &$parser ) {
4344 $parser->setFunctionHook( 'replaceset', array( 'ReplaceSet', 'parserFunction' ) );
Index: trunk/extensions/MediaFunctions/MediaFunctions.i18n.php
@@ -8,8 +8,6 @@
99 * @version 1.2
1010 */
1111
12 -require_once( dirname( __FILE__ ) . '/MediaFunctions.i18n.magic.php' );
13 -
1412 $messages = array();
1513
1614 /* English
Index: trunk/extensions/MediaFunctions/MediaFunctions.php
@@ -21,6 +21,7 @@
2222
2323 $dir = dirname( __FILE__ ) . '/';
2424 $wgExtensionMessagesFiles['MediaFunctions'] = $dir . 'MediaFunctions.i18n.php';
 25+$wgExtensionMessagesFiles['MediaFunctionsMagic'] = $dir . 'MediaFunctions.i18n.magic.php';
2526 $wgAutoloadClasses['MediaFunctions'] = $dir . 'MediaFunctions.class.php';
2627 $wgHooks['ParserFirstCallInit'][] = 'efMediaFunctionsSetup';
2728
Index: trunk/extensions/Plotters/Plotters.i18n.php
@@ -9,8 +9,6 @@
1010 * @license GNU General Public Licence 2.0 or later
1111 */
1212
13 -require_once( dirname(__FILE__) . '/Plotters.i18n.magic.php' );
14 -
1513 $messages = array();
1614
1715 /** English
Index: trunk/extensions/Plotters/Plotters.php
@@ -27,7 +27,7 @@
2828 $wgExtensionCredits['other'][] = array(
2929 'path' => __FILE__,
3030 'name' => 'Plotter parser extension',
31 - 'version' => '0.6c',
 31+ 'version' => '0.6d',
3232 'author' => 'Ryan Lane',
3333 'descriptionmsg' => 'plotters-desc',
3434 'url' => 'https://www.mediawiki.org/wiki/Extension:Plotters',
@@ -35,14 +35,12 @@
3636
3737 $wgHooks['ParserFirstCallInit'][] = 'efPlottersSetHooks';
3838 $wgHooks['OutputPageParserOutput'][] = 'PlottersParserOutput';
39 -if( version_compare( $wgVersion, '1.16alpha', '<' ) ) {
40 - $wgHooks['LanguageGetMagic'][] = 'PlottersLanguageGetMagic';
41 -}
4239 $wgHooks['ArticleSaveComplete'][] = 'wfPlottersArticleSaveComplete';
4340
4441 $dir = dirname( __FILE__ ) . '/';
4542 $wgExtensionMessagesFiles['Plotters'] = $dir . 'Plotters.i18n.php';
4643 $wgExtensionMessagesFiles['PlottersAlias'] = $dir . 'Plotters.alias.php';
 44+$wgExtensionMessagesFiles['PlottersMagic'] = $dir . 'Plotters.magic.php';
4745 $wgAutoloadClasses['Plotters'] = $dir . 'PlottersClass.php';
4846 $wgAutoloadClasses['PlottersParser'] = $dir . 'PlottersParser.php';
4947 $wgAutoloadClasses['SpecialPlotters'] = $dir . 'SpecialPlotters.php';
@@ -247,13 +245,3 @@
248246 }
249247 return true;
250248 }
251 -
252 -// FIXME: doesn't this make using this method and the hook above useless?
253 -/**
254 - * We ignore langCode - parser function names can be translated but
255 - * we are not using this feature
256 - */
257 -function PlottersLanguageGetMagic( $magicWords, $langCode ) {
258 - $magicWords['plot'] = array( 0, 'plot' );
259 - return true;
260 -}
Index: trunk/extensions/WikiArticleFeeds/WikiArticleFeeds.i18n.php
@@ -5,8 +5,6 @@
66 * @file
77 * @ingroup Extensions
88 */
9 -// FIXME: enable after 1.16 branching. This extension has not been branched yet.
10 -// require_once( dirname(__FILE__) . '/WikiArticleFeeds.i18n.magic.php' );
119
1210 $messages = array();
1311
Index: trunk/extensions/WikiArticleFeeds/WikiArticleFeeds.php
@@ -101,7 +101,7 @@
102102 # Confirm MW environment
103103 if ( !defined( 'MEDIAWIKI' ) ) die();
104104
105 -define( 'WIKIARTICLEFEEDS_VERSION', '0.6.6' );
 105+define( 'WIKIARTICLEFEEDS_VERSION', '0.6.7' );
106106
107107 # Bring in supporting classes
108108 require_once( "$IP/includes/Feed.php" );
@@ -119,12 +119,12 @@
120120
121121 $dir = dirname( __FILE__ ) . '/';
122122 $wgExtensionMessagesFiles['WikiArticleFeeds'] = $dir . 'WikiArticleFeeds.i18n.php';
 123+$wgExtensionMessagesFiles['WikiArticleFeedsMagic'] = $dir . 'WikiArticleFeeds.i18n.magic.php';
123124
124125 /**
125126 * Wrapper class for consolidating all WAF related parser methods
126127 */
127128 class WikiArticleFeedsParser {
128 -
129129 function feedStart( $text, $params = array() ) {
130130 return '<!-- FEED_START -->';
131131 }
@@ -147,12 +147,6 @@
148148 return ( !empty( $tags ) ? '<pre>@ITEMTAGS@' . base64_encode( serialize( implode( ',', $tags ) ) ) . '@ITEMTAGS@</pre>':'' );
149149 }
150150
151 - // FIXME: remove after 1.16 branching. This extension has not been branched yet.
152 - function itemTagsMagic( &$magicWords, $langCode = null ) {
153 - $magicWords['itemtags'] = array( 0, 'itemtags' );
154 - return true;
155 - }
156 -
157151 function itemTagsPlaceholderCorrections( $parser, &$text ) {
158152 $text = preg_replace(
159153 '|<pre>@ITEMTAGS@([0-9a-zA-Z\\+\\/]+=*)@ITEMTAGS@</pre>|',
@@ -165,8 +159,6 @@
166160
167161 # Create global instance
168162 $wgWikiArticleFeedsParser = new WikiArticleFeedsParser();
169 -// FIXME: update after 1.16 branching for new style magic words. This extension has not been branched yet.
170 -$wgHooks['LanguageGetMagic'][] = array( $wgWikiArticleFeedsParser, 'itemTagsMagic' );
171163 $wgHooks['ParserBeforeTidy'][] = array( $wgWikiArticleFeedsParser, 'itemTagsPlaceholderCorrections' );
172164
173165 # Add Extension Functions
@@ -570,4 +562,3 @@
571563 # Feed footer
572564 $feed->outFooter();
573565 }
574 -
Index: trunk/extensions/SemanticInternalObjects/SemanticInternalObjects.i18n.php
@@ -8,9 +8,6 @@
99 * @ingroup SemanticInternalObjects
1010 */
1111
12 -// FIXME: Can be enabled when new style magic words are used (introduced in r52503)
13 -// require_once( dirname( __FILE__ ) . '/SemanticInternalObjects.i18n.magic.php' );
14 -
1512 $messages = array();
1613
1714 /** English
Index: trunk/extensions/SemanticInternalObjects/SemanticInternalObjects.php
@@ -9,7 +9,7 @@
1010
1111 if ( !defined( 'MEDIAWIKI' ) ) die();
1212
13 -define( 'SIO_VERSION', '0.6.7' );
 13+define( 'SIO_VERSION', '0.6.8' );
1414
1515 $wgExtensionCredits[defined( 'SEMANTIC_EXTENSION_TYPE' ) ? 'semantic' : 'parserhook'][] = array(
1616 'path' => __FILE__,
@@ -33,6 +33,7 @@
3434
3535 $siogIP = dirname( __FILE__ );
3636 $wgExtensionMessagesFiles['SemanticInternalObjects'] = $siogIP . '/SemanticInternalObjects.i18n.php';
 37+$wgExtensionMessagesFiles['SemanticInternalObjectsMagic'] = $siogIP . '/SemanticInternalObjects.i18n.magic.php';
3738 $wgAutoloadClasses['SIOHandler'] = $siogIP . '/SemanticInternalObjects_body.php';
3839 $wgAutoloadClasses['SIOSQLStore'] = $siogIP . '/SemanticInternalObjects_body.php';
3940 if ( class_exists( 'SMWDIWikiPage' ) ) {
@@ -52,7 +53,7 @@
5354 function siofLanguageGetMagic( &$magicWords, $langCode = 'en' ) {
5455 switch ( $langCode ) {
5556 default:
56 - $magicWords['set_internal'] = array ( 0, 'set_internal' );
 57+ // Not in i18n file, so remains for now...
5758 $magicWords['set_internal_recurring_event'] = array ( 0, 'set_internal_recurring_event' );
5859 }
5960 return true;
Index: trunk/extensions/Icon/Icon.php
@@ -12,7 +12,7 @@
1313 $wgExtensionCredits['other'][] = array(
1414 'path' => __FILE__,
1515 'name' => 'Icon',
16 - 'version' => '1.6.1',
 16+ 'version' => '1.6.2',
1717 'author' => 'Tim Laqua',
1818 'descriptionmsg' => 'icon-desc',
1919 'url' => 'https://www.mediawiki.org/wiki/Extension:Icon',
@@ -21,6 +21,7 @@
2222 $wgHooks['ParserFirstCallInit'][] = 'efIcon_Setup';
2323 $dir = dirname(__FILE__) . '/';
2424 $wgExtensionMessagesFiles['Icon'] = $dir . 'Icon.i18n.php';
 25+$wgExtensionMessagesFiles['IconMagic'] = $dir . 'Icon.i18n.magic.php';
2526
2627 function efIcon_Setup( &$parser ) {
2728 # Set a function hook associating the "example" magic word with our function
Index: trunk/extensions/Icon/Icon.i18n.php
@@ -7,8 +7,6 @@
88 * @ingroup Extensions
99 */
1010
11 -require_once( dirname(__FILE__) . '/Icon.i18n.magic.php' );
12 -
1311 $messages = array();
1412
1513 $messages['en'] = array(
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_Messages.php
@@ -8,9 +8,6 @@
99 * @ingroup SMWLanguage
1010 */
1111
12 -// FIXME: Can be enabled when new style magic words are used (introduced in r52503)
13 -// require_once( dirname( __FILE__ ) . '/SMW_Magic.php' );
14 -
1512 $messages = array();
1613
1714 /** English
Index: trunk/extensions/SemanticResultFormats/SemanticResultFormats.php
@@ -34,7 +34,7 @@
3535 die( '<b>Error:</b> This version of Semantic Result Formats requires Semantic MediaWiki 1.7 or above; use Semantic Result Formats 1.6.1 for older versions of SMW.' );
3636 }
3737
38 -define( 'SRF_VERSION', '1.7' );
 38+define( 'SRF_VERSION', '1.7.1' );
3939
4040 // Require the settings file.
4141 require dirname( __FILE__ ) . '/SRF_Settings.php';
@@ -47,6 +47,7 @@
4848 $wgExtensionFunctions[] = 'srffInitFormats';
4949
5050 $wgExtensionMessagesFiles['SemanticResultFormats'] = dirname( __FILE__ ) . '/SRF_Messages.php';
 51+$wgExtensionMessagesFiles['SemanticResultFormatsMagic'] = dirname( __FILE__ ) . '/SRF_Magic.php';
5152
5253 // FIXME: hardcoded path
5354 $srfgScriptPath = $wgScriptPath . '/extensions/SemanticResultFormats';
@@ -100,9 +101,6 @@
101102 $wgHooks['AdminLinks'][] = 'SRFHooks::addToAdminLinks';
102103 $wgHooks['ParserFirstCallInit'][] = 'SRFParserFunctions::registerFunctions';
103104
104 -// FIXME: Can be removed when new style magic words are used (introduced in r52503)
105 -$wgHooks['LanguageGetMagic'][] = 'SRFParserFunctions::languageGetMagic';
106 -
107105 /**
108106 * Autoload the query printer classes and associate them with their formats in the $smwgResultFormats array.
109107 *
Index: trunk/extensions/SemanticResultFormats/SRF_ParserFunctions.php
@@ -23,16 +23,6 @@
2424 return true;
2525 }
2626
27 - // FIXME: Can be removed when new style magic words are used (introduced in r52503)
28 - static function languageGetMagic( &$magicWords, $langCode = "en" ) {
29 - switch ( $langCode ) {
30 - default:
31 - $magicWords['calendarstartdate'] = array ( 0, 'calendarstartdate' );
32 - $magicWords['calendarenddate'] = array ( 0, 'calendarenddate' );
33 - }
34 - return true;
35 - }
36 -
3727 static function runCalendarStartDate( &$parser, $calendar_type = 'month', $calendar_start_day = null, $calendar_days = 7, $default_year = null, $default_month = null, $default_day = null ) {
3828 if ( $calendar_type == '' ) $calendar_type = 'month';
3929 list( $lower_date, $upper_date, $query_date ) =
Index: trunk/extensions/SemanticResultFormats/SRF_Messages.php
@@ -6,9 +6,6 @@
77 * @ingroup Extensions
88 */
99
10 -// FIXME: Can be enabled when new style magic words are used (introduced in r52503)
11 -// require_once( dirname( __FILE__ ) . '/SRF_Magic.php' );
12 -
1310 $messages = array();
1411
1512 /** English
Index: trunk/extensions/Negref/Negref.i18n.php
@@ -6,8 +6,6 @@
77 * @ingroup Extensions
88 */
99
10 -require_once( dirname(__FILE__) . '/Negref.i18n.magic.php' );
11 -
1210 $messages = array();
1311
1412 /** English
Index: trunk/extensions/Negref/Negref.php
@@ -34,6 +34,7 @@
3535
3636 $dir = dirname( __FILE__ ) . '/';
3737 $wgExtensionMessagesFiles['NegRef'] = $dir . 'Negref.i18n.php';
 38+$wgExtensionMessagesFiles['NegRefMagic'] = $dir . 'Negref.i18n.magic.php';
3839 $wgHooks['ParserFirstCallInit'][] = 'efNegrefRegisterParser';
3940
4041 function efNegrefRegisterParser( &$parser ) {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r108558Follow-up to r108516 - after LanguageGetMagic hook was removed, a call to SF_...yaron22:59, 10 January 2012

Comments

#Comment by Jeroen De Dauw (talk | contribs)   13:56, 12 January 2012

You updated the version of SRF from 1.7 to 1.7.1. For all extensions I maintain, please never do this, and rather change it to "1.7.1 alpha", or leave it as it is if there already is some kind of status identifier after the version number. Right now I will not be able to distinguish between people reporting bugs that have version "1.7.1" that has been pulled from svn at some point before the rel or actually got the rel :/

Status & tagging log