r76882 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76881‎ | r76882 | r76883 >
Date:12:21, 17 November 2010
Author:ialex
Status:deferred
Tags:
Comment:
Converted CategoryMultisort extension to use the new version of the LoadExtensionSchemaUpdates hook
Modified paths:
  • /trunk/extensions/CategoryMultisort/CategoryMultisort.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CategoryMultisort/CategoryMultisort.hooks.php
@@ -30,14 +30,20 @@
3131 $this->integrate = $integrate;
3232 }
3333
34 - function onLoadExtensionSchemaUpdates() {
35 - global $wgExtNewTables, $wgDBtype;
36 -
37 - $sql = dirname( __FILE__ ) . "/tables.$wgDBtype.sql";
38 - if ( file_exists( $sql ) ) {
39 - $wgExtNewTables[] = array( 'categorylinks_multisort', $sql );
 34+ function onLoadExtensionSchemaUpdates( $updater = null ) {
 35+ if ( $updater === null ) {
 36+ global $wgExtNewTables, $wgDBtype;
 37+ $sql = dirname( __FILE__ ) . "/tables.$wgDBtype.sql";
 38+ if ( file_exists( $sql ) ) {
 39+ $wgExtNewTables[] = array( 'categorylinks_multisort', $sql );
 40+ }
 41+ } else {
 42+ $sql = dirname( __FILE__ ) . '/tables.' . $updater->getDB()->getType() . '.sql';
 43+ if ( file_exists( $sql ) ) {
 44+ $updater->addExtensionUpdate( array( 'addTable', 'categorylinks_multisort', $sql, true ) );
 45+ }
4046 }
41 -
 47+
4248 return true;
4349 }
4450

Status & tagging log