X-Git-Url: https://scripts.mit.edu/gitweb/autoinstallsdev/mediawiki.git/blobdiff_plain/19e297c21b10b1b8a3acad5e73fc71dcb35db44a..6932310fd58ebef145fa01eb76edf7150284d8ea:/includes/installer/WebInstallerInstall.php
diff --git a/includes/installer/WebInstallerInstall.php b/includes/installer/WebInstallerInstall.php
new file mode 100644
index 00000000..63740e38
--- /dev/null
+++ b/includes/installer/WebInstallerInstall.php
@@ -0,0 +1,95 @@
+getVar( '_UpgradeDone' ) ) {
+ return 'skip';
+ } elseif ( $this->getVar( '_InstallDone' ) ) {
+ return 'continue';
+ } elseif ( $this->parent->request->wasPosted() ) {
+ $this->startForm();
+ $this->addHTML( "
" );
+ $results = $this->parent->performInstallation(
+ [ $this, 'startStage' ],
+ [ $this, 'endStage' ]
+ );
+ $this->addHTML( "
" );
+ // 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( wfMessage( 'config-install-begin' )->plain() ) );
+ $this->endForm();
+ }
+
+ return true;
+ }
+
+ /**
+ * @param string $step
+ */
+ public function startStage( $step ) {
+ // Messages: config-install-database, config-install-tables, config-install-interwiki,
+ // config-install-stats, config-install-keys, config-install-sysop, config-install-mainpage
+ $this->addHTML( "" . wfMessage( "config-install-$step" )->escaped() .
+ wfMessage( 'ellipsis' )->escaped() );
+
+ if ( $step == 'extension-tables' ) {
+ $this->startLiveBox();
+ }
+ }
+
+ /**
+ * @param string $step
+ * @param Status $status
+ */
+ public function endStage( $step, $status ) {
+ if ( $step == 'extension-tables' ) {
+ $this->endLiveBox();
+ }
+ $msg = $status->isOK() ? 'config-install-step-done' : 'config-install-step-failed';
+ $html = wfMessage( 'word-separator' )->escaped() . wfMessage( $msg )->escaped();
+ if ( !$status->isOK() ) {
+ $html = "$html";
+ }
+ $this->addHTML( $html . "\n" );
+ if ( !$status->isGood() ) {
+ $this->parent->showStatusBox( $status );
+ }
+ }
+
+}