Index: trunk/extensions/SignupAPI/includes/SignupAPI.hooks.php |
— | — | @@ -8,13 +8,23 @@ |
9 | 9 | |
10 | 10 | class SignupAPIHooks { |
11 | 11 | |
12 | | - static function onSourceTracking() { |
13 | | - global $wgExtNewTables; |
| 12 | + /** |
| 13 | + * @param $updater DatabaseUpdater |
| 14 | + * @return bool |
| 15 | + */ |
| 16 | + static function onSourceTracking( $updater = null ) { |
| 17 | + if ( $updater !== null ) { |
| 18 | + $base = dirname( dirname( __FILE__ ) ); |
| 19 | + $updater->addExtensionUpdate( array( 'addTable', 'sourcetracking', |
| 20 | + "$base/sourcetracking.sql", true ) ); |
| 21 | + } else { |
| 22 | + global $wgExtNewTables; |
14 | 23 | |
15 | | - $wgExtNewTables[] = array( |
16 | | - 'sourcetracking', |
17 | | - dirname( __FILE__ ) . '/sourcetracking.sql' |
18 | | - ); |
| 24 | + $wgExtNewTables[] = array( |
| 25 | + 'sourcetracking', |
| 26 | + 'sourcetracking.sql' |
| 27 | + ); |
| 28 | + } |
19 | 29 | return true; |
20 | 30 | } |
21 | 31 | |