Update git submodules
[mediawiki.git] / load.php
blobf1e903bbe7bf41ddf39a6156bdb7f5e6b4a4d579
1 <?php
2 /**
3 * The web entry point for @ref ResourceLoader, which serves static CSS/JavaScript
4 * via @ref MediaWiki\ResourceLoader\Module Module subclasses.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 * http://www.gnu.org/copyleft/gpl.html
21 * @file
22 * @ingroup entrypoint
23 * @ingroup ResourceLoader
24 * @author Roan Kattouw
25 * @author Trevor Parscal
28 use MediaWiki\MediaWikiServices;
29 use MediaWiki\ResourceLoader\Context;
31 // This endpoint is supposed to be independent of request cookies and other
32 // details of the session. Enforce this constraint with respect to session use.
33 define( 'MW_NO_SESSION', 1 );
35 define( 'MW_ENTRY_POINT', 'load' );
37 require __DIR__ . '/includes/WebStart.php';
39 wfLoadMain();
41 function wfLoadMain() {
42 global $wgRequest;
44 $services = MediaWikiServices::getInstance();
45 // Disable ChronologyProtector so that we don't wait for unrelated MediaWiki
46 // writes when getting database connections for ResourceLoader. (T192611)
47 $services->getChronologyProtector()->setEnabled( false );
49 $resourceLoader = $services->getResourceLoader();
50 $context = new Context( $resourceLoader, $wgRequest );
52 // Respond to ResourceLoader request
53 $resourceLoader->respond( $context );
55 // Append any visible profiling data in a manner appropriate for the Content-Type
56 $profiler = Profiler::instance();
57 $profiler->setAllowOutput();
58 $profiler->logDataPageOutputOnly();
60 $mediawiki = new MediaWiki();
61 $mediawiki->doPostOutputShutdown();