Commit graph

1047 commits

Author SHA1 Message Date
Roan Kattouw
03c8bcb8db Fix up r50600, which had no effect 2009-05-15 10:42:25 +00:00
Chad Horohoe
80f670d1cb Followup to r50423: Check if the row is null, since older revs don't necessarily have rev_len populated. 2009-05-14 20:29:54 +00:00
Roan Kattouw
7885c3d4e1 Fix E_STRICT reported on Translatewiki.net 2009-05-12 14:15:08 +00:00
Roan Kattouw
d76bdf62be API: (bug 18749) Add generator flag to action=paraminfo output. Also fixes an internal error in r50367 2009-05-10 09:52:31 +00:00
Roan Kattouw
9c55278c40 API: (bug 18743) Add ucprop=size (enabled by default) to list=usercontribs. Also fix warning from r49732 2009-05-10 09:25:46 +00:00
Roan Kattouw
560365d615 API: (bug 18730) Add version information to action=paraminfo output 2009-05-09 13:00:59 +00:00
Roan Kattouw
91271d809e API: (bug 18731) Show correct SVN links for extension modules in api.php?version . Guesswork to get the path assumes extensions are in a directory called extensions/extensionname , which should be a valid assumption on sane installs. 2009-05-09 12:52:38 +00:00
Roan Kattouw
5daf0db847 API: (bug 18709) Missing descriptions for some parameters in action=paraminfo output 2009-05-08 17:24:49 +00:00
Chad Horohoe
49bfc91366 (bug 18710) Fixed internal error with empty parameter in ApiParamInfo 2009-05-07 20:09:45 +00:00
Chad Horohoe
c5ae50df41 Don't explicitly check for false. Most modules without params return an empty array rather than false, in which case we still don't want to output this. 2009-05-07 20:02:20 +00:00
Roan Kattouw
d01bd3b799 API: (bug 18518) Add clprop=hidden to prop=categories. Also use array_flip($params['prop']) to simplify code 2009-05-04 15:10:42 +00:00
Roan Kattouw
fc32d63609 Fix up r50126: dump $wgDBtype rather than a class name, per CR comment 2009-05-04 07:00:52 +00:00
Roan Kattouw
ea5b014e38 Followup to r50132: I guess I was smoking some pretty good stuff there 2009-05-02 15:03:02 +00:00
Roan Kattouw
5924eb85f0 API: Set $wgTitle to a dummy title in api.php, and introduce defined('API') as a check for API mode. This should fix errors about $wgTitle being null 2009-05-02 14:47:26 +00:00
Roan Kattouw
2e20458e1c API: (bug 18533) Add readonly message to meta=siteinfo output 2009-05-02 14:24:11 +00:00
Roan Kattouw
06687f0d95 API: Add PHP and database version to meta=siteinfo output 2009-05-02 13:35:20 +00:00
Tim Starling
4ba01bff2f Add lots more information to the siteinfo query. Based on the JS variable list. 2009-04-30 05:25:35 +00:00
Roan Kattouw
a4d055587e API: (bug 18617) Add xml:space="preserve" attribute to relevant tags in XML output so overzealous XML parsers will leave whitespace in e.g. revision content alone 2009-04-29 13:12:27 +00:00
Roan Kattouw
5811f0e274 API: (bug 16422) Don't show help in format=jsonfm unless specifically requested with action=help 2009-04-28 11:42:14 +00:00
Roan Kattouw
246d7c081a API: Fix list=deletedrevs paging bug pointed out by Splarka on IRC 2009-04-28 11:30:02 +00:00
Chad Horohoe
fdbb1752ab Kill a bunch of unused $wgUser 2009-04-28 03:03:48 +00:00
Roan Kattouw
e484ef763d API: Fix regression from r32224 with caused bug 18597 (internal error for empty generator= parameter) 2009-04-27 14:21:16 +00:00
Roan Kattouw
c3096d8ac6 API: (bug 18601) generator=backlinks returns invalid continue parameter. Patch by Brad Jorsch 2009-04-27 14:09:47 +00:00
Roan Kattouw
6f5aa4c078 API: (bug 18554) Also list hidden revisions in list=usercontribs for privileged users 2009-04-22 09:21:33 +00:00
Roan Kattouw
674724e686 API: (bug 18546) Added timestamp of new revision to action=edit output 2009-04-21 14:49:13 +00:00
Roan Kattouw
c1cb8854ee API: Add parentid (rev_parent_id) to prop=revisions output, as requested by Luca 2009-04-13 10:48:11 +00:00
Chad Horohoe
ef3bdc52e7 (bug 18311) Purging images via the API now works. This is why we should use articleFromTitle() rather than new Article(). 2009-04-03 13:27:30 +00:00
X!
e774395b54 Added usprop=gender to list=users 2009-03-31 03:48:08 +00:00
Roan Kattouw
1083d741dc Followup to r49013: forgot to commit ApiBase.php 2009-03-29 16:40:31 +00:00
Roan Kattouw
87a1cd7980 Remove ugly userrights-CentralAuth hack introduced in r48970 and friends:
* Make UserrightsForm::doSaveUserGroups(), addLogEntry() and helpers non-static again so CentralAuth can override them; remove the short-lived UserRightsLogEntry hook
* Let UserrightsForm::fetchUser() return a WikiErrorMsg on failure
* In ApiUserrights, use an instance of the UserrightsPage class rather than calling its methods statically. This also enables interwiki userrights in this module
* Add some messages to ApiBase::$messageMap
2009-03-29 16:39:42 +00:00
Roan Kattouw
31c1624fc8 API: Don't give patrol tokens for non-new RCs if only NP patrol is enabled 2009-03-29 12:51:39 +00:00
Roan Kattouw
549b1688cc Redo r48746 (API userrights, reverted in r48909 and r48910) in a way that doesn't break CentralAuth. Basically, this works around PHP's inability (at least in < 5.3) to override static methods by adding a hook. Changes to CentralAuth in next commit. 2009-03-28 19:08:47 +00:00
Andrew Garrett
d4d0329547 Revert r48746 (API userrights). Breaks Special:GlobalGroupMembership by changing overridden methods to static methods, which cannot be overridden. Also reverts r48747, r48814, r48778, r48775 2009-03-27 05:59:42 +00:00
Roan Kattouw
3d33524baa API: Added uiprop=changeablegroups to meta=userinfo 2009-03-26 13:10:13 +00:00
Roan Kattouw
5e7acff52b API: Add nosuchuser message to ApiBase::$messageMap 2009-03-26 13:01:53 +00:00
Andrew Garrett
106e14ba7e Fix fatals in ApiQueryImageInfo.php where no metadata exists 2009-03-25 13:59:06 +00:00
Andrew Garrett
c76462c25c Check for title validity in ApiQueryCategories 2009-03-25 13:43:45 +00:00
Roan Kattouw
ac81ec6513 API: (bug 18099) Editing a non-existent page with appendtext caused the contents of the noarticletext(anon) message to appear in the page text 2009-03-24 16:15:43 +00:00
Roan Kattouw
4f4a29e5a4 svn:keywords=Id 2009-03-24 16:08:29 +00:00
Roan Kattouw
a827d2358e Followup to r48746: forgot to add new file 2009-03-24 16:06:57 +00:00
Roan Kattouw
3c52c2c64b * API: (bug 15935) Add action=userrights to the API
* Add ustoken=userrights to list=users
* Move the non-UI part of UserrightsPage::saveUserGroups() to the static and more generic doSaveUserGroups()
* Add a $reason parameter to UserrightsPage::addLogEntry() and make it and its helpers static
* Move UserrightsPage::changeableGroups() and changeableByGroup() to the User class and make the latter static
* In doSaveUserGroups(), drop groups that the user doesn't have from $remove (and those that they do have from $add), and return array($add, $remove)
* Fix up a comment in ApiQueryRecentChanges
2009-03-24 16:04:50 +00:00
Roan Kattouw
1591f8110d Followup on r48713: fix a very stupid typo 2009-03-23 20:06:16 +00:00
Roan Kattouw
0d4b512622 API: Add a check for PHP bug 45314 (PHP's WDDX formatter messes up UTF-8) and fix up a similar check for JSON, which couldn't possibly succeed due to missing quotes. See also http://lists.wikimedia.org/pipermail/mediawiki-api/2009-March/001039.html 2009-03-23 19:58:07 +00:00
Domas Mituzas
7071205057 Every time someone relies on equality propagation, god kills a kitten 2009-03-20 20:21:38 +00:00
Roan Kattouw
902cc71973 * API: Really fix bug 17673 this time: exportnowrap still returned fatal errors when no titles were given or generated
* Move export/exportnowrap handling code out of the if(count($pages)) branch
* Add an error fallback to ApiFormatRaw (exportnowrap uses the XML formatter for errors), since Raw doesn't know how to format errors
2009-03-20 11:40:54 +00:00
Arash Boostani
c32a1ef480 Fixed bug #11213 - [edit] section links in printable version interfere with cut-and-paste of article text 2009-03-18 23:27:48 +00:00
Alexandre Emsenhuber
c53e76ad34 Changed ereg(i)_replace to preg_replace, the former is throwing E_DEPRECATED since PHP 5.3 2009-03-18 19:25:29 +00:00
Roan Kattouw
3f3bfb576d API: Fix E_NOTICE which broke displaying of legacy restrictions (page.page_restrictions) in prop=info 2009-03-17 15:18:26 +00:00
Chad Horohoe
21bb5ca6d6 (bug 17871) Mention that exportnowrap format is the same as Special:Export. 2009-03-11 13:35:19 +00:00
Roan Kattouw
555f84e41a API: Change Image: to File: in examples 2009-03-09 10:44:34 +00:00
Roan Kattouw
cb5fedd467 API: (bug 17873) Mention the 'g' prefix for generator parameters in the api.php help 2009-03-09 10:36:48 +00:00
Aaron Schulz
91094ea42d Fix check against wrong permission (should be 'hideuser') 2009-03-09 10:01:00 +00:00
Aaron Schulz
bab7396551 quick fix: add WHERE ar_deleted = 0. Nicer would be to make revision objects from the rows like queryRevisions does. 2009-03-09 09:08:40 +00:00
Alexandre Emsenhuber
9dd9379eb4 Per anomie's report on IRC: $wgMaxArticleSize is in kilobytes, not bytes 2009-03-07 17:37:29 +00:00
Roan Kattouw
24b290b453 Followup to r48122: missed one 2009-03-07 13:13:27 +00:00
Roan Kattouw
2f1af4d476 * API: (bug 17832) action=delete returns 'unknownerror' instead of 'permissiondenied' when the current user is blocked
* Fix this by changing all calls to current() to reset()
2009-03-07 12:58:41 +00:00
Rotem Liss
a5e5d8eb05 Fix typo. 2009-03-06 14:48:00 +00:00
Roan Kattouw
21fd7af97e * API: (bug 17774) API pretends action=query doesn't exist for users without read rights
* Instead of hiding read-restricted modules, throw an error when a user without read rights tries to use them
* Do the same for write modules when $wgEnableWriteAPI is false
* Indicate whether a module needs read or write rights in action=help and action=paraminfo
* BREAKING CHANGE: action=purge now requires write rights and, for anonymous users, a POST request
2009-03-06 13:49:44 +00:00
Chad Horohoe
7748725389 (bug 17795) Make meta=siteinfo respect $wgDisableCounters. 2009-03-05 13:52:14 +00:00
Roan Kattouw
c7ca98503a Fix up r47901: don't return the string "true" or "false", be consistent with the rest of the API 2009-03-01 11:02:49 +00:00
Nicolas Dumazet
fe53e8d894 For move logs, log_params can have a "suppressedRedirect" boolean, as a second parameter. Adding support to display it. 2009-03-01 05:13:42 +00:00
Roan Kattouw
5349ea2dd8 * API: (bug 13209) Add rvdiffto parameter to prop=revisions
* Add $wgAPIMaxUncachedDiffs (default 1) which controls how many non-cached diffs will be served per request
* Tweak DifferenceEngine.php a bit to make cache status accessible, and remove a useless 'parseinline' which broke diff generation in the API
2009-02-28 13:25:21 +00:00
Roan Kattouw
99c28aae22 API: Fix autolinker bug reported by DannyB on IRC: &gt; was included in the URL 2009-02-27 19:36: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
Roan Kattouw
a4b89293d6 API: (bug 17703) Fix regression from r47039 causing error code and error text to be switched for some errors. r47039 was backported to the 1.14 branch, will backport this one too. 2009-02-27 14:28:12 +00:00
Roan Kattouw
88075a3178 API: (bug 17673) Using &exportnowrap without &export results in an internal error 2009-02-26 10:11:53 +00:00
Roan Kattouw
1ca568692f Slight fix for r47781: remove useless if($index) conditional: $index is always set and non-false 2009-02-25 14:42:31 +00:00
Aaron Schulz
f0566ab4b6 INDEX use fixes 2009-02-25 04:33:44 +00:00
Roan Kattouw
decfd47c11 API: (bug 17626) Added uiprop=email to meta=userinfo 2009-02-23 13:34:29 +00:00
Roan Kattouw
9a7d4c9795 API: Fix up r47470: User::newFromRow() needs all rows from the User table. This kills lots of warnings and really fixes bug 17561 2009-02-21 12:44:41 +00:00
Roan Kattouw
7b631ca58d API: Add a STRAIGHT_JOIN to list=logevents on Domas's request. Also make an implicit JOIN explicit so the LEFT JOIN still goes against the right table 2009-02-20 21:18:07 +00:00
Roan Kattouw
b2503c70ab API: (bug 17563) Fix regression from r46845 that changed the output for list=backlinks to use page IDs as array indexes instead of 0,1,2,... (which makes a big difference in JSON and breaks clients) and caused weird output for generator=backlinks as well. Patch by Brad Jorsch 2009-02-19 21:24:28 +00:00
Roan Kattouw
02e968c1c8 API: (bug 17561) Recommit r44231 ("Added usprop=emailable to list=users"), which was accidentally undone by r46845 2009-02-18 22:31:46 +00:00
Roan Kattouw
48ae7ab6ff * API: (bug 17529) rvend ignored when rvstartid is specified
* To fix this, make the prop=revisions query slightly less performance-zealous and allow WHERE rev_timestamp <= 'foo' when sorting and rangescanning by rev_id
* Make adding ORDER BY in ApiQueryBase::addWhereRange() optional
* Move a RELEASE-NOTES entry to the right section
2009-02-18 15:26:09 +00:00
Tim Starling
7fa617fcfd Proposed fix for bug 17552. Also the name of the function should be changed, because there's nothing internal about it. 2009-02-18 12:41:28 +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
Andrew Garrett
f629ef2584 Fix logic error from bad casing 2009-02-18 05:29:11 +00:00
Roan Kattouw
360f217786 API: Add AS explicitly for PostgreSQL compatibility and fix hinky indentation in ApiQueryUsers. Patch by Brad Jorsch 2009-02-16 19:08:07 +00:00
Roan Kattouw
036351d362 API: Fix yet another regression from r46845 that completely broke list=users. Patch by Brad Jorsch 2009-02-16 17:47:54 +00:00
Roan Kattouw
8c813c3c92 Redo r47313 in a more readable way (probably more efficient too) by not using all those array_* functions 2009-02-16 12:19:29 +00:00
Roan Kattouw
37070d2e5a API: (bug 17502) meta=siteinfo&siprop=namespacealiases no longer lists namespace aliases already listed in siprop=namespaces 2009-02-16 11:20:58 +00:00
Roan Kattouw
e0542e1cf9 API: Make information about the main module (ApiMain) and the pageset module (ApiPageSet) available through action=paraminfo 2009-02-14 14:56:20 +00:00
Roan Kattouw
075e96b9c8 Document ptlevel parameter. I should really learn to get stuff right in fewer than 5 commits 2009-02-13 21:53:08 +00:00
Roan Kattouw
92102dfb3e And yet another fixup for r47231: use older/newer rather than ascending/descending 2009-02-13 21:49:01 +00:00
Roan Kattouw
df08e87bcd ...and remove another allpages leftover *sigh* 2009-02-13 21:37:17 +00:00
Roan Kattouw
e731df02b6 Fix leftover doc comment in ApiQueryProtectedTitles 2009-02-13 21:36:34 +00:00
Roan Kattouw
8fc08c1869 API: (bug 16740) Adding list=protectedtitles to list create-protected titles 2009-02-13 21:34:46 +00:00
Roan Kattouw
c9c570e4a7 * API: Page prop=info by (ns, title) rather than offset
* Also fix a regression from r47214 which caused database errors when $this->titles or $this->missing was empty
2009-02-13 15:36:32 +00:00
Roan Kattouw
1ff24603a9 API: Fix up r47214, which strangely had no commit message
* Use + instead of array_merge(), the latter messes up keys
* Fix a fatal error ($result not an object)
* Fix an interesting mistake when calling addTables(): addTables('foo', 'bar') doesn't add both tables, but adds foo AS bar
* Fix warning about $row->pt_namespace not being set

Commit message for r47214:
API: Refactor ApiQueryInfo
* Move result generating code from execute() to extractPageInfo()
** Merge code for existing and missing titles
* Don't loop over existing and missing titles separately, but on both in one go
* Move protection query code from execute() to getProtectionInfo()
** Merge code for existing and missing titles here as well
* Move subjectid/talkid query code from execute() to getTSIDs()
* Document some functions
2009-02-13 15:14:21 +00:00
Roan Kattouw
c426593d8a 2009-02-13 14:44:19 +00:00
Roan Kattouw
7526c937c7 API: More docs, break long lines in docs 2009-02-13 14:13:03 +00:00
Roan Kattouw
6f1f506675 API: Prevent ApiQueryInfo from trying to set a continue value twice (which will fail with a fatal error) 2009-02-12 17:29:17 +00:00
Roan Kattouw
f0c3eaf444 API: Fix up r47142: use a boolean parameter for suggest 2009-02-12 17:27:05 +00:00
Roan Kattouw
2755b38a45 API: Remove stray $options = array(); from ApiPageSet
Previous commit message didn't mention changing ApiQueryInfo to sort $titles by page ID and to add info about missing pages in one go (the latter upon Brad Jorsch's suggestion)
2009-02-11 19:28:07 +00:00
Roan Kattouw
fdb926bca4 * API: Add documentation to important API classes
* Move page_is_redirect up in ApiPageSet::getPageTableFields()
2009-02-11 19:25:25 +00:00
Aaron Schulz
0b28c717b2 Add suggest=1 to search suggestion AJAX request. ApiOpenSearch won't execute such request if $wgEnableMWSuggest is disabled 2009-02-11 15:56:53 +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
2293460cbf API: (bug 17433) Added bot flag to list=watchlist&wlprop=flags output 2009-02-10 16:01:50 +00:00
Roan Kattouw
f6307768aa API: Make UTF-8 cleanup actually work; it was broken from the beginning. Apparently I expected array_walk to behave like array_map, which is not the case. 2009-02-10 15:56:34 +00:00
Roan Kattouw
6145465e34 API: Page prop=revisions by rev_id or (rev_page, rev_id), depending on mode, because the offset system potentially sucks. Suggested by Brad Jorsch 2009-02-10 12:32:22 +00:00
Roan Kattouw
4e573ef087 API: Query-continue prop=categoryinfo by cat_title rather than offset. Suggested by Brad Jorsch 2009-02-09 19:54:25 +00:00
Roan Kattouw
9024971911 Fix up r47037, which was itself a fix-up of r46845. Change suggested by Brad Jorsch 2009-02-09 19:24:28 +00:00
Roan Kattouw
40b6193c06 Remove a TODO from ApiMove and add a FIXME to SpecialMovepage 2009-02-09 15:15:49 +00:00
Roan Kattouw
81bf8d0a3a * API: (bug 17357) Add subpage moving to the API
* Added Title::moveSubpages() as a backend function
** Didn't update SpecialMovepage to use this; left to braver souls
* Fix handling of errors on talk page move (will backport)
2009-02-09 14:16:51 +00:00
Roan Kattouw
5f0226fd8d API: Fix up r46825:
* put the tables in the right order
* JOIN on user_text as well for better index usage
* Force the index on the recentchanges table as well
* Don't ORDER BY rev_user_text if it's constant
2009-02-09 14:07:18 +00:00
Roan Kattouw
4e67c4bdee Fix some more regressions from r46845 reported by Brad Jorsch on the mediawiki-api list <http://lists.wikimedia.org/pipermail/mediawiki-api/2009-February/000924.html> 2009-02-09 13:28:12 +00:00
Aaron Schulz
48993f18f9 Hide title if DELETED_ACTION is on, but don't worry about type/action, which isn't what we're worried about 2009-02-06 14:42:50 +00:00
Roan Kattouw
c07397ee7f Fix fatal error in r46885 (add templates parameter to action=import): add missing comma 2009-02-06 10:25:51 +00:00
Chad Horohoe
dc6c95a6f9 Add r46884 (Import templates via interwiki) to API as well. 2009-02-06 00:21:06 +00:00
Roan Kattouw
4018f00fb4 Fix regression from r46845 which broke ApiResult::cleanUpUTF8() and caused an E_NOTICE 2009-02-05 15:46:30 +00:00
Roan Kattouw
84624f39b5 Fix E_WARNING reported by siebrand 2009-02-05 15:31:06 +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
Roan Kattouw
167d11a8c3 * API: Listing (semi-)deleted revisions and log entries (with rev_/log_deleted != 0) as well in prop=revisions and list=logevents, with commenthidden/userhidden/actionhidden/texthidden flags where appropriate
* Still honors the paranoia checks added in r46807
* Use $index consistently in ApiQueryLogEvents
* Some whitespace consistency
2009-02-05 11:44:10 +00:00
Roan Kattouw
3a259992fb API: Re-enable ucprop=patrolled and rcshow=patrolled|!patrolled using the timestamp index for the join (thanks to Tim for pointing this out) and a STRAIGHT_JOIN for the inner join case 2009-02-04 23:19:18 +00:00
Roan Kattouw
ff45244744 API: BREAKING CHANGE: Remove rctitles parameter from list=recentchanges for performance reasons (requests using it time out on enwiki) 2009-02-04 22:51:36 +00:00
Roan Kattouw
18eb32ec29 API: Tweak the format for &export to be more XML-friendly. Not a breaking change since &export hasn't gone live yet anyway 2009-02-04 22:12:25 +00:00
Roan Kattouw
bb3980dd8d * API: (bug 17007) Add action=import
* Add intoken=import to prop=info
* Store message key and arguments in WikiErrorMsg
2009-02-04 20:11:27 +00:00
Roan Kattouw
b677d0191d * API: (bug 17355) Added auwitheditsonly parameter to list=allusers
* Use consistent code style
2009-02-04 19:10:14 +00:00
Roan Kattouw
6f11c2331b Nitpicking brigade: fix copyright year 2009-02-04 14:18:53 +00:00
Roan Kattouw
f68b0a79c1 API: Temporarily disable ucprop=patrolled and ucshow=patrolled|!patrolled because of performance concerns mentioned on bug 17215 2009-02-04 13:16:12 +00:00
Roan Kattouw
bb81750f27 * API: (bug 17326) BREAKING CHANGE: Changing output format for prop=imageinfo&iiprop=metadata to something based on name/value pairs. This means we don't use parts of the metadata in attributes anymore, something that caused invalid XML to be output. For more info on the exact format, see the mediawiki-api mailing list
* Removed the spaces-to-underscores hack in the XML formatter
2009-02-03 16:25:50 +00:00
Roan Kattouw
2b6314c9c4 (bug 17327) Normalize API help texts: remove quotes 2009-02-02 23:17:07 +00:00
Roan Kattouw
5e5684ec77 * API: (bug 17007) Add export functionality to the API
* Accessed through the export and exportnowrap parameters added to action=query
* To facilitate &exportnowrap, add ApiFormatRaw, a formatter that just spits out its input without any formatting (not accessible through &format= of course)
* Fix up the action=query description message to reflect the deprecation of query.php
2009-02-02 20:07:33 +00:00
Roan Kattouw
a2974f51f1 API: (bug 17317) Added watch parameter to action=protect 2009-02-02 16:38:40 +00:00
Roan Kattouw
20fec70243 Fix up r46646: instead of outputting displaytitle="" when {{DISPLAYTITLE}} isn't used (or isn't valid), output the 'normal' title instead 2009-01-31 16:35:23 +00:00
Roan Kattouw
82b34d1b03 API: (bug 17239) Added prop=displaytitle to action=parse 2009-01-31 16:29:15 +00:00
Roan Kattouw
06b5d0f9d5 API: (bug 17224) Add siprop=rightsinfo to meta=siteinfo. Modified patch by Brianna Laugher 2009-01-31 15:56:52 +00:00
Roan Kattouw
8e361227a2 Revert r46512 (Add "check" parameter to action=email) and its followups r46515 and r46517. This functionality is already present in list=users (as usprop=emailable), where it belongs 2009-01-31 13:20:36 +00:00
Roan Kattouw
2e6fb0623e API: (bug 17182) Fix pretty printer so URLs with parentheses in them are autolinked correctly 2009-01-31 13:05:12 +00:00
Roan Kattouw
7babbd2fc5 Add the 'movenotallowedfile' message to the API message map. Turns out that's all I needed to do to support file moving through the API :D 2009-01-29 23:01:13 +00:00
Bryan Tong Minh
57d7e2bb88 Also return why the target user is not valid 2009-01-29 19:30:18 +00:00
Bryan Tong Minh
7058f802a2 Kill code duplication & other style tweaks 2009-01-29 19:27:44 +00:00
X!
73ba55efd6 Forgot to remove that 2009-01-29 04:13:50 +00:00
X!
38299137f7 Per 46512#c1554, moving check to before required params, returns a result rather than an error, and it must be posted. 2009-01-29 03:23:25 +00:00
X!
a9b78e1db9 Add "check" parameter to action=email 2009-01-29 01:25:17 +00:00
Andrew Garrett
0fcc017391 Fix broken calls to ArticleDelete hook. 2009-01-29 01:04:00 +00:00
Brion Vibber
79d0c8e34b Pulling back r46341 and r46342 for now "API: (bug 17142) Add redirects parameter to action=opensearch to control redirect resolution. Changes to OpenSearchXML extension in next commit"
Mysteriously there's no way to get a boolean parameter to default to true, which leads to an incompatibility in the sensible behavior of the more detailed responses in the XML output -- eg you get a whole buttload of "#REDIRECT Blabla" in your results, which is absolutely hideous. This is very much not desireable. :)
If we could change the default, and allow it to be set on or off for specific requests if some person for some reason is doing highly customized suggestion searches and wants it configured differently (no idea why), that might be doable. But as written this doesn't make any sense.
2009-01-27 20:39:24 +00:00
Roan Kattouw
41cc3f6271 API: (bug 17142) Add redirects parameter to action=opensearch to control redirect resolution. Changes to OpenSearchXML extension in next commit 2009-01-27 14:43:06 +00:00
Roan Kattouw
383d826b0f Revert r46138 (Get $wgLegalTitleChars through API) per comments on CodeReview and Bugzilla (bug 17024) 2009-01-27 13:10:16 +00:00
Roan Kattouw
6449867508 * API: (bug 15949) Add undo functionality to action=edit
* Move undo text generation from EditPage::getContent() to Article::getUndoText()
* Add some more examples for action=edit
* ApiEditPage.php: don't mix !is_null() and isset(), be consistent
2009-01-26 13:51:03 +00:00
Roan Kattouw
2e5e8808b4 API: (bug 17024) Added legaltitlechars field to meta=siteinfo&siprop=general output, which contains the value of $wgLegalTitleChars 2009-01-24 13:16:24 +00:00
Roan Kattouw
37ebf53907 Explain why this code doesn't use LinkBatch. 2009-01-24 13:10:30 +00:00
Roan Kattouw
32042c271f API: (bug 16483) Kill filesort in ApiQueryBacklinks caused by missing parentheses. Building query properly now using makeList() 2009-01-24 13:00:43 +00:00
Roan Kattouw
cd910c6544 API: Fix profiling errors caused by calling wfProfileClose() from dieUsage() 2009-01-23 20:23:34 +00:00
Roan Kattouw
4b20f8cc75 API: ApiBase::dieUsage() is not a static function, fix static calls 2009-01-23 20:08:00 +00:00
Roan Kattouw
ad4a03c316 Fix up r45749: do is_string() check in the caller instead 2009-01-21 09:26:48 +00:00
Roan Kattouw
b9669c44fe Followup to r45954: it helps to save before committing 2009-01-21 09:22:48 +00:00
Roan Kattouw
6f960e39e1 Fix indentation for r45944 and use consistent code style 2009-01-21 09:21:58 +00:00
Chad Horohoe
36a2416694 Code style tweak. 2009-01-20 23:58:18 +00:00
Alex Z
ff00dda0d0 Make API action=delete respect $wgDeleteRevisionsLimit 2009-01-20 23:37:39 +00:00