2006-10-01 04:38:31 +00:00
|
|
|
<?php
|
2009-03-21 16:48:09 +00:00
|
|
|
/**
|
2020-06-17 00:10:56 +00:00
|
|
|
* The web entry point for all %Action API queries, handled by ApiMain
|
|
|
|
|
* and ApiBase subclasses.
|
2020-02-04 21:44:38 +00:00
|
|
|
*
|
2023-12-08 09:47:13 +00:00
|
|
|
* @see ApiEntryPoint The corresponding entry point class
|
2009-03-21 16:48: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.,
|
2010-06-21 13:13:32 +00:00
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2009-03-21 16:48:09 +00:00
|
|
|
* http://www.gnu.org/copyleft/gpl.html
|
|
|
|
|
*
|
|
|
|
|
* @file
|
2020-02-04 21:44:38 +00:00
|
|
|
* @ingroup entrypoint
|
2020-02-05 22:53:25 +00:00
|
|
|
* @ingroup API
|
2009-03-21 16:48:09 +00:00
|
|
|
*/
|
2006-10-01 04:38:31 +00:00
|
|
|
|
2023-12-08 09:47:13 +00:00
|
|
|
use MediaWiki\Api\ApiEntryPoint;
|
2024-02-08 14:56:54 +00:00
|
|
|
use MediaWiki\Context\RequestContext;
|
2023-12-08 09:47:13 +00:00
|
|
|
use MediaWiki\EntryPointEnvironment;
|
2023-05-06 20:01:10 +00:00
|
|
|
use MediaWiki\MediaWikiServices;
|
2015-03-23 00:53:24 +00:00
|
|
|
|
2010-12-10 22:39:17 +00:00
|
|
|
// So extensions (and other code) can check whether they're running in API mode
|
|
|
|
|
define( 'MW_API', true );
|
2019-09-02 23:55:00 +00:00
|
|
|
define( 'MW_ENTRY_POINT', 'api' );
|
2010-12-10 22:39:17 +00:00
|
|
|
|
2013-05-17 00:16:59 +00:00
|
|
|
require __DIR__ . '/includes/WebStart.php';
|
2006-10-01 04:38:31 +00:00
|
|
|
|
2023-12-08 09:47:13 +00:00
|
|
|
// Construct entry point object and call doRun() to handle the request.
|
|
|
|
|
( new ApiEntryPoint(
|
|
|
|
|
RequestContext::getMain(),
|
|
|
|
|
new EntryPointEnvironment(),
|
|
|
|
|
MediaWikiServices::getInstance()
|
|
|
|
|
) )->run();
|