Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 10 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| WebInstallerDocument | |
0.00% |
0 / 10 |
|
0.00% |
0 / 2 |
12 | |
0.00% |
0 / 1 |
| getFileName | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | |||||
| execute | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 | |||
| getFileContents | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * @license GPL-2.0-or-later |
| 4 | * @file |
| 5 | * @ingroup Installer |
| 6 | */ |
| 7 | |
| 8 | namespace MediaWiki\Installer; |
| 9 | |
| 10 | abstract class WebInstallerDocument extends WebInstallerPage { |
| 11 | |
| 12 | /** |
| 13 | * @return string |
| 14 | */ |
| 15 | abstract protected function getFileName(); |
| 16 | |
| 17 | /** @inheritDoc */ |
| 18 | public function execute() { |
| 19 | $text = $this->getFileContents(); |
| 20 | $text = InstallDocFormatter::format( $text ); |
| 21 | $this->parent->output->addWikiTextAsInterface( $text ); |
| 22 | $this->startForm(); |
| 23 | $this->endForm( false ); |
| 24 | return ''; |
| 25 | } |
| 26 | |
| 27 | /** |
| 28 | * @return string |
| 29 | */ |
| 30 | public function getFileContents() { |
| 31 | $file = __DIR__ . '/../../' . $this->getFileName(); |
| 32 | if ( !file_exists( $file ) ) { |
| 33 | return wfMessage( 'config-nofile', $file )->plain(); |
| 34 | } |
| 35 | |
| 36 | return file_get_contents( $file ); |
| 37 | } |
| 38 | |
| 39 | } |