r81211 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81210‎ | r81211 | r81212 >
Date:18:21, 30 January 2011
Author:demon
Status:ok (Comments)
Tags:
Comment:
Tweak install steps to be on the POST rather than GET. It makes more sense architecturally. It also gives us one last chance for them to say no (in case they clicked "I'm bored already" but changed their minds). Check final step of installer for fatals, and if everything's good, suppress the back button. It's just going to confuse people. And the opposite, suppress continue on fatals...no need pretending things went dandy if they didn't. It's basically now impossible to re-run 'page=Install' after it completes. This is probably a good thing as it throws errors. Coincidentally this also fixes bug 26947.
Modified paths:
  • /trunk/phase3/includes/installer/Installer.i18n.php (modified) (history)
  • /trunk/phase3/includes/installer/WebInstallerPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/installer/Installer.i18n.php
@@ -438,6 +438,8 @@
439439 They may require additional configuration, but you can enable them now',
440440 'config-install-alreadydone' => "'''Warning:''' You seem to have already installed MediaWiki and are trying to install it again.
441441 Please proceed to the next page.",
 442+ 'config-install-begin' => 'By pressing next, you will begin the installation of MediaWiki.
 443+If you still want to make changes, press back.',
442444 'config-install-step-done' => 'done',
443445 'config-install-step-failed' => 'failed',
444446 'config-install-extensions' => 'Including extensions',
Index: trunk/phase3/includes/installer/WebInstallerPage.php
@@ -1009,25 +1009,29 @@
10101010 class WebInstaller_Install extends WebInstallerPage {
10111011
10121012 public function execute() {
1013 - if( $this->parent->request->wasPosted() ) {
 1013+ if( $this->getVar( '_UpgradeDone' ) ) {
 1014+ return 'skip';
 1015+ } elseif( $this->getVar( '_InstallDone' ) ) {
10141016 return 'continue';
1015 - } elseif( $this->getVar( '_InstallDone' ) ) {
 1017+ } elseif( $this->parent->request->wasPosted() ) {
10161018 $this->startForm();
1017 - $status = new Status();
1018 - $status->warning( 'config-install-alreadydone' );
1019 - $this->parent->showStatusBox( $status );
1020 - } elseif( $this->getVar( '_UpgradeDone' ) ) {
1021 - return 'skip';
1022 - } else {
1023 - $this->startForm();
10241019 $this->addHTML("<ul>");
1025 - $this->parent->performInstallation(
 1020+ $results = $this->parent->performInstallation(
10261021 array( $this, 'startStage'),
10271022 array( $this, 'endStage' )
10281023 );
10291024 $this->addHTML("</ul>");
 1025+ // PerformInstallation bails on a fatal, so make sure the last item
 1026+ // completed before giving 'next.' Likewise, only provide back on failure
 1027+ $lastStep = end( $results );
 1028+ $continue = $lastStep->isOK() ? 'continue' : false;
 1029+ $back = $lastStep->isOK() ? false : 'back';
 1030+ $this->endForm( $continue, $back );
 1031+ } else {
 1032+ $this->startForm();
 1033+ $this->addHTML( $this->parent->getInfoBox( wfMsgNoTrans( 'config-install-begin' ) ) );
 1034+ $this->endForm();
10301035 }
1031 - $this->endForm();
10321036 return true;
10331037 }
10341038

Follow-up revisions

RevisionCommit summaryAuthorDate
r814111.17: MFT r81186, r81187, r81197, r81209, r81210, r81211, r81215, r81238, r81...catrope20:23, 2 February 2011

Comments

#Comment by Nikerabbit (talk | contribs)   22:05, 30 January 2011
'config-install-begin'            => 'By pressing next, you will begin the installation of MediaWiki.

-> Click next to install MediaWiki.

Status & tagging log