MediaWiki  master
WebInstallerDocument.php
Go to the documentation of this file.
1 <?php
22 abstract class WebInstallerDocument extends WebInstallerPage {
23 
27  abstract protected function getFileName();
28 
29  public function execute() {
30  $text = $this->getFileContents();
31  $text = InstallDocFormatter::format( $text );
32  $this->parent->output->addWikiTextAsInterface( $text );
33  $this->startForm();
34  $this->endForm( false );
35  return '';
36  }
37 
41  public function getFileContents() {
42  $file = __DIR__ . '/../../' . $this->getFileName();
43  if ( !file_exists( $file ) ) {
44  return wfMessage( 'config-nofile', $file )->plain();
45  }
46 
47  return file_get_contents( $file );
48  }
49 
50 }
WebInstallerPage\startForm
startForm()
Definition: WebInstallerPage.php:69
WebInstallerDocument
Definition: WebInstallerDocument.php:22
$file
if(PHP_SAPI !='cli-server') if(!isset( $_SERVER['SCRIPT_FILENAME'])) $file
Item class for a filearchive table row.
Definition: router.php:42
wfMessage
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
Definition: GlobalFunctions.php:1220
WebInstallerPage\endForm
endForm( $continue='continue', $back='back')
Definition: WebInstallerPage.php:86
WebInstallerDocument\getFileName
getFileName()
WebInstallerDocument\execute
execute()
Definition: WebInstallerDocument.php:29
WebInstallerDocument\getFileContents
getFileContents()
Definition: WebInstallerDocument.php:41
InstallDocFormatter\format
static format( $text)
Definition: InstallDocFormatter.php:27
WebInstallerPage
Abstract class to define pages for the web installer.
Definition: WebInstallerPage.php:30