Get rid of addNewExtension()/getNewExtensions() method of adding new extensions ...
authorChad Horohoe <demon@users.mediawiki.org>
Tue, 7 Jun 2011 17:33:34 +0000 (17:33 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Tue, 7 Jun 2011 17:33:34 +0000 (17:33 +0000)
includes/installer/DatabaseInstaller.php
includes/installer/DatabaseUpdater.php

index d8e2442..87097b3 100644 (file)
@@ -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;
        }
index fddffd3..c240025 100644 (file)
@@ -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
         *