Index: trunk/extensions/AntiSpoof/AntiSpoof.php |
— | — | @@ -41,11 +41,16 @@ |
42 | 42 | $wgHooks['UserCreateForm'][] = 'asUserCreateFormHook'; |
43 | 43 | $wgHooks['AddNewAccount'][] = 'asAddNewAccountHook'; |
44 | 44 | |
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 | + } |
50 | 55 | return true; |
51 | 56 | } |
52 | 57 | |