Commit graph

68 commits

Author SHA1 Message Date
Yuri Astrakhan
0aa24ae558 Fixed many small spelling mistakes and php docs, var decl.
Change-Id: I1508ed7eb77e5e4f700fb63955d626c4f5915840
2013-03-10 23:45:51 -04:00
Yuri Astrakhan
62216932c1 API PageSet allows generator for non-query modules
* PageSet can now be used in any action to process titles/pageids/revids
or any generator, redirects resolution, and converttitle functionality.
* action=purge proper usage of MustBePosted()
* Add supports for all pageset capabilities - generators, redirects, converttitles to
  action=purge and action=setnotificationtimestamp
* BREAKING CHANGE: ApiPageSet constructor now has two params instead of three, with only the
  first one keeping its meaning. ApiPageSet is now derived from ApiBase.
* BREAKING CHANGE: ApiQuery::newGenerator() and executeGeneratorModule() were deleted.

Change-Id: I7a3d7b6eb015d21ec1a9b9d9c6af9d97663f3f9a
2013-02-08 15:42:21 -05:00
Yuri Astrakhan
a97bb3acfa API module manager and help rewrite
This is a non-versioned part of the larger patch #41014
https://gerrit.wikimedia.org/r/#/c/41014
It will allow help subsystem optimization (merging paraminfo and help),
path towards per-module or per-system versioning, removal of the
manually maintained generator lists.

Changes:
* ApiModuleManager now handles all submodules (actions,props,lists) and instantiation
* ApiModuleManager maintains a cache of all instantiated modules
* Query stores prop/list/meta as submodules
* action=help suports generalized submodules (modules=query+value), querymodules obsolete

Change-Id: Ie2dee41e44a29cd5d5935eeaa5240b708d95a8f0
2013-02-05 01:52:55 -05: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
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
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
Sam Reed
69d011a23f Examples can just be a string
So if it's not false, it can be string|array, if it's a string, just put it in an array
2012-02-24 02:06:39 +00: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
Max Semenik
6bd85a6a2c Follow-up r97303: sort module names in paraminfo's paraminfo 2011-12-20 07:50:45 +00:00
Sam Reed
6c80c5ff87 Prep work for * (bug 33147) API examples should explain what they do
Now formatted in the autogenerated documentation

Format for paraminfo adds a description attribute to output


query allimages descriptions are tranformed, need to do/add to other ones
2011-12-16 15:28:35 +00:00
Sam Reed
53000baecf Oh noes, moar http:// -> https:// 2011-11-28 15:43:11 +00:00
Sam Reed
f3839fe71f Added "ApiGetDescription" hook 2011-11-28 15:33:28 +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
d8957aca62 Refactor variables to give somewhat useful names 2011-09-16 18:28:24 +00:00
Sam Reed
324e642c2c Add handling of format modules to ApiParamInfo 2011-09-16 18:25:02 +00:00
Sam Reed
478a95fb13 Give a list of modules to query and action into paraminfo 2011-09-16 18:11:47 +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
9f785bc597 Followup r92430 per CR, like r94448 2011-08-15 18:56:37 +00:00
Max Semenik
e214ea91df ApiParamInfo: if no help URLs are available, return an empty array instead of array with one empty element 2011-08-14 09:37:23 +00:00
Sam Reed
54946d842f * (bug 29935) Improve formatting of examples in ApiParamInfo
Old example string with newlines left for the moment, pending discussion on bug...
2011-07-18 13:19:46 +00:00
Sam Reed
937c3bb69f Followup r92396
Using action=paraminfo to give help urls (and examples for that matter!!) look awful as a string with an encoded \n in the middle of it
2011-07-17 17:09:51 +00:00
Sam Reed
ac0ff8fb37 Followup r92396 rename method, fix boolean comparison that was supposed to be inverted when de-indenting 2011-07-17 16:23:29 +00:00
Sam Reed
d18c0dc315 * (bug 28817) Add reference help page link to API Modules
Start of this bug, fleshed out base code implemented, plus a few key modules (will finish rest up soon)

Tweaked/improved/updated some documentation as I went through also
2011-07-17 16:18:09 +00:00
Sam Reed
4ef1b5cb39 Fix 2 usages of 'bool' when 'boolean' is used elsewhere 2011-06-05 21:56:27 +00:00
Sam Reed
0f618da076 * (bug 27790) add query type for querymodules to action=paraminfo 2011-05-10 23:46:27 +00:00
Sam Reed
2730c42dd8 Whitespace fixes
Addition/tweak of documentation
2011-05-08 21:47:01 +00:00
Sam Reed
4d18298e86 Followup r87132, per Bryan, still return the "limit" to be the current users limit, but return high/low limit 2011-04-29 21:46:17 +00:00
Sam Reed
32f8443064 * (bug 28238) paraminfo: output both limits for multi param 2011-04-29 20:52:57 +00:00
Max Semenik
40294d93ba Follow-up r86954: make one centralised call to array_values(), there are more breakages of this kind 2011-04-26 19:20:19 +00:00
Sam Reed
6d118609c1 * (bug 28702) Undefined offset in ApiParamInfo.php
Followup r85758 (bug 28254)

If no DFLT is set, fall back to "null", which means a string parameter
2011-04-25 22:56:08 +00:00
Sam Reed
af3a1052ff * (bug 28254) action=paraminfo: Extract type from PARAM_DFLT if PARAM_TYPE is not set
Patch by Umherirrender
2011-04-10 13:01:47 +00:00
Zak Greant
6b8cbcdd11 Make paraminfo output examples along with parameter information. 2011-01-21 23:12:51 +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
17487e40ba Replace my old e-mail address with my new one in API comments. A bit outdated (dropped the old one in September '08) 2010-12-22 20:48:10 +00:00
Sam Reed
c48bbaec3c Remove error from ApiUserrights getPossibleErrors, it doesn't explicitally throw an error for missing user param. Does some other fancy errors from the special page. We should have a way for that to tell us it throws some errors....
Remove trailing whitespace
2010-10-01 19:37:38 +00:00
Alexandre Emsenhuber
457eb73b61 Standardised file description headers, added @file 2010-08-07 19:59:42 +00:00
Sam Reed
e2ec02531d Reduce unnecessary seperate nested if's, move them up to the top if (as per most of the others where this is necessary!) 2010-08-06 11:20:39 +00:00
Sam Reed
83411cd0fa Followup r70460 per Umherirrender comment
Add "required" to ApiParamInfo
2010-08-06 11:18:39 +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
0a17a0360a Append " and errors" to getDescription for ApiParamInfo to signify that information about the errors a module can return is there 2010-04-24 11:58:52 +00:00
Jack Phoenix
c286869e38 API: fix copyright symbol, coding style cleanup, more braces 2010-02-23 18:05:46 +00:00
Sam Reed
3fcc9a8bcd Fix r62331 - If we renamed a method, we need to to it everywhere! 2010-02-11 22:22:20 +00:00
Sam Reed
aa973b9eb7 More of bug 18771 - List possible errors in action=paraminfo
Followup to comments of r62282
2010-02-11 21:34:35 +00:00
Sam Reed
ee60482546 Start implementation of bug 18771 - List possible errors in action=paraminfo
Base has empty array() returning method, ApiBlock has implementation of possibleErrors from code above (possibly not complete)

Can be finished incrementally, so serves as a review point for Roan
2010-02-11 01:13:45 +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
Chad Horohoe
3cdae769b7 Only use one if, not 2 2010-01-05 10:50:07 +00:00
Chad Horohoe
c660ee428f (bug 21106) tag deprecated parameter in action=paraminfo. Add new PARAM_DEPRECATED const for automagically tagging deprecated parameters. Keeps action=help and action=paraminfo up to date 2009-10-28 00:56:07 +00:00