r77115 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77114‎ | r77115 | r77116 >
Date:22:57, 22 November 2010
Author:ialex
Status:deferred
Tags:
Comment:
Converted TodoTasks extension to use the new version of the LoadExtensionSchemaUpdates hook
Modified paths:
  • /trunk/extensions/TodoTasks/TodoTasks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/TodoTasks/TodoTasks.php
@@ -62,12 +62,15 @@
6363 $wgHooks['EditPage::attemptSave'][] = 'todoSavePreparser';
6464 $wgHooks['ParserFirstCallInit'][] = 'wfTodoParserFunction_Setup';
6565
66 -function efTodoTasksSchemaUpdates() {
67 - global $wgExtNewTables;
68 -
 66+function efTodoTasksSchemaUpdates( $updater = null ) {
6967 $base = dirname(__FILE__);
7068
71 - $wgExtNewTables[] = array( 'todo', "$base/todotasks.sql" ); // Initial install tables
 69+ if ( $updater === null ) {
 70+ global $wgExtNewTables;
 71+ $wgExtNewTables[] = array( 'todo', "$base/todotasks.sql" ); // Initial install tables
 72+ } else {
 73+ $updater->addExtensionUpdate( array( 'addTable', 'todo', "$base/todotasks.sql", true ) );
 74+ }
7275
7376 return true;
7477 }

Status & tagging log