MediaWiki REL1_35
Maintenance.php
Go to the documentation of this file.
1<?php
23if ( !defined( 'MW_ENTRY_POINT' ) ) {
24 define( 'MW_ENTRY_POINT', 'cli' );
25}
26
27// Bail on old versions of PHP, or if composer has not been run yet to install
28// dependencies.
29require_once __DIR__ . '/../includes/PHPVersionCheck.php';
30wfEntryPointCheck( 'text' );
31
37// Define this so scripts can easily find doMaintenance.php
38define( 'RUN_MAINTENANCE_IF_MAIN', __DIR__ . '/doMaintenance.php' );
39
40// Original name for compat, harmless
41// Support: MediaWiki < 1.31
42define( 'DO_MAINTENANCE', RUN_MAINTENANCE_IF_MAIN );
43
49
50// Some extensions rely on MW_INSTALL_PATH to find core files to include. Setting it here helps them
51// if they're included by a core script (like DatabaseUpdater) after Maintenance.php has already
52// been run.
53if ( strval( getenv( 'MW_INSTALL_PATH' ) ) === '' ) {
54 putenv( 'MW_INSTALL_PATH=' . realpath( __DIR__ . '/..' ) );
55}
56
57require_once __DIR__ . '/includes/Maintenance.php';
58require_once __DIR__ . '/includes/LoggedUpdateMaintenance.php';
59require_once __DIR__ . '/includes/FakeMaintenance.php';
const RUN_MAINTENANCE_IF_MAIN
string false $maintClass
-var class-string|false
wfEntryPointCheck( $format='text', $scriptPath='/')
Check PHP version and that external dependencies are installed, and display an informative error if e...