Go to the documentation of this file.
34 define(
'MW_API',
true );
37 if ( !function_exists(
'version_compare' ) || version_compare( phpversion(),
'5.3.2' ) < 0 ) {
39 require dirname( __FILE__ ) .
'/includes/PHPVersionError.php';
43 require __DIR__ .
'/includes/WebStart.php';
49 if ( !$wgRequest->checkUrlExtension() ) {
54 if ( !$wgEnableAPI ) {
55 header( $_SERVER[
'SERVER_PROTOCOL'] .
' 500 MediaWiki configuration Error',
true, 500 );
56 echo
'MediaWiki API is not enabled for this site. Add the following line to your LocalSettings.php'
57 .
'<pre><b>$wgEnableAPI=true;</b></pre>';
75 throw new MWException(
'ApiBeforMain hook set $processor to a non-ApiMain class' );
77 }
catch ( Exception
$e ) {
88 if ( function_exists(
'fastcgi_finish_request' ) ) {
89 fastcgi_finish_request();
102 if ( $wgAPIRequestLog ) {
107 $_SERVER[
'HTTP_USER_AGENT']
109 $items[] = $wgRequest->wasPosted() ?
'POST' :
'GET';
112 if ( $module->mustBePosted() ) {
113 $items[] =
"action=" . $wgRequest->getVal(
'action' );
118 $items[] =
"failed in ApiBeforeMain";
120 wfErrorLog( implode(
',', $items ) .
"\n", $wgAPIRequestLog );
121 wfDebug(
"Logged API request to $wgAPIRequestLog\n" );
This is the main API class, used for both external and internal processing.
static & makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
wfErrorLog( $text, $file)
Log to a file without getting "file size exceeded" signals.
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
wfProfileIn( $functionname)
Begin profiling of a function.
static handleApiBeforeMainException(Exception $e)
Handle an exception from the ApiBeforeMain hook.
wfPHPVersionError( $type)
Display something vaguely comprehensible in the event of a totally unrecoverable error.
static doUpdates( $commit='')
Do any deferred updates and clear the list.
if( $wgAPIRequestLog) $lb
wfProfileOut( $functionname='missing')
Stop profiling of a function.
wfRunHooks( $event, array $args=array(), $deprecatedVersion=null)
Call hook functions defined in $wgHooks.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
const TS_MW
MediaWiki concatenated string timestamp (YYYYMMDDHHMMSS)
wfDebug( $text, $dest='all')
Sends a line to the debug log if enabled or, optionally, to a comment in output.
static getMain()
Static methods.
& wfGetLBFactory()
Get the load balancer factory object.
if(! $wgRequest->checkUrlExtension()) if(! $wgEnableAPI) $wgTitle
wfArrayToCgi( $array1, $array2=null, $prefix='')
This function takes two arrays as input, and returns a CGI-style string, e.g.