r79537 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79536‎ | r79537 | r79538 >
Date:23:56, 3 January 2011
Author:demon
Status:ok
Tags:
Comment:
Add new addExtensionTable() wrapper for adding new tables for extensions: way easier than remembering array syntax for addExtensionUpdate()
Modified paths:
  • /trunk/phase3/includes/installer/DatabaseUpdater.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/installer/DatabaseUpdater.php
@@ -128,7 +128,7 @@
129129 * first item is the callback function, it also can be a
130130 * simple string with the name of a function in this class,
131131 * following elements are parameters to the function.
132 - * Note that callback functions will recieve this object as
 132+ * Note that callback functions will receive this object as
133133 * first parameter.
134134 */
135135 public function addExtensionUpdate( Array $update ) {
@@ -136,6 +136,16 @@
137137 }
138138
139139 /**
 140+ * Convenience wrapper for addExtensionUpdate() when adding a new table (which
 141+ * is the most common usage of updaters in an extension)
 142+ * @param $tableName String Name of table to create
 143+ * @param $sqlPath String Full path to the schema file
 144+ */
 145+ public function addExtensionTable( $tableName, $sqlPath ) {
 146+ $this->extensionUpdates[] = array( 'addTable', $tableName, $sqlPath, true );
 147+ }
 148+
 149+ /**
140150 * Get the list of extension-defined updates
141151 *
142152 * @return Array

Follow-up revisions

RevisionCommit summaryAuthorDate
r79538Use r79537 in PureWikiDeletion (r79516 is where I spotted this and had the aw...demon23:58, 3 January 2011
r801901.17: MFT first batch of installer changes: r78043, r78231, r78259, r78300, r...catrope20:47, 13 January 2011

Status & tagging log