Add an API log
authorTim Starling <tstarling@wikimedia.org>
Wed, 19 Sep 2012 10:07:48 +0000 (20:07 +1000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 24 Sep 2012 21:22:09 +0000 (21:22 +0000)
commit343cbf74638ef5ee0f22d8bc822f400db2ef9661
tree2b92a9d9446d028e7717881fbf438f0032e1774a
parent9b6a9fdc8de6651786517c9ccea475377f815ddd
Add an API log

During incident response, it was not possible to tell what API modules
were being requested and by whom, since the action parameter is often
posted. This change logs the API parameters whether they are posted or
sent in the query string.

I did try to get the API parameters from the module, but that turns out
to be difficult. Modules create submodules (generators, page sets) as
local variables, which are created in a procedural style and destroyed
before logging is done, so there is no easy way to query them for
parameter lists after execution completes.

In ApiOptionsTest, use a real ApiMain object like all the other API test
cases, rather than a mock object. Otherwise the test fails.

Change-Id: Idc786007fe61811d1874f29b5ce4762dd97b1847
includes/api/ApiBase.php
includes/api/ApiMain.php
tests/phpunit/includes/api/ApiOptionsTest.php