2010-09-04 04:00:09 +00:00
|
|
|
<?php
|
|
|
|
|
/**
|
2015-10-28 03:24:40 +00:00
|
|
|
* This file is the entry point for ResourceLoader.
|
2010-09-04 06:46:50 +00:00
|
|
|
*
|
2010-09-04 04:00:09 +00:00
|
|
|
* 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
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
* http://www.gnu.org/copyleft/gpl.html
|
|
|
|
|
*
|
2010-09-04 06:46:50 +00:00
|
|
|
* @file
|
2010-09-04 04:00:09 +00:00
|
|
|
* @author Roan Kattouw
|
|
|
|
|
* @author Trevor Parscal
|
|
|
|
|
*/
|
2010-09-04 12:53:01 +00:00
|
|
|
|
2015-06-04 03:52:45 +00:00
|
|
|
use MediaWiki\Logger\LoggerFactory;
|
|
|
|
|
|
2016-02-25 21:54:06 +00:00
|
|
|
// This endpoint is supposed to be independent of request cookies and other
|
|
|
|
|
// details of the session. Log warnings for violations of the no-session
|
|
|
|
|
// constraint.
|
|
|
|
|
define( 'MW_NO_SESSION', 'warn' );
|
|
|
|
|
|
2013-05-17 00:16:59 +00:00
|
|
|
require __DIR__ . '/includes/WebStart.php';
|
2011-05-30 13:49:09 +00:00
|
|
|
|
2010-09-04 04:00:09 +00:00
|
|
|
// URL safety checks
|
2011-06-03 05:32:51 +00:00
|
|
|
if ( !$wgRequest->checkUrlExtension() ) {
|
2010-09-04 04:00:09 +00:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2016-03-10 23:33:58 +00:00
|
|
|
// Set up ResourceLoader
|
2015-06-04 03:52:45 +00:00
|
|
|
$resourceLoader = new ResourceLoader(
|
2016-02-25 21:00:56 +00:00
|
|
|
ConfigFactory::getDefaultInstance()->makeConfig( 'main' ),
|
2015-06-04 03:52:45 +00:00
|
|
|
LoggerFactory::getInstance( 'resourceloader' )
|
|
|
|
|
);
|
2016-03-10 23:33:58 +00:00
|
|
|
$context = new ResourceLoaderContext( $resourceLoader, $wgRequest );
|
|
|
|
|
|
|
|
|
|
// Respond to ResourceLoader request
|
|
|
|
|
$resourceLoader->respond( $context );
|
2010-09-04 04:00:09 +00:00
|
|
|
|
2015-03-31 07:44:08 +00:00
|
|
|
Profiler::instance()->setTemplated( true );
|
2010-09-04 04:00:09 +00:00
|
|
|
|
2015-05-20 23:32:20 +00:00
|
|
|
$mediawiki = new MediaWiki();
|
|
|
|
|
$mediawiki->doPostOutputShutdown( 'fast' );
|