Commit graph

55 commits

Author SHA1 Message Date
Brion VIBBER
3807ba51b9 Merge "ORDER BY/GROUP BY accept arrays" 2012-05-08 18:10:38 +00:00
umherirrender
b08ee41f45 (bug 34927) Output media_type for list=filearchive
Change-Id: I7c9b2f614ab319facfc9fb30893d82a9427e4253
2012-05-05 20:24:27 +02:00
umherirrender
81dd7fefa5 ORDER BY/GROUP BY accept arrays
renaming all variable which hold "' DESC'" to $sort
to keep it all the same

Change-Id: I75118f8cdd701f53949fe5cdd7155fb07f78ff65
2012-05-05 15:29:08 +02:00
Petr Onderka
4f17f49b78 Fixed whitespace in API classes
Change-Id: Ia06de4822e32612c4f668e14643236322837a3e1
2012-05-02 15:48:02 +02:00
Petr Onderka
720c1b7be0 Corrected capitalization in the file and class names of API modules
Change-Id: I8f317e458ee0f8706434e43a7890cda530595e64
2012-04-16 23:53:56 +02:00
Sam Reed
6115b93df8 Re-instate most of the revisions for bug 33147 "API examples should explain what they do"
Using this to sync up my working copies

Should have the little niggles tidied up though
2011-12-27 16:22:35 +00:00
Brion Vibber
ad0d48d6bc Revert r106439, r106441 - bad formatting mushing separate lines together 2011-12-20 22:11:29 +00:00
Sam Reed
1b46e91efd Convert a few more descriptions
Ping r106439
2011-12-16 15:45:16 +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
John Du Hart
40f19e6def Adding context to the API
This will probably break something somewhere so when it does please yell at me on IRC and I'll fix it.
2011-10-26 23:27:01 +00:00
Max Semenik
95ec650786 Revert r93246: besides the problems pointed out at CR, it also causes bug 31403, wreaking havoc on large wikis 2011-10-07 13:58:16 +00:00
Alexandre Emsenhuber
da4edaaf40 Call Linker methods statically 2011-09-16 19:35:14 +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
Happy-melon
c3e096c6e5 (bug 15641) prevent blocked administrators from accessing deleted revisions. 2011-07-26 20:54:41 +00:00
Sam Reed
bdc31bb9bc Change usages of $wgUser->getSkin() in special pages to use $this->getSkin()
Fix trailing whitespace
2011-07-01 02:25:19 +00:00
Bryan Tong Minh
3b79ad5c14 Follow-up r89544: add dot per CR 2011-06-30 18:51:24 +00:00
Sam Reed
79d982679f Followup r89576, and other related revisions
Move SHA1 has validation functions in ApiQueryBase
2011-06-25 03:50:41 +00:00
Sam Reed
d0d2975f61 Fix error noticed in r88174, wasn't actually validating sha1base36 hash 2011-06-07 09:13:09 +00:00
Sam Reed
63111d750d Followup r89542, validate hashes 2011-06-06 16:06:59 +00:00
Sam Reed
a8f6a731d7 * (bug 27595) sha1 search of list=filearchive does not work
Still disabled in misermode, but switched for LIKE rather than =
2011-06-05 23:48:39 +00:00
Sam Reed
d2b35ca13a * (bug 21346) Make deleted images searchable by hash (disabled in Miser Mode)
Effectively reverts r83411, but with the addition of it only works in !$wgMiserMode
2011-06-05 23:40:57 +00:00
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
d48986abc5 Followup r84356, don't pass title string, pass a title object 2011-03-26 18:46:15 +00:00
Platonides
b37e81b76b Use class name Html in canonical form.
Removed unused globals $wgHooks, $wgBlockAllowsUTEdit, $wgUser, $wgOut
$wgUser was already set global at function beginning.
Moved global out of switch
2011-03-24 21:35:14 +00:00
Sam Reed
b3ca74bd57 * (bug 27343) Add parseddescription to list=filearchive 2011-03-19 22:54:43 +00:00
Sam Reed
478bcebf12 Improve query building if's to cater for addition of columns 2011-03-18 20:50:40 +00:00
Sam Reed
1100285027 Followup r84260, normalise API behaviour, and fixup description 2011-03-18 20:30:06 +00:00
Sam Reed
da4807d62a Followup r83862, add notation that page count will be added if appropriate 2011-03-18 19:55:34 +00:00
Sam Reed
09c2fbf75e * (bug 27585) add pagecount to list=filearchive 2011-03-13 23:04:51 +00:00
Sam Reed
67dc654a9f * (bug 27203) add fato param to list=filearchive
Cleanup some whitespace also
2011-03-13 17:41:47 +00:00
Bryan Tong Minh
9ad9f1b353 Follow-up r83461, replace deleted with hidden and reverse the word, e.g. deletedfile->filehidden. Consistency with prop=revision etc. (In Soviet-Russia, file hides you!) 2011-03-07 17:17:57 +00:00
Bryan Tong Minh
3d3f61a0ab (bug 27722) list=filearchive now supports revdel
* Adds a condition fa_deleted=0 if the user does not have the suppressrevision rights. This field is unindexed. This should however not be a big problem as files with fa_deleted are rare. Unfortunately this hides files that do not have DELETED_RESTRICTED, but I don't know how bad fa_deleted & DELETED_RESTRICTED = 0 is for performance
* Added deletedfile, deletedcomment, deleteduser and deletedrestricted to the output for what I think are appropriate fa_deleted fields, but it's hard to tell what's corrent without a single line of documentation or even comment in the code. Perhaps somebody can dig up a commit message where the purpose of the constants is explained?
2011-03-07 17:07:10 +00:00
Bryan Tong Minh
29eaa85c82 Kill filtering by hash because the query is unindexed. We need a condition on fa_storage_group, but I'm not sure how index merging will work out. I don't have time to investigate this at the moment, so killing it in its entirety seems the safest option for now. 2011-03-06 22:16:34 +00:00
Bryan Tong Minh
9770ff88f5 Breaking change: remove faminsize/famaxsize because they lead to an unindexed query, which takes a very long time if there are only few rows that match the filter. Introduced in r66168, so luckily only live since 1.17. 2011-03-06 22:03:45 +00:00
Sam Reed
2dc186a1d7 Followup r83399, add back base conversion 2011-03-06 20:20:24 +00:00
Sam Reed
56aefb445f * (bug 27588) list=filearchive&faprop=sha1 returns empty attribute
Refactored code out, to be reused in ApiQueryFilearchive

Simplified too per Bryan on IRC
2011-03-06 20:05:41 +00:00
Bryan Tong Minh
51b0552b75 (bug 27587) list=filearchive now outputs full title info 2011-03-05 15:00:23 +00:00
Sam Reed
41cbdab221 Display userid, and actually put username in user (like usual)
Fix up a bad description
2011-02-25 17:21:34 +00:00
Roan Kattouw
b81ac8ea52 Improve some of the descriptions added in r68482 2010-12-14 11:47:13 +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
8f1d2cb199 Big blitz on unused variables (a lot of $db = $this->getDb() ) 2010-07-22 22:13:21 +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
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
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
1061d519f8 Followup r66259 r66168
Wrong column used...
2010-05-12 09:00:09 +00:00