X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=api.php;h=1cd549747c42109fb9a609676d268086766ccde3;hb=7b0534c87477b8c5af7c1258f53ab00e20c21b9f;hp=154e168efd418e43234167a3a0ed336a8d65f1d1;hpb=a0fbb287ae58054ee3d9b69bf1afaf4edea327bb;p=lhc%2Fweb%2Fwiklou.git diff --git a/api.php b/api.php index 154e168efd..1cd549747c 100644 --- a/api.php +++ b/api.php @@ -1,9 +1,16 @@ @gmail.com + * Copyright © 2006 Yuri Astrakhan @gmail.com * * 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 @@ -23,29 +30,18 @@ * @file */ -/** - * This file is the entry point for all API queries. It begins by checking - * whether the API is enabled on this wiki; if not, it informs the user that - * s/he should set $wgEnableAPI to true and exits. Otherwise, it constructs - * a new ApiMain using the parameter passed to it 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. - */ - // So extensions (and other code) can check whether they're running in API mode define( 'MW_API', true ); // Bail if PHP is too low -if ( !function_exists( 'version_compare' ) || version_compare( phpversion(), '5.2.3' ) < 0 ) { +if ( !function_exists( 'version_compare' ) || version_compare( phpversion(), '5.3.2' ) < 0 ) { require( dirname( __FILE__ ) . '/includes/PHPVersionError.php' ); wfPHPVersionError( 'api.php' ); } // Initialise common code. if ( isset( $_SERVER['MW_COMPILED'] ) ) { - require ( 'phase3/includes/WebStart.php' ); + require ( 'core/includes/WebStart.php' ); } else { require ( dirname( __FILE__ ) . '/includes/WebStart.php' ); } @@ -105,9 +101,6 @@ if ( $wgCrossSiteAJAXdomains && isset( $_SERVER['HTTP_ORIGIN'] ) ) { // Set a dummy $wgTitle, because $wgTitle == null breaks various things // In a perfect world this wouldn't be necessary -// -// @todo @fixme Ummmm, doesn't this line make the PHP4 check at the top completely -// useless? Suggest moving more stuff out of api.php like we did with index.php $wgTitle = Title::makeTitle( NS_MAIN, 'API' ); /* Construct an ApiMain with the arguments passed via the URL. What we get back @@ -120,7 +113,7 @@ $processor = new ApiMain( $wgRequest, $wgEnableWriteAPI ); $processor->execute(); // Execute any deferred updates -wfDoUpdates(); +DeferredUpdates::doUpdates(); // Log what the user did, for book-keeping purposes. $endtime = microtime( true );