Index: trunk/extensions/CollabWatchlist/CollabWatchlist.php |
— | — | @@ -45,30 +45,29 @@ |
46 | 46 | $wgHooks['LoadExtensionSchemaUpdates'][] = 'fnCollabWatchlistDbSchema'; |
47 | 47 | $wgHooks['GetPreferences'][] = 'fnCollabWatchlistPreferences'; |
48 | 48 | |
49 | | -function fnCollabWatchlistDbSchema() { |
50 | | - global $updater; |
51 | | - $wgSql = dirname(__FILE__) . '/sql/'; |
| 49 | +function fnCollabWatchlistDbSchema( $updater = null ) { |
| 50 | + $sqlDir = dirname(__FILE__) . '/sql/'; |
52 | 51 | if ( $updater === null ) { // <= 1.16 support |
53 | 52 | global $wgExtNewTables, $wgExtNewFields; |
54 | | - $wgExtNewTables[] = array('collabwatchlist', $wgSql . 'collabwatchlist.sql'); |
55 | | - $wgExtNewTables[] = array('collabwatchlistuser', $wgSql . 'collabwatchlistuser.sql'); |
56 | | - $wgExtNewTables[] = array('collabwatchlistcategory', $wgSql . 'collabwatchlistcategory.sql'); |
57 | | - $wgExtNewTables[] = array('collabwatchlistrevisiontag', $wgSql . 'collabwatchlistrevisiontag.sql'); |
58 | | - $wgExtNewTables[] = array('collabwatchlisttag', $wgSql . 'collabwatchlisttag.sql'); |
59 | | - $wgExtNewFields[] = array('collabwatchlistrevisiontag', 'ct_rc_id', $wgSql . 'patch-collabwatchlist_noctid.sql'); |
| 53 | + $wgExtNewTables[] = array('collabwatchlist', $sqlDir . 'collabwatchlist.sql'); |
| 54 | + $wgExtNewTables[] = array('collabwatchlistuser', $sqlDir . 'collabwatchlistuser.sql'); |
| 55 | + $wgExtNewTables[] = array('collabwatchlistcategory', $sqlDir . 'collabwatchlistcategory.sql'); |
| 56 | + $wgExtNewTables[] = array('collabwatchlistrevisiontag', $sqlDir . 'collabwatchlistrevisiontag.sql'); |
| 57 | + $wgExtNewTables[] = array('collabwatchlisttag', $sqlDir . 'collabwatchlisttag.sql'); |
| 58 | + $wgExtNewFields[] = array('collabwatchlistrevisiontag', 'ct_rc_id', $sqlDir . 'patch-collabwatchlist_noctid.sql'); |
60 | 59 | } else { // >= 1.17 support |
61 | 60 | $updater->addExtensionUpdate( array ( 'addTable', 'collabwatchlist', |
62 | | - $wgSql . 'collabwatchlist.sql', true ) ); |
| 61 | + $sqlDir . 'collabwatchlist.sql', true ) ); |
63 | 62 | $updater->addExtensionUpdate( array ( 'addTable', 'collabwatchlistuser', |
64 | | - $wgSql . 'collabwatchlistuser.sql', true ) ); |
| 63 | + $sqlDir . 'collabwatchlistuser.sql', true ) ); |
65 | 64 | $updater->addExtensionUpdate( array ( 'addTable', 'collabwatchlistcategory', |
66 | | - $wgSql . 'collabwatchlistcategory.sql', true ) ); |
| 65 | + $sqlDir . 'collabwatchlistcategory.sql', true ) ); |
67 | 66 | $updater->addExtensionUpdate( array ( 'addTable', 'collabwatchlistrevisiontag', |
68 | | - $wgSql . 'collabwatchlistrevisiontag.sql', true ) ); |
| 67 | + $sqlDir . 'collabwatchlistrevisiontag.sql', true ) ); |
69 | 68 | $updater->addExtensionUpdate( array ( 'addTable', 'collabwatchlisttag', |
70 | | - $wgSql . 'collabwatchlisttag.sql', true ) ); |
| 69 | + $sqlDir . 'collabwatchlisttag.sql', true ) ); |
71 | 70 | $updater->addExtensionUpdate( array( 'modifyField', 'collabwatchlistrevisiontag', 'ct_rc_id', |
72 | | - $wgSql . 'patch-collabwatchlist_noctid.sql', true ) ); |
| 71 | + $sqlDir . 'patch-collabwatchlist_noctid.sql', true ) ); |
73 | 72 | } |
74 | 73 | return true; |
75 | 74 | } |