X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=api.php;h=9d7f6480ed31ba929416abc76c4559344256f8ce;hb=619a3f3b85fb7fc6d900288129e33a611f614621;hp=94266d88fbf945fc0259d2db475c9f3f044787cb;hpb=cbc5ea8f3b86c5bc7852bd708fc59b918cb40bf9;p=lhc%2Fweb%2Fwiklou.git diff --git a/api.php b/api.php index 94266d88fb..9d7f6480ed 100644 --- a/api.php +++ b/api.php @@ -8,7 +8,7 @@ * as an argument in the URL ('?action=') and with write-enabled set to the * value of $wgEnableWriteAPI as specified in LocalSettings.php. * It then invokes "execute()" on the ApiMain object instance, which - * produces output in the format sepecified in the URL. + * produces output in the format specified in the URL. * * Copyright © 2006 Yuri Astrakhan @gmail.com * @@ -41,11 +41,7 @@ if ( !function_exists( 'version_compare' ) || version_compare( phpversion(), '5. } // Initialise common code. -if ( isset( $_SERVER['MW_COMPILED'] ) ) { - require ( 'core/includes/WebStart.php' ); -} else { - require ( __DIR__ . '/includes/WebStart.php' ); -} +require ( __DIR__ . '/includes/WebStart.php' ); wfProfileIn( 'api.php' ); $starttime = microtime( true ); @@ -58,9 +54,9 @@ if ( !$wgRequest->checkUrlExtension() ) { // Verify that the API has not been disabled if ( !$wgEnableAPI ) { header( $_SERVER['SERVER_PROTOCOL'] . ' 500 MediaWiki configuration Error', true, 500 ); - echo( 'MediaWiki API is not enabled for this site. Add the following line to your LocalSettings.php' - . '
$wgEnableAPI=true;
' ); - die(1); + echo 'MediaWiki API is not enabled for this site. Add the following line to your LocalSettings.php' + . '
$wgEnableAPI=true;
'; + die( 1 ); } // Set a dummy $wgTitle, because $wgTitle == null breaks various things @@ -87,10 +83,10 @@ wfLogProfilingData(); // Log the request if ( $wgAPIRequestLog ) { $items = array( - wfTimestamp( TS_MW ), - $endtime - $starttime, - $wgRequest->getIP(), - $_SERVER['HTTP_USER_AGENT'] + wfTimestamp( TS_MW ), + $endtime - $starttime, + $wgRequest->getIP(), + $_SERVER['HTTP_USER_AGENT'] ); $items[] = $wgRequest->wasPosted() ? 'POST' : 'GET'; $module = $processor->getModule(); @@ -107,4 +103,3 @@ if ( $wgAPIRequestLog ) { // get here to worry about whether this should be = or =&, but the file has to parse properly. $lb = wfGetLBFactory(); $lb->shutdown(); -