Move <warnings> and <query-continue> to result's top and optimize
authorYuri Astrakhan <yuriastrakhan@gmail.com>
Tue, 19 Feb 2013 16:40:07 +0000 (11:40 -0500)
committerBrad Jorsch <bjorsch@wikimedia.org>
Tue, 19 Feb 2013 16:45:44 +0000 (11:45 -0500)
commit86ce0ee506b46079255ab7cfdf07f7b18ba2f470
tree52ef2307a2f903e4a9cd2298386ec80e696544fb
parentf3a4d362106a90dc66925bef5ea63f723a434fed
Move <warnings> and <query-continue> to result's top and optimize

* Both the warnings and query-continue elements will now be shown
at the top of the result, making it easier for debugging and learning.
* Added int $flags parameter instead of bool $overwrite for addValue()
and setElement(). Supported flags are OVERRIDE - overrides existing value,
same meaning as true (which will continue to work), and ADD_ON_TOP which
ensures that if the value being added does not exist, it will be placed
as the first element in the parent array.
* Optimized ApiBase::setWarning to no longer use regex (faster)
* Optimized ApiResult::addValue() for a bit more efficiency
* Added ApiResult::addAsFirstElement() that inserts a named value into
the array at the top

Change-Id: I0fa2697e1eaa4947d01527bb3ad555e1051f6be4
RELEASE-NOTES-1.21
includes/api/ApiBase.php
includes/api/ApiQueryBase.php
includes/api/ApiResult.php