r76881 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76880‎ | r76881 | r76882 >
Date:11:57, 17 November 2010
Author:ialex
Status:deferred
Tags:
Comment:
* Put extension credits directly in initialisation file; an extension function is not needed
* Removed trailing whitespaces
Modified paths:
  • /trunk/extensions/Deployment/Deployment.php (modified) (history)
  • /trunk/extensions/Distribution/Distribution.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Deployment/Deployment.php
@@ -17,8 +17,14 @@
1818
1919 include_once 'Deployment_Settings.php';
2020
21 -// Register the initialization function.
22 -$wgExtensionFunctions[] = 'efDeploymentSetup';
 21+$wgExtensionCredits['other'][] = array(
 22+ 'path' => __FILE__,
 23+ 'name' => 'Deployment',
 24+ 'version' => Deployment_VERSION,
 25+ 'author' => '[http://www.mediawiki.org/wiki/User:Jeroen_De_Dauw Jeroen De Dauw]',
 26+ 'url' => 'http://www.mediawiki.org/wiki/Extension:Deployment',
 27+ 'descriptionmsg' => 'deployment-desc',
 28+);
2329
2430 // Register the internationalization and aliasing files.
2531 $wgExtensionMessagesFiles['Deployment'] = dirname( __FILE__ ) . '/Deployment.i18n.php';
@@ -52,19 +58,3 @@
5359 * By default only sysops have this permission.
5460 */
5561 $wgGroupPermissions['sysop']['siteadmin'] = true;
56 -
57 -/**
58 - * Initialization function for the Deployment extension.
59 - */
60 -function efDeploymentSetup() {
61 - global $wgExtensionCredits;
62 -
63 - $wgExtensionCredits['other'][] = array(
64 - 'path' => __FILE__,
65 - 'name' => 'Deployment',
66 - 'version' => Deployment_VERSION,
67 - 'author' => '[http://www.mediawiki.org/wiki/User:Jeroen_De_Dauw Jeroen De Dauw]',
68 - 'url' => 'http://www.mediawiki.org/wiki/Extension:Deployment',
69 - 'descriptionmsg' => 'deployment-desc',
70 - );
71 -}
Index: trunk/extensions/Distribution/Distribution.php
@@ -17,17 +17,24 @@
1818
1919 define( 'Distribution_VERSION', '0.1 alpha' );
2020
 21+$wgExtensionCredits['other'][] = array(
 22+ 'path' => __FILE__,
 23+ 'name' => 'Distribution',
 24+ 'version' => Distribution_VERSION,
 25+ 'author' => array( '[http://www.mediawiki.org/wiki/User:Jeroen_De_Dauw Jeroen De Dauw]', 'Chad Horohoe' ),
 26+ 'url' => 'http://www.mediawiki.org/wiki/Extension:Distribution',
 27+ 'descriptionmsg' => 'distribution-desc',
 28+);
 29+
2130 include_once 'Distribution_Settings.php';
2231
23 -// Register the initialization function.
24 -$wgExtensionFunctions[] = 'efDistributionSetup';
2532
2633 // Register the internationalization and aliasing files.
2734 $wgExtensionMessagesFiles['Distribution'] = dirname( __FILE__ ) . '/Distribution.i18n.php';
2835 $wgExtensionAliasesFiles['Distribution'] = dirname( __FILE__ ) . '/Distribution.alias.php';
2936
3037 // Load classes.
31 -$wgAutoloadClasses['DistributionRelease'] = dirname( __FILE__ ) . '/includes/DistributionRelease.php';
 38+$wgAutoloadClasses['DistributionRelease'] = dirname( __FILE__ ) . '/includes/DistributionRelease.php';
3239 $wgAutoloadClasses['ExtensionDataImporter'] = dirname( __FILE__ ) . '/includes/ExtensionDataImporter.php';
3340 $wgAutoloadClasses['ReleaseRepo'] = dirname( __FILE__ ) . '/includes/ReleaseRepo.php';
3441 // $wgAutoloadClasses['Release'] = dirname( __FILE__ ) . '/includes/Release.php';
@@ -60,29 +67,10 @@
6168 $wgHooks['LoadExtensionSchemaUpdates'][] = 'efDistributionSchemaUpdate';
6269
6370 /**
64 - * Initialization function for the Distribution extension.
65 - *
66 - * @since 0.1
67 - */
68 -// FIXME: no need to put these extension credits in a hook.
69 -function efDistributionSetup() {
70 - global $wgExtensionCredits;
71 -
72 - $wgExtensionCredits['other'][] = array(
73 - 'path' => __FILE__,
74 - 'name' => 'Distribution',
75 - 'version' => Distribution_VERSION,
76 - 'author' => array( '[http://www.mediawiki.org/wiki/User:Jeroen_De_Dauw Jeroen De Dauw]', 'Chad Horohoe' ),
77 - 'url' => 'http://www.mediawiki.org/wiki/Extension:Distribution',
78 - 'descriptionmsg' => 'distribution-desc',
79 - );
80 -}
81 -
82 -/**
8371 * LoadExtensionSchemaUpdates hook.
84 - *
 72+ *
8573 * @since 0.1
86 - *
 74+ *
8775 * @return true
8876 */
8977 function efDistributionSchemaUpdate() {
@@ -92,12 +80,12 @@
9381 'distribution_packages',
9482 dirname( __FILE__ ) . '/distribution.sql'
9583 );
96 -
 84+
9785 $wgExtNewTables[] = array(
9886 'distribution_units',
9987 dirname( __FILE__ ) . '/distribution.sql'
100 - );
101 -
 88+ );
 89+
10290 $wgExtNewTables[] = array(
10391 'distribution_unit_versions',
10492 dirname( __FILE__ ) . '/distribution.sql'
@@ -106,7 +94,7 @@
10795 $wgExtNewTables[] = array(
10896 'distribution_mwreleases',
10997 dirname( __FILE__ ) . '/distribution.sql'
110 - );
 98+ );
11199
112100 return true;
113101 }

Status & tagging log