Commit graph

37 commits

Author SHA1 Message Date
Brad Jorsch
f62bc7536e API: Fix access on getExamplesMessages
ApiBase declares it protected, but for some reason I had made it public
in all subclasses.

Change-Id: I8a50d4f47e66c7f09137968d3941dc5cdc1d28e4
2014-10-29 11:15:27 -04:00
Brad Jorsch
ad225f501c API: Internationalize all remaining core API modules
This also adds some new ApiBase::PARAM_* constants to generate more
helpful help, and a method to override the default description message
for the use of ApiDisabled and ApiQueryDisabled.

Bug: 71638
Change-Id: Ic0c3d232e0498d58a043037e2e0c6f0b1c3edad3
2014-10-20 16:56:35 -04:00
Brad Jorsch
f0a6435f3b API: Remove action=paraminfo 'props' and 'errors' result properties
The format for 'props' was never specified and the list for 'errors' is
impossible to keep updated when considering that many errors come from
MediaWiki backend code and extension hook functions. And since there
doesn't seem to be any real use case for either of these, let's just
kill both of them instead of wasting effort on trying to fix them.

Note that neither getResultProperties nor getPossibleErrors are called
from any extensions in gerrit, and none of the other deprecated methods
are called outside of the implementations of those two methods. Removing
the obsolete methods is left to the maintainers of the extensions, as
keeping them hurts nothing and is needed to maintain compatibility with
earlier versions of MediaWiki.

Change-Id: Ie11a401d60c834059fbf1b5625ca8ea093b3337c
2014-08-07 16:51:19 +01:00
umherirrender
e63299d208 Fixed some @params documentation (includes/api)
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Also added some missing @param.

Change-Id: I758fa4ad80ac95e2ddd3770bcb9b7d2e57ec34ea
2014-04-18 13:55:36 +00:00
addshore
719d7a2f03 Add final period to API module descriptions
Change-Id: Icae68c1ab1fd0006e00a3a9a56ae8f831d3d0d45
2014-03-10 09:04:08 +00:00
Siebrand Mazeland
ca209473d1 Remove unneeded uses of else{} in api/
Fixed a little documentation issue, removed a line of unreachable code
and fixed up two formatting issues in the process.

Change-Id: If29391ee1a0daf19973437f36c3216b8716debd0
2013-11-18 21:34:43 +01:00
Siebrand Mazeland
d026e1a403 Address errors and warnings in CodeSniffer in api/
Change-Id: I06de371393d50eada33154626874b106d814642b
2013-11-17 16:52:24 +01:00
Siebrand Mazeland
4c5088e635 Fix incorrect parameter order for dieUsage()
Change-Id: Ib163c40d728bacbd16e7c4beaae0c80e79855686
2013-11-16 20:13:41 +00:00
Siebrand Mazeland
fe05f85a62 Update formatting on API classes
Change-Id: Ifd18a8de1d2580b723a5b91e8d202818fd97795a
2013-11-14 17:03:20 +00:00
umherirrender
a35cce4be0 Fixed spacing in api folder
Added spaces before if, foreach
Added some braces for one line statements

Change-Id: Id7779dca4d1185245cf5764102b8de8b232c34b6
2013-04-20 07:47:36 +00:00
umherirrender
5880f89707 API: Throw error when interwiki is given for various title param
See bug 44341 for action=parse, but the problem with interwiki
processing can also be happen in other modules.

This gives clearer error message on some modules
For example action=move:
Bad title "*title*"
instead of:
Unknown error: "immobile-target-namespace-iw"

Change-Id: I86524533dfd778a169b39968999918a1f531efeb
2013-03-01 16:01:26 +01:00
Antoine Musso
b2fba3f27f api: remove duplicate __contruct calls
For historical reasons, all our API class had a dummy __construct which
simply calls their parent constructor.  This patch removes all such
occurences to save out some bytes.

Change-Id: I667955d7821f780fc5ce23823d74dedb1729b9fa
2013-01-29 09:38:17 +01:00
umherirrender
2e8da558ba fix some spacing
Change-Id: Id7eda67a43f9040117edd79fdbeb678f1c3a6da2
2013-01-26 22:11:09 +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
daniel
2bc191889a Fixing creation of DifferenceEninge
Creation of DifferenceEninge insteances was based on invalid assumptions
in several places.

Change-Id: Ib67ca893ea53a27d4ac7efd8a9ca0d3b2d93949f
2012-08-24 20:49:19 +02:00
Tim Starling
072416fa2d Fix indenting errors introduced in Wikidata branch
Change-Id: I487a0966a26359d4a6769331a6e2ee356eeb41db
2012-06-19 19:45:31 +10:00
daniel
a830943203 Merge branch 'master' of ssh://gerrit.wikimedia.org:29418/mediawiki/core into Wikidata 2012-06-14 12:43:43 +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
daniel
cbc2014b2d Use integers for content_model and content_format.
Representing content_model and content_format as integers in the
database was suggested by Asher mainly to save space.

This change entails some refactoring and renaming, but no big
change in logic.
2012-05-14 10:22:52 +02:00
daniel
02b78b2c15 renamed getDifferenceEngine to createDifferenceEngine 2012-04-17 21:02:03 +02:00
Jens Ohlig
10e91851b2 Merge branch 'master' into Wikidata
Conflicts:
	.gitreview
	includes/Article.php
	includes/AutoLoader.php
	includes/EditPage.php
	includes/LinksUpdate.php
	includes/WikiPage.php
	includes/installer/Ibm_db2Updater.php
	includes/installer/MysqlUpdater.php
	includes/installer/OracleUpdater.php
	includes/installer/SqliteUpdater.php
	maintenance/refreshLinks.php
2012-04-11 14:24:29 +02:00
Alex Monk
8e2b0d2b8d (bug 32498) Allow comparing pages using pageids
Change-Id: Ia2ab39e3b7b911f622aad96ca7b94ea7675c00ac
2012-04-08 00:30:54 +01:00
Daniel Kinzler
88f8ab8e90 use factory method to get difference engine everywhere 2012-04-04 19:59:46 +02:00
Max Semenik
c7bc27d5f8 Consistency: made all API examples a verbs 2012-01-12 17:36:06 +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
02bb594ac7 Revert r106521: creates lots of long, unwrappable lines in help output 2011-12-20 21:26:57 +00:00
Sam Reed
b0818acd86 More example conversions/additions
Ping r106439
2011-12-17 19:10:33 +00:00
Alexandre Emsenhuber
2b78de3f02 Made DifferenceEngine use a context instead of global variables and updaters calls to constructor in core 2011-11-10 13:06:52 +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
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
Sam Reed
696d202e18 Followup r89550, add new error message to getPossibleErrors 2011-06-06 09:40:45 +00:00
Matthew Britton
3d0bc9ca1c ApiComparePages: Throw an error if getDiffBody returns false, instead of blank output
This lets the client distinguish a legitimately blank diff (identical revisions) from one that does not exist or which they do not have permission to view.

getDiffBody doesn't tell the caller why it failed, so there may be a better way to do this.
2011-06-06 09:22:52 +00:00
Alexandre Emsenhuber
e44f4c34e5 Fixed api=compare example to use existing parameters 2011-05-24 16:16:00 +00:00
Sam Reed
c6490439d7 Followup r88002, fix naming on param documentation 2011-05-14 09:05:15 +00:00
Sam Reed
4bd15ed2e7 Improve variable naming 2011-05-13 16:16:08 +00:00
Sam Reed
cee8036e61 Followup r87225
Best to rename everything when you rename something
2011-05-02 11:12:48 +00:00
Sam Reed
c8079f0b81 * (bug 27185) API: Add Special:ComparePages 2011-05-01 21:56:02 +00:00