aboutsummaryrefslogtreecommitdiffstats
path: root/includes/api/ApiRsd.php
Commit message (Collapse)AuthorAgeFilesLines
* Add namespace to includes/api classesJames D. Forrester2024-09-251-0/+5
| | | | | Bug: T353458 Change-Id: I3ea6b08c5018ba03ba45c5766e1f46e12f6b8597
* Update name & email for bvibberBrooke Vibber2024-02-081-1/+1
| | | | | | | | | | | | | Updating name & email addresses for Brooke Vibber. Re-ran updateCredits.php as well so there are some new entries in there as well. There are a couple of files in resources/libs that will have to be changed upstream to keep tests happy, I will do patches later. :D Change-Id: I2f2e75d3fa42e8cf6de19a8fbb615bac28efcd54
* api: add missing help URLs that exist on mw.orgAaron Schulz2023-10-121-0/+4
| | | | | Bug: T342632 Change-Id: I06fe334942848a599e94edadc7e7a14094e4d4b5
* API: Replace deprecated calls to wfExpandUrl with UrlUtils::expandJames D. Forrester2023-06-221-2/+4
| | | | | Bug: T319340 Change-Id: Ic987f9381ac17e9e46504abdb2d07a5a94ba3b4a
* Reorg: Namespace the Title classJames D. Forrester2023-03-021-0/+2
| | | | | | | | | | | | | | | | | | | This is moderately messy. Process was principally: * xargs rg --files-with-matches '^use Title;' | grep 'php$' | \ xargs -P 1 -n 1 sed -i -z 's/use Title;/use MediaWiki\\Title\\Title;/1' * rg --files-without-match 'MediaWiki\\Title\\Title;' . | grep 'php$' | \ xargs rg --files-with-matches 'Title\b' | \ xargs -P 1 -n 1 sed -i -z 's/\nuse /\nuse MediaWiki\\Title\\Title;\nuse /1' * composer fix Then manual fix-ups for a few files that don't have any use statements. Bug: T166010 Follows-Up: Ia5d8cb759dc3bc9e9bbe217d0fb109e2f8c4101a Change-Id: If8fc9d0d95fc1a114021e282a706fc3e7da3524b
* Hooks::run() call site migrationTim Starling2020-05-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Migrate all callers of Hooks::run() to use the new HookContainer/HookRunner system. General principles: * Use DI if it is already used. We're not changing the way state is managed in this patch. * HookContainer is always injected, not HookRunner. HookContainer is a service, it's a more generic interface, it is the only thing that provides isRegistered() which is needed in some cases, and a HookRunner can be efficiently constructed from it (confirmed by benchmark). Because HookContainer is needed for object construction, it is also needed by all factories. * "Ask your friendly local base class". Big hierarchies like SpecialPage and ApiBase have getHookContainer() and getHookRunner() methods in the base class, and classes that extend that base class are not expected to know or care where the base class gets its HookContainer from. * ProtectedHookAccessorTrait provides protected getHookContainer() and getHookRunner() methods, getting them from the global service container. The point of this is to ease migration to DI by ensuring that call sites ask their local friendly base class rather than getting a HookRunner from the service container directly. * Private $this->hookRunner. In some smaller classes where accessor methods did not seem warranted, there is a private HookRunner property which is accessed directly. Very rarely (two cases), there is a protected property, for consistency with code that conventionally assumes protected=private, but in cases where the class might actually be overridden, a protected accessor is preferred over a protected property. * The last resort: Hooks::runner(). Mostly for static, file-scope and global code. In a few cases it was used for objects with broken construction schemes, out of horror or laziness. Constructors with new required arguments: * AuthManager * BadFileLookup * BlockManager * ClassicInterwikiLookup * ContentHandlerFactory * ContentSecurityPolicy * DefaultOptionsManager * DerivedPageDataUpdater * FullSearchResultWidget * HtmlCacheUpdater * LanguageFactory * LanguageNameUtils * LinkRenderer * LinkRendererFactory * LocalisationCache * MagicWordFactory * MessageCache * NamespaceInfo * PageEditStash * PageHandlerFactory * PageUpdater * ParserFactory * PermissionManager * RevisionStore * RevisionStoreFactory * SearchEngineConfig * SearchEngineFactory * SearchFormWidget * SearchNearMatcher * SessionBackend * SpecialPageFactory * UserNameUtils * UserOptionsManager * WatchedItemQueryService * WatchedItemStore Constructors with new optional arguments: * DefaultPreferencesFactory * Language * LinkHolderArray * MovePage * Parser * ParserCache * PasswordReset * Router setHookContainer() now required after construction: * AuthenticationProvider * ResourceLoaderModule * SearchEngine Change-Id: Id442b0dbe43aba84bd5cf801d86dedc768b082c7
* Fix new phan errors, part 1Daimona Eaytoy2019-10-111-1/+1
| | | | | | | First part, mostly doc-only. Bug: T231636 Change-Id: Id59f585740fa5bfb53c257287121f51a30de38fe
* Fix a couple of Generic.Files.OneObjectStructurePerFile.MultipleFound in apiReedy2019-04-131-16/+0
| | | | Change-Id: Ibb6b324b286f62153ce5d08a66454e0b05a0ef78
* Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenientBartosz Dziewoński2018-05-301-1/+1
| | | | | | | | | | | | | | Find: /isset\(\s*([^()]+?)\s*\)\s*\?\s*\1\s*:\s*/ Replace with: '\1 ?? ' (Everywhere except includes/PHPVersionCheck.php) (Then, manually fix some line length and indentation issues) Then manually reviewed the replacements for cases where confusing operator precedence would result in incorrect results (fixing those in I478db046a1cc162c6767003ce45c9b56270f3372). Change-Id: I33b421c8cb11cdd4ce896488c9ff5313f03a38cf
* A few doc comment fixupsTim Starling2017-12-041-2/+0
| | | | | | | | | | | | | | | | * Remove some creation dates, they are not protected by GPL * Remove duplicate @defgroup API * Remove @ingroup from some @file doc comments on class files. It is not useful to list class files alongside classes in the doxygen module menu. Add @ingroup to some more class files that had @ingroup on their file, that was probably the author's intent. * In PackedOverlayImageGallery, use the file comment as a class comment * Don't put @defgroup and @file in the same comment. @defgroup makes the whole doc comment describe the group. * Instead of putting AnsiTermColorer in two groups, use hierarchical groups. Change-Id: If54f6e0b2bc1ea6de42045885cf836ee67b8e961
* 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
* Update weblinks in comments from HTTP to HTTPSFomafix2016-11-071-1/+1
| | | | | | | | Use HTTPS instead of HTTP where the HTTP link is a redirect to the HTTPS link. Also update some defect links. Change-Id: Ic3a5eac910d098ed5c2a21e9f47c9b6ee06b2643
* Convert all array() syntax to []Kunal Mehta2016-02-171-18/+18
| | | | | | | | | | 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
* API: Overhaul ApiResult, make format=xml not throw, and add json formatversionBrad Jorsch2015-04-101-8/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Replace wfRunHooks calls with direct Hooks::run callsAaron Schulz2014-12-101-1/+1
| | | | | | * This avoids the overhead of an extra function call Change-Id: I8ee996f237fd111873ab51965bded3d91e61e4dd
* 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-14/+3
| | | | | | | | | 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
* 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
* Make API action=rsd work on private wikisDaniel Friesen2014-04-181-0/+4
| | | | | | | Tweak ApiRsd's settings so that it doesn't require read permissions to function. Bug: 64085 Change-Id: I15288458ec3b0b583eece930d323f80314bb6ee3
* Add final period to API module descriptionsaddshore2014-03-101-1/+1
| | | | Change-Id: Icae68c1ab1fd0006e00a3a9a56ae8f831d3d0d45
* The light at the end of the API code format updating tunnelSiebrand Mazeland2013-11-141-0/+2
| | | | Change-Id: I12fdb71bc87a8ad5ed5b9f1fe9c06bd0f7154e9a
* Fix case of some Title methodsAlexandre Emsenhuber2013-03-271-1/+1
| | | | Change-Id: I37ce7fe392f4941c500fa0a88007664501d7e338
* api: remove duplicate __contruct callsAntoine Musso2013-01-291-4/+0
| | | | | | | | 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
* (bug 35885) remove api version string and parameterYuri Astrakhan2013-01-181-8/+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
* Oh noes, moar http:// -> https://Sam Reed2011-11-281-2/+2
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/104445
* Removed the 'eclipse helper' bit on top of every API moduleJohn Du Hart2011-11-161-4/+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
* Make the PROTO_ parameter to wfExpandUrl() explicit in all calls. There are ↵Roan Kattouw2011-08-191-2/+2
| | | | | | | 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) Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/95010
* Based on diff to wikia, set more functions consistently public rather than ↵Sam Reed2011-08-171-1/+1
| | | | | | | protected Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/94827
* Some random URL protocol forcing for protocol-relative URLsRoan Kattouw2011-08-031-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/93820
* Followup r87261Sam Reed2011-05-071-2/+2
| | | | | | | Somewhat vague spec is somehwat vague Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/87631
* A few minor RSD changesSam Reed2011-05-021-3/+4
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/87261
* Styleli[zs]e the API up to date (Been a while since)Sam Reed2010-12-301-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/79266
* Follow up r75621: Use setContent and setIndexedTagName methodsBryan Tong Minh2010-11-061-19/+12
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/76195
* r75621 copy-paste failBryan Tong Minh2010-10-291-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/75669
* Followup r75554, functionise Export code, allows for return to be used "non ↵Sam Reed2010-10-291-1/+0
| | | | | | | | | scarily" Remove some extra blank comment lines Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/75641
* Minor followup to r75621, add whitespaceSam Reed2010-10-281-0/+5
| | | | | | | Add getVersion to ApiFormatXmlRsd Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/75632
* (bug 25648) API discovery information has been added as RSD link in page ↵Bryan Tong Minh2010-10-281-0/+183
<head> and by providing an API module action=rsd. Added hook ApiRsdServiceApis for extensions to add their own service to the services list. Patch by Brion Vibber and Bryan Tong Minh. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/75621