r89586 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89585‎ | r89586 | r89587 >
Date:18:35, 6 June 2011
Author:brion
Status:ok
Tags:
Comment:
Revert r89263, r89297, r89347: unclear whether this is needed; DatabaseUpdater actions list is already extensible and it might just need some rearrangement?
Modified paths:
  • /trunk/phase3/includes/installer/DatabaseUpdater.php (modified) (history)
  • /trunk/phase3/includes/installer/ExtensionUpdater.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/installer/DatabaseUpdater.php
@@ -31,12 +31,6 @@
3232 protected $extensionUpdates = array();
3333
3434 /**
35 - * List of extension-provided database updaters
36 - * @var array
37 - */
38 - protected $extensionUpdaters = array();
39 -
40 - /**
4135 * Used to hold schema files during installation process
4236 * @var array
4337 */
@@ -173,17 +167,6 @@
174168 }
175169
176170 /**
177 - * Add a updater class that will handle extensions DB install/update.
178 - * This should be called by extensions while executing the
179 - * LoadExtensionSchemaUpdates hook.
180 - *
181 - * @param $updater (string) classname (extends DatabaseUpdater).
182 - */
183 - public function addExtensionUpdater( $updater ) {
184 - $this->extensionUpdaters[] = $updater;
185 - }
186 -
187 - /**
188171 * Convenience wrapper for addExtensionUpdate() when adding a new table (which
189172 * is the most common usage of updaters in an extension)
190173 * @param $tableName String Name of table to create
@@ -219,15 +202,6 @@
220203 return $this->extensionUpdates;
221204 }
222205
223 - /**
224 - * Get the list of extension-defined updaters
225 - *
226 - * @return Array
227 - */
228 - protected function getExtensionUpdaters() {
229 - return $this->extensionUpdaters;
230 - }
231 -
232206 public function getPostDatabaseUpdateMaintenance() {
233207 return $this->postDatabaseUpdateMaintenance;
234208 }
@@ -247,10 +221,6 @@
248222 if ( isset( $what['extensions'] ) ) {
249223 $this->runUpdates( $this->getOldGlobalUpdates(), false );
250224 $this->runUpdates( $this->getExtensionUpdates(), true );
251 - foreach ( $this->getExtensionUpdaters() as $updaterClass ) {
252 - $eupdater = new $updaterClass( $this );
253 - $eupdater->doUpdates();
254 - }
255225 }
256226
257227 $this->setAppliedUpdates( $wgVersion, $this->updates );
Index: trunk/phase3/includes/installer/ExtensionUpdater.php
@@ -1,16 +0,0 @@
2 -<?php
3 -
4 -class ExtensionUpdater extends DatabaseUpdater {
5 -
6 - // overload the constructor, so the init and hooks don't get called
7 - // while still have all the patching code without duplicating
8 - public function __construct( DatabaseBase &$db, $shared, Maintenance $maintenance = null ) {
9 - $this->db = $db;
10 - $this->shared = $shared;
11 - $this->maintenance = $maintenance;
12 - }
13 -
14 - public function doUpdates() {
15 - $this->runUpdates( $this->getCoreUpdateList(), false );
16 - }
17 -}

Follow-up revisions

RevisionCommit summaryAuthorDate
r89593Follow-up r89586: actually delete the filemaxsem19:23, 6 June 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r89263* suggestion for ExtensionUpdater that would handle DB install/update of exte...freakolowsky15:15, 1 June 2011
r89297Not silly, but parser error (r89263)... fixing...platonides22:04, 1 June 2011
r89347Fix for r89263: this to $thisplatonides16:10, 2 June 2011

Status & tagging log