Commit graph

100 commits

Author SHA1 Message Date
Aaron Schulz
fdb74872a8 Merge "multi dbms support in api" 2012-05-20 18:15:42 +00:00
umherirrender
278bb4414f multi dbms support in api
Add some calls to Database::timestamp
Change some calls from Database::strencode to
Database::addQuotes to avoid ' in raw sql
Remove ' from ints in raw sql
Rename some vars to avoid duplicate names

Change-Id: I63f5602fa968f969a42932902a3ccc45fc54b432
2012-05-16 19:22:36 +02:00
Alexandre Emsenhuber
18cc220038 Don't make two database requests to load the same object, again.
I know there's no second parameter to WikiPage::newFromID(), but this will change soon.

This follows-up I098dd36619fff3610be6894037220d3472b809d5.

Change-Id: Ic28b7e05db51e55a5f49fed70c042ba11e4d97fe
2012-05-04 22:10:36 +02:00
umherirrender
e0ded894d9 (bug 30488) API now allows listing of backlinks/embeddedin/imageusage
per pageid

Move the possibles errors set by ApiBase::getTitleOrPageId to
ApiBase::getTitleOrPageIdErrorMessages and remove it from used modules

Change-Id: If037e04665d2524c1f2476bc7996d9573753a4b8
2012-05-02 01:35:04 +01:00
Aaron Schulz
5a6559d8b1 Reverted r108743 per CR comment. This should at least be discussed first. 2012-01-12 19:41:18 +00:00
Sam Reed
a5c200a25b Kill "* @return void" 2012-01-12 19:12:24 +00: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
Sam Reed
a5628f5734 Based on diff to wikia, set more functions consistently public rather than protected 2011-08-17 22:24:21 +00:00
Sam Reed
9c37ab4fb3 * (bug 28817) Add reference help page link to API Modules
Last followup of r92396

Should be all modules with documentation pages in core now documented...
2011-07-17 17:02:06 +00:00
Sam Reed
25ea9b8d95 Replace more multiple calls to $this->getResult() in methods with temporary variable 2011-06-30 01:06:17 +00:00
Alexandre Emsenhuber
dc4081528c Removed usage of error suppression operator 2011-05-17 18:03:50 +00:00
Bryan Tong Minh
2cc5f4e972 Kill the error suppression operator in the Api 2011-05-15 14:57:10 +00:00
Sam Reed
27ca6b2fa8 Tweak comments, remove some unused stuff.
Explicit definitions, move a few minor bits around
2011-02-27 21:10:11 +00:00
Sam Reed
fa64025161 More parameter documentation 2011-02-19 00:30:18 +00:00
Sam Reed
1f05665cf3 Styleli[zs]e the API up to date (Been a while since) 2010-12-30 17:06:09 +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
Chad Horohoe
65871ee245 Cleanup r65183, fix ugly stylize.php formatting 2010-11-03 12:49:21 +00:00
Sam Reed
f1999bef69 extract is weird
Do what extract is doing explicitally
2010-09-25 17:01:17 +00:00
Alexandre Emsenhuber
457eb73b61 Standardised file description headers, added @file 2010-08-07 19:59:42 +00:00
Sam Reed
b76fb090a8 Followup r70474 and r70461, drop missingparam from getPossibleErrors 2010-08-04 19:32:23 +00:00
X!
1afd723c5b Followup to r70460 and r70461: Use true instead of 1 2010-08-04 14:29:39 +00:00
X!
8b466d3d0d Followup to r70460: Committed wrong version of ApiBase.php, convert all core API modules to PARAM_REQUIRED syntax 2010-08-04 14:15:33 +00:00
Bryan Tong Minh
0e61296f98 (bug 24564) Fix fatal errors when using list=deletedrevs, prop=revisions or one of the backlinks generators with limit=max. 2010-07-28 11:30:14 +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
8f1d2cb199 Big blitz on unused variables (a lot of $db = $this->getDb() ) 2010-07-22 22:13:21 +00:00
Sam Reed
3cb1d23890 Remove various unused parameters
Only comment them out in ApiFormatYaml_spyc.php
2010-07-22 21:55:40 +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
faf34b4073 Per http://www.mediawiki.org/wiki/Special:Code/MediaWiki/66168#c7252 switch while ( $row = $db->fectchObject( $res ) ) to foreach ( $res as row )
On ApiQueryUsers switch $r to row, and remove nested brackets
2010-06-20 18:48:34 +00:00
Sam Reed
a90a0783de Nuke $db->freeResult() from Api stuffs 2010-06-20 17:48:21 +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
Jack Phoenix
96b4f302af API: fix copyright symbol, coding style cleanup, more braces 2010-02-24 13:34:11 +00:00
Sam Reed
9e44e9295d Fixup spaces to tabs from r62404 2010-02-14 14:29:24 +00:00
Sam Reed
6911358977 Complete dieUsage errors in 6 more Api files 2010-02-13 01:05:14 +00:00
Sam Reed
2081a0693f Rest of dieUsageMsg in getPossibleErrors 2010-02-13 00:28:27 +00:00
Sam Reed
8761fef623 Stylize.php on API 2010-01-31 21:21:46 +00:00
Roan Kattouw
39a50765c5 API: Document the behavior added in r61447 2010-01-24 10:10:00 +00:00
Sam Reed
ed02427598 minor followup to r61447, moving commment 2010-01-24 00:14:21 +00:00
Sam Reed
3f9621dfd1 * (bug 22245) blfilterredirect=nonredirects in blredirect mode wrongly filtering
If filterredir == 'nonredirects', only filter if !redirect
2010-01-23 23:32:15 +00:00
Sam Reed
b739e97341 More of r61437 (adding/removing whitespace) 2010-01-23 22:47:49 +00:00
Sam Reed
01e257cbd5 Normalise check for filterredir in Allpages to that of backlinks
Add a couple of blank lines
2010-01-23 21:28:27 +00:00
Sam Reed
9edf60de0f filterredir is mutually exclusive (one value)
Change 2nd if for else if in both 1st and 2nd queries
2010-01-23 21:25:25 +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
Roan Kattouw
73560aeb2c API: Do a STRAIGHT_JOIN in ApiQueryBacklinks's first query to counter a MySQL 4 bug where the optmizer chooses to do a table scan on page instead. 2009-08-27 14:58:19 +00:00
Siebrand Mazeland
8e23949bee Proper casing for getDBkey() 2009-05-24 08:29:10 +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
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
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