MediaWiki master
WebInstallerInstall.php
Go to the documentation of this file.
1<?php
2
23namespace MediaWiki\Installer;
24
27
29
33 public function isSlow() {
34 return true;
35 }
36
40 public function execute() {
41 if ( $this->getVar( '_UpgradeDone' ) ) {
42 return 'skip';
43 } elseif ( $this->getVar( '_InstallDone' ) ) {
44 return 'continue';
45 } elseif ( $this->parent->request->wasPosted() ) {
46 $this->startForm();
47 $this->addHTML( "<ul>" );
48 $status = $this->parent->performInstallation(
49 [ $this, 'startStage' ],
50 [ $this, 'endStage' ]
51 );
52 $this->addHTML( "</ul>" );
53 $continue = $status->isOK() ? 'continue' : false;
54 $back = $status->isOK() ? false : 'back';
55 $this->endForm( $continue, $back );
56 } else {
57 $this->startForm();
58 $this->addHTML( $this->parent->getInfoBox( wfMessage( 'config-install-begin' )->plain() ) );
59 $this->endForm();
60 }
61
62 return true;
63 }
64
68 public function startStage( $task ) {
69 $this->addHTML( "<li>" . $task->getDescriptionMessage()->escaped() .
70 wfMessage( 'ellipsis' )->escaped() );
71
72 if ( $task->getName() == 'extension-tables' ) {
73 $this->startLiveBox();
74 }
75 }
76
81 public function endStage( $task, $status ) {
82 if ( $task->getName() == 'extension-tables' ) {
83 $this->endLiveBox();
84 }
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>";
89 }
90 $this->addHTML( $html . "</li>\n" );
91 if ( !$status->isGood() ) {
92 $this->parent->showStatusBox( $status );
93 }
94 }
95
96}
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:54