| 1 |
<?php |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
use MediaWiki\Config\SiteConfiguration; |
| 55 |
use MediaWiki\Context\RequestContext; |
| 56 |
use MediaWiki\Debug\MWDebug; |
| 57 |
use MediaWiki\Deferred\DeferredUpdates; |
| 58 |
use MediaWiki\HookContainer\FauxGlobalHookArray; |
| 59 |
use MediaWiki\HookContainer\HookRunner; |
| 60 |
use MediaWiki\Language\Language; |
| 61 |
use MediaWiki\Logger\LoggerFactory; |
| 62 |
use MediaWiki\MainConfigNames; |
| 63 |
use MediaWiki\MainConfigSchema; |
| 64 |
use MediaWiki\MediaWikiServices; |
| 65 |
use MediaWiki\Message\Message; |
| 66 |
use MediaWiki\Registration\ExtensionRegistry; |
| 67 |
use MediaWiki\Registration\MissingExtensionException; |
| 68 |
use MediaWiki\Request\HeaderCallback; |
| 69 |
use MediaWiki\Settings\DynamicDefaultValues; |
| 70 |
use MediaWiki\Settings\LocalSettingsLoader; |
| 71 |
use MediaWiki\Settings\SettingsBuilder; |
| 72 |
use MediaWiki\Settings\Source\PhpSettingsSource; |
| 73 |
use MediaWiki\Settings\Source\ReflectionSchemaSource; |
| 74 |
use MediaWiki\Settings\WikiFarmSettingsLoader; |
| 75 |
use MediaWiki\StubObject\StubGlobalUser; |
| 76 |
use MediaWiki\StubObject\StubUserLang; |
| 77 |
use MediaWiki\Title\Title; |
| 78 |
use MediaWiki\User\User; |
| 79 |
use Psr\Log\LoggerInterface; |
| 80 |
use Wikimedia\RequestTimeout\RequestTimeout; |
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
if ( !defined( 'MEDIAWIKI' ) ) { |
| 91 |
exit( 1 ); |
| 92 |
} |
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
if ( !defined( 'MW_ENTRY_POINT' ) ) { |
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
define( 'MW_ENTRY_POINT', 'unknown' ); |
| 104 |
} |
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
global $IP; |
| 113 |
$IP = wfDetectInstallPath(); |
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
|
| 120 |
require_once MW_INSTALL_PATH . '/includes/AutoLoader.php'; |
| 121 |
require_once MW_INSTALL_PATH . '/includes/Defines.php'; |
| 122 |
|
| 123 |
|
| 124 |
if ( !interface_exists( LoggerInterface::class ) ) { |
| 125 |
$message = ( |
| 126 |
'<strong>Error: Missing external libraries.</strong> ' . |
| 127 |
'MediaWiki depends on external libraries bundled with most MediaWiki distributions. ' . |
| 128 |
"When installing MediaWiki from its Git reposistory, these must be installed separately.\n\n" . |
| 129 |
'Please see the <a href="https://www.mediawiki.org/wiki/Download_from_Git' . |
| 130 |
'#Fetch_external_libraries">instructions for installing libraries</a> on mediawiki.org ' . |
| 131 |
'for help on installing the required libraries.' |
| 132 |
); |
| 133 |
http_response_code( 500 ); |
| 134 |
echo $message; |
| 135 |
error_log( $message ); |
| 136 |
exit( 1 ); |
| 137 |
} |
| 138 |
|
| 139 |
|
| 140 |
|
| 141 |
$wgCommandLineMode = MW_ENTRY_POINT === 'cli'; |
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
$wgConf = new SiteConfiguration; |
| 149 |
|
| 150 |
$wgAutoloadClasses ??= []; |
| 151 |
|
| 152 |
$wgSettings = SettingsBuilder::getInstance(); |
| 153 |
|
| 154 |
if ( defined( 'MW_USE_CONFIG_SCHEMA_CLASS' ) ) { |
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
$wgSettings->load( new ReflectionSchemaSource( MainConfigSchema::class ) ); |
| 159 |
} else { |
| 160 |
$wgSettings->load( new PhpSettingsSource( MW_INSTALL_PATH . '/includes/config-schema.php' ) ); |
| 161 |
} |
| 162 |
|
| 163 |
require_once MW_INSTALL_PATH . '/includes/GlobalFunctions.php'; |
| 164 |
|
| 165 |
HeaderCallback::register(); |
| 166 |
|
| 167 |
|
| 168 |
|
| 169 |
mb_internal_encoding( 'UTF-8' ); |
| 170 |
|
| 171 |
|
| 172 |
|
| 173 |
|
| 174 |
|
| 175 |
|
| 176 |
|
| 177 |
$wgSettings->putConfigValues( [ |
| 178 |
MainConfigNames::BaseDirectory => MW_INSTALL_PATH, |
| 179 |
MainConfigNames::ExtensionDirectory => MW_INSTALL_PATH . '/extensions', |
| 180 |
MainConfigNames::StyleDirectory => MW_INSTALL_PATH . '/skins', |
| 181 |
MainConfigNames::ServiceWiringFiles => [ MW_INSTALL_PATH . '/includes/ServiceWiring.php' ], |
| 182 |
'Version' => MW_VERSION, |
| 183 |
] ); |
| 184 |
$wgSettings->apply(); |
| 185 |
|
| 186 |
|
| 187 |
|
| 188 |
|
| 189 |
$wgScopeTest = 'MediaWiki Setup.php scope test'; |
| 190 |
if ( !isset( $GLOBALS['wgScopeTest'] ) || $GLOBALS['wgScopeTest'] !== $wgScopeTest ) { |
| 191 |
foreach ( $wgSettings->getConfigSchema()->getDefinedKeys() as $key ) { |
| 192 |
$var = "wg$key"; |
| 193 |
|
| 194 |
global $$var; |
| 195 |
} |
| 196 |
unset( $key, $var ); |
| 197 |
} |
| 198 |
unset( $wgScopeTest ); |
| 199 |
|
| 200 |
try { |
| 201 |
if ( defined( 'MW_CONFIG_CALLBACK' ) ) { |
| 202 |
call_user_func( MW_CONFIG_CALLBACK, $wgSettings ); |
| 203 |
} else { |
| 204 |
wfDetectLocalSettingsFile( MW_INSTALL_PATH ); |
| 205 |
|
| 206 |
if ( getenv( 'MW_USE_LOCAL_SETTINGS_LOADER' ) ) { |
| 207 |
|
| 208 |
|
| 209 |
$localSettingsLoader = new LocalSettingsLoader( $wgSettings, MW_INSTALL_PATH ); |
| 210 |
$localSettingsLoader->loadLocalSettingsFile( MW_CONFIG_FILE ); |
| 211 |
unset( $localSettingsLoader ); |
| 212 |
} else { |
| 213 |
if ( str_ends_with( MW_CONFIG_FILE, '.php' ) ) { |
| 214 |
|
| 215 |
$wgSettings->apply(); |
| 216 |
require_once MW_CONFIG_FILE; |
| 217 |
} else { |
| 218 |
$wgSettings->loadFile( MW_CONFIG_FILE ); |
| 219 |
} |
| 220 |
} |
| 221 |
} |
| 222 |
|
| 223 |
|
| 224 |
$wgSettings->apply(); |
| 225 |
} catch ( MissingExtensionException $e ) { |
| 226 |
|
| 227 |
$e->render(); |
| 228 |
} |
| 229 |
|
| 230 |
|
| 231 |
if ( $wgSettings->getConfig()->get( MainConfigNames::WikiFarmSettingsDirectory ) ) { |
| 232 |
$wikiFarmSettingsLoader = new WikiFarmSettingsLoader( $wgSettings ); |
| 233 |
$wikiFarmSettingsLoader->loadWikiFarmSettings(); |
| 234 |
unset( $wikiFarmSettingsLoader ); |
| 235 |
} |
| 236 |
|
| 237 |
|
| 238 |
$wgSettings->enterRegistrationStage(); |
| 239 |
|
| 240 |
|
| 241 |
|
| 242 |
|
| 243 |
|
| 244 |
|
| 245 |
|
| 246 |
|
| 247 |
if ( defined( 'MW_SETUP_CALLBACK' ) ) { |
| 248 |
call_user_func( MW_SETUP_CALLBACK, $wgSettings ); |
| 249 |
|
| 250 |
$wgSettings->apply(); |
| 251 |
} |
| 252 |
|
| 253 |
|
| 254 |
$dynamicDefaults = new DynamicDefaultValues( $wgSettings->getConfigSchema() ); |
| 255 |
$dynamicDefaults->applyDynamicDefaults( $wgSettings->getConfigBuilder() ); |
| 256 |
|
| 257 |
|
| 258 |
$wgSettings->apply(); |
| 259 |
|
| 260 |
|
| 261 |
|
| 262 |
|
| 263 |
require __DIR__ . '/SetupDynamicConfig.php'; |
| 264 |
|
| 265 |
if ( defined( 'MW_AUTOLOAD_TEST_CLASSES' ) ) { |
| 266 |
require_once __DIR__ . '/../tests/common/TestsAutoLoader.php'; |
| 267 |
} |
| 268 |
|
| 269 |
if ( $wgBaseDirectory !== MW_INSTALL_PATH ) { |
| 270 |
throw new FatalError( |
| 271 |
'$wgBaseDirectory must not be modified in settings files! ' . |
| 272 |
'Use the MW_INSTALL_PATH environment variable to override the installation root directory.' |
| 273 |
); |
| 274 |
} |
| 275 |
|
| 276 |
|
| 277 |
if ( $wgRequestTimeLimit && MW_ENTRY_POINT !== 'cli' ) { |
| 278 |
RequestTimeout::singleton()->setWallTimeLimit( $wgRequestTimeLimit ); |
| 279 |
} |
| 280 |
|
| 281 |
|
| 282 |
|
| 283 |
|
| 284 |
if ( defined( 'MW_AUTOLOAD_TEST_CLASSES' ) ) { |
| 285 |
ExtensionRegistry::getInstance()->setLoadTestClassesAndNamespaces( true ); |
| 286 |
} |
| 287 |
|
| 288 |
ExtensionRegistry::getInstance()->setSettingsBuilder( $wgSettings ); |
| 289 |
ExtensionRegistry::getInstance()->loadFromQueue(); |
| 290 |
|
| 291 |
ExtensionRegistry::getInstance()->finish(); |
| 292 |
|
| 293 |
|
| 294 |
|
| 295 |
|
| 296 |
|
| 297 |
|
| 298 |
if ( defined( 'MW_FINAL_SETUP_CALLBACK' ) ) { |
| 299 |
call_user_func( MW_FINAL_SETUP_CALLBACK, $wgSettings ); |
| 300 |
|
| 301 |
$wgSettings->apply(); |
| 302 |
} |
| 303 |
|
| 304 |
|
| 305 |
$wgSettings->enterReadOnlyStage(); |
| 306 |
|
| 307 |
|
| 308 |
|
| 309 |
|
| 310 |
|
| 311 |
|
| 312 |
|
| 313 |
putenv( "LC_ALL=" . setlocale( LC_ALL, 'C.UTF-8', 'C' ) ); |
| 314 |
|
| 315 |
|
| 316 |
date_default_timezone_set( $wgLocaltimezone ); |
| 317 |
|
| 318 |
MWDebug::setup(); |
| 319 |
|
| 320 |
|
| 321 |
|
| 322 |
|
| 323 |
MediaWikiServices::allowGlobalInstance(); |
| 324 |
|
| 325 |
|
| 326 |
|
| 327 |
define( 'MW_SERVICE_BOOTSTRAP_COMPLETE', 1 ); |
| 328 |
|
| 329 |
MWExceptionRenderer::setShowExceptionDetails( $wgShowExceptionDetails ); |
| 330 |
if ( !defined( 'MW_PHPUNIT_TEST' ) ) { |
| 331 |
|
| 332 |
|
| 333 |
MWExceptionHandler::installHandler( $wgLogExceptionBacktrace, $wgPropagateErrors ); |
| 334 |
} |
| 335 |
Profiler::init( $wgProfiler ); |
| 336 |
|
| 337 |
|
| 338 |
|
| 339 |
if ( $wgServer === false ) { |
| 340 |
|
| 341 |
throw new FatalError( |
| 342 |
'$wgServer must be set in LocalSettings.php. ' . |
| 343 |
'See <a href="https://www.mediawiki.org/wiki/Manual:$wgServer">' . |
| 344 |
'https://www.mediawiki.org/wiki/Manual:$wgServer</a>.' |
| 345 |
); |
| 346 |
} |
| 347 |
|
| 348 |
|
| 349 |
|
| 350 |
|
| 351 |
|
| 352 |
|
| 353 |
global $wgHooks; |
| 354 |
$wgHooks = new FauxGlobalHookArray( |
| 355 |
MediaWikiServices::getInstance()->getHookContainer(), |
| 356 |
$wgHooks |
| 357 |
); |
| 358 |
|
| 359 |
|
| 360 |
|
| 361 |
|
| 362 |
if ( $wgCanonicalServer === false ) { |
| 363 |
$wgCanonicalServer = MediaWikiServices::getInstance()->getUrlUtils()->getCanonicalServer(); |
| 364 |
} |
| 365 |
$wgVirtualRestConfig['global']['domain'] = $wgCanonicalServer; |
| 366 |
|
| 367 |
if ( $wgServerName !== false ) { |
| 368 |
wfWarn( '$wgServerName should be derived from $wgCanonicalServer, ' |
| 369 |
. 'not customized. Overwriting $wgServerName.' ); |
| 370 |
} |
| 371 |
$wgServerName = parse_url( $wgCanonicalServer, PHP_URL_HOST ); |
| 372 |
|
| 373 |
|
| 374 |
if ( !$wgEmergencyContact ) { |
| 375 |
$wgEmergencyContact = 'wikiadmin@' . $wgServerName; |
| 376 |
} |
| 377 |
if ( !$wgPasswordSender ) { |
| 378 |
$wgPasswordSender = 'apache@' . $wgServerName; |
| 379 |
} |
| 380 |
if ( !$wgNoReplyAddress ) { |
| 381 |
$wgNoReplyAddress = $wgPasswordSender; |
| 382 |
} |
| 383 |
|
| 384 |
|
| 385 |
|
| 386 |
if ( $wgSecureLogin && substr( $wgServer, 0, 2 ) !== '//' ) { |
| 387 |
$wgSecureLogin = false; |
| 388 |
wfWarn( 'Secure login was enabled on a server that only supports ' |
| 389 |
. 'HTTP or HTTPS. Disabling secure login.' ); |
| 390 |
} |
| 391 |
|
| 392 |
|
| 393 |
if ( $wgTmpDirectory === false ) { |
| 394 |
$wgTmpDirectory = wfTempDir(); |
| 395 |
} |
| 396 |
|
| 397 |
if ( $wgSharedDB && $wgSharedTables ) { |
| 398 |
|
| 399 |
MediaWikiServices::getInstance()->getDBLoadBalancer()->setTableAliases( |
| 400 |
array_fill_keys( |
| 401 |
$wgSharedTables, |
| 402 |
[ |
| 403 |
'dbname' => $wgSharedDB, |
| 404 |
'schema' => $wgSharedSchema, |
| 405 |
'prefix' => $wgSharedPrefix |
| 406 |
] |
| 407 |
) |
| 408 |
); |
| 409 |
} |
| 410 |
|
| 411 |
|
| 412 |
|
| 413 |
wfMemoryLimit( $wgMemoryLimit ); |
| 414 |
|
| 415 |
|
| 416 |
global $wgRequest, $wgInitialSessionId; |
| 417 |
|
| 418 |
|
| 419 |
$wgRequest = RequestContext::getMain()->getRequest(); |
| 420 |
|
| 421 |
|
| 422 |
if ( $wgRequest->getCookie( 'UseDC', '' ) === 'master' ) { |
| 423 |
|
| 424 |
|
| 425 |
|
| 426 |
MediaWikiServices::getInstance()->getMainWANObjectCache()->useInterimHoldOffCaching( false ); |
| 427 |
} |
| 428 |
|
| 429 |
|
| 430 |
( static function () { |
| 431 |
global $wgRequest; |
| 432 |
|
| 433 |
$logger = LoggerFactory::getInstance( 'wfDebug' ); |
| 434 |
if ( MW_ENTRY_POINT === 'cli' ) { |
| 435 |
$self = $_SERVER['PHP_SELF'] ?? ''; |
| 436 |
$logger->debug( "\n\nStart command line script $self" ); |
| 437 |
} else { |
| 438 |
$debug = "\n\nStart request {$wgRequest->getMethod()} {$wgRequest->getRequestURL()}\n"; |
| 439 |
$debug .= "IP: " . $wgRequest->getIP() . "\n"; |
| 440 |
$debug .= "HTTP HEADERS:\n"; |
| 441 |
foreach ( $wgRequest->getAllHeaders() as $name => $value ) { |
| 442 |
$debug .= "$name: $value\n"; |
| 443 |
} |
| 444 |
$debug .= "(end headers)"; |
| 445 |
$logger->debug( $debug ); |
| 446 |
} |
| 447 |
} )(); |
| 448 |
|
| 449 |
|
| 450 |
( new HookRunner( MediaWikiServices::getInstance()->getHookContainer() ) )->onSetupAfterCache(); |
| 451 |
|
| 452 |
|
| 453 |
|
| 454 |
|
| 455 |
|
| 456 |
|
| 457 |
|
| 458 |
|
| 459 |
|
| 460 |
|
| 461 |
if ( MW_ENTRY_POINT === 'index' ) { |
| 462 |
$wgRequest->interpolateTitle(); |
| 463 |
} |
| 464 |
|
| 465 |
|
| 466 |
|
| 467 |
|
| 468 |
$wgInitialSessionId = null; |
| 469 |
if ( !defined( 'MW_NO_SESSION' ) && MW_ENTRY_POINT !== 'cli' ) { |
| 470 |
|
| 471 |
if ( $wgPHPSessionHandling !== 'disable' && !wfIniGetBool( 'session.auto_start' ) ) { |
| 472 |
HeaderCallback::warnIfHeadersSent(); |
| 473 |
session_name( $wgSessionName ?: $wgCookiePrefix . '_session' ); |
| 474 |
} |
| 475 |
|
| 476 |
|
| 477 |
|
| 478 |
if ( !defined( 'MW_NO_SESSION_HANDLER' ) ) { |
| 479 |
MediaWiki\Session\PHPSessionHandler::install( |
| 480 |
MediaWiki\Session\SessionManager::singleton() |
| 481 |
); |
| 482 |
} |
| 483 |
|
| 484 |
$contLang = MediaWikiServices::getInstance()->getContentLanguage(); |
| 485 |
|
| 486 |
|
| 487 |
try { |
| 488 |
$session = MediaWiki\Session\SessionManager::getGlobalSession(); |
| 489 |
} catch ( MediaWiki\Session\SessionOverflowException $ex ) { |
| 490 |
|
| 491 |
|
| 492 |
$list = []; |
| 493 |
foreach ( $ex->getSessionInfos() as $info ) { |
| 494 |
$list[] = $info->getProvider()->describe( $contLang ); |
| 495 |
} |
| 496 |
$list = $contLang->listToText( $list ); |
| 497 |
throw new HttpError( 400, |
| 498 |
Message::newFromKey( 'sessionmanager-tie', $list )->inLanguage( $contLang ) |
| 499 |
); |
| 500 |
} |
| 501 |
|
| 502 |
unset( $contLang ); |
| 503 |
|
| 504 |
if ( $session->isPersistent() ) { |
| 505 |
$wgInitialSessionId = $session->getSessionId(); |
| 506 |
} |
| 507 |
|
| 508 |
$session->renew(); |
| 509 |
if ( MediaWiki\Session\PHPSessionHandler::isEnabled() && |
| 510 |
( $session->isPersistent() || $session->shouldRememberUser() ) && |
| 511 |
session_id() !== $session->getId() |
| 512 |
) { |
| 513 |
|
| 514 |
if ( session_id() !== '' ) { |
| 515 |
wfDebugLog( 'session', 'PHP session {old_id} was already started, changing to {new_id}', 'all', [ |
| 516 |
'old_id' => session_id(), |
| 517 |
'new_id' => $session->getId(), |
| 518 |
] ); |
| 519 |
session_write_close(); |
| 520 |
} |
| 521 |
session_id( $session->getId() ); |
| 522 |
session_start(); |
| 523 |
} |
| 524 |
|
| 525 |
unset( $session ); |
| 526 |
} else { |
| 527 |
|
| 528 |
|
| 529 |
if ( !defined( 'MW_NO_SESSION_HANDLER' ) ) { |
| 530 |
MediaWiki\Session\PHPSessionHandler::install( |
| 531 |
MediaWiki\Session\SessionManager::singleton() |
| 532 |
); |
| 533 |
} |
| 534 |
} |
| 535 |
|
| 536 |
|
| 537 |
global $wgUser, $wgLang, $wgOut, $wgTitle; |
| 538 |
|
| 539 |
|
| 540 |
|
| 541 |
|
| 542 |
|
| 543 |
|
| 544 |
$wgUser = new StubGlobalUser( RequestContext::getMain()->getUser() ); |
| 545 |
register_shutdown_function( static function () { |
| 546 |
StubGlobalUser::$destructorDeprecationDisarmed = true; |
| 547 |
} ); |
| 548 |
|
| 549 |
|
| 550 |
|
| 551 |
|
| 552 |
$wgLang = new StubUserLang; |
| 553 |
|
| 554 |
|
| 555 |
|
| 556 |
|
| 557 |
$wgOut = RequestContext::getMain()->getOutput(); |
| 558 |
|
| 559 |
|
| 560 |
|
| 561 |
|
| 562 |
$wgTitle = null; |
| 563 |
|
| 564 |
|
| 565 |
global $wgFullyInitialised, $wgExtensionFunctions; |
| 566 |
|
| 567 |
|
| 568 |
|
| 569 |
|
| 570 |
|
| 571 |
foreach ( $wgExtensionFunctions as $func ) { |
| 572 |
call_user_func( $func ); |
| 573 |
} |
| 574 |
unset( $func ); |
| 575 |
|
| 576 |
|
| 577 |
|
| 578 |
if ( !defined( 'MW_NO_SESSION' ) && MW_ENTRY_POINT !== 'cli' ) { |
| 579 |
$sessionUser = MediaWiki\Session\SessionManager::getGlobalSession()->getUser(); |
| 580 |
if ( $sessionUser->getId() === 0 && |
| 581 |
MediaWikiServices::getInstance()->getUserNameUtils()->isValid( $sessionUser->getName() ) |
| 582 |
) { |
| 583 |
$res = MediaWikiServices::getInstance()->getAuthManager()->autoCreateUser( |
| 584 |
$sessionUser, |
| 585 |
MediaWiki\Auth\AuthManager::AUTOCREATE_SOURCE_SESSION, |
| 586 |
true, |
| 587 |
true, |
| 588 |
$sessionUser |
| 589 |
); |
| 590 |
$firstMessage = $res->getMessages( 'error' )[0] ?? $res->getMessages( 'warning' )[0] ?? null; |
| 591 |
\MediaWiki\Logger\LoggerFactory::getInstance( 'authevents' )->info( 'Autocreation attempt', [ |
| 592 |
'event' => 'autocreate', |
| 593 |
'successful' => $res->isGood(), |
| 594 |
'status' => $firstMessage ? $firstMessage->getKey() : '-', |
| 595 |
] ); |
| 596 |
unset( $res ); |
| 597 |
unset( $firstMessage ); |
| 598 |
} |
| 599 |
unset( $sessionUser ); |
| 600 |
} |
| 601 |
|
| 602 |
|
| 603 |
if ( MW_ENTRY_POINT !== 'cli' && $wgPingback ) { |
| 604 |
|
| 605 |
|
| 606 |
|
| 607 |
|
| 608 |
|
| 609 |
|
| 610 |
DeferredUpdates::addCallableUpdate( static function () { |
| 611 |
MediaWikiServices::getInstance()->getPingback()->run(); |
| 612 |
} ); |
| 613 |
} |
| 614 |
|
| 615 |
$settingsWarnings = $wgSettings->getWarnings(); |
| 616 |
if ( $settingsWarnings ) { |
| 617 |
$logger = LoggerFactory::getInstance( 'Settings' ); |
| 618 |
foreach ( $settingsWarnings as $msg ) { |
| 619 |
$logger->warning( $msg ); |
| 620 |
} |
| 621 |
unset( $logger ); |
| 622 |
} |
| 623 |
|
| 624 |
unset( $settingsWarnings ); |
| 625 |
|
| 626 |
|
| 627 |
global $wgFullyInitialised; |
| 628 |
$wgFullyInitialised = true; |
| 629 |
|
| 630 |
|
| 631 |
if ( !defined( 'MW_NO_SESSION' ) && MW_ENTRY_POINT !== 'cli' ) { |
| 632 |
MediaWiki\Session\SessionManager::singleton()->logPotentialSessionLeakage(); |
| 633 |
} |