-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathapi.php
More file actions
30 lines (26 loc) · 780 Bytes
/
api.php
File metadata and controls
30 lines (26 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
/**
* The web entry point for all %Action API queries, handled by ApiMain
* and ApiBase subclasses.
*
* @see ApiEntryPoint The corresponding entry point class
*
* @license GPL-2.0-or-later
* @file
* @ingroup entrypoint
* @ingroup API
*/
use MediaWiki\Api\ApiEntryPoint;
use MediaWiki\Context\RequestContext;
use MediaWiki\EntryPointEnvironment;
use MediaWiki\MediaWikiServices;
// So extensions (and other code) can check whether they're running in API mode
define( 'MW_API', true );
define( 'MW_ENTRY_POINT', 'api' );
require __DIR__ . '/includes/WebStart.php';
// Construct entry point object and call doRun() to handle the request.
( new ApiEntryPoint(
RequestContext::getMain(),
new EntryPointEnvironment(),
MediaWikiServices::getInstance()
) )->run();