From e54a7056e9fc7bb991143299e610e8d7902ee8fd Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Tue, 7 Jun 2011 17:33:34 +0000 Subject: [PATCH] Get rid of addNewExtension()/getNewExtensions() method of adding new extensions (added in r81266). Since r85021, this isn't necessary because we run old updates like we should. Fix the 3 extensions using it. Reverts most of r81266, all of r84868, tiny part of r86741. Also ping r89653 which is what caused me to look at this again. --- includes/installer/DatabaseInstaller.php | 19 +------------------ includes/installer/DatabaseUpdater.php | 23 ----------------------- 2 files changed, 1 insertion(+), 41 deletions(-) diff --git a/includes/installer/DatabaseInstaller.php b/includes/installer/DatabaseInstaller.php index d8e24421e2..87097b31eb 100644 --- a/includes/installer/DatabaseInstaller.php +++ b/includes/installer/DatabaseInstaller.php @@ -183,26 +183,9 @@ abstract class DatabaseInstaller { if ( !$status->isOK() ) { return $status; } - $updater = DatabaseUpdater::newForDB( $this->db ); - $extensionUpdates = $updater->getNewExtensions(); - - $ourExtensions = array_map( 'strtolower', $this->getVar( '_Extensions' ) ); - - foreach( $ourExtensions as $ext ) { - if( isset( $extensionUpdates[$ext] ) ) { - $this->db->begin( __METHOD__ ); - $error = $this->db->sourceFile( $extensionUpdates[$ext] ); - if( $error !== true ) { - $this->db->rollback( __METHOD__ ); - $status->warning( 'config-install-tables-failed', $error ); - } else { - $this->db->commit( __METHOD__ ); - } - } - } // Now run updates to create tables for old extensions - $updater->doUpdates( array( 'extensions' ) ); + DatabaseUpdater::newForDB( $this->db )->doUpdates( array( 'extensions' ) ); return $status; } diff --git a/includes/installer/DatabaseUpdater.php b/includes/installer/DatabaseUpdater.php index fddffd35b6..c240025744 100644 --- a/includes/installer/DatabaseUpdater.php +++ b/includes/installer/DatabaseUpdater.php @@ -30,12 +30,6 @@ abstract class DatabaseUpdater { */ protected $extensionUpdates = array(); - /** - * Used to hold schema files during installation process - * @var array - */ - protected $newExtensions = array(); - /** * Handle to the database subclass * @@ -176,23 +170,6 @@ abstract class DatabaseUpdater { $this->extensionUpdates[] = array( 'addTable', $tableName, $sqlPath, true ); } - /** - * Add a brand new extension to MediaWiki. Used during the initial install - * @param $ext String Name of extension - * @param $sqlPath String Full path to the schema file - */ - public function addNewExtension( $ext, $sqlPath ) { - $this->newExtensions[ strtolower( $ext ) ] = $sqlPath; - } - - /** - * Get the list of extensions that registered a schema with our DB type - * @return array - */ - public function getNewExtensions() { - return $this->newExtensions; - } - /** * Get the list of extension-defined updates * -- 2.20.1