r76247 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76246‎ | r76247 | r76248 >
Date:14:33, 7 November 2010
Author:ialex
Status:deferred
Tags:
Comment:
* Converted WhosOnline extension to use the new version of the LoadExtensionSchemaUpdates hook
* Fixed SQL schema
Modified paths:
  • /trunk/extensions/WhosOnline/WhosOnline.php (modified) (history)
  • /trunk/extensions/WhosOnline/whosonline.sql (modified) (history)

Diff [purge]

Index: trunk/extensions/WhosOnline/whosonline.sql
@@ -1,7 +1,7 @@
2 -CREATE TABLE /*$wgDBprefix*/online (
 2+CREATE TABLE /*_*/online (
33 `userid` int(5) NOT NULL default '0',
44 `username` varchar(255) NOT NULL default '',
55 `timestamp` char(14) NOT NULL default '',
66 PRIMARY KEY USING HASH (`userid`, `username`),
77 INDEX USING BTREE (`timestamp`)
8 -) TYPE=MEMORY;
\ No newline at end of file
 8+) ENGINE=MEMORY;
\ No newline at end of file
Index: trunk/extensions/WhosOnline/WhosOnline.php
@@ -62,10 +62,14 @@
6363 // Register database operations
6464 $wgHooks['LoadExtensionSchemaUpdates'][] = 'wfWhosOnlineCheckSchema';
6565
66 -function wfWhosOnlineCheckSchema() {
67 - global $wgExtNewTables;
68 - $wgExtNewTables[] = array( 'online',
69 - dirname( __FILE__ ) . '/whosonline.sql' );
70 - // Continue
 66+function wfWhosOnlineCheckSchema( $updater = null ) {
 67+ if ( $updater === null ) {
 68+ global $wgExtNewTables;
 69+ $wgExtNewTables[] = array( 'online',
 70+ dirname( __FILE__ ) . '/whosonline.sql' );
 71+ } else {
 72+ $updater->addExtensionUpdate( array( 'addTable', 'online',
 73+ dirname( __FILE__ ) . '/whosonline.sql', true ) );
 74+ }
7175 return true;
7276 }

Status & tagging log