Manual:DoMaintenance.php/pl
Wersja MediaWiki: | ≥ 1.16 |
Plik MediaWiki: doMaintenance.php | |
---|---|
Lokalizacja: | maintenance/ |
Kod źródłowy: | master • 1.42.1 • 1.41.2 • 1.39.8 |
Klasy: | Znajdź kod • Znajdź dokumentację |
Details
doMaintenance.php file is a maintenance script to verify the most important files and run some jobs automatically.
Usage
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.