aboutsummaryrefslogtreecommitdiffstats
path: root/includes/api/ApiQueryAllMessages.php
Commit message (Collapse)AuthorAgeFilesLines
* api: Replace numerous deprecated constantsReedy2022-06-061-8/+9
| | | | Change-Id: I34ffcb70efbfa257da8dab6e0790aa0d697caf5b
* phan: Remove PhanPossiblyUndeclaredVariable suppressionUmherirrender2022-03-301-0/+3
| | | | | | | | | Make phan stricter about conditional variable declaration Remaining false positive issues are suppressed. The suppression and the setting change can only be done together Bug: T259172 Change-Id: I1f200ac37df7448453688bf464a8250c97313e5d
* Add various fallback values for null return valuesUmherirrender2022-03-091-1/+1
| | | | | | Found by phan strict checks Change-Id: I83187b5fd25b015d2c75e22d4b5202803653d743
* api: Inject services into ApiQueryAllMessagesUmherirrender2021-07-031-10/+45
| | | | | Bug: T259960 Change-Id: Ib7058c8c55ce65802b501a5a7b7458c14ba27cfe
* Use array_fill_keys() instead of array_flip() if that reflects the ↵Tim Starling2021-06-151-1/+1
| | | | | | | | | | | | | | | | | | developer's intention array_fill_keys() was introduced in PHP 5.2.0 and works like array_flip() except that it does only one thing (copying keys) instead of two things (copying keys and values). That makes it faster and more obvious. When array_flip() calls were paired, I left them as is, because that pattern is too cute. I couldn't kill something so cute. Sometimes it was hard to figure out whether the values in array_flip() result were used. That's the point of this change. If you use array_fill_keys(), the intention is obvious. Change-Id: If8d340a8bc816a15afec37e64f00106ae45e10ed
* Use Message::page instead of Message::titlePetr Pchelko2021-06-091-1/+1
| | | | | | | Also modified new APIs added to ApiErrorFormatter to use PageReference instead of Title. Change-Id: I093c89f8e1e6d383603f887358be6ece70f23a02
* Inject services into SpecialAllMessagesUmherirrender2020-11-021-1/+2
| | | | | | | | | | | This covers only directly used services by this special page and pager Services used by the base class are not part of this patch set Have to change the signature of one static function to avoid global state and changed the caller as well Bug: T259960 Change-Id: I9502c6cfd718b6edb074a50931094fcdbf2c48de
* Use MediaWikiServices::getMessageCacheUmherirrender2020-03-141-1/+2
| | | | Change-Id: I07fcc9529991adc634c10e5ed8498ac138a1c2b7
* Remove usages of deprecated Language methodsPetr Pchelko2020-02-161-5/+5
| | | | Change-Id: Iad3375b141b1d87c890baec6ecd16ed92f93e699
* Coding style: Auto-fix MediaWiki.Usage.IsNull.IsNullJames D. Forrester2020-01-101-5/+5
| | | | Change-Id: I90cfe8366c0245c9c67e598d17800684897a4e27
* Remove Language::factory and getParentLanguage useAryeh Gregor2019-10-271-1/+2
| | | | Change-Id: I11f8801ef47ec1a1f63d840116e69667e6f3ae3c
* Mass conversion of $wgContLang to serviceAryeh Gregor2018-08-111-3/+3
| | | | | | | Brought to you by vim macros. Bug: T200246 Change-Id: I79e919f4553e3bd3eb714073fed7a43051b4fb2a
* Remove "Created on" from file header commentsUmherirrender2018-01-261-4/+0
| | | | | | | | | It is the job of git and svn to provide this information/metadata. The form was different, some with short, some with long month name some with leading zero at the day, some without. The year is also present in the Copyright clause Change-Id: If006907b82b9e45f13cfa2e45d41107a95570e1a
* Make API documentation links language awareBaha2017-04-051-1/+1
| | | | | | | | | | | | | | Links generated by the API are now aware of the user's preferred language and will show documents in that language if available. To test, log in to mediawiki.org and set your language preference to 'es', then on an MediaWiki installation with this patch view the generated expanded API help at `api.php?action=help&recursivesubmodules=1&modules=main`. Each link to documentation on mediawiki.org should take you to its translated /es subpage, if one exists. Bug: T104518 Change-Id: I339a1f3ae1bce9d759cf251899d57c32b1def91e
* API: i18n for warnings and errorsBrad Jorsch2016-12-061-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | API warnings and error messages are currently hard-coded English strings. This patch changes that. With a few exceptions, this patch should be compatible with non-updated extensions: * The change to ApiBase::$messageMap will blow up anything trying to mess with it. * The changes to the 'ApiCheckCanExecute' hook will cause a wrong (probably unparsed) error message to be emitted for extensions not already using an ApiMessage. Unless they're currently broken like Wikibase. Bug: T37074 Bug: T47843 Depends-On: Ia2b66b57cd4eaddc30b3ffdd7b97d6ca3e02d898 Depends-On: I2e1bb975bb0045476c03ebe6cdec00259bae22ec Depends-On: I53987bf87c48f6c00deec17a8e957d24fcc3eaa6 Depends-On: Ibf93a459eb62d30f7c70d20e91ec9faeb80d10ed Depends-On: I3cf889811f44a15935e454dd42f081164d4a098c Depends-On: Ieae527de86735ddcba34724730e8730fb277b99b Depends-On: I535344c29d51521147c2a26c341dae38cec3e931 Change-Id: Iae0e2ce3bd42dd4776a9779664086119ac188412
* Language: Introduce new method equals( Language $lang )Fomafix2016-05-161-3/+2
| | | | | | | | | | | | Use $lang->equals( $wgContLang ) instead of $lang->getCode() === $wgContLang->getCode() Change-Id: Id7ed6a21ce5e2ea2887ec98c7bd9d3eba83d733b
* Convert all array() syntax to []Kunal Mehta2016-02-171-26/+26
| | | | | | | | | | Per wikitech-l consensus: https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html Notes: * Disabled CallTimePassByReference due to false positives (T127163) Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
* Fix Generic.Files.LineLength phpcs failure in 11 files under includes/Amir E. Aharoni2015-10-031-1/+7
| | | | | Bug: T102614 Change-Id: I0d759be6ef568c2c6f28606d3002484ad77a1830
* Normalize message name in AllmessagesGeoffrey Mon2015-07-151-1/+5
| | | | | | | | | * Normalize the message name returned by allmessages * Separate message key normalization into MessageCache::normalizeKey() Bug: T63894 Change-Id: I1d89fc73fea705243d390bab91255a635d8f9eee
* Update getHelpUrls() for reworked mw.org API pagesRobinHood702015-05-041-1/+1
| | | | | | | | | | | | | | | | | | | Community members restructured the mediawiki.org API pages, e.g. the meta allmessages query submodule is no longer in the catch-all https://www.mediawiki.org/wiki/API:Meta?oldid=1408361#allmessages_.2F_am but its own https://www.mediawiki.org/wiki/API:Allmessages The links in the generated API help, e.g. https://www.mediawiki.org/wiki/Special:ApiHelp/query+allmessages, are no correct. They're not 404s but they don't take you directly to the relevant page. This patch set fixes the getHelpUrls() URLs (and does nothing else). I tested them all. Thanks RobinHood70! Change-Id: Icea94abdd22d1ad468172642a21641e7c5ce2046
* Change API result data structure to be cleaner in new formatsBrad Jorsch2015-04-201-3/+3
| | | | | | | | | | | Nothing in this patch should result in changed output for format=json or format=php except as noted in RELEASE-NOTES-1.25, and changed output for format=xml should be similar or cosmetic. However, other code accessing the result data directly may need to be updated. Bug: T87053 Bug: T12887 Change-Id: I3500708965cb8869b5aed1543381aad208dadd13
* API: Overhaul ApiResult, make format=xml not throw, and add json formatversionBrad Jorsch2015-04-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ApiResult was a mess: some methods could only be used with an array reference instead of manipulating the stored data, methods that had both array-ref and internal-data versions had names that didn't at all correspond, some methods that worked on an array reference were annoyingly non-static, and then the whole mess with setIndexedTagName. ApiFormatXml is also entirely annoying to deal with, as it liked to throw exceptions if certain metadata wasn't provided that no other formatter required. Its legacy also means we have this silly convention of using empty-string rather than boolean true, annoying restrictions on keys (leading to things that should be hashes being arrays of key-value object instead), '*' used as a key all over the place, and so on. So, changes here: * ApiResult is no longer an ApiBase or a ContextSource. * Wherever sensible, ApiResult provides a static method working on an arrayref and a non-static method working on internal data. * Metadata is now always added to ApiResult's internal data structure. Formatters are responsible for stripping it if necessary. "raw mode" is deprecated. * New metadata to replace the '*' key, solve the array() => '[]' vs '{}' question, and so on. * New class for formatting warnings and errors using i18n messages, and support for multiple errors and a more machine-readable format for warnings. For the moment, though, the actual output will not be changing yet (see T47843 for future plans). * New formatversion parameter for format=json and format=php, to select between BC mode and the modern output. * In BC mode, booleans will be converted to empty-string presence style; modules currently returning booleans will need to use ApiResult::META_BC_BOOLS to preserve their current output. Actual changes to the API modules' output (e.g. actually returning booleans for the new formatversion) beyond the use of ApiResult::setContentValue() are left for a future change. Bug: T76728 Bug: T57371 Bug: T33629 Change-Id: I7b37295e8862b188d1f3b0cd07f66ac34629678f
* 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
* API: Internationalize all remaining core API modulesBrad Jorsch2014-10-201-28/+5
| | | | | | | | | 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
* API: Remove action=paraminfo 'props' and 'errors' result propertiesBrad Jorsch2014-08-071-27/+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
* Capitalise Message in SpecialAllMessages filesReedy2014-06-161-1/+1
| | | | | | No internal changes to Special:Allmessage etc made Change-Id: I21a164af0b6ec123bf654cd1e4e7085b1192f067
* Switch API to use Config classesReedy2014-06-151-2/+1
| | | | | | 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
* Add final period to API module descriptionsaddshore2014-03-101-1/+1
| | | | Change-Id: Icae68c1ab1fd0006e00a3a9a56ae8f831d3d0d45
* Update formatting on some API classes (must've forgotten these)Siebrand Mazeland2013-11-141-2/+2
| | | | Change-Id: I3fe42e75c3029dc76d2d1d40609c9a69aae8e987
* Fixed spacing in api folderumherirrender2013-04-201-1/+1
| | | | | | | Added spaces before if, foreach Added some braces for one line statements Change-Id: Id7779dca4d1185245cf5764102b8de8b232c34b6
* (bug 45937) API: Check amlang in meta=allmessagesBrad Jorsch2013-03-131-0/+8
| | | | | | | | Language::factory() throws an exception if given a syntactically invalid code. Check the code beforehand to generate a proper error message. Bug: 45937 Change-Id: I521e6f7ffc44becb302fde33c1df3879baa4045a
* Use ContextSource::getLanguage instead of $wgLangumherirrender2013-03-091-2/+1
| | | | | | Found two places, where $wgLang is used inside a ContextSource. Change-Id: I1881a20d3cd9b50eb4af0cd588451ed941f936fa
* API: Throw error when interwiki is given for various title paramumherirrender2013-03-011-1/+1
| | | | | | | | | | | | | 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
* 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
* Minor cleanupYuri Astrakhan2013-01-121-1/+1
| | | | | | Fixed spacing, eol chars, "string" --> 'string' Change-Id: I630247c6c5b469efb67ec9de32e8533ae88e59fb
* 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
* Added result properties to action=paraminfoPetr Onderka2012-06-061-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Corrected capitalization in the file and class names of API modulesPetr Onderka2012-04-161-0/+277
Change-Id: I8f317e458ee0f8706434e43a7890cda530595e64