MediaWiki
REL1_41
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
// Abort if called from a web server
46
// wfIsCLI() is not available yet
47
if
( PHP_SAPI !==
'cli'
&& PHP_SAPI !==
'phpdbg'
) {
48
echo
"This script must be run from the command line\n"
;
49
exit( 1 );
50
}
51
52
define(
'MW_ENTRY_POINT'
,
'cli'
);
53
54
// Bail on old versions of PHP, or if composer has not been run yet to install
55
// dependencies.
56
require_once __DIR__ .
'/../includes/BootstrapHelperFunctions.php'
;
57
require_once __DIR__ .
'/../includes/PHPVersionCheck.php'
;
58
wfEntryPointCheck
(
'text'
);
59
64
$maintClass
=
false
;
65
66
// Some extensions rely on MW_INSTALL_PATH to find core files to include. Setting it here helps them
67
// if they're included by a core script (like DatabaseUpdater) after Maintenance.php has already
68
// been run.
69
if
( strval( getenv(
'MW_INSTALL_PATH'
) ) ===
''
) {
70
putenv(
'MW_INSTALL_PATH='
. realpath( __DIR__ .
'/..'
) );
71
}
72
73
require_once __DIR__ .
'/includes/Maintenance.php'
;
74
require_once __DIR__ .
'/includes/LoggedUpdateMaintenance.php'
;
75
require_once __DIR__ .
'/includes/FakeMaintenance.php'
;
$maintClass
$maintClass
Definition
Maintenance.php:64
wfEntryPointCheck
wfEntryPointCheck( $format='text', $scriptPath='/')
Check PHP version and that external dependencies are installed, and display an informative error if e...
Definition
PHPVersionCheck.php:337
maintenance
Maintenance.php
Generated on Wed Nov 27 2024 07:26:32 for MediaWiki by
1.10.0