X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=load.php;h=974771f9781c832a9c82dba243f5c419641e8fc1;hb=c3f084d44bab25a16fa110023859db81bce39100;hp=1d6a242575af3462c65b640b6a159360e07b9437;hpb=052770c40b84e22ddd42ff5686e0aaf3b9131030;p=lhc%2Fweb%2Fwiklou.git diff --git a/load.php b/load.php index 1d6a242575..974771f978 100644 --- a/load.php +++ b/load.php @@ -23,6 +23,11 @@ */ use MediaWiki\Logger\LoggerFactory; +use MediaWiki\MediaWikiServices; + +// This endpoint is supposed to be independent of request cookies and other +// details of the session. Enforce this constraint with respect to session use. +define( 'MW_NO_SESSION', 1 ); require __DIR__ . '/includes/WebStart.php'; @@ -31,14 +36,21 @@ if ( !$wgRequest->checkUrlExtension() ) { return; } -// Respond to resource loading request. -// foo()->bar() syntax is not supported in PHP4, and this file needs to *parse* in PHP4. -$configFactory = ConfigFactory::getDefaultInstance(); +// Don't initialise ChronologyProtector from object cache, and +// don't wait for unrelated MediaWiki writes when querying ResourceLoader. +MediaWikiServices::getInstance()->getDBLoadBalancerFactory()->setRequestInfo( [ + 'ChronologyProtection' => 'false', +] ); + +// Set up ResourceLoader $resourceLoader = new ResourceLoader( - $configFactory->makeConfig( 'main' ), + ConfigFactory::getDefaultInstance()->makeConfig( 'main' ), LoggerFactory::getInstance( 'resourceloader' ) ); -$resourceLoader->respond( new ResourceLoaderContext( $resourceLoader, $wgRequest ) ); +$context = new ResourceLoaderContext( $resourceLoader, $wgRequest ); + +// Respond to ResourceLoader request +$resourceLoader->respond( $context ); Profiler::instance()->setTemplated( true );