| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Change-Id: I34ffcb70efbfa257da8dab6e0790aa0d697caf5b
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Found by phan strict checks
Change-Id: I83187b5fd25b015d2c75e22d4b5202803653d743
|
|
|
|
|
| |
Bug: T259960
Change-Id: Ib7058c8c55ce65802b501a5a7b7458c14ba27cfe
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
Also modified new APIs added to ApiErrorFormatter to
use PageReference instead of Title.
Change-Id: I093c89f8e1e6d383603f887358be6ece70f23a02
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Change-Id: I07fcc9529991adc634c10e5ed8498ac138a1c2b7
|
|
|
|
| |
Change-Id: Iad3375b141b1d87c890baec6ecd16ed92f93e699
|
|
|
|
| |
Change-Id: I90cfe8366c0245c9c67e598d17800684897a4e27
|
|
|
|
| |
Change-Id: I11f8801ef47ec1a1f63d840116e69667e6f3ae3c
|
|
|
|
|
|
|
| |
Brought to you by vim macros.
Bug: T200246
Change-Id: I79e919f4553e3bd3eb714073fed7a43051b4fb2a
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 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
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use
$lang->equals( $wgContLang )
instead of
$lang->getCode() === $wgContLang->getCode()
Change-Id: Id7ed6a21ce5e2ea2887ec98c7bd9d3eba83d733b
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
Bug: T102614
Change-Id: I0d759be6ef568c2c6f28606d3002484ad77a1830
|
|
|
|
|
|
|
|
|
| |
* Normalize the message name returned by allmessages
* Separate message key normalization into
MessageCache::normalizeKey()
Bug: T63894
Change-Id: I1d89fc73fea705243d390bab91255a635d8f9eee
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
ApiBase declares it protected, but for some reason I had made it public
in all subclasses.
Change-Id: I8a50d4f47e66c7f09137968d3941dc5cdc1d28e4
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
No internal changes to Special:Allmessage etc made
Change-Id: I21a164af0b6ec123bf654cd1e4e7085b1192f067
|
|
|
|
|
|
| |
Only done where globals are config (so not $wgParser, $wgContLang etc)
Change-Id: Ic39cdd858cfb9096a2bc09618f97e64270d76f13
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Change-Id: Icae68c1ab1fd0006e00a3a9a56ae8f831d3d0d45
|
|
|
|
| |
Change-Id: I3fe42e75c3029dc76d2d1d40609c9a69aae8e987
|
|
|
|
|
|
|
| |
Added spaces before if, foreach
Added some braces for one line statements
Change-Id: Id7779dca4d1185245cf5764102b8de8b232c34b6
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Found two places, where $wgLang is used inside a ContextSource.
Change-Id: I1881a20d3cd9b50eb4af0cd588451ed941f936fa
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
Added/removed spaces after opening/before closing parentheses
Added a space after a comma
Removed unneeded parentheses in condition
Change-Id: I306091347ccaaf11dee0cdfda3019cb0c12be51b
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Fixed spacing, eol chars, "string" --> 'string'
Change-Id: I630247c6c5b469efb67ec9de32e8533ae88e59fb
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 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
|
|
Change-Id: I8f317e458ee0f8706434e43a7890cda530595e64
|