From: Sam Reed Date: Tue, 11 Oct 2011 03:57:53 +0000 (+0000) Subject: Add documentation X-Git-Tag: 1.31.0-rc.0~27154 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/fiche.php?a=commitdiff_plain;h=65bc0431b2d5e3633724f87c880087c187af1f9f;p=lhc%2Fweb%2Fwiklou.git Add documentation Add addExtensionField and addExtensionIndex utility functions --- diff --git a/includes/installer/DatabaseUpdater.php b/includes/installer/DatabaseUpdater.php index 595b1e265b..b8700dbf46 100644 --- a/includes/installer/DatabaseUpdater.php +++ b/includes/installer/DatabaseUpdater.php @@ -171,6 +171,24 @@ abstract class DatabaseUpdater { $this->extensionUpdates[] = array( 'addTable', $tableName, $sqlPath, true ); } + /** + * @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 * @@ -180,6 +198,9 @@ abstract class DatabaseUpdater { return $this->extensionUpdates; } + /** + * @return array + */ public function getPostDatabaseUpdateMaintenance() { return $this->postDatabaseUpdateMaintenance; } @@ -232,6 +253,10 @@ abstract class DatabaseUpdater { $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 @@ abstract class DatabaseUpdater { * 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 @@ abstract class DatabaseUpdater { * $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,