r95526 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95525‎ | r95526 | r95527 >
Date:21:25, 25 August 2011
Author:reedy
Status:ok
Tags:
Comment:
Use addTable function

Don't make 2 calls to add tables when they both are in the same file
Modified paths:
  • /trunk/extensions/UploadWizard/UploadWizardHooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/UploadWizardHooks.php
@@ -9,7 +9,7 @@
1010
1111 public static $modules = array(
1212 // n.b. we tend not to use mediawiki.language functions, they are better implemented in mediawiki.language.parser.
13 - // however, loading mediawiki.language will a) create the namespace b) load the language files with convertPlural for the current language and all.
 13+ // however, loading mediawiki.language will a) create the namespace b) load the language files with convertPlural for the current language and all.
1414 'ext.uploadwizard.mediawiki.language.parser' => array(
1515 'dependencies' => array( 'mediawiki.language', 'mediawiki.util' ),
1616 'scripts' => 'resources/mediawiki.language.parser.js'
@@ -67,11 +67,11 @@
6868 'resources/mw.LanguageUpWiz.js',
6969
7070 // workhorse libraries
71 - 'resources/mw.IframeTransport.js',
 71+ 'resources/mw.IframeTransport.js',
7272 'resources/mw.ApiUploadHandler.js',
7373 'resources/mw.DestinationChecker.js',
7474 'resources/mw.UploadWizardUtil.js',
75 -
 75+
7676 // firefogg support libraries
7777 'resources/mw.Firefogg.js',
7878 'resources/mw.FirefoggHandler.js',
@@ -80,7 +80,7 @@
8181 //upload using FormData, large files in chunks
8282 'resources/mw.FormDataTransport.js',
8383 'resources/mw.ApiUploadFormDataHandler.js',
84 -
 84+
8585 // interface libraries
8686 'resources/mw.GroupProgressBar.js',
8787
@@ -90,14 +90,14 @@
9191
9292 // main library
9393 'resources/mw.UploadWizard.js',
94 -
95 - // main library components:
 94+
 95+ // main library components:
9696 'resources/mw.UploadWizardDeed.js',
9797 'resources/mw.UploadWizardDescription.js',
9898 'resources/mw.UploadWizardDetails.js',
9999 'resources/mw.UploadWizardUploadInterface.js',
100 -
101100
 101+
102102 // launcher
103103 'UploadWizardPage.js'
104104 ),
@@ -423,7 +423,7 @@
424424 }
425425 return true;
426426 }
427 -
 427+
428428 /**
429429 * Schema update to set up the needed database tables.
430430 *
@@ -434,19 +434,8 @@
435435 * @return true
436436 */
437437 public static function onSchemaUpdate( /* DatabaseUpdater */ $updater = null ) {
 438+ $updater->addExtensionTable( 'uw_campaigns', dirname( __FILE__ ) . '/UploadWizard.sql' );
438439 $updater->addExtensionUpdate( array(
439 - 'addTable',
440 - 'uw_campaigns',
441 - dirname( __FILE__ ) . '/UploadWizard.sql',
442 - true
443 - ) );
444 - $updater->addExtensionUpdate( array(
445 - 'addTable',
446 - 'uw_campaign_conf',
447 - dirname( __FILE__ ) . '/UploadWizard.sql',
448 - true
449 - ) );
450 - $updater->addExtensionUpdate( array(
451440 'addIndex',
452441 'uw_campaigns',
453442 'uw_campaigns_name',
@@ -470,5 +459,5 @@
471460
472461 return true;
473462 }
474 -
 463+
475464 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r95527MFT r92917 - r95526awjrichards21:29, 25 August 2011

Status & tagging log