require (dirname(__FILE__) . '/includes/WebStart.php');
wfProfileIn('api.php');
+$starttime = microtime( true );
// URL safety checks
//
wfDoUpdates();
// Log what the user did, for book-keeping purposes.
+$endtime = microtime( true );
wfProfileOut('api.php');
wfLogProfilingData();
+// Log the request
+if ( $wgAPIRequestLog ) {
+ wfErrorLog( implode( ',', array(
+ wfTimestamp( TS_MW ),
+ $endtime - $starttime,
+ wfGetIP(),
+ wfArrayToCGI( $wgRequest->getValues() )
+ ) ) . "\n", $wgAPIRequestLog );
+ wfDebug( "Logged API request to $wgAPIRequestLog\n" );
+}
+
// Shut down the database
wfGetLBFactory()->shutdown();
*/
$wgAPIMaxUncachedDiffs = 1;
+/**
+ * Log file or URL (TCP or UDP) to log API requests to, or false to disable
+ * API request logging
+ */
+$wgAPIRequestLog = false;
+
/**
* Parser test suite files to be run by parserTests.php when no specific
* filename is passed to it.