r70512 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70511‎ | r70512 | r70513 >
Date:18:08, 5 August 2010
Author:siebrand
Status:deferred
Tags:
Comment:
Remove pre-1.7 compatibility and checks for MW_SUPPORTS_PARSERFIRSTCALLINIT introduced in MediaWiki 1.12.0 (released 2008-03-20).
Modified paths:
  • /trunk/extensions/WikiArticleFeeds/WikiArticleFeeds.php (modified) (history)

Diff [purge]

Index: trunk/extensions/WikiArticleFeeds/WikiArticleFeeds.php
@@ -2,7 +2,7 @@
33 /*
44 * WikiArticleFeeds.php - A MediaWiki extension for converting regular pages into feeds.
55 * @author Jim R. Wilson
6 - * @version 0.6.5
 6+ * @version 0.6.6
77 * @copyright Copyright (C) 2007 Jim R. Wilson
88 * @license The MIT License - http://www.opensource.org/licenses/mit-license.php
99 * -----------------------------------------------------------------------
@@ -10,7 +10,7 @@
1111 * This is a MediaWiki (http://www.mediawiki.org/) extension which adds support
1212 * for publishing RSS or Atom feeds generated from standard wiki articles.
1313 * Requirements:
14 - * MediaWiki 1.6.x or higher
 14+ * MediaWiki 1.12.x or higher
1515 * PHP 4.x, 5.x or higher
1616 * Installation:
1717 * 1. Drop this script (WikiArticleFeeds.php) in $IP/extensions
@@ -35,6 +35,8 @@
3636 * {{#itemTags:dogs, cats}}
3737 * {{#itemTags:dogs|cats}}
3838 * Version Notes:
 39+ * version 0.6.6:
 40+ * Updated version requirement to MediaWiki 1.12 and up.
3941 * version 0.6.5:
4042 * Simplified many regular expression to get it working on MW 1.16
4143 * version 0.6.4:
@@ -99,7 +101,7 @@
100102 # Confirm MW environment
101103 if ( !defined( 'MEDIAWIKI' ) ) die();
102104
103 -define( 'WIKIARTICLEFEEDS_VERSION', '0.6.4' );
 105+define( 'WIKIARTICLEFEEDS_VERSION', '0.6.6' );
104106
105107 # Bring in supporting classes
106108 require_once( "$IP/includes/Feed.php" );
@@ -116,7 +118,6 @@
117119 );
118120
119121 $dir = dirname( __FILE__ ) . '/';
120 -
121122 $wgExtensionMessagesFiles['WikiArticleFeeds'] = $dir . 'WikiArticleFeeds.i18n.php';
122123
123124 /**
@@ -165,30 +166,11 @@
166167 # Create global instance
167168 $wgWikiArticleFeedsParser = new WikiArticleFeedsParser();
168169 // FIXME: update after 1.16 branching for new style magic words. This extension has not been branched yet.
169 -if ( version_compare( $wgVersion, '1.7', '<' ) ) {
170 - # Hack solution to resolve 1.6 array parameter nullification for hook args
171 - function wfWAFParserItemTagsMagic( &$magicWords ) {
172 - global $wgWikiArticleFeedsParser;
173 - $wgWikiArticleFeedsParser->itemTagsMagic( $magicWords );
174 - return true;
175 - }
176 - function wfWAFParserPlaceholderCorrections( $parser, &$text ) {
177 - global $wgWikiArticleFeedsParser;
178 - $wgWikiArticleFeedsParser->itemTagsPlaceholderCorrections( $parser, $text );
179 - return true;
180 - }
181 - $wgHooks['LanguageGetMagic'][] = 'wfWAFParserItemTagsMagic';
182 - $wgHooks['ParserBeforeTidy'][] = 'wfWAFParserPlaceholderCorrections';
183 -} else {
184 - $wgHooks['LanguageGetMagic'][] = array( $wgWikiArticleFeedsParser, 'itemTagsMagic' );
185 - $wgHooks['ParserBeforeTidy'][] = array( $wgWikiArticleFeedsParser, 'itemTagsPlaceholderCorrections' );
186 -}
 170+$wgHooks['LanguageGetMagic'][] = array( $wgWikiArticleFeedsParser, 'itemTagsMagic' );
 171+$wgHooks['ParserBeforeTidy'][] = array( $wgWikiArticleFeedsParser, 'itemTagsPlaceholderCorrections' );
187172
188173 # Add Extension Functions
189 -if ( defined( 'MW_SUPPORTS_PARSERFIRSTCALLINIT' ) )
190 - $wgHooks['ParserFirstCallInit'][] = 'wfWikiArticleFeedsParserSetup';
191 -else
192 - $wgExtensionFunctions[] = 'wfWikiArticleFeedsParserSetup';
 174+$wgHooks['ParserFirstCallInit'][] = 'wfWikiArticleFeedsParserSetup';
193175
194176 # Sets up the WikiArticleFeeds Parser hooks
195177 function wfWikiArticleFeedsParserSetup() {

Status & tagging log