MediaWiki REL1_39
Maintenance.php
Go to the documentation of this file.
1<?php
28if ( !defined( 'RUN_MAINTENANCE_IF_MAIN' ) ) {
29 // Define this so scripts can easily find doMaintenance.php
30 define( 'RUN_MAINTENANCE_IF_MAIN', __DIR__ . '/doMaintenance.php' );
31
32 // Original name for compat, harmless
33 // Support: MediaWiki < 1.31
34 define( 'DO_MAINTENANCE', RUN_MAINTENANCE_IF_MAIN );
35}
36
37if ( defined( 'MEDIAWIKI' ) ) {
38 // This file is included by many autoloaded class files, and so may
39 // potentially be invoked in the context of a web request or another CLI
40 // script. It's not appropriate to run the following file-scope code in
41 // such a case.
42 return;
43}
44
45define( 'MW_ENTRY_POINT', 'cli' );
46
47// Bail on old versions of PHP, or if composer has not been run yet to install
48// dependencies.
49require_once __DIR__ . '/../includes/BootstrapHelperFunctions.php';
50require_once __DIR__ . '/../includes/PHPVersionCheck.php';
51wfEntryPointCheck( 'text' );
52
58
59// Some extensions rely on MW_INSTALL_PATH to find core files to include. Setting it here helps them
60// if they're included by a core script (like DatabaseUpdater) after Maintenance.php has already
61// been run.
62if ( strval( getenv( 'MW_INSTALL_PATH' ) ) === '' ) {
63 putenv( 'MW_INSTALL_PATH=' . realpath( __DIR__ . '/..' ) );
64}
65
66require_once __DIR__ . '/includes/Maintenance.php';
67require_once __DIR__ . '/includes/LoggedUpdateMaintenance.php';
68require_once __DIR__ . '/includes/FakeMaintenance.php';
string false $maintClass
wfEntryPointCheck( $format='text', $scriptPath='/')
Check PHP version and that external dependencies are installed, and display an informative error if e...