API continue param to streamline iteration of complex queries
authorYuri Astrakhan <yuriastrakhan@gmail.com>
Sat, 2 Mar 2013 00:06:46 +0000 (19:06 -0500)
committerYuri Astrakhan <yuriastrakhan@gmail.com>
Sat, 2 Mar 2013 00:06:46 +0000 (19:06 -0500)
commit68820277aff9409f54494eb35c4cb005d3cd98aa
treee16502be60339906c8e7c0188fa87f50778fbadf
parentea77ca659d8a4d15ed34ef8383a6830055d9e15c
API continue param to streamline iteration of complex queries

Greatly simplifies query result iteration by the clients
by providing a mechanism to track sub-iterations (props in generated set)

Assuming the client has the param=>value dictionary with the original request
parameters, client will only need to perform this operation in their language
to get all results from the server regardless of what query they make.

  $request = array_merge( $request, $result['continue'] );

Related changes:
* Moved dieContinueUsageIf() from ApiQueryBase to ApiBase
* Internal calls will also return unused param warnings
* Reworked query unit tests for easier testing

Change-Id: Ieb45241fc6db2109f1d92fa3381165ec30701b63
13 files changed:
RELEASE-NOTES-1.21
includes/api/ApiBase.php
includes/api/ApiMain.php
includes/api/ApiPageSet.php
includes/api/ApiQuery.php
includes/api/ApiQueryBase.php
includes/api/ApiResult.php
tests/phpunit/StructureTest.php
tests/phpunit/includes/api/query/ApiQueryBasicTest.php
tests/phpunit/includes/api/query/ApiQueryContinue2Test.php [new file with mode: 0644]
tests/phpunit/includes/api/query/ApiQueryContinueTest.php [new file with mode: 0644]
tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php [new file with mode: 0644]
tests/phpunit/includes/api/query/ApiQueryTestBase.php [new file with mode: 0644]