Commit graph

145 commits

Author SHA1 Message Date
umherirrender
ca31ebad3f fix some spacing
Added/removed spaces after opening/before closing parentheses

Added a space after a comma

Removed unneeded parentheses in condition

Change-Id: I306091347ccaaf11dee0cdfda3019cb0c12be51b
2013-02-09 23:03:53 +01:00
Yuri Astrakhan
503cd2f4ae (bug 35885) remove api version string and parameter
API was using SVN's version keyword which GIT does not support.
All related methods were either removed, or for those that
could have been used from extensions, emptied out.
api.php?version now shows unrecognized param warning.

Change-Id: I910ca1448ed2ed697ac19b17c486d130aa1d7e03
2013-01-18 12:41:18 -05:00
Yuri Astrakhan
983545c362 API Cleanup: renamed '_badcontinue'->'badcontinue', one die()
* If a query module has 'continue' parameter, it will auto-report
that it has 'badcontinue' error.
* Added APIQueryBase::DieUsageContinueIf( $condition ) that shows
correct badcontinue error if $condition is true.

Change-Id: I9c48bda6de0cde3c117ad24460bddf6980279633
2013-01-14 21:19:16 -05:00
Yuri Astrakhan
32fd68f81c Minor cleanup
Fixed spacing, eol chars, "string" --> 'string'

Change-Id: I630247c6c5b469efb67ec9de32e8533ae88e59fb
2013-01-12 01:50:48 -05:00
Reedy
493e87a34a Revert "(bug 29115) Add redirect target value on page info"
This reverts commit 0c6ba8c61d
2012-12-12 21:51:54 +00:00
umherirrender
0c6ba8c61d (bug 29115) Add redirect target value on page info
Added inprop=redirecttarget

Refactored ApiPageSet::getRedirectTargets to having one method for
resolving redirect targets and calling that from prop=info.

Change-Id: Ia5fb9f25488880c2dd63e613c913a0864464d327
2012-12-09 20:09:15 +01:00
umherirrender
82375631c2 Fix tabs inside/between statements/text
This tabs are strange and a space there is better

Change-Id: I0885dff575ee2fcd0668d08fef3226e132c5b319
2012-10-26 18:18:59 +02:00
umherirrender
eb41fc9dc1 Add User to Title::userCan calls in api
Change-Id: I86ee1398abe4a790796d61aba1e1739bc55e565b
2012-09-22 13:33:33 +02:00
Brad Jorsch
fdad41156c Allow manipulation of wl_notificationtimestamp via the API
It should be possible to query the notificationtimestamp as a page info
property, rather than only by querying the recent changes for the
watchlist. It should also be possible to clear or adjust the
notificationtimestamp via the API.

This patch does just that.

Change-Id: I8e2c0769e93802a6a09936899a41c07f9c4c9f25
2012-08-02 13:01:10 -07:00
Catrope
ffa4afe483 Merge "show old protection in prop=info, if no new protection exists" 2012-07-24 22:08:24 +00:00
Aaron Schulz
e6faa2fd76 Merge "escape HTML elements in docblock with double quotes" 2012-07-18 19:17:46 +00:00
Antoine Musso
4f5d2386f3 escape HTML elements in docblock with double quotes
Doxygen choke on text enclosed by '<' and '>' since it tries to
interpret them as HTML or XML elements. This patch adds double quotes
in includes/api/*.php files around the two following strings:

 <Firstname>.<Lastname>@gmail.com
 <Firstname><Lastname>@gmail.com

Which becomes:

 "<Firstname>.<Lastname>@gmail.com"
 "<Firstname><Lastname>@gmail.com"

Tested locally, it prevents doxygen 1.8.0 related warnings.

Change-Id: I36d82eb3fd4989ee3ffc65b0b527b83711d1ba69
2012-07-15 22:15:45 +02:00
umherirrender
5342d822a8 Notice: Undefined index: page_is_redirect in
\includes\api\ApiPageSet.php on line 111

This came when using action=query&redirects, because ApiQueryInfo was
requesting page_is_redirect unconditionally, but that field is sorted
out, when using resolve redirects

Change-Id: Ifde9c5d8cbbb8775151829ae8c07e3ed5d76868a
2012-07-08 17:09:04 +02:00
umherirrender
8d2b1a1b58 show old protection in prop=info, if no new protection exists
prop=info shows only old protection from page.page_restrictions, if a
new protection in table page_restrictions was found, because only in the
foreach was the old protection checked, but that foreach operated
on pages, which was found in table page_restrictions. Doing an extra
foreach over the array of old protection fix this.
This change also removes the join from the query to table
page_restrictions, because the code already know the needed ns/dbkey.

Change-Id: I52111f30e4fa9550c82d18db33efda5edec59c66
2012-07-08 14:52:02 +00:00
daniel
bfa1ced1a7 API: Reset token cache on login, so API tests work
Previously, logging in several times during a phpunit run would change the
session token, but keep the edit token, leasing to "bad token" failures for
all but the first login.

Change-Id: Iad49c990c5661d55cd907b8441addb74eb0ef694
2012-06-22 23:34:59 +02:00
Aaron Schulz
a3a293f0e6 Merge "avoid Title::exist/getArticleId in ApiQueryInfo::extractPageInfo" 2012-06-14 19:56:02 +00:00
umherirrender
43b1c36ab3 avoid Title::exist/getArticleId in ApiQueryInfo::extractPageInfo
For missing title the pageid is not set inside the Title objects, but
the pageid is given to that method, so it is better to use that
pageid to check for exist or to use the pageid, instead of using the
Title method.

Change-Id: I07db242eb37731610ac7a83acdb5e6adfc2951aa
2012-06-08 11:02:46 +02:00
Petr Onderka
80aa025528 Added result properties to action=paraminfo
Added information about the properties of the results of API calls
to action=paraminfo, including information about "property groups":
what should the prop parameter be set to to get that property.

Uses the same format for types as parameters already do.
The output format of some modules doesn't fit this, so the result
properties for them weren't added, or only partially.

Partially implemented modules:
* expandtemplates:
  parsetree is in its own tag
* protect, allusers, backlinks, deletedrevs, info, imageinfo,
  logevents, querypage, recentchanges, revisions, searchinfo,
  usercontribs, userinfo, users, watchlist, upload:
  response with partially complex structure

Not implemented modules:
* feedcontributions, feedwatchlist, opensearch, rds:
  non-standard reponse
* help:
  error is normal response; not very useful for automated tools anyway
* paraminfo, parse, pageprops, siteinfo, userrights:
  response with complex structure

Change-Id: Iff2a9bef79f994e73eef3062b4dd5461bff968ab
2012-06-06 19:24:59 +02:00
Szymon Świerkosz
7cf5f38232 Move optionstoken from meta=userinfo to action=tokens.
Follow up to I0d6c654a7354ba77e65e338423952a6a78c1150f.
I have also added a URL to a help page on mw.org.

Change-Id: Ie223930cfc313aff150e2dcfd70b74bf4360a8a8
2012-05-06 16:07:17 +02:00
Sam Reed
b18ea7dee2 Normalise casing of getArticleID used in core 2012-03-11 18:54:55 +00: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
Robin Pepermans
be2de16942 update all core usage of deprecated Title::userCanRead() 2011-12-13 11:05:30 +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
1ba364df99 Update documentation
Fix some context method calls which were considered deprecated
2011-10-28 18:10:41 +00:00
Sam Reed
fa65fa3243 Documentation
Deprecated code updates
2011-10-27 00:46:17 +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
Roan Kattouw
d8a2733757 Make the PROTO_ parameter to wfExpandUrl() explicit in all calls. There are now no calls to wfExpandUrl() in core that rely on PROTO_CURRENT being the default. Also switch to using getCanonicalUrl() for.... rel="canonical" :D (I picked the right name, I KNEW IT) 2011-08-19 15:46:08 +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
Roan Kattouw
fbdba8b26f Revert r93802 per CR. Will avoid cache pollution by splitting the cache instead 2011-08-03 07:54:23 +00:00
Roan Kattouw
541aa4cbdd Followup r92044: force HTTP on URLs output by the API, now that wfExpandUrl() has a flag for this 2011-08-03 07:05:21 +00:00
Sam Reed
d5e46f9614 Followup r92396
More modules documented, pretty much only action=query&list= to be done (ie links added where documentation pages exist already)
2011-07-17 16:51:11 +00:00
Roan Kattouw
7b8b23e8b4 Per wikitech-l, run a bunch of URLs in the API output through wfExpandUrl(), so they become fully-qualified even if they were originally protocol-relative 2011-07-13 01:27:07 +00:00
Sam Reed
d993a1578c * (bug 29070) Add token to action=watch 2011-05-21 16:38:40 +00:00
Sam Reed
f373e63255 Followup r84825
Allow obtaining of an import token if users have the importupload right
2011-04-01 17:29:15 +00:00
Happy-melon
91e7b5a93c More cleanup in Block.php. Push Block::encodeExpiry() and Block::decodeExpiry() deeper into the callstack, to DatabaseBase for encode and Language for decode. The vast majority of callers of these functions are not handling block expiries, but expiries generally, particularly page protections. 2011-03-18 19:15:56 +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
6309c920dd Delete all the "API for MediaWiki 1.8+" comments
Add since to ApiQueryQueryPage
2010-12-22 20:52:06 +00:00
Bryan Tong Minh
b97ce8c015 Revert the addition of the patrol token from ApiQueryInfo from r78141; does not belong there 2010-12-09 21:42:01 +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
Alexandre Emsenhuber
00226e1e9b * (bug 25987) prop=info&inprop=watched now also works for missing pages 2010-11-19 10:53:08 +00:00
Sam Reed
9826f4a7df Followup r75999, use the correct variable. Zak confused me with having one thing in the bug title, and another in the bug content! :P 2010-11-05 22:24:07 +00:00
Sam Reed
1d0acc5fb4 Fixup r75999, add missing ./PhpStorm-98.240/bin/webide.sh Wheee r76000 2010-11-04 13:20:58 +00:00
Sam Reed
bfd1fd770a * (bug 25760) counter property still reported by the API when wgDisableCounters enabled. If it's enabled, don't request counter information, and just display , to avoid breaking any backwards compatability 2010-11-04 13:10:38 +00:00
Sam Reed
4a0c3d8ff5 Comment return types, some explicit class variable declaration 2010-10-09 00:01:45 +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