r105058 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105057‎ | r105058 | r105059 >
Date:04:34, 3 December 2011
Author:aaron
Status:ok
Tags:
Comment:
* Remove use of obsolete $wgExtensionAliasesFiles
* Used dirname() in require statements to be more specific
* Moved up resource definitions code a few lines
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.setup.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -35,19 +35,18 @@
3636 );
3737
3838 # Load global constants
39 -require( "FlaggedRevs.defines.php" );
 39+require( dirname( __FILE__ ) . '/FlaggedRevs.defines.php' );
4040
4141 # Load default configuration variables
42 -require( "FlaggedRevs.config.php" );
 42+require( dirname( __FILE__ ) . '/FlaggedRevs.config.php' );
4343
44 -# Define were classes and i18n files are located
45 -require( "FlaggedRevs.setup.php" );
46 -FlaggedRevsSetup::defineSourcePaths(
47 - $wgAutoloadClasses,
48 - $wgExtensionMessagesFiles,
49 - $wgExtensionAliasesFiles
50 -);
 44+# Define were PHP files and i18n files are located
 45+require( dirname( __FILE__ ) . '/FlaggedRevs.setup.php' );
 46+FlaggedRevsSetup::defineSourcePaths( $wgAutoloadClasses, $wgExtensionMessagesFiles );
5147
 48+# Define JS/CSS modules and file locations
 49+FlaggedRevsUISetup::defineResourceModules( $wgResourceModules );
 50+
5251 # Define user rights
5352 $wgAvailableRights[] = 'review'; # review pages to basic quality levels
5453 $wgAvailableRights[] = 'validate'; # review pages to all quality levels
@@ -76,9 +75,6 @@
7776 FlaggedRevsUISetup::defineLogBasicDescription( $wgLogNames, $wgLogHeaders, $wgFilterLogTypes );
7877 FlaggedRevsUISetup::defineLogActionHandlers( $wgLogActions, $wgLogActionsHandlers );
7978
80 -# JS/CSS modules and message bundles used by JS scripts
81 -FlaggedRevsUISetup::defineResourceModules( $wgResourceModules );
82 -
8379 # AJAX functions
8480 FlaggedRevsUISetup::defineAjaxFunctions( $wgAjaxExportList );
8581
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.setup.php
@@ -1,6 +1,6 @@
22 <?php
33 /**
4 - * Class containing basic setup functions for a FlaggedRevs environment.
 4+ * Class containing basic setup functions.
55 * This class depends on config variables in LocalSettings.php.
66 * Note: avoid FlaggedRevs class calls here for performance (like load.php).
77 */
@@ -27,17 +27,14 @@
2828 }
2929
3030 /**
31 - * Register FlaggedRevs source code paths.
 31+ * Register source code paths.
3232 * This function must NOT depend on any config vars.
3333 *
3434 * @param $classes Array $wgAutoloadClasses
3535 * @param $messagesFiles Array $wgExtensionMessagesFiles
36 - * @param $aliasesFiles Array $wgExtensionAliasesFiles
3736 * @return void
3837 */
39 - public static function defineSourcePaths(
40 - array &$classes, array &$messagesFiles, array &$aliasesFiles
41 - ) {
 38+ public static function defineSourcePaths( array &$classes, array &$messagesFiles ) {
4239 $dir = dirname( __FILE__ );
4340
4441 # Basic directory layout
@@ -84,7 +81,7 @@
8582 ### Presentation classes ###
8683 # Main i18n file and special page alias file
8784 $messagesFiles['FlaggedRevs'] = "$langDir/FlaggedRevs.i18n.php";
88 - $aliasesFiles['FlaggedRevs'] = "$langDir/FlaggedRevs.alias.php";
 85+ $messagesFiles['FlaggedRevsAliases'] = "$langDir/FlaggedRevs.alias.php";
8986 # UI setup, forms, and HTML elements
9087 $classes['FlaggedRevsUISetup'] = "$frontendDir/FlaggedRevsUI.setup.php";
9188 $classes['FlaggablePageView'] = "$frontendDir/FlaggablePageView.php";

Status & tagging log