r73284 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73283‎ | r73284 | r73285 >
Date:11:31, 18 September 2010
Author:ialex
Status:ok
Tags:
Comment:
Coverted AntiSpoof extension to use the new version of the LoadExtensionSchemaUpdates hook
Modified paths:
  • /trunk/extensions/AntiSpoof/AntiSpoof.php (modified) (history)

Diff [purge]

Index: trunk/extensions/AntiSpoof/AntiSpoof.php
@@ -41,11 +41,16 @@
4242 $wgHooks['UserCreateForm'][] = 'asUserCreateFormHook';
4343 $wgHooks['AddNewAccount'][] = 'asAddNewAccountHook';
4444
45 -function asUpdateSchema() {
46 - global $wgExtNewTables, $wgDBtype;
47 - $wgExtNewTables[] = array(
48 - 'spoofuser',
49 - dirname( __FILE__ ) . '/sql/patch-antispoof.' . $wgDBtype . '.sql' );
 45+function asUpdateSchema( $updater = null ) {
 46+ if ( $updater === null ) {
 47+ global $wgExtNewTables, $wgDBtype;
 48+ $wgExtNewTables[] = array(
 49+ 'spoofuser',
 50+ dirname( __FILE__ ) . '/sql/patch-antispoof.' . $wgDBtype . '.sql' );
 51+ } else {
 52+ $updater->addExtensionUpdate( array( 'addTable', 'spoofuser',
 53+ dirname( __FILE__ ) . '/sql/patch-antispoof.' . $updater->getDB()->getType() . '.sql' ) );
 54+ }
5055 return true;
5156 }
5257

Status & tagging log