X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=api.php;h=a6ce3b25e317d114b7f382ce4e73002dc2b959d1;hp=83c1373c14a97b645ad1d7948e1b774ded6806d0;hb=5886ad074709f1737d480526545af889950aae8e;hpb=1d489846c1691d2ba93220e09891c990543dabb1 diff --git a/api.php b/api.php index 83c1373c14..a6ce3b25e3 100644 --- a/api.php +++ b/api.php @@ -63,12 +63,12 @@ RequestContext::getMain()->setTitle( $wgTitle ); try { /* Construct an ApiMain with the arguments passed via the URL. What we get back * is some form of an ApiMain, possibly even one that produces an error message, - * but we don't care here, as that is handled by the ctor. + * but we don't care here, as that is handled by the constructor. */ $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' ); } @@ -88,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 {