Tweak install steps to be on the POST rather than GET. It makes more sense architectu...
authorChad Horohoe <demon@users.mediawiki.org>
Sun, 30 Jan 2011 18:21:37 +0000 (18:21 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Sun, 30 Jan 2011 18:21:37 +0000 (18:21 +0000)
includes/installer/Installer.i18n.php
includes/installer/WebInstallerPage.php

index 80bc7e7..dacecf0 100644 (file)
@@ -438,6 +438,8 @@ Should be separated with commas and specify the port to be used (for example: 12
 They may require additional configuration, but you can enable them now',
        'config-install-alreadydone'      => "'''Warning:''' You seem to have already installed MediaWiki and are trying to install it again.
 Please proceed to the next page.",
+       'config-install-begin'            => 'By pressing next, you will begin the installation of MediaWiki.
+If you still want to make changes, press back.',
        'config-install-step-done'        => 'done',
        'config-install-step-failed'      => 'failed',
        'config-install-extensions'       => 'Including extensions',
index 9fa81f4..902b620 100644 (file)
@@ -1009,25 +1009,29 @@ class WebInstaller_Options extends WebInstallerPage {
 class WebInstaller_Install extends WebInstallerPage {
 
        public function execute() {
-               if( $this->parent->request->wasPosted() ) {
-                       return 'continue';
-               } elseif( $this->getVar( '_InstallDone' ) ) {
-                       $this->startForm();
-                       $status = new Status();
-                       $status->warning( 'config-install-alreadydone' );
-                       $this->parent->showStatusBox( $status );
-               } elseif( $this->getVar( '_UpgradeDone' ) ) {
+               if( $this->getVar( '_UpgradeDone' ) ) {
                        return 'skip';
-               } else {
+               } elseif( $this->getVar( '_InstallDone' ) ) {
+                       return 'continue';
+               } elseif( $this->parent->request->wasPosted() ) {
                        $this->startForm();
                        $this->addHTML("<ul>");
-                       $this->parent->performInstallation(
+                       $results = $this->parent->performInstallation(
                                array( $this, 'startStage'),
                                array( $this, 'endStage' )
                        );
                        $this->addHTML("</ul>");
+                       // PerformInstallation bails on a fatal, so make sure the last item
+                       // completed before giving 'next.' Likewise, only provide back on failure
+                       $lastStep = end( $results );
+                       $continue = $lastStep->isOK() ? 'continue' : false;
+                       $back = $lastStep->isOK() ? false : 'back';
+                       $this->endForm( $continue, $back );
+               } else {
+                       $this->startForm();
+                       $this->addHTML( $this->parent->getInfoBox( wfMsgNoTrans( 'config-install-begin' ) ) );
+                       $this->endForm();
                }
-               $this->endForm();
                return true;
        }