MediaWiki
REL1_31
autoload.ide.php
Go to the documentation of this file.
1
<?php
2
20
// Set a flag which can be used to detect when other scripts have been entered
21
// through this entry point or not.
22
use
MediaWiki\MediaWikiServices
;
23
24
global
$argv
;
25
$argv
[1] =
'--wiki'
;
26
$argv
[2] = getenv(
'WIKI_NAME'
) ?:
'wiki'
;
27
28
require_once __DIR__ .
"/phpunit.php"
;
29
30
// Get an object to start us off
32
$maintenance
=
new
PHPUnitMaintClass
();
33
34
// Basic sanity checks and such
35
$maintenance
->setup();
36
37
// We used to call this variable $self, but it was moved
38
// to $maintenance->mSelf. Keep that here for b/c
39
$self
=
$maintenance
->getName();
40
global
$IP
;
41
# Get profiler configuraton
42
$wgProfiler
= [];
43
if
( file_exists(
"$IP/StartProfiler.php"
) ) {
44
require
"$IP/StartProfiler.php"
;
45
}
46
# Start the autoloader, so that extensions can derive classes from core files
47
require_once
"$IP/includes/AutoLoader.php"
;
48
49
$requireOnceGlobalsScope
=
function
( $file ) use (
$self
) {
50
foreach
( array_keys(
$GLOBALS
) as $varName ) {
51
eval( sprintf(
'global $%s;'
, $varName ) );
52
}
53
54
require_once $file;
55
56
unset( $file );
57
$definedVars = get_defined_vars();
58
foreach
( $definedVars as $varName =>
$value
) {
59
eval( sprintf(
'global $%s; $%s = $value;'
, $varName, $varName ) );
60
}
61
};
62
63
// Some other requires
64
$requireOnceGlobalsScope
(
"$IP/includes/Defines.php"
);
65
$requireOnceGlobalsScope
(
"$IP/includes/DefaultSettings.php"
);
66
$requireOnceGlobalsScope
(
"$IP/includes/GlobalFunctions.php"
);
67
68
foreach
( array_keys(
$GLOBALS
) as $varName ) {
69
eval( sprintf(
'global $%s;'
, $varName ) );
70
}
71
72
# Load composer's autoloader if present
73
if
( is_readable(
"$IP/vendor/autoload.php"
) ) {
74
require_once
"$IP/vendor/autoload.php"
;
75
}
76
77
if
( defined(
'MW_CONFIG_CALLBACK'
) ) {
78
# Use a callback function to configure MediaWiki
79
call_user_func(
MW_CONFIG_CALLBACK
);
80
}
else
{
81
// Require the configuration (probably LocalSettings.php)
82
require
$maintenance
->loadSettings();
83
}
84
85
if
(
$maintenance
->getDbType() ===
Maintenance::DB_NONE
) {
86
if
(
87
$wgLocalisationCacheConf
[
'storeClass'
] ===
false
88
&& (
89
$wgLocalisationCacheConf
[
'store'
] ==
'db'
90
|| (
$wgLocalisationCacheConf
[
'store'
] ==
'detect'
&& !
$wgCacheDirectory
)
91
)
92
) {
93
$wgLocalisationCacheConf
[
'storeClass'
] = LCStoreNull::class;
94
}
95
}
96
97
$maintenance
->finalSetup();
98
// Some last includes
99
$requireOnceGlobalsScope
(
"$IP/includes/Setup.php"
);
100
101
// Initialize main config instance
102
$maintenance
->setConfig( MediaWikiServices::getInstance()->getMainConfig() );
103
104
// Sanity-check required extensions are installed
105
$maintenance
->checkRequiredExtensions();
106
107
// A good time when no DBs have writes pending is around lag checks.
108
// This avoids having long running scripts just OOM and lose all the updates.
109
$maintenance
->setAgentAndTriggers();
$GLOBALS
$GLOBALS['IP']
Definition
ComposerHookHandler.php:6
$wgCacheDirectory
$wgCacheDirectory
Directory for caching data in the local filesystem.
Definition
DefaultSettings.php:2252
$wgLocalisationCacheConf
$wgLocalisationCacheConf
Localisation cache configuration.
Definition
DefaultSettings.php:2535
$maintenance
$maintenance
Definition
autoload.ide.php:32
$requireOnceGlobalsScope
$requireOnceGlobalsScope
Definition
autoload.ide.php:49
$argv
global $argv
Definition
autoload.ide.php:24
$self
$self
Definition
autoload.ide.php:39
$wgProfiler
$wgProfiler
Definition
autoload.ide.php:42
$IP
global $IP
Definition
autoload.ide.php:40
Maintenance\DB_NONE
const DB_NONE
Constants for DB access type.
Definition
Maintenance.php:66
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition
MediaWikiServices.php:88
PHPUnitMaintClass
Definition
phpunit.php:16
MW_CONFIG_CALLBACK
const MW_CONFIG_CALLBACK
Definition
install.php:26
$value
$value
Definition
styleTest.css.php:45
tests
phpunit
autoload.ide.php
Generated on Mon Nov 25 2024 15:36:12 for MediaWiki by
1.10.0