X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=api.php;h=6e75fb746ae672de4f99b3bc18b6b718fa17a9a1;hp=af7c452550f19fb11aa3e49d7cdf7e41b9770c05;hb=60dd35ede4dd255328cee18caf1250c973c7d10f;hpb=f1a890c34cebd8744bf3a6277734275fb975575a diff --git a/api.php b/api.php index af7c452550..6e75fb746a 100644 --- a/api.php +++ b/api.php @@ -35,11 +35,6 @@ use MediaWiki\Logger\LegacyLogger; // So extensions (and other code) can check whether they're running in API mode define( 'MW_API', true ); -// Bail on old versions of PHP, or if composer has not been run yet to install -// dependencies. Using dirname( __FILE__ ) here because __DIR__ is PHP5.3+. -require_once dirname( __FILE__ ) . '/includes/PHPVersionCheck.php'; -wfEntryPointCheck( 'api.php' ); - require __DIR__ . '/includes/WebStart.php'; $starttime = microtime( true ); @@ -73,7 +68,7 @@ try { $processor = new ApiMain( RequestContext::getMain(), $wgEnableWriteAPI ); // Last chance hook before executing the API - Hooks::run( 'ApiBeforeMain', array( &$processor ) ); + Hooks::run( 'ApiBeforeMain', [ &$processor ] ); if ( !$processor instanceof ApiMain ) { throw new MWException( 'ApiBeforeMain hook set $processor to a non-ApiMain class' ); } @@ -93,12 +88,12 @@ $endtime = microtime( true ); // Log the request if ( $wgAPIRequestLog ) { - $items = array( + $items = [ wfTimestamp( TS_MW ), $endtime - $starttime, $wgRequest->getIP(), $wgRequest->getHeader( 'User-agent' ) - ); + ]; $items[] = $wgRequest->wasPosted() ? 'POST' : 'GET'; if ( $processor ) { try {