+// Log the request
+if ( $wgAPIRequestLog ) {
+ $items = array(
+ wfTimestamp( TS_MW ),
+ $endtime - $starttime,
+ $wgRequest->getIP(),
+ $_SERVER['HTTP_USER_AGENT']
+ );
+ $items[] = $wgRequest->wasPosted() ? 'POST' : 'GET';
+ $module = $processor->getModule();
+ if ( $module->mustBePosted() ) {
+ $items[] = "action=" . $wgRequest->getVal( 'action' );
+ } else {
+ $items[] = wfArrayToCGI( $wgRequest->getValues() );
+ }
+ wfErrorLog( implode( ',', $items ) . "\n", $wgAPIRequestLog );
+ wfDebug( "Logged API request to $wgAPIRequestLog\n" );
+}
+
+// Shut down the database. foo()->bar() syntax is not supported in PHP4: we won't ever actually
+// get here to worry about whether this should be = or =&, but the file has to parse properly.
+$lb = wfGetLBFactory();
+$lb->shutdown();