4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 * http://www.gnu.org/copyleft/gpl.html
23 namespace MediaWiki\Installer
;
25 use MediaWiki\Installer\Task\Task
;
26 use MediaWiki\Status\Status
;
28 class WebInstallerInstall
extends WebInstallerPage
{
31 * @return bool Always true.
33 public function isSlow() {
40 public function execute() {
41 if ( $this->getVar( '_UpgradeDone' ) ) {
43 } elseif ( $this->getVar( '_InstallDone' ) ) {
45 } elseif ( $this->parent
->request
->wasPosted() ) {
47 $this->addHTML( "<ul>" );
48 $status = $this->parent
->performInstallation(
49 [ $this, 'startStage' ],
52 $this->addHTML( "</ul>" );
53 $continue = $status->isOK() ?
'continue' : false;
54 $back = $status->isOK() ?
false : 'back';
55 $this->endForm( $continue, $back );
58 $this->addHTML( $this->parent
->getInfoBox( wfMessage( 'config-install-begin' )->plain() ) );
68 public function startStage( $task ) {
69 $this->addHTML( "<li>" . $task->getDescriptionMessage()->escaped() .
70 wfMessage( 'ellipsis' )->escaped() );
72 if ( $task->getName() == 'extension-tables' ) {
73 $this->startLiveBox();
79 * @param Status $status
81 public function endStage( $task, $status ) {
82 if ( $task->getName() == 'extension-tables' ) {
85 $msg = $status->isOK() ?
'config-install-step-done' : 'config-install-step-failed';
86 $html = wfMessage( 'word-separator' )->escaped() . wfMessage( $msg )->escaped();
87 if ( !$status->isOK() ) {
88 $html = "<span class=\"error\">$html</span>";
90 $this->addHTML( $html . "</li>\n" );
91 if ( !$status->isGood() ) {
92 $this->parent
->showStatusBox( $status );