Commit graph

192 commits

Author SHA1 Message Date
Yuri Astrakhan
0aa24ae558 Fixed many small spelling mistakes and php docs, var decl.
Change-Id: I1508ed7eb77e5e4f700fb63955d626c4f5915840
2013-03-10 23:45:51 -04:00
Reedy
c3e4057e06 Kill off numerous unused variables
Change-Id: I7039f1328f37ee669b694f73ee282602186bffd1
2013-03-08 02:36:24 +00:00
Brad Jorsch
89a222dd86 Limit ApiQueryImageInfo transform calls
Apparently calls to File::transform can be slow. Add code to limit these
calls in prop=imageinfo.

The only effect for clients will be a possibility of seeing iicontinue
more often.

Once this is merged, TimedMediaHandler's ApiQueryVideoInfo.php should be
updated in the same way.

Change-Id: Id0ec6a0afb85ca73eefb5b8370c2147c37f037e9
2013-02-20 13:51:16 -05:00
Brad Jorsch
2c9dfcb7d1 Clean up ApiQueryImageInfo continuation
Reviewing this code, I spotted a few issues:
* 'imagerepository' is added to non-images, and to images that were
  skipped this round due to iicontinue. The latter is particularly
  troublesome, as clients may wind up with an incorrect value when
  merging continued results.
* Say two images are being queried, A.jpg and B.jpg. If the query needs
  to be continued somewhere in the middle of A.jpg's old versions, but
  then A.jpg is deleted before the client sends the continuation query,
  it will start in the middle of B.jpg's old versions instead of at the
  beginning of B.jpg's revisions.
* If the query needs to be continued somewhere in the middle of A.jpg's
  old versions, but in the continuation query some other module that is
  also being continued fills the result object, iicontinue will be
  reset to the *beginning* of A.jpg's old versions instead of preserving
  the position in the middle.

Change-Id: I08e2941010c7a70ff90b6244bfddd5ed0540fc9f
2013-02-07 16:50:17 -05:00
umherirrender
f97a3a4027 fix some spacing
Change-Id: I670a7baf3ba1e70d18346bb00938d518ba2063bd
2013-02-04 19:59:14 +00:00
Brad Jorsch
6a9ec23612 (bug 31849) API imageinfo correctly handle redirects
RepoGroup::singleton()->findFiles() returns an associative array mapping
the redirect *target* to the image object; the image object refers back
to the original title queried.

If a redirect and its target are both queried,
RepoGroup::singleton()->findFiles() will return an entry for the target
title only, mapping to an image object that may have getOriginalTitle()
returning the redirect. If this happens, prop=imageinfo will never see
an entry for which getOriginalTitle()->isRedirect() is false and so will
not return any information about the image.

The fix is to ignore getOriginalTitle() entirely. Instead, we just go
through each of our queried titles and see if we got any result back.

Note this automatically handles a "redirects=1" query correctly, since
in that case any local redirect will already have been followed before
we ever got the list of titles to query.

Change-Id: I0b2982901e2dc4491e2933291fd97697b2a622a9
2013-01-22 14:31:38 -05:00
Yuri Astrakhan
503cd2f4ae (bug 35885) remove api version string and parameter
API was using SVN's version keyword which GIT does not support.
All related methods were either removed, or for those that
could have been used from extensions, emptied out.
api.php?version now shows unrecognized param warning.

Change-Id: I910ca1448ed2ed697ac19b17c486d130aa1d7e03
2013-01-18 12:41:18 -05:00
Yuri Astrakhan
983545c362 API Cleanup: renamed '_badcontinue'->'badcontinue', one die()
* If a query module has 'continue' parameter, it will auto-report
that it has 'badcontinue' error.
* Added APIQueryBase::DieUsageContinueIf( $condition ) that shows
correct badcontinue error if $condition is true.

Change-Id: I9c48bda6de0cde3c117ad24460bddf6980279633
2013-01-14 21:19:16 -05:00
Yuri Astrakhan
32fd68f81c Minor cleanup
Fixed spacing, eol chars, "string" --> 'string'

Change-Id: I630247c6c5b469efb67ec9de32e8533ae88e59fb
2013-01-12 01:50:48 -05:00
btongminh
f14f01a33b (bug 36751) InstantCommons doesn't follow redirects
This fixes r56837: now redirects are only skipped if the redirects query
parameter is not set. This was presumably the intent of that commit, see
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/56837#code-comments

Change-Id: I27485bba9fe196211baeeb84238e4a397c620a1d
2012-12-22 16:36:16 +01:00
umherirrender
dd26d2b8e7 Add 'dimensions' and 'thumbmine' to resultproperties in prop=imageinfo
This also effects list=allimages/prop=stashimageinfo

Change-Id: I5fee9539f376a2164f3143f23c23aa18fb96a4b8
2012-11-18 18:25:19 +00:00
Reedy
25231f842e Bug 41234 - api prop=imageinfo broken on PHP 5.4
Fix by Roan

Change-Id: I14d8da45f7655ded501e3dd48dbdd424ecacc885
2012-10-20 03:23:27 +01:00
btongminh
5aab0ff71e (bug 35693) ApiQueryImageInfo now suppresses errors when unserializing
metadata

Change-Id: I7c9649b54a9d1d8f8b79beff7435a32860b80a61
2012-09-23 20:52:00 +02:00
umherirrender
a57ea5c3ad Add localonly= to prop duplicatefiles and imageinfo
When looking only for local files, the localonly param skipped the
mabye expensive look up inside the file repos.

Change-Id: Ib8f38d6abf9238a349bbfd617a36933bdfe74b5c
2012-08-01 19:51:23 +02:00
Aaron Schulz
e6faa2fd76 Merge "escape HTML elements in docblock with double quotes" 2012-07-18 19:17:46 +00:00
Catrope
2217f124da Merge "prop=imageinfo&iiprop=url|thumbmime needs iiurlwidth=" 2012-07-18 01:42:33 +00:00
Antoine Musso
4f5d2386f3 escape HTML elements in docblock with double quotes
Doxygen choke on text enclosed by '<' and '>' since it tries to
interpret them as HTML or XML elements. This patch adds double quotes
in includes/api/*.php files around the two following strings:

 <Firstname>.<Lastname>@gmail.com
 <Firstname><Lastname>@gmail.com

Which becomes:

 "<Firstname>.<Lastname>@gmail.com"
 "<Firstname><Lastname>@gmail.com"

Tested locally, it prevents doxygen 1.8.0 related warnings.

Change-Id: I36d82eb3fd4989ee3ffc65b0b527b83711d1ba69
2012-07-15 22:15:45 +02:00
umherirrender
87524b1e75 (bug 38376) call to undefined method ThumbnailImage::getPath()
* Added MediaTransformOutput::getExtension() function and use it instead.
* Also fixed getScriptedTransform() to not pass the page as the path parameter.

Change-Id: I6c530aa155d62a6bfd5727c6f3d104fe91453745
2012-07-15 14:09:43 +02:00
umherirrender
dbea761c29 prop=imageinfo&iiprop=url|thumbmime needs iiurlwidth=
A thumb is only generated when prop=url and a urlwidth is given. Adding
a hint to param description.
list=allpages does not have a urlwidth param and therefor cannot get the
thumbmime, adding thumbmime to the filter list to remove it from output

Change-Id: Ic1dbdb9b07f6325756058d6a0aa6ea148499fdfb
2012-07-13 17:25:22 +02:00
umherirrender
a9a71011ff Change some NS_IMAGE to NS_FILE
Change-Id: Id530c88d24df1a47a2f6565911184008b67fe04d
2012-06-24 21:50:10 +02:00
Petr Onderka
80aa025528 Added result properties to action=paraminfo
Added information about the properties of the results of API calls
to action=paraminfo, including information about "property groups":
what should the prop parameter be set to to get that property.

Uses the same format for types as parameters already do.
The output format of some modules doesn't fit this, so the result
properties for them weren't added, or only partially.

Partially implemented modules:
* expandtemplates:
  parsetree is in its own tag
* protect, allusers, backlinks, deletedrevs, info, imageinfo,
  logevents, querypage, recentchanges, revisions, searchinfo,
  usercontribs, userinfo, users, watchlist, upload:
  response with partially complex structure

Not implemented modules:
* feedcontributions, feedwatchlist, opensearch, rds:
  non-standard reponse
* help:
  error is normal response; not very useful for automated tools anyway
* paraminfo, parse, pageprops, siteinfo, userrights:
  response with complex structure

Change-Id: Iff2a9bef79f994e73eef3062b4dd5461bff968ab
2012-06-06 19:24:59 +02:00
Reedy
2173e1fbee Make getContinueStr protected as it's used in subclass by TMH
Change-Id: I3bd265805122d3ae12b986d1396ca634ca9f8097
2012-05-08 19:08:43 +01:00
Sam Reed
53000baecf Oh noes, moar http:// -> https:// 2011-11-28 15:43:11 +00:00
John Du Hart
2e7d867478 Removed the 'eclipse helper' bit on top of every API module
It's a parctice that dates back to 2006 when the API was first written, and frankly isn't covered by the coding conventions. Same thing with the docblocks, they're all copypasted with some bits changed and don't even make sense if you look at them in the genereated code docs.
I don't feel that any of us depend on this anymore (get a better IDE), so in the inerest of consistancy it's time we said goodbye to it.
2011-11-16 00:17:26 +00:00
Alexandre Emsenhuber
da4edaaf40 Call Linker methods statically 2011-09-16 19:35:14 +00:00
Roan Kattouw
d8a2733757 Make the PROTO_ parameter to wfExpandUrl() explicit in all calls. There are now no calls to wfExpandUrl() in core that rely on PROTO_CURRENT being the default. Also switch to using getCanonicalUrl() for.... rel="canonical" :D (I picked the right name, I KNEW IT) 2011-08-19 15:46:08 +00:00
Sam Reed
a5628f5734 Based on diff to wikia, set more functions consistently public rather than protected 2011-08-17 22:24:21 +00:00
Roan Kattouw
fbdba8b26f Revert r93802 per CR. Will avoid cache pollution by splitting the cache instead 2011-08-03 07:54:23 +00:00
Roan Kattouw
541aa4cbdd Followup r92044: force HTTP on URLs output by the API, now that wfExpandUrl() has a flag for this 2011-08-03 07:05:21 +00:00
Sam Reed
d5e46f9614 Followup r92396
More modules documented, pretty much only action=query&list= to be done (ie links added where documentation pages exist already)
2011-07-17 16:51:11 +00:00
Roan Kattouw
7b8b23e8b4 Per wikitech-l, run a bunch of URLs in the API output through wfExpandUrl(), so they become fully-qualified even if they were originally protocol-relative 2011-07-13 01:27:07 +00:00
Sam Reed
bdf84cb20e Swap else if for elseif
Trimming trailing whitespace also

Doing in 3 commits, so hopefully reviewable in CR...
2011-06-17 16:03:52 +00:00
Sam Reed
202f4d7443 Fixup error message
Remove {} (documentation tweaks)

Remove whitespace
2011-06-05 23:44:37 +00:00
Sam Reed
f4b92d6b4b Add missing word to r89505 2011-06-05 15:12:38 +00:00
Sam Reed
ef6afb5d9e Tweak documentation
Add braces
2011-04-29 23:34:37 +00:00
Chad Horohoe
783d4e0862 Remove @static from all over the place. That's what the static keyword is for, this being PHP5 and all 2011-04-21 00:07:09 +00:00
Brian Wolff
74f16767e7 Merge to trunk everything in img_metadata branch.
Hope I did this in an ok fashion. svn merge --re-integrate was giving me issues
so I just essentially over-wrote my working copy with the version at img_metadata.
2011-04-16 01:23:15 +00:00
Sam Reed
ea056f5171 Fixup a few undefined variables and alike while checking REL1_17 2011-04-04 21:13:34 +00:00
Bryan Tong Minh
100ecff40e Get the thumbmime from the handler instead of guessing it with UnregisteredLocalFile. 2011-04-02 14:49:12 +00:00
Sam Reed
9818053bd3 * (bug 27589) list=allimages&aiprop=archivename is useless
Followup r84433

Add way to filter returned properties/descriptions
2011-03-21 23:51:26 +00:00
Sam Reed
db3698860a Start of bug 27586/bug 27589
Turn properties into a filterable key/value pair, but leave exisiting wrapper methods in place for the moment

Will finish it off later
2011-03-20 23:50:59 +00:00
Bryan Tong Minh
2c145e77b0 Follow-up r83286: detabify description for mediatype 2011-03-05 15:14:49 +00:00
Bryan Tong Minh
6b70a9f121 (bug 27590) prop=imageinfo now allows querying the media type 2011-03-05 14:56:49 +00:00
Sam Reed
dcda4332c9 Tweak some documentation
Add some braces

Explicitally define a variable
2011-02-27 00:40:06 +00:00
Sam Reed
66d3616fc6 Followup r82810, r82813, r82814
Only display hidden stuff if any vaguely related property is set
2011-02-25 21:41:19 +00:00
Sam Reed
3f3e6617a4 Fix double indenting 2011-02-25 20:24:08 +00:00
Sam Reed
19e698b82c One minor followup to r82810
return $vals; early, rather than indenting all of the code another level
2011-02-25 20:22:54 +00:00
Brian Wolff
a1eb4a0973 (follow-up r82810) Address Reedy's comments on irc. 2011-02-25 20:16:19 +00:00
Brian Wolff
c09deaa426 (bug 27715) Make imageinfo api module respect revDelete.
This treats metadata and similar properties to be deleted if the file is deleted, since they
are derived from the file, and i know examples of where the file was deleted to hide sensitive
data in exif. Does still show the file size if file is deleted, because that is what is done
in interface. Follows what ApiQueryLogEvents does and outputs userhidden="" if the user cannot
be displayed due to being hidden.

Due to this bug, all the secret oversight cabal info could be visible for images, so probably
should be merged into wmf stuff soon as possible.
2011-02-25 19:51:37 +00:00
Sam Reed
442bec4f9b Commit stuff from my w/c
Remove white line

Make second if else if (they're opposites)
2011-02-25 16:53:33 +00:00
Sam Reed
14e998aae5 Followup r82509, prefix the code for urlwidth too 2011-02-20 13:59:40 +00:00
Sam Reed
adf3254f47 Remove error duplication in ApiQueryStashImageInfo by using non hardcoded prefix in ApiQueryImageInfo 2011-02-20 13:51:24 +00:00
Sam Reed
7906fde17e * (bug 27554) Update api information text to reflect change in bug 26125 2011-02-19 19:52:08 +00:00
Sam Reed
fa64025161 More parameter documentation 2011-02-19 00:30:18 +00:00
Bryan Tong Minh
a65582f4e8 Follow-up r82049: Fix strict comparison because MediaHandler::parseParamString() is not guaranteed to use intval() on the width and height parameters.
Add __METHOD__ to wfDebug() call.
2011-02-13 20:38:05 +00:00
Brian Wolff
fc5df5e52d (follow-up r81558) Per suggestion, make this use media handler's getParamString/parseParamString
Additionally, rename makeThumbParam back to getScale since that makes more sense now.
Also update the version number used in ForeignAPIRepo user-agent, since this is kind of significant change.
2011-02-13 07:30:49 +00:00
Bryan Tong Minh
0680ff6df2 Follow-up r81971: Can't use $this->setWarning() in static context, so append the error to the imageinfo array instead 2011-02-12 14:49:34 +00:00
Bryan Tong Minh
de9b4fb463 Follow-up r81971: Fix error handling 2011-02-11 15:42:28 +00:00
Bryan Tong Minh
290e4486a6 * (bug 27199) Thumbnail urls can be fetched for old files as well 2011-02-11 15:40:39 +00:00
Bryan Tong Minh
b6688f5b02 Follow-up r81558: Only raise a warning if no image handler could be found 2011-02-11 15:31:52 +00:00
Platonides
8ce7093775 Use of undefined constant h in line 250. Follow up to r81558 2011-02-08 22:08:58 +00:00
Sam Reed
41c35b3aa4 * (bug 27205) aiprop=metadata and aiprop=parsedcomment need help text
Refactored code out to reduce duplication (and hence, mismatches like this)
2011-02-06 23:59:03 +00:00
Brian Wolff
ec2af084d2 (bug 26548) Make multi-paged documents (PDFs) work with ForeignAPIRepo (aka InstantCommons).
This adds a new parameter to the query=imageinfo (and query=stashimageinfo) that takes rendering
parameters other than width and height. This could be page for pdf's and DjVu, or thumbtime for ogg's, etc.
Syntax is &iiurlparam=param1=value1|param2=value2|... I'm not sure if that really fits with the normal way
of doing things in the api, but couldn't think of anything better since the parameters are arbitrary.

I also noticed that some of the pre-existing error codes in query=imageinfo seem to duplicate the module prefix. I'm
not sure what the deal with that is, but i did not follow that example in the new error codes i introduced.

Note: In order for this to work, both the foreign repo and the local wiki have to be running this code.
2011-02-05 08:49:48 +00:00
Sam Reed
e0373cc450 Per CR on r68482, fix adss to add
Also remove trailing whitespace in files
2010-12-30 00:56:30 +00:00
Sam Reed
6309c920dd Delete all the "API for MediaWiki 1.8+" comments
Add since to ApiQueryQueryPage
2010-12-22 20:52:06 +00:00
Roan Kattouw
b81ac8ea52 Improve some of the descriptions added in r68482 2010-12-14 11:47:13 +00:00
Bryan Tong Minh
3406091152 (bug 26125) prop=imageinfo&iiprop=size now returns the page count if the file is a multi-page file
Also fix blatant lie in File::pageCount()
2010-11-27 18:51:17 +00:00
Sam Reed
6706fcb62a Fixed up some doxygen warnings 2010-11-13 00:32:54 +00:00
Neil Kandalgaonkar
902995cb1d core changes for UploadWizard (merged from r73549 to HEAD in branches/uploadwizard/phase3) 2010-11-03 04:32:41 +00:00
Bryan Tong Minh
7f71612ac8 Added iiprop=parsedcomment to prop=imageinfo, similar to prop=revisions 2010-10-23 15:40:55 +00:00
Sam Reed
f0f79d19c2 Add missing @'s to r73753, document return type 2010-09-25 17:17:27 +00:00
Sam Reed
ee40f73227 Remove some unused keys from foreach
Documentation tweaks
2010-09-25 16:56:03 +00:00
Sam Reed
68b89f0b6b Followup r71831, it's not mutually exclusive!
Add missing if
2010-08-28 00:54:16 +00:00
Sam Reed
fd976ad072 Part of Bug 19195 - Make user IDs more readily available with the API
ApiQueryAllUsers, ApiQueryImageInfo and ApiQueryRevisions exposing user_id
2010-08-28 00:37:48 +00:00
Alexandre Emsenhuber
457eb73b61 Standardised file description headers, added @file 2010-08-07 19:59:42 +00:00
Sam Reed
5387b8a806 Stylize API up to date
Fix spaces from r69755

Minor update to RELEASE-NOTES per r69753
2010-07-23 07:33:40 +00:00
Tim Starling
b2dc451c82 Rewrote r69339 etc. to clean up API cache header handling.
* Introduced a "cache mode" concept to simplify the header generation code, and to avoid odd results when conflicting cache header requests are received from submodules, or at least to formalise the handling of such cases.
* Made the cache mode private by default, so that code written in ignorance of caching tends to be safe. If different query modules are used in a single request, private caching is preferred over public caching.
* Removed the "must-revalidate" option from all CC headers, this is really specific to page views with a hacked squid in front, I don't think it's applicable here.
* Made the watchlist module private. This is really the definition of private data. There's nothing in the HTTP spec that says the URL for a CC:public request is private and can't be leaked. CC:private provides protection against unknown proxy behaviour.
* In ApiQueryAllmessages: avoid calling $wgLang->getCode() to check if it's necessary to make a new $wgLang when lang= is specified, since this is the only thing that unstubs $wgUser.
* Removed "FIXME: should this check $user instead of $wgUser?" Answer is no.
2010-07-23 07:17:56 +00:00
Sam Reed
f5c639fd10 Stylize API
Add a few braces
2010-07-06 13:15:59 +00:00
Sam Reed
2d21295243 * (bug 23473) - Give description of properties on all modules
Commit patch by John Du Hart with a few minor tweaks/fixes
2010-06-23 19:36:26 +00:00
Derk-Jan Hartman
921619b119 Correct the address of the FSF in some of the GPL headers
59 Temple Place -> 51 Franklin Street
2010-06-21 13:13:32 +00:00
Sam Reed
bdb88da500 * (bug 23835) Need "thumbmime" result in "imageinfo" query 2010-06-08 12:40:11 +00:00
Sam Reed
b744fdba23 * (bug 23834) Invalid "thumbwidth" and "thumbheight" in "imageinfo" query when thumbnailing larger than original image
Minor comment casing tweak in File.php
2010-06-08 12:15:48 +00:00
Sam Reed
50b88a5b1b Remove arrays from getDescription where we are only using 1 line 2010-05-25 20:46:09 +00:00
Sam Reed
e55ed729c4 Mixture of things.
Couple of class comments

Normalisation of "." usage at end of lines (removed)

Normalisation of {prefix}parameter as per bug 23461
2010-05-11 22:30:18 +00:00
Sam Reed
0769301e87 Stylize Api upto date 2010-04-17 20:58:04 +00:00
Alexandre Emsenhuber
00ed478a33 Fixed some doxygen warnings 2010-03-07 17:26:23 +00:00
Jack Phoenix
7fa78fefa9 API: fix copyright symbol, coding style cleanup, more braces 2010-02-24 14:00:23 +00:00
Sam Reed
40dd0530f9 Stylize API files 2010-02-13 01:41:37 +00:00
Sam Reed
1f9a7d791c Implement 9 modules dieUsage errors 2010-02-13 00:48:31 +00:00
Sam Reed
b15f2c8c46 Normalise comment usage (# --> //) 2010-01-23 22:52:40 +00:00
Aryeh Gregor
3758769f0d stylize.php on API code
"I wouldn't object to stylizing the API code to bring it in line with
the rest of MW on principle, but I'm not gonna bother myself." --Roan
<http://www.mediawiki.org/wiki/Special:Code/MediaWiki/60657#c5108>

If you're seeing this commit in blames, tell your blame tool to ignore
whitespace, e.g., git blame -w or svn blame -x -w.
2010-01-11 15:55:52 +00:00
Bryan Tong Minh
859ff802ca API: Expand the thumburl to an absolute url to make it consistent with url and descriptionurl 2010-01-04 11:13:25 +00:00
Roan Kattouw
6d638b24cb API: Handle image redirects properly in imageinfo, based on reports of API requests dying with backtraces on Commons, e.g. http://commons.wikimedia.org/w/api.php?action=query&prop=imageinfo&iiprop=user&titles=File:Semaphore_Alfa.svg 2009-09-23 20:55:54 +00:00
Bryan Tong Minh
05336e91ad Unify properties in ApiQueryAllimages, ApiQueryImageinfo and ApiUpload. 2009-08-26 17:30:36 +00:00
Andrew Garrett
106e14ba7e Fix fatals in ApiQueryImageInfo.php where no metadata exists 2009-03-25 13:59:06 +00:00
Roan Kattouw
555f84e41a API: Change Image: to File: in examples 2009-03-09 10:44:34 +00:00
Roan Kattouw
88f35cdf6e API: Some cleanup
* Aggressively intval() numeric things; addresses the concerns raised on bug 11633
* Use ApiQueryBase::addTitleInfo() everywhere
* Remove a drug-induced-looking line from ApiQueryWatchlist.php
2009-02-27 16:03:01 +00:00
Tim Starling
dc40106960 Don't give a warning if there are no files in the page set. 2009-02-18 06:04:09 +00:00
Roan Kattouw
f825c7ba23 API: Page prop=imageinfo by (title, timestamp) rather than using an offset. Suggested by Brad Jorsch. 2009-02-10 19:10:58 +00:00
Roan Kattouw
2df33ff098 * API: BREAKING CHANGE: (bug 11430) Return fewer results than the limit in some cases to prevent running out of memory
* This means queries could possibly return fewer results than the limit and still set a query-continue
* Add iicontinue, rvcontinue, cicontinue, incontinue, amfrom to faciliate query-continue for these modules
* Implemented by blocking additions to the ApiResult object if they would make it too large
** Important things like query-continue values and warnings are exempt from this check
** RSS feeds and exported XML are also exempted (size-checking them would be too messy)
** Result size is checked against $wgAPIMaxResultSize, which defaults to 8 MB

For those who really care, per-file details follow:

ApiResult.php:
* Introduced ApiResult::$mSize which keeps track of the result size.
* Introduced ApiResult::size() which calculates an array's size
  (which is the sum of the strlen()s of its elements).
* ApiResult::addValue() now checks that the result size stays below
  $wgAPIMaxResultSize. If the item won't fit, it won't be added and addValue()
  will return false. Callers should check the return value and set a
  query-continue if it's false.
* Closed the back door that is ApiResult::getData(): callers can't manipulate
  the data array directly anymore so they can't bypass the result size limit.
* Added ApiResult::setIndexedTagName_internal() which will call
  setIndexedTagName() on an array already in the result. This is needed for the
  'new' order of adding results, which means addValue()ing one result at a time
  until you hit the limit or run out, then calling this function to set the tag
  name.
* Added ApiResult::disableSizeCheck() and enableSizeCheck() which disable and
  enable size checking in addValue(). This is used for stuff like query-continue
  elements and warnings which shouldn't count towards the result size.
* Added ApiResult::unsetValue() which removes an element from the result and
  decreases $mSize.

ApiBase.php:
* Like ApiResult::getData(), ApiBase::getResultData() no longer returns a
  reference.
* Use ApiResult::disableSizeCheck() in ApiBase::setWarning()

ApiQueryBase.php:
* Added ApiQueryBase::addPageSubItem(), which adds page subitems one item
  at a time.
* addPageSubItem() and addPageSubItems() now return whether the subitem
  fit in the result.
* Use ApiResult::disableSizeCheck() in setContinueEnumParameter()

ApiMain.php:
* Use ApiResult::disableSizeCheck() in ApiMain::substituteResultWithError()
* Use getParameter() rather than $mRequest to obtain requestid

DefaultSettings.php:
* Added $wgAPIMaxResultSize, with a default value of 8 MB

ApiQuery*.php:
* Added results one at a time, and set a query-continue if the result is full.

ApiQueryLangLinks.php and friends:
* Migrated from addPageSubItems() to addPageSubItem(). This eliminates the
  need for $lastId.

ApiQueryAllLinks.php, ApiQueryWatchlist.php, ApiQueryAllimages.php, ApiQuerySearch.php:
* Renamed $data to something more appropriate ($pageids, $ids or $titles)

ApiQuerySiteinfo.php:
* Abuse siprop as a query-continue parameter and set it to all props that
  couldn't be processed.

ApiQueryRandom.php:
* Doesn't do continuations, because the result is supposed to be random.
* Be smart enough to not run the second query if the results of the first
  didn't fit.

ApiQueryImageInfo.php, ApiQueryRevisions.php, ApiQueryCategoryInfo.php, ApiQueryInfo.php:
* Added continue parameter which basically skips the first so many items

ApiQueryBacklinks.php:
* Throw the result in a big array first and addValue() that one element at a time if necessary
** This is necessary because the results aren't retrieved in order
* Introduced $this->pageMap to map namespace and title to page ID
* Rewritten extractRowInfo() and extractRedirRowInfo() a little
* Declared all private member variables explicitly

ApiQueryDeletedrevs.php:
* Use a pagemap just like in Backlinks
* Introduce fake page IDs and keep track of them so we know where to add what
** This doesn't change the output format, because the fake page IDs start at 0 and are consecutive

ApiQueryAllmessages.php:
* Add amfrom to facilitate query-continue

ApiQueryUsers.php:
* Rewrite: put the getOtherUsersInfo() code in execute()
2009-02-05 14:30:59 +00:00