r92717 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92716‎ | r92717 | r92718 >
Date:00:08, 21 July 2011
Author:catrope
Status:ok
Tags:
Comment:
RL2: Add new table to Gadgets extension
Modified paths:
  • /branches/RL2/extensions/Gadgets/Gadgets.php (modified) (history)
  • /branches/RL2/extensions/Gadgets/Gadgets_body.php (modified) (history)
  • /branches/RL2/extensions/Gadgets/sql (added) (history)
  • /branches/RL2/extensions/Gadgets/sql/gadgets.sql (added) (history)

Diff [purge]

Index: branches/RL2/extensions/Gadgets/sql/gadgets.sql
@@ -0,0 +1,9 @@
 2+-- Add gadgets table
 3+
 4+CREATE TABLE /*_*/gadgets (
 5+ gd_name varchar(255) binary NOT NULL PRIMARY KEY,
 6+ gd_blob mediumblob NOT NULL,
 7+ gd_global bool NOT NULL
 8+) /*$wgDBTableOptions*/;
 9+
 10+CREATE INDEX /*i*/gd_global_name ON /*_*/gadgets (gd_global, gd_name);
Property changes on: branches/RL2/extensions/Gadgets/sql/gadgets.sql
___________________________________________________________________
Added: svn:eol-style
111 + native
Index: branches/RL2/extensions/Gadgets/Gadgets_body.php
@@ -181,6 +181,12 @@
182182 $files[] = dirname( __FILE__ ) . '/Gadgets_tests.php';
183183 return true;
184184 }
 185+
 186+ public static function loadExtensionSchemaUpdates( $updater ) {
 187+ $dir = dirname( __FILE__ );
 188+ $updater->addExtensionUpdate( array( 'addtable', 'gadgets', "$dir/sql/gadgets.sql", true ) );
 189+ return true;
 190+ }
185191 }
186192
187193 /**
Index: branches/RL2/extensions/Gadgets/Gadgets.php
@@ -32,6 +32,7 @@
3333 $wgHooks['ArticleSaveComplete'][] = 'GadgetHooks::articleSaveComplete';
3434 $wgHooks['BeforePageDisplay'][] = 'GadgetHooks::beforePageDisplay';
3535 $wgHooks['GetPreferences'][] = 'GadgetHooks::getPreferences';
 36+$wgHooks['LoadExtensionSchemaUpdates'][] = 'GadgetHooks::loadExtensionSchemaUpdates';
3637 $wgHooks['ResourceLoaderRegisterModules'][] = 'GadgetHooks::registerModules';
3738 $wgHooks['UnitTestsList'][] = 'GadgetHooks::unitTestsList';
3839

Status & tagging log