r77984 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77983‎ | r77984 | r77985 >
Date:15:30, 7 December 2010
Author:ialex
Status:deferred
Tags:
Comment:
Updated GeoIP extension to use the new version of the LoadExtensionSchemaUpdates hook
Modified paths:
  • /trunk/extensions/DonationInterface/GeoIP/GeoIP.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/GeoIP/GeoIP.php
@@ -43,12 +43,14 @@
4444 $wgHooks['LoadExtensionSchemaUpdates'][] = 'fnGeoIPSchema';
4545 $wgSpecialPages['GeoIP'] = 'GeoIP';
4646
47 -function fnGeoIPSchema() {
48 - global $wgExtNewTables;
49 - $wgExtNewTables[] = array(
50 - 'geoip',
51 - dirname( __FILE__ ) . '/GeoIP.sql'
52 - );
 47+function fnGeoIPSchema( $updater = null ) {
 48+ if ( $updater === null ) {
 49+ global $wgExtNewTables;
 50+ $wgExtNewTables[] = array( 'geoip', dirname( __FILE__ ) . '/GeoIP.sql' );
 51+ } else {
 52+ $updater->addExtensionUpdate( array( 'addTable', 'geoip',
 53+ dirname( __FILE__ ) . '/GeoIP.sql', true ) );
 54+ }
5355 return true;
5456 }
5557

Status & tagging log