Index: trunk/extensions/InterwikiIntegration/InterwikiIntegration.hooks.php |
— | — | @@ -4,32 +4,35 @@ |
5 | 5 | /** |
6 | 6 | * Creates necessary tables |
7 | 7 | */ |
8 | | - public static function InterwikiIntegrationCreateTable() { |
9 | | - global $wgExtNewTables; |
10 | | - $wgExtNewTables[] = array( |
11 | | - 'integration_prefix', |
12 | | - dirname( __FILE__ ) . '/interwikiintegration-prefix.sql' |
13 | | - ); |
14 | | - $wgExtNewTables[] = array( |
15 | | - 'integration_namespace', |
16 | | - dirname( __FILE__ ) . '/interwikiintegration-namespace.sql' |
17 | | - ); |
18 | | - $wgExtNewTables[] = array( |
19 | | - 'integration_iwlinks', |
20 | | - dirname( __FILE__ ) . '/interwikiintegration-iwlinks.sql' |
21 | | - ); |
22 | | - $wgExtNewTables[] = array( |
23 | | - 'integration_watchlist', |
24 | | - dirname( __FILE__ ) . '/interwikiintegration-watchlist.sql' |
25 | | - ); |
26 | | - $wgExtNewTables[] = array( |
27 | | - 'integration_recentchanges', |
28 | | - dirname( __FILE__ ) . '/interwikiintegration-recentchanges.sql' |
29 | | - ); |
30 | | - $wgExtNewTables[] = array( |
31 | | - 'integration_page', |
32 | | - dirname( __FILE__ ) . '/interwikiintegration-page.sql' |
33 | | - ); |
| 8 | + public static function InterwikiIntegrationCreateTable( $updater = null ) { |
| 9 | + if ( $updater === null ) { |
| 10 | + global $wgExtNewTables; |
| 11 | + $wgExtNewTables[] = array( 'integration_prefix', |
| 12 | + dirname( __FILE__ ) . '/interwikiintegration-prefix.sql' ); |
| 13 | + $wgExtNewTables[] = array( 'integration_namespace', |
| 14 | + dirname( __FILE__ ) . '/interwikiintegration-namespace.sql' ); |
| 15 | + $wgExtNewTables[] = array( 'integration_iwlinks', |
| 16 | + dirname( __FILE__ ) . '/interwikiintegration-iwlinks.sql' ); |
| 17 | + $wgExtNewTables[] = array( 'integration_watchlist', |
| 18 | + dirname( __FILE__ ) . '/interwikiintegration-watchlist.sql' ); |
| 19 | + $wgExtNewTables[] = array( 'integration_recentchanges', |
| 20 | + dirname( __FILE__ ) . '/interwikiintegration-recentchanges.sql' ); |
| 21 | + $wgExtNewTables[] = array( 'integration_page', |
| 22 | + dirname( __FILE__ ) . '/interwikiintegration-page.sql' ); |
| 23 | + } else { |
| 24 | + $updater->addExtensionUpdate( array( 'addTable', 'integration_prefix', |
| 25 | + dirname( __FILE__ ) . '/interwikiintegration-prefix.sql', true ) ); |
| 26 | + $updater->addExtensionUpdate( array( 'addTable', 'integration_namespace', |
| 27 | + dirname( __FILE__ ) . '/interwikiintegration-namespace.sql', true ) ); |
| 28 | + $updater->addExtensionUpdate( array( 'addTable', 'integration_iwlinks', |
| 29 | + dirname( __FILE__ ) . '/interwikiintegration-iwlinks.sql', true ) ); |
| 30 | + $updater->addExtensionUpdate( array( 'addTable', 'integration_watchlist', |
| 31 | + dirname( __FILE__ ) . '/interwikiintegration-watchlist.sql', true ) ); |
| 32 | + $updater->addExtensionUpdate( array( 'addTable', 'integration_recentchanges', |
| 33 | + dirname( __FILE__ ) . '/interwikiintegration-recentchanges.sql', true ) ); |
| 34 | + $updater->addExtensionUpdate( array( 'addTable', 'integration_page', |
| 35 | + dirname( __FILE__ ) . '/interwikiintegration-page.sql', true ) ); |
| 36 | + } |
34 | 37 | return true; |
35 | 38 | } |
36 | 39 | |