Manual:doMaintenance.php
From Linux Web Expert
MediaWiki バージョン: | <translate> ≥</translate> 1.16 |
MediaWiki ファイル: doMaintenance.php | |
---|---|
場所: | maintenance/ |
ソース コード: | master • 1.41.1 • 1.40.3 • 1.39.7 |
クラス: | コードを検索 • 説明文書を検索 |
詳細
doMaintenance.php file is a maintenance script to verify the most important files and run some jobs automatically.
使用法
When writing a maintenance script, add RUN_MAINTENANCE_IF_MAIN
to the end of file.
<?php
require_once __DIR__ . '/Maintenance.php';
class HelloWorld extends Maintenance {
public function execute() {
$this->output( "Hello, MediaWiki Devs!" );
}
}
$maintClass = HelloWorld::class;
require_once RUN_MAINTENANCE_IF_MAIN;
Here RUN_MAINTENANCE_IF_MAIN
loads doMaintenance.php
file which autoloads MediaWiki classes and configuration to run the script smoothly.