MediaWiki master
WebInstallerInstall.php
Go to the documentation of this file.
1<?php
2
9namespace MediaWiki\Installer;
10
13
15
19 public function isSlow() {
20 return true;
21 }
22
26 public function execute() {
27 if ( $this->getVar( '_UpgradeDone' ) ) {
28 return 'skip';
29 } elseif ( $this->getVar( '_InstallDone' ) ) {
30 return 'continue';
31 } elseif ( $this->parent->request->wasPosted() ) {
32 $this->startForm();
33 $this->addHTML( "<ul>" );
34 $status = $this->parent->performInstallation(
35 $this->startStage( ... ),
36 $this->endStage( ... )
37 );
38 $this->addHTML( "</ul>" );
39 $continue = $status->isOK() ? 'continue' : false;
40 $back = $status->isOK() ? false : 'back';
41 $this->endForm( $continue, $back );
42 } else {
43 $this->startForm();
44 $this->addHTML( $this->parent->getInfoBox( wfMessage( 'config-install-begin' )->plain() ) );
45 $this->endForm();
46 }
47
48 return true;
49 }
50
54 public function startStage( $task ) {
55 $this->addHTML( "<li>" . $task->getDescriptionMessage()->escaped() .
56 wfMessage( 'ellipsis' )->escaped() );
57
58 if ( $task->getName() == 'extension-tables' ) {
59 $this->startLiveBox();
60 }
61 }
62
67 public function endStage( $task, $status ) {
68 if ( $task->getName() == 'extension-tables' ) {
69 $this->endLiveBox();
70 }
71 $msg = $status->isOK() ? 'config-install-step-done' : 'config-install-step-failed';
72 $html = wfMessage( 'word-separator' )->escaped() . wfMessage( $msg )->escaped();
73 if ( !$status->isOK() ) {
74 $html = "<span class=\"error\">$html</span>";
75 }
76 $this->addHTML( $html . "</li>\n" );
77 if ( !$status->isGood() ) {
78 $this->parent->showStatusBox( $status );
79 }
80 }
81
82}
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
Base class for installer tasks.
Definition Task.php:24
Abstract class to define pages for the web installer.
endForm( $continue='continue', $back='back')
startLiveBox()
Opens a textarea used to display the progress of a long operation.
endLiveBox()
Opposite to WebInstallerPage::startLiveBox.
Generic operation result class Has warning/error list, boolean status and arbitrary value.
Definition Status.php:44