MediaWiki  master
Maintenance.php
Go to the documentation of this file.
1 <?php
28 if ( !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 
37 if ( 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 
45 define( 'MW_ENTRY_POINT', 'cli' );
46 
47 // Bail on old versions of PHP, or if composer has not been run yet to install
48 // dependencies.
49 require_once __DIR__ . '/../includes/PHPVersionCheck.php';
50 wfEntryPointCheck( 'text' );
51 
56 $maintClass = false;
57 
58 // Some extensions rely on MW_INSTALL_PATH to find core files to include. Setting it here helps them
59 // if they're included by a core script (like DatabaseUpdater) after Maintenance.php has already
60 // been run.
61 if ( strval( getenv( 'MW_INSTALL_PATH' ) ) === '' ) {
62  putenv( 'MW_INSTALL_PATH=' . realpath( __DIR__ . '/..' ) );
63 }
64 
65 require_once __DIR__ . '/includes/Maintenance.php';
66 require_once __DIR__ . '/includes/LoggedUpdateMaintenance.php';
67 require_once __DIR__ . '/includes/FakeMaintenance.php';
wfEntryPointCheck
wfEntryPointCheck( $format='text', $scriptPath='/')
Check PHP version and that external dependencies are installed, and display an informative error if e...
Definition: PHPVersionCheck.php:338
$maintClass
string false $maintClass
Definition: Maintenance.php:56