| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Bug: T353458
Change-Id: I2ae4577de79832b082adca282ff73cfabc8f9392
|
|
|
|
|
| |
Bug: T353458
Change-Id: Ibe1810f1c71316a9124e1dc6ae405097dafd5267
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Inject all services into the following API classes
* ApiQueryAllDeletedRevisions
* ApiQueryAllRevisions
* ApiQueryDeletedRevisions
* ApiQueryDeletedrevs
* ApiQueryLogEvents
* ApiQueryRecentChanges
* ApiQueryRevisions
* ApiQuerySiteinfo
* ApiQueryUserContribs
The classes are not extended by extensions.
Change-Id: Iaf3de739f43108976982f5255806e8a1a521dacd
|
|
|
|
|
|
|
| |
Also for all sub-classes
Remove simple doc-blocks without further information
Change-Id: I981934efe32d44f52e5ab865a9b887be5bd0f41e
|
|
|
|
|
| |
Bug: T360664
Change-Id: I3363a225e54bb2cae01ba066d432a8b7b21933d2
|
|
|
|
|
| |
Bug: T353458
Change-Id: I3ea6b08c5018ba03ba45c5766e1f46e12f6b8597
|
|
|
|
|
|
|
|
|
|
| |
Add doc-typehints to class properties found by the PropertyDocumentation
sniff to improve the documentation.
Once the sniff is enabled it avoids that new code is missing type
declarations. This is focused on documentation and does not change code.
Change-Id: I8b33b5f4d91c1935228e7010327dbc6ce138fc00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Define "RecentChanges" doc group and add all classes in changes/
and rcfeed/ to the group, as well as a few obvious classes
that we (currently) maintain in vertical buckets: maintenance,
api, specials.
* Doc group "Change tagging" was invalid because a group identifier
must be a single word, and this was thus passing an unexpected
second argument to the `ingroup` Doxygen command.
As such, it was missing on
https://doc.wikimedia.org/mediawiki-core/master/php/
Define "ChangeTags" properly and fix/add classes in this component.
* Add missing `ingroup` to class blocks (and remove from any file blocks)
as otherwise the file is indexed twice (e.g. in Doxygen) which makes
navigation on doc.wikimedia.org rather messy.
Remove duplicate descriptions from file blocks in favour of class
doc blocks. This reduces needless duplication and was often
incorrect or outdated, and helps make file headers more consistently
(visually) ignorable.
Ref https://gerrit.wikimedia.org/r/q/message:ingroup+is:merged
* Minor improvements to class descriptions here and there.
Test plan:
* `php maintenance/mwdocgen.php --file includes/changes,includes/changetags,includes/rcfeed`
(This will emits harmless warnings about undefined "Hooks" group,
because it's referenced but not included in this fast subset.)
* open docs/html/index.html
Bug: T364652
Change-Id: Ifac20da51f7e809f1a9ccbfac3bf50e739a083ea
|
|
|
|
| |
Change-Id: I453ce3148a46fcb9cc5c685cee92274e0cb4f98a
|
|
|
|
|
|
|
|
|
|
|
|
| |
Edits from temporary accounts are considered anonymous edits.
ApiQueryRecentChanges doesn't correctly reflect this and needs to be
updated to correctly return temporary account edits as anonymous (and
similarly, not to return them when requesting !anon)
- Update the anon|!anon query to accomodate temporary accounts
Bug: T370803
Change-Id: Ica5225422ea53d2aa3a84b86d9c2f14832a34ed4
|
|
|
|
|
| |
Bug: T361023
Change-Id: Ibf1c93ddbf8f680e8fb9442816f6fed94a069c0a
|
|
|
|
|
|
| |
I noticed these while reviewing other changes to the code.
Change-Id: If548eb937ba36c94d652ec2f881ce668ea1df21d
|
|
|
|
|
|
| |
Use expression builder instead
Change-Id: Iba330955dc97eb69aeaf2d45c7c3130f9c1e723d
|
|
|
|
| |
Change-Id: I7859191740d66d00595c4bdeea12b227ac25bcc5
|
|
|
|
|
|
|
|
| |
Most (all?) of the remaining usages are caught somewhere and will be
migrated later.
Bug: T328220
Change-Id: I5c36693a5361dd75b4f1e7a0bab5ad48626ed75c
|
|
|
|
|
|
|
|
|
|
|
|
| |
Temporary accounts are now distinct from users or anonymous.
Add a flag to reflect that to:
- ApiQueryImageInfo
- ApiQueryLogEvents
- ApiQueryRecentChanges
- ApiQueryRevisionsBase
Bug: T351636
Change-Id: I7986dea5ccd0dc942bf133040c4ac715487f29b9
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Why:
* Before this task, when an API parameter specifies allowed user
types, temporary users and permanent users are in the same
category: 'name'.
* However, it is useful to separate them out, and sometimes
allow a permanent user but not a temporary user (e.g.
ApiResetPassword, since temporary users don't have passwords).
* We therefore re-defined the 'name' type only to refer to
permanent (named) users, and add a new 'temp' type.
* This fixes params that currently intend to allow temp users,
and that use 'name' to do so, by adding 'temp'.
What:
* Based on a search for `UserDef::PARAM_ALLOWED_USER_TYPES`,
add the 'temp' type where necessary.
* The following were not updated, because they shouldn't apply
to temporary users:
- owners for includes/api/ApiQueryWatchlist.php,
includes/api/ApiQueryWatchlistRaw.php
- users for includes/api/ApiResetPassword.php,
includes/api/ApiUserrights.php,
includes/api/ApiValidatePassword.php
Bug: T350701
Change-Id: If5ccf1d469327791acff74d013343307e411cca9
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Mostly used find-and-replace:
Find:
/\*[\*\s]+@var (I?[A-Z](\w+)(?:Interface)?)[\s\*]+/\s*(private|protected|public) (\$[a-z]\w+;\n)((?=\s*/\*[\*\s]+@var (I?[A-Z](\w+)(?:Interface)?))\n|)
Replace with:
\3 \1 \4
Followed by some manual review to make sure I'm not changing too much,
omitting some changes that looked too complicated and anything that
caused test failures, and some whitespace fixes.
Change-Id: Ie78be1c614985d7c2964156e454cc9266515dc18
|
|
|
|
|
|
|
|
|
| |
Easier to translate
There is no visible change for example on
Special:ApiHelp/query+watchlist
Bug: T285545
Change-Id: I536fa3e07a951f3ff98870678ffdbc294a3c7bc0
|
|
|
|
|
|
| |
Reduce raw sql fragments on simple compares
Change-Id: I3f2340dfdbf5197cc22546911e6c5653dc5a6269
|
|
|
|
|
|
| |
Syntax supported since 26235c73
Change-Id: I397c76d4aba753a1629383559b95df86514f19ff
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
so that extensions (i.e. CheckUser) can implement their own comment
store without having a lot of code duplication
basically the comment store version of I3a6486532f2ef36
Bug: T233004
Change-Id: Ib40f99e00a514d41776ce521baf113e46d37e9cd
|
|
|
|
|
| |
Bug: T324906
Change-Id: I1fcb7bd9d84754793c07ac9e39e50c38b364e4c1
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
The sql contains the namespace twice, which is not useful:
WHERE rc_namespace = ? AND (rc_namespace = ?) AND rc_title = '?' )
Change-Id: Ia0d50ad70dc4962b888b8baac8fc11be2ba537bb
|
|/
|
|
|
| |
Bug: T321265
Change-Id: Ib46bc3e643938f56e0c58a3c5f5e093327e00964
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
30+ API modules had nearly identical code to split and validate
the value of the 'continue' parameter.
Introduce the ApiBase::parseContinueParamOrDie() method and use it to
replace most usages of ApiBase::dieContinueUsageIf(). A few remain in
modules with more complex continuation handling.
Inline most single-use variables that remained after validation was
moved into the new method.
Change-Id: I66bd59ecd4ad16e2039e90f7d66cfa276e6c1c2a
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
See ec79aa394312d62b598ad29601e2c80eaaf0dd19 about the new method.
These changes all follow the same simple patterns. More complex cases
are handled in I6231b6beae13474d4986929367a9adc6bb76b0db.
This commit was created by running the following terrible Ruby script
I devised: https://phabricator.wikimedia.org/P34833, then manually
reviewing the results: checking that the output makes sense in general,
that the affected variables are not used elsewhere in the file, and
that no comparison conditions have been lost. A few incorrect changes
were undone or corrected.
Change-Id: I8ed363bd6b80a9481d44434a526f078cce20220f
|
|
|
|
| |
Change-Id: I1f20597093448d00435158a9ac861873000bb057
|
|\ |
|
| |
| |
| |
| |
| |
| | |
It is only useful to use local titles for various api parameters
Change-Id: Ife2a951e6b48b59e2b77d455c8343f79f1163b0a
|
| |
| |
| |
| | |
Change-Id: I498a315b8b4b56d5e2f939e797adbe0487cd7d07
|
|/
|
|
| |
Change-Id: I34ffcb70efbfa257da8dab6e0790aa0d697caf5b
|
|
|
|
|
|
|
| |
This covers all occurrences of /onfig->.*get( '/ in includes/.
Undoubtedly there are still plenty more to go.
Change-Id: I33196c4153437778496f40436bcde399638ac361
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These special pages and their counter-part APIs are:
- Special:RecentChanges
- Special:Watchlist
- Special:Log
- Special:Contributions
This also changes the way MAX_EXECUTION_TIME works from taking the value
as milliseconds, it takes seconds which is more intuitive for users.
Bug: T297708
Depends-On: I126e7181422d8da1a63afc3717faa4f72a687dd9
Change-Id: I3ff78751c3df3b6342f1865d35c2075f4415185d
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
CommentParser:
* Move comment formatting backend from Linker to a CommentParser service.
Allow link existence and file existence to be batched.
* Rename $local to $samePage since I think that is clearer.
* Rename $title to $selfLinkTarget since it was unclear what the title
was used for.
* Rename the "autocomment" concept to "section link" in public
interfaces, although the old term remains in CSS classes.
* Keep unsafe HTML pass-through in separate "unsafe" methods, for easier
static analysis and code review.
CommentFormatter:
* Add CommentFormatter and RowCommentFormatter services as a usable
frontend for comment batches, and to replace the Linker static methods.
* Provide fluent and parametric interfaces.
Linker:
* Remove Linker::makeCommentLink() without deprecation -- nothing calls
it and it is obviously an internal helper.
* Soft-deprecate Linker methods formatComment(), formatLinksInComment(),
commentBlock() and revComment().
Caller migration:
* CommentFormatter single: Linker, RollbackAction, ApiComparePages,
ApiParse
* CommentFormatter parametric batch: ImageHistoryPseudoPager
* CommentFormatter fluent batch: ApiQueryFilearchive
* RowCommentFormatter sequential: History feed, BlocklistPager,
ProtectedPagesPager, ApiQueryProtectedTitles
* RowCommentFormatter with index: ChangesFeed, ChangesList,
ApiQueryDeletedrevs, ApiQueryLogEvents, ApiQueryRecentChanges
* RevisionCommentBatch: HistoryPager, ContribsPager
Bug: T285917
Change-Id: Ia3fd50a4a13138ba5003d884962da24746d562d0
|
|
|
|
|
|
|
|
|
|
|
| |
Removes deprecated API endpoints and modules for dealing with
CSRF tokens.
Note: i18n messages are removed in a followup for ease of revert.
Bug: T280806
Depends-On: Ic83f44587db119ff2e3e6d5ff33a10894e0695e7
Change-Id: I58aedec6942ac5d3c21574cb0072f00ef365098c
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
This reverts commit 0d75fdb4f73ddbf4ad5f29e14258d58e507d55b4.
Bug: T287542
Change-Id: Iedd3461869f973f8d621a39e6ad4674cbb577551
|
|/
|
|
|
|
| |
Avoid implicit User::__toString
Change-Id: Ia2d13c7127834b9bc2d59e31c8b231edd66f5e93
|
|
|
|
| |
Change-Id: I079d2c802d9b48d6abf7f37fa9ef7dafac631345
|
|
|
|
|
| |
Bug: T259960
Change-Id: Ifab55daae08ee49e07bef93656cb7eb474f46cae
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
Bug: T278917
Change-Id: I4d6c175c637a2cb26c63e0b2b27d5ea8ce6b1e0d
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- ApiQueryBlocks
- ApiQueryDeletedrevs
- ApiQueryFilearchive
- ApiQueryLogEvents
- ApiQueryProtectedTitles
- ApiQueryRecentChanges
- ApiQueryUserContribs
- ApiQueryWatchlist
Bug: T259960
Change-Id: Ib7ee815fcea3e72523124eb6a2eaf20ad9565cfe
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replaces calls directly to PermissionManager with calls to
the Authority object available from Context or the
GroupPermissionLookup service.
This patch does not address use of PermissionManager for
blocks.
Deprecations:
- ApiBase::checkUserRightsAny deprecated passing optional
User parameter
- ApiBase::checkTitleUserPermissions deprecated passing
LinkTarget as first parameter, takes PageIdentity instead
Bug: T271462
Bug: T271854
Change-Id: I5d7cac1c28a37e074750c46cda03283980a07fca
|
|
|
|
| |
Change-Id: I78338d48530f098fa5d36fe84cfd45c0d160f444
|
|
|
|
| |
Change-Id: I2bc140576efc891bb9b6e50e44041d5bb022ac8f
|
|
|
|
|
| |
Bug: T243708
Change-Id: I2f82af8c3413038fa321434759dc9e9a921e3118
|