r84237 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84236‎ | r84237 | r84238 >
Date:13:33, 18 March 2011
Author:ialex
Status:ok
Tags:
Comment:
Removed some useless extension functions
Modified paths:
  • /trunk/extensions/Contributors/Contributors.php (modified) (history)
  • /trunk/extensions/Description/Description.php (modified) (history)
  • /trunk/extensions/Duplicator/Duplicator.php (modified) (history)
  • /trunk/extensions/FileSearch/FileSearch.php (modified) (history)
  • /trunk/extensions/FundraiserPortal/FundraiserPortal.php (modified) (history)
  • /trunk/extensions/geoserver/SpecialWikimaps.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FileSearch/FileSearch.php
@@ -21,15 +21,9 @@
2222 'url' => 'http://www.mediawiki.org/wiki/Extension:FileSearch',
2323 );
2424
25 -$wgExtensionFunctions[] = 'efFileSearchSetup';
 25+#$wgExtensionFunctions[] = array( 'FileSearchIndexer', 'initialise' );
2626 $wgAutoloadClasses['FileSearchIndexer'] = dirname( __FILE__ ) . '/FileSearchIndexer.php';
2727 $wgAutoloadClasses['Extractor'] = dirname( __FILE__ ) . '/extract/Extractor.php';
2828 $wgFileSearchExtractors['TextExtractor'] = dirname( __FILE__ ) . '/extract/TextExtractor.php';
29 -
30 -function efFileSearchSetup() {
31 - global $wgHooks;
32 - $wgHooks['FileUpload'][] = 'FileSearchIndexer::upload';
33 - $wgHooks['SearchUpdate'][] = 'FileSearchIndexer::index';
34 - #FileSearchIndexer::initialise();
35 -}
36 -
 29+$wgHooks['FileUpload'][] = 'FileSearchIndexer::upload';
 30+$wgHooks['SearchUpdate'][] = 'FileSearchIndexer::index';
Index: trunk/extensions/FundraiserPortal/FundraiserPortal.php
@@ -66,16 +66,8 @@
6767 $wgExtensionMessagesFiles['FundraiserPortal'] =
6868 dirname( __FILE__ ) . "/FundraiserPortal.i18n.php";
6969
70 -$wgExtensionFunctions[] = 'efFundraiserPortalSetup';
 70+$wgHooks['BeforePageDisplay'][] = 'efFundraiserPortalLoader';
7171
72 -
73 -// Register hooks
74 -function efFundraiserPortalSetup() {
75 - global $wgHooks;
76 -
77 - $wgHooks['BeforePageDisplay'][] = 'efFundraiserPortalLoader';
78 -}
79 -
8072 // Load the js that will choose the button client side
8173 function efFundraiserPortalLoader( $out, $skin ) {
8274 global $wgOut, $wgContLang;
Index: trunk/extensions/geoserver/SpecialWikimaps.php
@@ -11,7 +11,6 @@
1212 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
1313 */
1414
15 -$wgExtensionFunctions[] = 'wfSpecialWikimaps';
1615 $wgExtensionCredits['specialpage'][] = array(
1716 'name' => 'Wikimaps',
1817 'author' => 'Jens Frank',
Index: trunk/extensions/Duplicator/Duplicator.php
@@ -23,8 +23,10 @@
2424 $wgExtensionAliasesFiles['Duplicator'] = $dir . 'Duplicator.alias.php';
2525 $wgAutoloadClasses['SpecialDuplicator'] = $dir . 'Duplicator.page.php';
2626 $wgSpecialPages['Duplicator'] = 'SpecialDuplicator';
27 -$wgExtensionFunctions[] = 'efDuplicator';
2827
 28+$wgHooks['SkinTemplateBuildNavUrlsNav_urlsAfterPermalink'][] = 'efDuplicatorNavigation';
 29+$wgHooks['SkinTemplateToolboxEnd'][] = 'efDuplicatorToolbox';
 30+
2931 /**
3032 * User permissions
3133 */
@@ -37,15 +39,6 @@
3840 $wgDuplicatorRevisionLimit = 250;
3941
4042 /**
41 - * Extension setup function
42 - */
43 -function efDuplicator() {
44 - global $wgHooks;
45 - $wgHooks['SkinTemplateBuildNavUrlsNav_urlsAfterPermalink'][] = 'efDuplicatorNavigation';
46 - $wgHooks['SkinTemplateToolboxEnd'][] = 'efDuplicatorToolbox';
47 -}
48 -
49 -/**
5043 * Build the link to be shown in the toolbox if appropriate
5144 */
5245 function efDuplicatorNavigation( &$skin, &$nav_urls, &$oldid, &$revid ) {
Index: trunk/extensions/Contributors/Contributors.php
@@ -13,7 +13,6 @@
1414 exit( 1 );
1515 }
1616
17 -$wgExtensionFunctions[] = 'efContributors';
1817 $wgExtensionCredits['specialpage'][] = array(
1918 'path' => __FILE__,
2019 'name' => 'Contributors',
@@ -30,6 +29,12 @@
3130 $wgSpecialPages['Contributors'] = 'SpecialContributors';
3231 $wgSpecialPageGroups['Contributors'] = 'pages';
3332
 33+$wgHooks['ArticleDeleteComplete'][] = 'efContributorsInvalidateCache';
 34+$wgHooks['ArticleSaveComplete'][] = 'efContributorsInvalidateCache';
 35+# Good god, this is ludicrous!
 36+$wgHooks['SkinTemplateBuildNavUrlsNav_urlsAfterPermalink'][] = 'efContributorsNavigation';
 37+$wgHooks['SkinTemplateToolboxEnd'][] = 'efContributorsToolbox';
 38+
3439 /**
3540 * Intelligent cut-off limit; see below
3641 */
@@ -42,19 +47,6 @@
4348 $wgContributorsThreshold = 2;
4449
4550 /**
46 - * Extension initialisation function
47 - */
48 -function efContributors() {
49 - global $wgHooks;
50 -
51 - $wgHooks['ArticleDeleteComplete'][] = 'efContributorsInvalidateCache';
52 - $wgHooks['ArticleSaveComplete'][] = 'efContributorsInvalidateCache';
53 - # Good god, this is ludicrous!
54 - $wgHooks['SkinTemplateBuildNavUrlsNav_urlsAfterPermalink'][] = 'efContributorsNavigation';
55 - $wgHooks['SkinTemplateToolboxEnd'][] = 'efContributorsToolbox';
56 -}
57 -
58 -/**
5951 * Invalidate the cache we saved for a given title
6052 *
6153 * @param $article Article object that changed
Index: trunk/extensions/Description/Description.php
@@ -29,7 +29,6 @@
3030
3131 define('DESCRIPTION_VERSION', '0.1');
3232
33 -$wgExtensionFunctions[] = 'DescriptionSetup';
3433 $wgExtensionCredits['other'][] = array(
3534 'path' => __FILE__,
3635 'name' => 'Description',
@@ -38,12 +37,7 @@
3938 'url' => 'http://www.mediawiki.org/wiki/Extension:Description',
4039 'description' => 'Adds a description meta-tag to MW pages');
4140
42 -function DescriptionSetup() {
43 -
44 - global $wgHooks;
45 -
46 - $wgHooks['ArticleViewHeader'][] = 'DescriptionArticleViewHeader';
47 -}
 41+$wgHooks['ArticleViewHeader'][] = 'DescriptionArticleViewHeader';
4842
4943 function DescriptionArticleViewHeader(&$article, &$outputDone = null, &$pcache = null) {
5044 global $wgOut;

Status & tagging log