r73474 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73473‎ | r73474 | r73475 >
Date:19:52, 21 September 2010
Author:ialex
Status:deferred
Tags:
Comment:
Converted Translate extension to use the new version of the LoadExtensionSchemaUpdates hook
Modified paths:
  • /trunk/extensions/Translate/tag/PageTranslationHooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/tag/PageTranslationHooks.php
@@ -343,14 +343,20 @@
344344 return true;
345345 }
346346
347 - public static function schemaUpdates() {
348 - global $wgExtNewTables, $wgExtNewFields;
349 -
 347+ public static function schemaUpdates( $updater = null ) {
350348 $dir = dirname( __FILE__ ) . '/..';
351 - $wgExtNewTables[] = array( 'translate_sections', "$dir/translate.sql" );
352 - $wgExtNewFields[] = array( 'translate_sections', 'trs_order', "$dir/translate-add-trs_order.patch.sql" );
353 - $wgExtNewTables[] = array( 'revtag_type', "$dir/revtags.sql" );
354349
 350+ if ( $updater === null ) {
 351+ global $wgExtNewTables, $wgExtNewFields;
 352+
 353+ $wgExtNewTables[] = array( 'translate_sections', "$dir/translate.sql" );
 354+ $wgExtNewFields[] = array( 'translate_sections', 'trs_order', "$dir/translate-add-trs_order.patch.sql" );
 355+ $wgExtNewTables[] = array( 'revtag_type', "$dir/revtags.sql" );
 356+ } else {
 357+ $updater->addExtensionUpdate( array( 'addTable', 'translate_sections', "$dir/translate.sql" ) );
 358+ $updater->addExtensionUpdate( array( 'addField', 'translate_sections', 'trs_order', "$dir/translate-add-trs_order.patch.sql" ) );
 359+ $updater->addExtensionUpdate( array( 'addTable', 'revtag_type', "$dir/revtags.sql" ) );
 360+ }
355361 return true;
356362 }
357363

Status & tagging log