Index: trunk/extensions/WhosOnline/WhosOnline.php |
— | — | @@ -55,3 +55,17 @@ |
56 | 56 | |
57 | 57 | return true; |
58 | 58 | } |
| 59 | + |
| 60 | +// Register database operations |
| 61 | +$wgHooks['LoadExtensionSchemaUpdates'][] = 'wfWhosOnlineCheckSchema'; |
| 62 | + |
| 63 | +function wfWhosOnlineCheckSchema() { |
| 64 | + // Get a connection |
| 65 | + $db = wfGetDB( DB_MASTER ); |
| 66 | + // Create table if it doesn't exist |
| 67 | + if ( !$db->tableExists( 'online' ) ) { |
| 68 | + $db->sourceFile( dirname( __FILE__ ) . '/whosonline.sql' ); |
| 69 | + } |
| 70 | + // Continue |
| 71 | + return true; |
| 72 | +} |