]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blobdiff - load.php
MediaWiki 1.30.2
[autoinstallsdev/mediawiki.git] / load.php
index d360bd2bfa94b8d0c0c6921da2c8cafa8ce3f404..974771f9781c832a9c82dba243f5c419641e8fc1 100644 (file)
--- a/load.php
+++ b/load.php
@@ -1,6 +1,6 @@
 <?php
 /**
- * This file is the entry point for the resource loader.
+ * This file is the entry point for ResourceLoader.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * @file
  * @author Roan Kattouw
  * @author Trevor Parscal
- *
  */
 
-require ( dirname( __FILE__ ) . '/includes/WebStart.php' );
-wfProfileIn( 'load.php' );
+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';
 
 // URL safety checks
 if ( !$wgRequest->checkUrlExtension() ) {
        return;
 }
 
-// Respond to resource loading request
-$resourceLoader = new ResourceLoader();
-$resourceLoader->respond( new ResourceLoaderContext( $resourceLoader, $wgRequest ) );
+// 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::getDefaultInstance()->makeConfig( 'main' ),
+       LoggerFactory::getInstance( 'resourceloader' )
+);
+$context = new ResourceLoaderContext( $resourceLoader, $wgRequest );
+
+// Respond to ResourceLoader request
+$resourceLoader->respond( $context );
 
-wfProfileOut( 'load.php' );
-wfLogProfilingData();
+Profiler::instance()->setTemplated( true );
 
-// Shut down the database
-wfGetLBFactory()->shutdown();
+$mediawiki = new MediaWiki();
+$mediawiki->doPostOutputShutdown( 'fast' );