MediaWiki  master
Maintenance.php
Go to the documentation of this file.
1 <?php
23 if ( !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.
29 require_once __DIR__ . '/../includes/PHPVersionCheck.php';
30 wfEntryPointCheck( 'text' );
31 
37 // Define this so scripts can easily find doMaintenance.php
38 define( 'RUN_MAINTENANCE_IF_MAIN', __DIR__ . '/doMaintenance.php' );
39 
40 // Original name for compat, harmless
41 // Support: MediaWiki < 1.31
42 define( 'DO_MAINTENANCE', RUN_MAINTENANCE_IF_MAIN );
43 
48 $maintClass = false;
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.
53 if ( strval( getenv( 'MW_INSTALL_PATH' ) ) === '' ) {
54  putenv( 'MW_INSTALL_PATH=' . realpath( __DIR__ . '/..' ) );
55 }
56 
57 require_once __DIR__ . '/includes/Maintenance.php';
58 require_once __DIR__ . '/includes/LoggedUpdateMaintenance.php';
59 require_once __DIR__ . '/includes/FakeMaintenance.php';
RUN_MAINTENANCE_IF_MAIN
const RUN_MAINTENANCE_IF_MAIN
Definition: Maintenance.php:38
wfEntryPointCheck
wfEntryPointCheck( $format='text', $scriptPath='/')
Check PHP version and that external dependencies are installed, and display an informative error if e...
Definition: PHPVersionCheck.php:298
$maintClass
string false $maintClass
-var class-string|false
Definition: Maintenance.php:48