Commit graph

144 commits

Author SHA1 Message Date
Happy-melon
2c9cfd7cce Refactor the factory/i18n/list/etc static methods from SpecialPage into their own class; there's no reason we need to be parsing them in every single SpecialPage subclass. Leave all the methods as stubs in SpecialPage.php; if we required PHP 5.3 they could be replaced by a a __callStatic() magic method, but that doesn't work on PHP 5.2.
Also make a few changes to the functions available.  SpecialPageFactory::resolveAlias() now takes an optional subpage and returns array(<name>,<subpage>).  Similarly merge getPage() and getPageByAlias().  There were many examples of (extensions particularly) making dubious assumptions about the presence or absence of subpages or canonical-ness.

I didn't deprecate SpecialPage::getTitleFor() as it's got over six hundred calls.  I'm rather undecided on the best position of getPage()/executePath().  Although the latter needs cleanup anyway.
2011-04-17 11:31:11 +00:00
Sam Reed
fa64025161 More parameter documentation 2011-02-19 00:30:18 +00:00
Bryan Tong Minh
fe8d16bda9 Follow-up r69233: use getDbKey() instead of getText() for special pages. 2011-01-23 20:19:04 +00:00
Sam Reed
135d0998b6 Not sure why I originally used array_key_exists(). Switch for isset() 2011-01-12 01:17:31 +00:00
Sam Reed
981e47d801 Widen api help splitters 2011-01-07 03:04:03 +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
b3496e5fc9 Another variable type hint, and some function documentation 2010-12-23 20:00:02 +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
1e6add8882 (bug 14869) Add API module for accessing QueryPage-based special pages. Took 2.5 years and a flight to England to get this done, but there you go :) 2010-12-22 20:35:37 +00:00
Neil Kandalgaonkar
59339ca723 Fixed bug#25784 (thumbnails of stashed files had wrong description URLs).
This fixes the more general problem that the imageinfo returned with stashed uploads was inaccurate, since it was relying on
code that only worked with non-stashed files.

So, I had to:
- move the ApiQueryStashImageInfo module into core. Which others had asked for anyway, and was anticipated sometime later.
  - add lines to AutoLoader and ApiQuery to accomodate the new module

- add an ugly if/then to UploadBase -- based on the type of uploaded file, it will use a different API module to simulate a getImageInfo call. 
  I left a TODO that this situation wasn't ideal, but the way things are now, imageInfo is constructed by the API modules, when it should probably
  really be the File modules. Then the API can wrap that info into various formats.

- add a few new lines to the tests to check imageinfo information in both regular and stashed upload files
2010-11-16 06:57:46 +00:00
Sam Reed
563eb117f5 Followup r75641, improve function documentation 2010-11-01 11:57:23 +00:00
Sam Reed
2b81e29ac5 Followup r75554, functionise Export code, allows for return to be used "non scarily"
Remove some extra blank comment lines
2010-10-29 12:20:11 +00:00
Sam Reed
f1335b34bf * (bug 25463) Export header should not be shown if no pages were requested, to reduce confusion
Patch by Umherirrender, with a tweak to inverse logic to reduce nesting
2010-10-27 15:42:32 +00:00
Bryan Tong Minh
3f603335f3 Remove unnecessary @error surpressing operator. $pageSet is always defined and getGoodTitles() always returns an array 2010-10-24 14:56:13 +00:00
Sam Reed
661d26c9a3 Followup r75096 per Platonides, name the stuff better, rather than just fixing the typo.. 2010-10-20 23:36:21 +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
550271e806 Explicit class variable definition
Parameter hints
2010-10-06 21:18:55 +00:00
Roan Kattouw
adf4822d18 Per r74201 CR, make it clear that the list of languages supporting variant conversion may not be complete 2010-10-04 09:11:15 +00:00
Roan Kattouw
4bdf872f0a Per r69587 CR, mention which languages support variant conversion in the API help for the converttitles parameter 2010-10-03 12:11:42 +00:00
Alexandre Emsenhuber
1405fa3c83 Fixed parameter name in documentation 2010-09-19 11:08:09 +00:00
Alexandre Emsenhuber
457eb73b61 Standardised file description headers, added @file 2010-08-07 19:59:42 +00:00
X!
685ef510ee -(bug 24484) Add prop=pageprops module
-Add $wgPageProps global variable
2010-08-07 18:50:23 +00:00
Roan Kattouw
075c8d1624 Followup to r69776: cache result of extractRequestParams() because it gets called 2 or 3 times per module per request now. Also touch up documentation here and there 2010-07-23 10:15:29 +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
3cb1d23890 Remove various unused parameters
Only comment them out in ApiFormatYaml_spyc.php
2010-07-22 21:55:40 +00:00
Bryan Tong Minh
1d2b69a414 Follow-up r69233: Add existence check for NS_MEDIA titles 2010-07-21 14:40:24 +00:00
Roan Kattouw
79efadb25c Coding style: camelCase, not CamelCase 2010-07-21 10:30:02 +00:00
Roan Kattouw
d585f0a045 Followup to r69237: clarify documentation to avoid confusion with title normalization, minor style tweak 2010-07-20 09:24:26 +00:00
Bryan Tong Minh
1162995b21 (bug 24296) Added converttitles parameter to convert titles to their canonical language variant. 2010-07-10 11:53:22 +00:00
Bryan Tong Minh
3f3465126a (bug 24185) Titles in the Media and Special namespace are now supported for title normalization in action=query. Special pages have their name resolved to the local alias. 2010-07-10 10:46:20 +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
411600af87 * (bug 23524) Api Modules as followup to bug 14473 (Add iwlinks table to track inline interwiki link usage
Addition of IWBacklinks... That should be the bug done
2010-05-25 19:50:20 +00:00
Sam Reed
68ff239ac4 Minor part of bug 23473 - For the top level ApiMain/ApiQuery modules, note that module help is available before
Minor comment tweak to ApiQueryIWLinks
2010-05-15 11:07:31 +00:00
Sam Reed
5b5bf3ba53 Part 1 of Bug 23524 - Api Modules as followup to bug 14473 (Add iwlinks table to track inline interwiki link usage)
Addition of ApiQueryIWLinks (prop=iwlinks)
2010-05-14 20:54:55 +00:00
Sam Reed
b9c3930bb5 metadata is one word... 2010-05-14 11:25:41 +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
e4eca2c65e * (bug 21346) Make deleted images searchable by hash
Based roughly on ApiQueryAllimages
2010-05-10 22:41:16 +00:00
Sam Reed
ff442ae79f * (bug 19721) API action=help should have a way to just list for a specific module 2010-05-08 11:45:41 +00:00
Jack Phoenix
96b4f302af API: fix copyright symbol, coding style cleanup, more braces 2010-02-24 13:34:11 +00:00
Sam Reed
1f9a7d791c Implement 9 modules dieUsage errors 2010-02-13 00:48:31 +00:00
Mark A. Hershberger
8b36a2b969 various eol whitespace now instead of when someone needs to do CR 2010-02-12 06:44:16 +00:00
Sam Reed
b15f2c8c46 Normalise comment usage (# --> //) 2010-01-23 22:52:40 +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
Tim Starling
bd8fffe24d Reverted r58646 as per my comments on bug 20554. 2009-12-01 01:55:04 +00:00
Roan Kattouw
1b89cd274a API: (bug 20554) Expose average slave lag (avglag) as well as maxlag. Patch by Sam Reed. 2009-11-06 14:38:55 +00:00
Roan Kattouw
1d471caa46 API: (bug 19004) Add support for tags. Patch by Matthew Britton 2009-11-01 10:42:41 +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