Commit graph

103 commits

Author SHA1 Message Date
Sam Reed
289af6c964 Add some documentation
Swap if ( $foo ) { $this->addFields( 'foo' ); } for $this->addFieldsIf( 'foo', $foo ); etc

Also swap $this->addFieldsIf( 'foo', $foo ); $this->addFieldsIf( 'foo2', $foo ); for $this->addFieldsIf( array( 'foo', 'foo2' ), $foo );


Micro-optimisation and readability!
2011-06-01 16:40:59 +00:00
Sam Reed
f8d56fe7ae * (bug 29063) When viewing list=recentchanges&rcprop=loginfo for an unblock entry, get undefined index
Unblocks have no params, so skip adding info
2011-05-20 22:01:50 +00:00
Antoine Musso
6a8e32e986 Single messages can be passed as strings to Api::dieUsageMsg()
Since r88045
2011-05-19 17:51:16 +00:00
Sam Reed
4801267d08 Fix line removedfor no explicit reason from r85771 2011-05-14 14:44: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
Sam Reed
12d7d7b90f * (bug 26873) API: Add 'toponly' filter in usercontribs module 2011-04-10 21:52:34 +00:00
Sam Reed
00b3434d47 * (bug 28455) Add 'toponly' to recentchanges API module 2011-04-10 21:42:20 +00:00
Sam Reed
8c6f2012b9 * (bug 27670) Ordering by timestamp (and usage of start and end) isn't as clear in auto generated document, as it is on mw.org
where dir = (newer|older)

Will look at doing (asc|desc)(ending)?
2011-03-12 23:39:15 +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
589a3f24ba * (bug 26541) Generator-ise ApiQueryRecentChanges 2011-01-02 21:01:44 +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
Roan Kattouw
b81ac8ea52 Improve some of the descriptions added in r68482 2010-12-14 11:47:13 +00:00
Bryan Tong Minh
27b998755c BREAKING CHANGE: Require POST for patrolling revisions and salt the patrol token with 'patrol' instead of rc_id.
See my comments on r75274, for which this is a follow-up. Using a dedicated, but constant patrol token is in my opinion the optimal compromise between performance (only require fetching the token once) and security (leaking the token will only compromise the patrolling feature).
2010-12-09 21:29:03 +00:00
Roan Kattouw
cb8dad9da4 BREAKING CHANGE: Per r70640 CR, salt patrol tokens with rcid in the API too. This means patrol tokens are now different for every recentchanges entry. 2010-10-23 17:22:38 +00:00
Sam Reed
8b03a013a1 Fix some method documentation
Fix some typos

Some explicit class members
2010-10-20 18:50:33 +00:00
Sam Reed
4a0c3d8ff5 Comment return types, some explicit class variable declaration 2010-10-09 00:01:45 +00:00
Sam Reed
ffa29cd9f1 Bug 19195 - Make user IDs more readily available with the API
Rest of user props done
2010-08-28 01:09:21 +00:00
Sam Reed
51a665abba It's params, not param 2010-08-13 19:44:47 +00:00
Alexandre Emsenhuber
457eb73b61 Standardised file description headers, added @file 2010-08-07 19:59:42 +00:00
Sam Reed
5c3131cd36 Move a few braces noticed while doing CR 2010-07-31 19:53:43 +00:00
Platonides
958a998611 Remove double globals. 2010-07-25 19:45:52 +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
Mark A. Hershberger
e28aaea397 follow up r69339:
* Add a missing setVaryCookie for consistency
* don't cache result when token is given in ApiFeedWatchlist
2010-07-14 21:46:52 +00:00
Roan Kattouw
70824ccccc API: Make output containing private or user-specific data uncacheable for logged-in users by setting Vary: Cookie or Cache-Control: private, whichever is appropriate. Fixes instances in core and WMF-deployed extensions only. Without this change, the output of requests like ?action=query&list=recentchanges&rcprop=patrolled&smaxage=3600 would be cached in Squid and viewable for anyone using the same URL, even if they don't have patrol rights. Other, more serious exploits are also possible. Also avoid using $wgUser in one place, kill some unused global $wgUser; instances and tweak a comment. 2010-07-14 19:00:54 +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
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
Jack Phoenix
eba6c94002 API: fix copyright symbol, coding style cleanup, more braces 2010-02-24 14:45:19 +00:00
Sam Reed
b18d53d035 Followup to r62465, should be in an array 2010-02-14 15:19:45 +00:00
Sam Reed
fcdb5b846c Move ( 'code' => 'show', 'info' => 'Incorrect parameter - mutually exclusive values may not be supplied' ) to messageMap 2010-02-14 15:16:09 +00:00
Sam Reed
d299fc6a55 Complete dieUsage errors in 7 more Api files 2010-02-13 01:21:52 +00:00
Tim Starling
91f1c4c903 Fix for r61957: initialise array variables explicitly. 2010-02-05 04:40:57 +00:00
Tim Starling
6892c5536d Fix for r58399 (missing index on change_tag table), using the patch from bug 22032 by Gurch, but altered to respect $wgOldChangeTagsIndex. 2010-02-03 23:30:19 +00:00
Sam Reed
4b3f63b445 Rem extra brace from r61761 2010-01-31 23:10:57 +00:00
Sam Reed
c1f6d86274 Finish (bug 18427) Comment (edit summary) parser option for API
Followup to r61747 r61754 (RELEASE-NOTES to cover whole bug)
2010-01-31 23:06:35 +00:00
Sam Reed
b739e97341 More of r61437 (adding/removing whitespace) 2010-01-23 22:47:49 +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
038301df2c Another fatal in r58419 2009-11-03 14:00:20 +00:00
Roan Kattouw
fc92a38146 Redo r58410, r58411 (attempts to to fix r58399) properly: isset vs. !is_null wasn't the problem, it's that the 'tag' parameter wasn't in the parameter list. 2009-11-02 08:29:26 +00:00
Roan Kattouw
1d471caa46 API: (bug 19004) Add support for tags. Patch by Matthew Britton 2009-11-01 10:42:41 +00:00
Daniel Kinzler
0234640637 adding public access methods for use by XMLRC extension. 2009-09-03 16:15:55 +00:00
Brion Vibber
8919302663 Revert r54291 "(bug 19004) Added support for tags to the API. Patch by Matthew Britton."
Per notes on code review, this doesn't handle multiple tags correctly right now.
2009-08-19 17:34:08 +00:00
Bryan Tong Minh
1ac223539e (bug 19004) Added support for tags to the API. Patch by Matthew Britton. 2009-08-03 17:48:01 +00:00
Roan Kattouw
6d8d92d333 API: (bug 14200) Add user and excludeuser to list=recentchanges and list=watchlist. Requires the rc_user_text index, which was finally added on all servers with the recent schema changes. 2009-06-19 08:03:52 +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