(bug 18195) Allow changing preferences via API
authorSzymon Świerkosz <beau@adres.pl>
Mon, 16 Apr 2012 20:02:34 +0000 (22:02 +0200)
committerAndrew Garrett <agarrett@wikimedia.org>
Fri, 20 Apr 2012 06:56:27 +0000 (16:56 +1000)
commita6cd69d83a631cc39277eb88bdc22ab688b45746
treefc4ab74060f351f1dc8c91554c5813fed7d07efe
parent0e6dc67f120910b959bb7081f6b2afaf4e4e696b
(bug 18195) Allow changing preferences via API

I have created an API module for changing the preferences.
It allows resetting preferences (reset argument) and bulk changes
of preferences (change argument) in a format:
name1=value1|name2=value2

The change argument has a limitation imposed by the current API
implementation as it cannot accept | in values. There is
available a pair of arguments optionname and optionvalue, the
latter accepts values with |.

I have created optionstoken parameter in meta=userinfo to provide
a token. There is already preferencestoken there, but I would
like to have a consistent naming.

Change-Id: I0d6c654a7354ba77e65e338423952a6a78c1150f
includes/AutoLoader.php
includes/User.php
includes/api/ApiMain.php
includes/api/ApiOptions.php [new file with mode: 0644]
includes/api/ApiQueryUserInfo.php
tests/phpunit/includes/api/ApiOptionsTest.php [new file with mode: 0644]