(bug 28237) Installer doesn't create extension tables
authorMax Semenik <maxsem@users.mediawiki.org>
Wed, 30 Mar 2011 17:32:20 +0000 (17:32 +0000)
committerMax Semenik <maxsem@users.mediawiki.org>
Wed, 30 Mar 2011 17:32:20 +0000 (17:32 +0000)
includes/installer/DatabaseInstaller.php
includes/installer/DatabaseUpdater.php
includes/installer/OracleUpdater.php
includes/installer/WebInstallerPage.php

index 9e8d05c..3594f35 100644 (file)
@@ -202,6 +202,10 @@ abstract class DatabaseInstaller {
                                }
                        }
                }
+
+               // Now run updates to create tables for old extensions
+               $updater->doUpdates( array( 'extensions' ) );
+
                return $status;
        }
 
index abcea33..ad39bee 100644 (file)
@@ -189,21 +189,29 @@ abstract class DatabaseUpdater {
        /**
         * Do all the updates
         *
+        * @param $what Array: what updates to perform
         * @param $purge Boolean: whether to clear the objectcache table after updates
         */
-       public function doUpdates( $purge = true ) {
+       public function doUpdates( $what = array( 'core', 'extensions', 'purge' ) ) {
                global $wgVersion;
 
-               $this->runUpdates( $this->getCoreUpdateList(), false );
-               $this->runUpdates( $this->getOldGlobalUpdates(), false );
-               $this->runUpdates( $this->getExtensionUpdates(), true );
+               $what = array_flip( $what );
+               if ( isset( $what['core'] ) ) {
+                       $this->runUpdates( $this->getCoreUpdateList(), false );
+               }
+               if ( isset( $what['extensions'] ) ) {
+                       $this->runUpdates( $this->getOldGlobalUpdates(), false );
+                       $this->runUpdates( $this->getExtensionUpdates(), true );
+               }
 
                $this->setAppliedUpdates( $wgVersion, $this->updates );
 
-               if( $purge ) {
+               if( isset( $what['purge'] ) ) {
                        $this->purgeCache();
                }
-               $this->checkStats();
+               if ( isset( $what['core'] ) ) {
+                       $this->checkStats();
+               }
        }
 
        /**
index cb41e8e..331c798 100644 (file)
@@ -83,8 +83,8 @@ class OracleUpdater extends DatabaseUpdater {
        /**
         * Overload: after this action field info table has to be rebuilt
         */
-       public function doUpdates( $purge = true ) {
-               parent::doUpdates();
+       public function doUpdates( $what = array( 'core', 'extensions', 'purge' ) ) {
+               parent::doUpdates( $what );
 
                $this->db->query( 'BEGIN fill_wiki_info; END;' );
        }
index 38b12d5..1d3daf2 100644 (file)
@@ -114,6 +114,27 @@ abstract class WebInstallerPage {
        protected function getFieldsetEnd() {
                return "</fieldset>\n";
        }
+
+       /**
+        * Opens a textarea used to display the progress of a long operation
+        */
+       protected function startLiveBox() {
+               $this->addHTML(
+                       '<div id="config-spinner" style="display:none;"><img src="../skins/common/images/ajax-loader.gif" /></div>' .
+                       '<script>jQuery( "#config-spinner" ).show();</script>' .
+                       '<textarea id="config-live-log" name="LiveLog" rows="10" cols="30" readonly="readonly">'
+               );
+               $this->parent->output->flush();
+       }
+
+       /**
+        * Opposite to startLiveBox()
+        */
+       protected function endLiveBox() {
+               $this->addHTML( '</textarea>
+<script>jQuery( "#config-spinner" ).hide()</script>' );
+               $this->parent->output->flush();
+       }
 }
 
 class WebInstaller_Language extends WebInstallerPage {
@@ -464,16 +485,11 @@ class WebInstaller_Upgrade extends WebInstallerPage {
 
                if ( $this->parent->request->wasPosted() ) {
                        $installer->preUpgrade();
-                       $this->addHTML(
-                               '<div id="config-spinner" style="display:none;"><img src="../skins/common/images/ajax-loader.gif" /></div>' .
-                               '<script>jQuery( "#config-spinner" ).show();</script>' .
-                               '<textarea id="config-update-log" name="UpdateLog" rows="10" readonly="readonly">'
-                       );
-                       $this->parent->output->flush();
+
+                       $this->startLiveBox();
                        $result = $installer->doUpgrade();
-                       $this->addHTML( '</textarea>
-<script>jQuery( "#config-spinner" ).hide()</script>' );
-                       $this->parent->output->flush();
+                       $this->endLiveBox();
+
                        if ( $result ) {
                                // If they're going to possibly regenerate LocalSettings, we
                                // need to create the upgrade/secret keys. Bug 26481
@@ -1081,9 +1097,15 @@ class WebInstaller_Install extends WebInstallerPage {
 
        public function startStage( $step ) {
                $this->addHTML( "<li>" . wfMsgHtml( "config-install-$step" ) . wfMsg( 'ellipsis') );
+               if ( $step == 'extension-tables' ) {
+                       $this->startLiveBox();
+               }
        }
 
        public function endStage( $step, $status ) {
+               if ( $step == 'extension-tables' ) {
+                       $this->endLiveBox();
+               }
                $msg = $status->isOk() ? 'config-install-step-done' : 'config-install-step-failed';
                $html = wfMsgHtml( 'word-separator' ) . wfMsgHtml( $msg );
                if ( !$status->isOk() ) {