r70511 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70510‎ | r70511 | r70512 >
Date:18:08, 5 August 2010
Author:siebrand
Status:deferred
Tags:
Comment:
Removed most checks for MW_SUPPORTS_PARSERFIRSTCALLINIT introduced in MediaWiki 1.12.0 (released 2008-03-20).
Modified paths:
  • /trunk/extensions/AmazonPlus/AmazonPlus.php (modified) (history)
  • /trunk/extensions/Cite/Cite.php (modified) (history)
  • /trunk/extensions/ConditionalShowSection/ConditionalShowSection.php (modified) (history)
  • /trunk/extensions/ConditionalShowSection/README (modified) (history)
  • /trunk/extensions/DonationInterface/activemq_stomp/activemq_stomp.php (modified) (history)
  • /trunk/extensions/FBConnect/FBConnect.php (modified) (history)
  • /trunk/extensions/HideNamespace/HideNamespace.php (modified) (history)
  • /trunk/extensions/SemanticForms/includes/SF_GlobalFunctions.php (modified) (history)
  • /trunk/extensions/SlippyMap/SlippyMap.php (modified) (history)

Diff [purge]

Index: trunk/extensions/AmazonPlus/AmazonPlus.php
@@ -66,12 +66,7 @@
6767
6868 $wgExtensionMessagesFiles['AmazonPlus'] = dirname( __FILE__ ) . '/AmazonPlus.i18n.php';
6969
70 -if ( defined( 'MW_SUPPORTS_PARSERFIRSTCALLINIT' ) ) {
71 - $wgHooks['ParserFirstCallInit'][] = 'efAmazonPlusSetup';
72 -} else {
73 - $wgExtensionFunctions[] = 'efAmazonPlusSetup';
74 -}
75 -
 70+$wgHooks['ParserFirstCallInit'][] = 'efAmazonPlusSetup';
7671 $wgHooks['BeforePageDisplay'][] = 'efAmazonPlusJavascript';
7772
7873 $wgAmazonPlusJSVersion = 1; # Bump the version number every time you change AmazonPlus.js
Index: trunk/extensions/FBConnect/FBConnect.php
@@ -44,7 +44,7 @@
4545 /*
4646 * FBConnect version.
4747 */
48 -define( 'MEDIAWIKI_FBCONNECT_VERSION', '2.0.2' );
 48+define( 'MEDIAWIKI_FBCONNECT_VERSION', '2.1.0' );
4949
5050 /*
5151 * Add information about this extension to Special:Version.
@@ -153,13 +153,6 @@
154154 } else {
155155 self::$fbOnLoginJs = "window.location.reload(true);";
156156 }
157 -
158 - // ParserFirstCallInit was introduced in modern (1.12+) MW versions so as to
159 - // avoid unstubbing $wgParser on setHook() too early, as per r35980
160 - if (!defined( 'MW_SUPPORTS_PARSERFIRSTCALLINIT' )) {
161 - global $wgParser;
162 - wfRunHooks( 'ParserFirstCallInit', $wgParser );
163 - }
164157 }
165158
166159 /**
Index: trunk/extensions/SlippyMap/SlippyMap.php
@@ -47,12 +47,7 @@
4848 $wgParserTestFiles[] = $dir . '/slippyMapParserTests.txt';
4949
5050 /* Parser hook */
51 -if ( defined( 'MW_SUPPORTS_PARSERFIRSTCALLINIT' ) ) {
52 - $wgHooks['ParserFirstCallInit'][] = 'wfSlippyMapHook';
53 -} else {
54 - // Legacy support
55 - $wgExtensionFunctions[] = 'wfSlippyMapHook';
56 -}
 51+$wgHooks['ParserFirstCallInit'][] = 'wfSlippyMapHook';
5752
5853 function wfSlippyMapHook() {
5954 new SlippyMapHook;
@@ -156,4 +151,3 @@
157152 * see see the static map and nothing else.
158153 */
159154 $wgSlippyMapAutoLoadMaps = false;
160 -
Index: trunk/extensions/SemanticForms/includes/SF_GlobalFunctions.php
@@ -26,7 +26,6 @@
2727 define( 'SF_SP_HAS_FIELD_LABEL_FORMAT', 5 );
2828
2929 $wgExtensionFunctions[] = 'sfgSetupExtension';
30 -$wgExtensionFunctions[] = 'sfgParserFunctions';
3130
3231 // FIXME: Can be removed when new style magic words are used (introduced in r52503)
3332 $wgHooks['LanguageGetMagic'][] = 'SFParserFunctions::languageGetMagic';
@@ -42,6 +41,7 @@
4342 $wgHooks['smwInitProperties'][] = 'SFUtils::initProperties';
4443 $wgHooks['AdminLinks'][] = 'sffAddToAdminLinks';
4544 $wgHooks['ParserBeforeStrip'][] = 'SFUtils::cacheFormDefinition';
 45+$wgHooks['ParserFirstCallInit'][] = 'SFParserFunctions::registerFunctions';
4646
4747 $wgAPIModules['sfautocomplete'] = 'SFAutocompleteAPI';
4848
@@ -116,18 +116,6 @@
117117 $sfgFormPrinter = new StubObject( 'sfgFormPrinter', 'SFFormPrinter' );
118118 }
119119
120 -function sfgParserFunctions() {
121 - global $wgHooks, $wgParser;
122 - if ( defined( 'MW_SUPPORTS_PARSERFIRSTCALLINIT' ) ) {
123 - $wgHooks['ParserFirstCallInit'][] = 'SFParserFunctions::registerFunctions';
124 - } else {
125 - if ( class_exists( 'StubObject' ) && !StubObject::isRealObject( $wgParser ) ) {
126 - $wgParser->_unstub();
127 - }
128 - SFParserFunctions::registerFunctions( $wgParser );
129 - }
130 -}
131 -
132120 /**********************************************/
133121 /***** namespace settings *****/
134122 /**********************************************/
Index: trunk/extensions/DonationInterface/activemq_stomp/activemq_stomp.php
@@ -23,13 +23,8 @@
2424 //default variables that should be set in LocalSettings
2525 $wgStompServer = "";
2626
27 -if ( defined( 'MW_SUPPORTS_PARSERFIRSTCALLINIT' ) ) {
28 - $wgHooks['ParserFirstCallInit'][] = 'efStompSetup';
29 -} else { // Otherwise do things the old fashioned way
30 - $wgExtensionFunctions[] = 'efStompSetup';
31 -}
 27+$wgHooks['ParserFirstCallInit'][] = 'efStompSetup';
3228
33 -
3429 /*
3530 * Create <donate /> tag to include landing page donation form
3631 */
Index: trunk/extensions/Cite/Cite.php
@@ -17,11 +17,7 @@
1818 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
1919 */
2020
21 -if ( defined( 'MW_SUPPORTS_PARSERFIRSTCALLINIT' ) ) {
22 - $wgHooks['ParserFirstCallInit'][] = 'wfCite';
23 -} else {
24 - $wgExtensionFunctions[] = 'wfCite';
25 -}
 21+$wgHooks['ParserFirstCallInit'][] = 'wfCite';
2622
2723 $wgExtensionCredits['parserhook'][] = array(
2824 'path' => __FILE__,
@@ -53,4 +49,3 @@
5450 }
5551
5652 /**#@-*/
57 -
Index: trunk/extensions/HideNamespace/HideNamespace.php
@@ -26,7 +26,7 @@
2727 'name' => "HideNamespace",
2828 'description' => "Hides namespace in the header and title when a page is in specified namespace or when the <code><nowiki>{{#hidens:}}</nowiki></code> parser function is called.",
2929 'descriptionmsg' => "hidens-desc",
30 - 'version' => "1.3",
 30+ 'version' => "1.4",
3131 'author' => 'Matěj Grabovský',
3232 'url' => "http://www.mediawiki.org/wiki/Extension:HideNamespace",
3333 );
@@ -39,18 +39,7 @@
4040 // Register hooks
4141 $wgHooks['ArticleViewHeader'][] = array( $extHidensObj, 'onArticleViewHeader' );
4242 $wgHooks['BeforePageDisplay'][] = array( $extHidensObj, 'onBeforePageDisplay' );
43 -
44 - // If we support ParserFirstCallInit, hook our function to register PF hooks with it
45 - if( defined('MW_SUPPORTS_PARSERFIRSTCALLINIT') ) {
46 - $wgHooks['ParserFirstCallInit'][] = array( $extHidensObj, 'RegisterParser' );
47 -
48 - // Else manualy unstub Parser and call our function
49 - } else {
50 - if( class_exists( 'StubObject' ) && !StubObject::isRealObject( $wgParser ) ) {
51 - $wgParser->_unstub();
52 - }
53 - $extHidensObj->RegisterParser( $wgParser );
54 - }
 43+ $wgHooks['ParserFirstCallInit'][] = array( $extHidensObj, 'RegisterParser' );
5544 }
5645
5746 class ExtensionHideNamespace {
Index: trunk/extensions/ConditionalShowSection/ConditionalShowSection.php
@@ -32,11 +32,7 @@
3333 $dir = dirname( __FILE__ ) . '/';
3434 $wgExtensionMessagesFiles['ConditionalShowSection'] = $dir . 'ConditionalShowSection.i18n.php';
3535
36 -if ( defined( 'MW_SUPPORTS_PARSERFIRSTCALLINIT' ) ) {
37 - $wgHooks['ParserFirstCallInit'][] = 'wfConditionalShowSection';
38 -} else { // Otherwise do things the old fashioned way
39 - $wgExtensionFunctions[] = 'wfConditionalShowSection';
40 -}
 36+$wgHooks['ParserFirstCallInit'][] = 'wfConditionalShowSection';
4137
4238 function wfConditionalShowSection() {
4339 global $wgParser;
Index: trunk/extensions/ConditionalShowSection/README
@@ -37,7 +37,7 @@
3838 |imagesize =
3939 |version = 1.5
4040 |update = 2009-09-10
41 -|mediawiki = tested on 1.8.2, 1.9.3, 1.10, 1.14, 1.15, 1.16A
 41+|mediawiki = tested on 1.14, 1.15, 1.16A
4242 |php =
4343 |license = GNU General Public Licence 2.0
4444 |download = [http://wiki.jldupont.com/Extension:ConditionalContent http version <1.5]

Status & tagging log