r76446 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76445‎ | r76446 | r76447 >
Date:15:11, 10 November 2010
Author:ialex
Status:deferred
Tags:
Comment:
Converted Drafts extension to use the new version of the LoadExtensionSchemaUpdates hook
Modified paths:
  • /trunk/extensions/Drafts/Drafts.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Drafts/Drafts.hooks.php
@@ -9,18 +9,25 @@
1010 class DraftHooks {
1111
1212 /* Static Functions */
13 - public static function schema() {
14 - global $wgExtNewTables, $wgExtModifiedFields;
 13+ public static function schema( $updater = null ) {
 14+ if ( $updater === null ) {
 15+ global $wgExtNewTables, $wgExtModifiedFields;
1516
16 - $wgExtNewTables[] = array(
17 - 'drafts',
18 - dirname( __FILE__ ) . '/Drafts.sql'
19 - );
20 - $wgExtModifiedFields[] = array(
21 - 'drafts',
22 - 'draft_token',
23 - dirname( __FILE__ ) . '/patch-draft_token.sql'
24 - );
 17+ $wgExtNewTables[] = array(
 18+ 'drafts',
 19+ dirname( __FILE__ ) . '/Drafts.sql'
 20+ );
 21+ $wgExtModifiedFields[] = array(
 22+ 'drafts',
 23+ 'draft_token',
 24+ dirname( __FILE__ ) . '/patch-draft_token.sql'
 25+ );
 26+ } else {
 27+ $updater->addExtensionUpdate( array( 'addTable', 'drafts',
 28+ dirname( __FILE__ ) . '/Drafts.sql', true ) );
 29+ $updater->addExtensionUpdate( array( 'modifyField', 'drafts', 'draft_token',
 30+ dirname( __FILE__ ) . '/patch-draft_token.sql', true ) );
 31+ }
2532
2633 return true;
2734 }

Status & tagging log