aboutsummaryrefslogtreecommitdiffstats
path: root/includes/api/ApiQueryInfo.php
Commit message (Collapse)AuthorAgeFilesLines
* API: Always request page_is_redirect from ApiQueryInfoBrad Jorsch2014-11-171-4/+4
| | | | | | | | | | | | The ApiPageSet doesn't know for sure whether it will be resolving redirects until it is executed, as the revids parameter may override that (and it can't easily check before being executed because it might never actually be executed). So ApiQueryInfo needs to just unconditionally request page_is_redirect and only consider later whether to try using it. Bug: 73464 Change-Id: I2297158188dae5476c5b9b5755ea26cf5b8ae487
* Select column page_lang in prop=infoumherirrender2014-11-041-0/+3
| | | | | | | | The new field needs to be part of the select to init the title object correct. Only needed when $wgPageLanguageUseDB = true Change-Id: I30e8bb1dd493148cba9fec214718f80d04b7638b
* API: Fix access on getExamplesMessagesBrad Jorsch2014-10-291-1/+1
| | | | | | | ApiBase declares it protected, but for some reason I had made it public in all subclasses. Change-Id: I8a50d4f47e66c7f09137968d3941dc5cdc1d28e4
* Merge "API: Internationalize all remaining core API modules"jenkins-bot2014-10-201-27/+7
|\
| * API: Internationalize all remaining core API modulesBrad Jorsch2014-10-201-27/+7
| | | | | | | | | | | | | | | | | | 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
* | Remove hitcounters and associated codeChad Horohoe2014-10-201-9/+0
|/ | | | | | | | | The hitcounter implementation in MediaWiki is flawed and needs removal. For proper metrics, it is suggested to use something like Piwik or Google Analytics. RFC: https://www.mediawiki.org/wiki/Requests_for_comment/Removing_hit_counters_from_MediaWiki_core Change-Id: I0e5006a7e8a09c800f8fa4effa9399e8afdd7a57
* APIQueryInfo: Allow fetching the canonical url of a pageKunal Mehta2014-09-051-1/+2
| | | | Change-Id: If0f62481d059815390b74ccf8167957bc1dbce52
* API: Overhaul token handlingBrad Jorsch2014-08-261-0/+35
| | | | | | | | | | | | | | | | | | | | The current token handling is a mess. This simplifies things greatly: * *All* tokens are obtained from action=query&meta=tokens, rather than being spread over action=tokens, action=query&prop=info, action=query&prop=revisions, action=query&prop=recentchanges, and action=query&prop=users. All these old methods are deprecated. * Similarly, there is only one hook to register new token types. All old hooks are deprecated. * All tokens are cacheable. * Most token types are dropped in favor of a 'csrf' token. They already were returning the same token anyway. * All token-using modules will document the required token type in a standard manner in action=help and are documented in machine-readable fashion in action=paraminfo. Note this will require updates to all extensions using tokens. Change-Id: I2793a3f2dd64a4bebb0b4d065e09af1e9f63fb89
* API: Remove action=paraminfo 'props' and 'errors' result propertiesBrad Jorsch2014-08-071-66/+0
| | | | | | | | | | | | | | | | | 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
* Switch API to use Config classesReedy2014-06-151-14/+8
| | | | | | Only done where globals are config (so not $wgParser, $wgContLang etc) Change-Id: Ic39cdd858cfb9096a2bc09618f97e64270d76f13
* Use precise ApiMain/ApiQuery type hints in all API modulesThiemo Mättig2014-05-161-1/+1
| | | | | | | | | | | | | | | | | Which type is used depends on the ApiModuleManager responsible for the API module. There are two managers, one in ApiMain and one in ApiQuery. Both contain a list of API modules they instantiate. Both use $this as the first parameter in the constructors of the individual modules. There is no other regular way to instantiate the modules, so we know the type must either be ApiMain or ApiQuery. The lists don't intersect. I would have prefered the naming scheme $mainModule for ApiMain modules and $queryModule for ApiQuery modules but since this doesn't add much I left the shorter variable names untouched. Change-Id: Ie6bf19150f1c9b619655a06a8e051412665e54db
* Fixed some @params documentation (includes/api)umherirrender2014-04-181-3/+3
| | | | | | | | | 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
* Declare visibility on class property in ApiQueryInfoSiebrand Mazeland2013-11-151-1/+1
| | | | | | Only used in this class, so make protected. Change-Id: I20984d14524073b6b1b9f4b31c2107722318503f
* Fix CodeSniffer errors and warnings (you guessed it, on API classes)Siebrand Mazeland2013-11-151-4/+8
| | | | Change-Id: I56f9632975d53bdfe33ff9412e1a4ba010bdb2aa
* Yet more formatting updates for yet more API classesSiebrand Mazeland2013-11-141-8/+10
| | | | Change-Id: Iaa1cfaaffc7c55bb7670dfbff3f063cf22434f09
* Add user rights 'viewmywatchlist', 'editmywatchlist'Brad Jorsch2013-06-261-1/+3
| | | | | | | | | These are needed for OAuth grants. Note that, even if 'editmywatchlist' is not granted, various actions will still allow for adding but not removing of pages. Change-Id: Ie33446a228dd6ed0114730935c1bf65667f5ce01
* Add page language to prop=infoumherirrender2013-05-221-0/+1
| | | | | | | | This can be useful to determine the language of a page, for example javascript has english as page language. MediaWiki pages has it page language corresponding to the lang code in the sub page. Change-Id: Idd0412574b314ecf52d92243a3f8a08755474663
* Add content model to prop=infoumherirrender2013-05-081-2/+9
| | | | | | Fields of page table are shown by default in prop=info Change-Id: Id8b90c341dea19337558ed355975ab890f0663e2
* Fixed spacing in api folderumherirrender2013-04-201-2/+2
| | | | | | | Added spaces before if, foreach Added some braces for one line statements Change-Id: Id7779dca4d1185245cf5764102b8de8b232c34b6
* Fixed @param tags to conform with Doxygen format.Tyler Anthony Romeo2013-03-111-1/+1
| | | | | | | | | | | Doxygen expects parameter types to come before the parameter name in @param tags. Used a quick regex to switch everything around where possible. This only fixes cases where a primitve variable (or a primitive followed by other types) is the variable type. Other cases will need to be fixed manually. Change-Id: Ic59fd20856eb0489d70f3469a56ebce0efb3db13
* Fixed many small spelling mistakes and php docs, var decl.Yuri Astrakhan2013-03-101-0/+3
| | | | Change-Id: I1508ed7eb77e5e4f700fb63955d626c4f5915840
* (bug 44244) Add number of watchers to API prop=infoBrad Jorsch2013-03-031-2/+65
| | | | | | | | | | | | Following up I1cb6ee22, which added this information to each page's action=info, this adds inprop=watchers to query the number of people watching the page. It is subject to the same limitations (user has unwatchedpages or watchers >= $wgUnwatchedPageThreshold) as action=info. Also, update doc for $wgUnwatchedPageThreshold to match reality. Bug: 44244 Change-Id: Ideaac1d84bbe0349154ffe96ba54d74305e3da1d
* fix some spacingumherirrender2013-02-091-1/+1
| | | | | | | | | | Added/removed spaces after opening/before closing parentheses Added a space after a comma Removed unneeded parentheses in condition Change-Id: I306091347ccaaf11dee0cdfda3019cb0c12be51b
* (bug 35885) remove api version string and parameterYuri Astrakhan2013-01-181-4/+0
| | | | | | | | | 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
* API Cleanup: renamed '_badcontinue'->'badcontinue', one die()Yuri Astrakhan2013-01-141-10/+1
| | | | | | | | | * 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
* Minor cleanupYuri Astrakhan2013-01-121-28/+28
| | | | | | Fixed spacing, eol chars, "string" --> 'string' Change-Id: I630247c6c5b469efb67ec9de32e8533ae88e59fb
* Revert "(bug 29115) Add redirect target value on page info"Reedy2012-12-121-24/+2
| | | This reverts commit 0c6ba8c61d73f995d32e5c8348833ebedd90ea4a
* (bug 29115) Add redirect target value on page infoumherirrender2012-12-091-2/+24
| | | | | | | | Added inprop=redirecttarget Refactored ApiPageSet::getRedirectTargets to having one method for resolving redirect targets and calling that from prop=info. Change-Id: Ia5fb9f25488880c2dd63e613c913a0864464d327
* Fix tabs inside/between statements/textumherirrender2012-10-261-1/+1
| | | | | | This tabs are strange and a space there is better Change-Id: I0885dff575ee2fcd0668d08fef3226e132c5b319
* Add User to Title::userCan calls in apiumherirrender2012-09-221-1/+1
| | | | Change-Id: I86ee1398abe4a790796d61aba1e1739bc55e565b
* Allow manipulation of wl_notificationtimestamp via the APIBrad Jorsch2012-08-021-12/+36
| | | | | | | | | | | 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
* Merge "show old protection in prop=info, if no new protection exists"Catrope2012-07-241-12/+14
|\
| * show old protection in prop=info, if no new protection existsumherirrender2012-07-081-12/+14
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge "escape HTML elements in docblock with double quotes"Aaron Schulz2012-07-181-1/+1
|\ \
| * | escape HTML elements in docblock with double quotesAntoine Musso2012-07-151-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* / Notice: Undefined index: page_is_redirect inumherirrender2012-07-081-3/+9
|/ | | | | | | | | | \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
* API: Reset token cache on login, so API tests workdaniel2012-06-221-46/+42
| | | | | | | | 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
* Merge "avoid Title::exist/getArticleId in ApiQueryInfo::extractPageInfo"Aaron Schulz2012-06-141-11/+14
|\
| * avoid Title::exist/getArticleId in ApiQueryInfo::extractPageInfoumherirrender2012-06-081-11/+14
| | | | | | | | | | | | | | | | | | 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
* | Added result properties to action=paraminfoPetr Onderka2012-06-061-0/+53
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Move optionstoken from meta=userinfo to action=tokens.Szymon Świerkosz2012-05-061-0/+15
| | | | | | | Follow up to I0d6c654a7354ba77e65e338423952a6a78c1150f. I have also added a URL to a help page on mw.org. Change-Id: Ie223930cfc313aff150e2dcfd70b74bf4360a8a8
* Normalise casing of getArticleID used in coreSam Reed2012-03-111-2/+2
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/113580
* Reverted r108743 per CR comment. This should at least be discussed first.Aaron Schulz2012-01-121-0/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/108745
* Kill "* @return void"Sam Reed2012-01-121-1/+0
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/108743
* update all core usage of deprecated Title::userCanRead()Robin Pepermans2011-12-131-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/106010
* Oh noes, moar http:// -> https://Sam Reed2011-11-281-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/104445
* Removed the 'eclipse helper' bit on top of every API moduleJohn Du Hart2011-11-161-5/+0
| | | | | | | | 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. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/103273
* Update documentationSam Reed2011-10-281-1/+1
| | | | | | | Fix some context method calls which were considered deprecated Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/101160
* DocumentationSam Reed2011-10-271-8/+8
| | | | | | | Deprecated code updates Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/100922
* Adding context to the APIJohn Du Hart2011-10-261-3/+3
| | | | | | | This will probably break something somewhere so when it does please yell at me on IRC and I'll fix it. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/100905