Index: trunk/phase3/includes/installer/DatabaseUpdater.php |
— | — | @@ -172,6 +172,24 @@ |
173 | 173 | } |
174 | 174 | |
175 | 175 | /** |
| 176 | + * @param $tableName string |
| 177 | + * @param $indexName string |
| 178 | + * @param $sqlPath string |
| 179 | + */ |
| 180 | + public function addExtensionIndex( $tableName, $indexName, $sqlPath ) { |
| 181 | + $this->extensionUpdates[] = array( 'addIndex', $tableName, $indexName, $sqlPath, true ); |
| 182 | + } |
| 183 | + |
| 184 | + /** |
| 185 | + * @param $tableName string |
| 186 | + * @param $columnName string |
| 187 | + * @param $sqlPath string |
| 188 | + */ |
| 189 | + public function addExtensionField( $tableName, $columnName, $sqlPath ) { |
| 190 | + $this->extensionUpdates[] = array( 'addField', $tableName, $columnName, $sqlPath ); |
| 191 | + } |
| 192 | + |
| 193 | + /** |
176 | 194 | * Get the list of extension-defined updates |
177 | 195 | * |
178 | 196 | * @return Array |
— | — | @@ -180,6 +198,9 @@ |
181 | 199 | return $this->extensionUpdates; |
182 | 200 | } |
183 | 201 | |
| 202 | + /** |
| 203 | + * @return array |
| 204 | + */ |
184 | 205 | public function getPostDatabaseUpdateMaintenance() { |
185 | 206 | return $this->postDatabaseUpdateMaintenance; |
186 | 207 | } |
— | — | @@ -232,6 +253,10 @@ |
233 | 254 | $this->updates = array_merge( $this->updates, $updates ); |
234 | 255 | } |
235 | 256 | |
| 257 | + /** |
| 258 | + * @param $version |
| 259 | + * @param $updates array |
| 260 | + */ |
236 | 261 | protected function setAppliedUpdates( $version, $updates = array() ) { |
237 | 262 | $this->db->clearFlag( DBO_DDLMODE ); |
238 | 263 | if( !$this->canUseNewUpdatelog() ) { |
— | — | @@ -249,6 +274,8 @@ |
250 | 275 | * Obviously, only use this for updates that occur after the updatelog table was |
251 | 276 | * created! |
252 | 277 | * @param $key String Name of the key to check for |
| 278 | + * |
| 279 | + * @return bool |
253 | 280 | */ |
254 | 281 | public function updateRowExists( $key ) { |
255 | 282 | $row = $this->db->selectRow( |
— | — | @@ -295,6 +322,8 @@ |
296 | 323 | * $wgExtNewTables/Fields/Indexes. This is nasty :) We refactored a lot |
297 | 324 | * of this in 1.17 but we want to remain back-compatible for a while. So |
298 | 325 | * load up these old global-based things into our update list. |
| 326 | + * |
| 327 | + * @return array |
299 | 328 | */ |
300 | 329 | protected function getOldGlobalUpdates() { |
301 | 330 | global $wgExtNewFields, $wgExtNewTables, $wgExtModifiedFields, |