http://www.mediawiki.org/wiki/Special:Code/MediaWiki/99461
Revision: 99461
Author: reedy
Date: 2011-10-11 03:57:53 +0000 (Tue, 11 Oct 2011)
Log Message:
-----------
Add documentation
Add addExtensionField and addExtensionIndex utility functions
Modified Paths:
--------------
trunk/phase3/includes/installer/DatabaseUpdater.php
Modified: trunk/phase3/includes/installer/DatabaseUpdater.php
===================================================================
--- trunk/phase3/includes/installer/DatabaseUpdater.php 2011-10-11 03:49:40 UTC
(rev 99460)
+++ trunk/phase3/includes/installer/DatabaseUpdater.php 2011-10-11 03:57:53 UTC
(rev 99461)
@@ -172,6 +172,24 @@
}
/**
+ * @param $tableName string
+ * @param $indexName string
+ * @param $sqlPath string
+ */
+ public function addExtensionIndex( $tableName, $indexName, $sqlPath ) {
+ $this->extensionUpdates[] = array( 'addIndex', $tableName,
$indexName, $sqlPath, true );
+ }
+
+ /**
+ * @param $tableName string
+ * @param $columnName string
+ * @param $sqlPath string
+ */
+ public function addExtensionField( $tableName, $columnName, $sqlPath ) {
+ $this->extensionUpdates[] = array( 'addField', $tableName,
$columnName, $sqlPath );
+ }
+
+ /**
* Get the list of extension-defined updates
*
* @return Array
@@ -180,6 +198,9 @@
return $this->extensionUpdates;
}
+ /**
+ * @return array
+ */
public function getPostDatabaseUpdateMaintenance() {
return $this->postDatabaseUpdateMaintenance;
}
@@ -232,6 +253,10 @@
$this->updates = array_merge( $this->updates, $updates );
}
+ /**
+ * @param $version
+ * @param $updates array
+ */
protected function setAppliedUpdates( $version, $updates = array() ) {
$this->db->clearFlag( DBO_DDLMODE );
if( !$this->canUseNewUpdatelog() ) {
@@ -249,6 +274,8 @@
* Obviously, only use this for updates that occur after the updatelog
table was
* created!
* @param $key String Name of the key to check for
+ *
+ * @return bool
*/
public function updateRowExists( $key ) {
$row = $this->db->selectRow(
@@ -295,6 +322,8 @@
* $wgExtNewTables/Fields/Indexes. This is nasty :) We refactored a lot
* of this in 1.17 but we want to remain back-compatible for a while. So
* load up these old global-based things into our update list.
+ *
+ * @return array
*/
protected function getOldGlobalUpdates() {
global $wgExtNewFields, $wgExtNewTables, $wgExtModifiedFields,
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs