MediaWiki
master
Toggle main menu visibility
Maintenance.php
Go to the documentation of this file.
1
<?php
8
13
14
use
MediaWiki\PHPVersionCheck
;
15
16
if
( !defined(
'RUN_MAINTENANCE_IF_MAIN'
) ) {
17
// Define this so scripts can easily find doMaintenance.php
18
define(
'RUN_MAINTENANCE_IF_MAIN'
, __DIR__ .
'/doMaintenance.php'
);
19
20
// Original name for compat, harmless
21
// Support: MediaWiki < 1.31
22
define(
'DO_MAINTENANCE'
, RUN_MAINTENANCE_IF_MAIN );
23
}
24
25
if
( defined(
'MEDIAWIKI'
) ) {
26
// This file is included by many autoloaded class files, and so may
27
// potentially be invoked in the context of a web request or another CLI
28
// script. It's not appropriate to run the following file-scope code in
29
// such a case.
30
return
;
31
}
32
33
// Abort if called from a web server
34
// wfIsCLI() is not available yet
35
if
( PHP_SAPI !==
'cli'
&& PHP_SAPI !==
'phpdbg'
) {
36
echo
"This script must be run from the command line\n"
;
37
exit( 1 );
38
}
39
40
define(
'MW_ENTRY_POINT'
,
'cli'
);
41
42
// Bail on old versions of PHP, or if composer has not been run yet to install
43
// dependencies.
44
require_once __DIR__ .
'/../includes/PHPVersionCheck.php'
;
45
(
new
PHPVersionCheck(
'text'
) )->run();
46
47
// For compatibility require the bootstrap after version check
48
require_once __DIR__ .
'/../includes/BootstrapHelperFunctions.php'
;
49
54
$maintClass
=
false
;
55
56
// Some extensions rely on MW_INSTALL_PATH to find core files to include. Setting it here helps them
57
// if they're included by a core script (like DatabaseUpdater) after Maintenance.php has already
58
// been run.
59
if
( strval( getenv(
'MW_INSTALL_PATH'
) ) ===
''
) {
60
putenv(
'MW_INSTALL_PATH='
. realpath( __DIR__ .
'/..'
) );
61
}
62
63
require_once __DIR__ .
'/includes/Maintenance.php'
;
64
require_once __DIR__ .
'/includes/LoggedUpdateMaintenance.php'
;
65
require_once __DIR__ .
'/includes/FakeMaintenance.php'
;
$maintClass
$maintClass
Definition
addChangeTag.php:56
MediaWiki\PHPVersionCheck
Check PHP Version, as well as for composer dependencies in entry points, and display something vaguel...
Definition
PHPVersionCheck.php:26
maintenance
Maintenance.php
Generated on
for MediaWiki by
1.18.0