| Commit message (Collapse) | Author | Age | Files | Lines |
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Implicitly marking parameter $... as nullable is deprecated in php8.4,
the explicit nullable type must be used instead
Created with autofix from Ide15839e98a6229c22584d1c1c88c690982e1d7a
Break one long line in SpecialPage.php
Bug: T376276
Change-Id: I807257b2ba1ab2744ab74d9572c9c3d3ac2a968e
|
|/
|
|
|
| |
Bug: T360664
Change-Id: I3363a225e54bb2cae01ba066d432a8b7b21933d2
|
|
|
|
|
| |
Bug: T353458
Change-Id: If02cc9b1ff78e26c1cf8c91ee4695845eb133829
|
|
|
|
|
|
|
|
|
| |
A constant is not a variable. The type is hard-coded via the value
and can never change. While the extra @var probably doesn't hurt much,
it's redundant and error-prone and can't provide any additional
information.
Change-Id: Iee1f36a1905d9b9c6b26d0684b7848571f0c1733
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Why:
- When temporary users are enabled, creating IP actors is disallowed
apart from specific cases, such as importing revisions authored by
anonymous users.
- If such a revision includes a category link and
wgRCWatchCategoryMembership is true, MediaWiki will fire a job to
create a corresponding RC entry, which will attempt to attribute the RC
to the anonymous IP that authored the imported revision and fail in
doing so.
What:
- Track whether a category membership change job was triggered by an
import, and allow RecentChange objects created by such jobs to create
anonymous actors.
Test Plan:
1. On a wiki with temporary accounts enabled and wgRCWatchCategoryMembership = true,
import a revision via Special:Import that was authored by an anonymous user
and contains a category link.
2. Verify that the import succeeds and that the corresponding RC entry
shows up.
Bug: T373318
Change-Id: I89abdca9c4ab8796a211df8b37c1bd7173a496e5
|
|/
|
|
|
| |
Bug: T353458
Change-Id: I3b736346550953e3b2977c14dc3eb10edc07cf97
|
|
|
|
|
| |
Bug: T353458
Change-Id: I23cf7991f8792d4d000d1780463d8ce76dc0aee0
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make store() handle cache purging upon new ID insertion and fetching
of the winning ID when raced out. This avoids the reloadMap() call.
Remove connection flag hack in reloadMap() given 0cb0f0ba7.
Remove comments about retryStore() logic removed in 505bd8e70f.
Clean up return types for the ID:name arrays.
Change-Id: Ic57eb5e2b59da67c6511b935d9e68ffb595028fa
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Callers should not catch an unchecked exception, so it doesn't belong
in a function signature. Unchecked exceptions indicate a coding error,
which by definition the code will not be able to handle correctly.
If any of these exceptions were supposed to be in response to an edge
case, user input, or initial conditions, then they should be changed
to a runtime error. If the exception class cannot be changed, then
the annotation should include a comment explaining its purpose and
prognosis.
Bug: T240672
Change-Id: I2e640b9737cb68090a8e1cb70067d1b74037d647
|
|
|
|
|
|
|
|
|
|
| |
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: I1da4b272a6b28c419cc8e860d142dae19ca0bbcf
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
This also avoid false positive from phan
Change-Id: I4b182fda29e9cb9719c26fd01a609de2453be56d
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
What it's trying to achieve can be done much simpler by just making an
out of transaction connection via setting CONN_TRX_AUTOCOMMIT flag.
Removing this allows us to get rid of a large portion of transaction
management in rdbms library as this is the only place that uses cancel
callbacks.
Split out of I3cb1e30611b83c0
Bug: T372169
Change-Id: Idad029b6da6b09e084d466d282ef1145ebd8fe73
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Instead of making the caller responsible for knowing what we do
internally at each step, rebrand WRITE_ALLOW_SEGMENTS as generally
"do stuff for segments", not only creating them, but also deleting
them.
* Easier to find and verify correct usage.
* Easier to understand parity between set() and delete().
* Documentation for deleteMulti() already said this, by mistake.
* Reduce amount of required knowledge.
There is only 1 usage in Codesearch Everywhere (in PageEditStash here
in core), with no known usage anywhere else. Hypothetically, if it
were used, this commit keeps compat by aliasing WRITE_PRUNE_SEGMENTS
to WRITE_ALLOW_SEGMENTS.
Change-Id: Iea10b23f06243814c35ccd02a4a878cdc1195c76
|
| |
| |
| |
| |
| | |
Bug: T353458
Change-Id: Id3202c0c4f4a2043bf97b7caee081acab684155c
|
|/
|
|
|
| |
Bug: T353458
Change-Id: Ia0f3e22078550be410c4b87faf6aa4eabe6e270d
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
And deprecated aliases for the the no namespaced classes.
ReplicatedBagOStuff that already is deprecated isn't moved.
Bug: T353458
Change-Id: Ie01962517e5b53e59b9721e9996d4f1ea95abb51
|
|/
|
|
|
|
|
|
|
|
| |
Internally it still uses WikiPage. While this change shouldn't have any
effect in theory, this is not guaranteed because WikiPage is not
stateless and if different parts of the code use different instances we
may see unexpected errors. Hence, this patch is limited to the bare
minimum so that it's easier to revert if necessary.
Change-Id: I2c18a62ccc04720a2ef25298515850e91fb288e9
|
|
|
|
|
|
|
| |
Modifies incrStatsByContent in order to migrate cache_misses, cache_hits to Prometheus backend
Bug: T359465
Change-Id: I78afac7437bc2849b64f43c23477d702b94e907b
|
|
|
|
|
|
| |
Use narrow interface if no writes are done
Change-Id: I55148c8b6fda8830a29a235c63fc118f636ab3e6
|
|
|
|
|
|
|
|
|
| |
This patch introduces a namespace declaration for the
MediaWiki\Deferred to RefreshSecondaryDataUpdate and establishes a class
alias marked as deprecated since version 1.43.
Bug: T353458
Change-Id: I9ee3282918f8f3d444a12ca32434a15e93952055
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It was asked in a patch review to apply fully import
InvalidArgumentException where possible. I was guessing some
of my other already merged patches have but turned out such
thing exists other places style so for the sake of consistency
I've turned rest of inline import of the specific exception at
top of the file.
There are instances of source files that aren't in any namespace but
have fully qualified import which this patch doesn't touch.
Change-Id: I4071fc698b65746d9594cf4d5f45bae82843d436
|
|
|
|
|
|
|
|
|
| |
This patch introduces a namespace declaration for the
MediaWiki\Json to FormatJson and establishes a class
alias marked as deprecated since version 1.43.
Bug: T353458
Change-Id: I5e1311e4eb7a878a7db319b725ae262f40671c32
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Some of these have been marked in-code as deprecated for a long while,
but haven't ever been announced in the RELEASE-NOTES (and later,
HISTORY) file, so let's mark them up now so we can get the ball rolling
at least.
Per Gergo, the AuthManager one was 'born deprecated' and should only
have been used by humans also reading the deprecation notice given in
the code, and indeed no uses are known to code search, so also emit
deprecation warnings there immediately; others will have to wait until
uses have been migrated.
Change-Id: I0c1c71d8f4293623039302da35d58d2a24367e97
|
|\ \
| |/
|/| |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Introduce "es:" which has ?flags= as url parameter and store that
instead.
Bug: T362566
Change-Id: I9d8409fdbd757ef061aa38ff6248cf614f6ef2de
|
| |
| |
| |
| |
| | |
Bug: T326274
Change-Id: I90493d7cd4c21fdc022bcc19765fc04d986a9c8f
|
|/
|
|
|
|
|
|
|
|
|
|
| |
Remove check for false from IDatabase::select as this is not possible
A DBQueryError is thrown (documented since efda8cd3 / I056b7148)
Use IResultWrapper::numRows to check for empty IResultWrapper
This ignores includes\libs\rdbms as QUERY_SILENCE_ERRORS is an internal
option to get false from this function
Change-Id: I4b2fc26ca0e68612f6beadc01e68097a74962c84
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Also remove the fallback index and options as it was agreed upon in the
ticket as its needlessly complicates the function and is only used in
SqlBlobStore which can have its own copy of the function
Bug: T354194
Change-Id: I38b179c9bfeb7d2c3e92fa4845dce19558f45a0f
|
|/
|
|
|
|
|
|
|
|
|
|
| |
This is inconsistent with the access pattern of other constants in
MediaWiki. it's also confusing (e.g. it's unclear to a newcomer why
UserFactory is implementing IDBAccessObject) and it's prone to clashes
(e.g. BagOStuff class has a clashing constant).
It has been already announced: https://w.wiki/9DAX
Bug: T354194
Change-Id: Ic2357634b8385d65b55db2b557191419b06c40e0
|
|
|
|
|
|
|
|
|
|
| |
Found via (?<!IDBAccessObject)::READ_
We are planning to deprecate and remove implementing IDBAccessObject
interface just to use the constants.
Bug: T354194
Change-Id: I89d442fa493b8e5332ce118e5bf13f13b8dd3477
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Instead of calling self::READ_* on these constants, just directly call
it.
Since these classes are public and might be relied on directly in other
places, we can't remove the "implements IDBAccessObject" yet but we will
start doing that soon.
Bug: T354194
Change-Id: I3e26b9fc7f93efdfc55a1790a7cdfa5c0d562303
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Follows-up I8518e0488 (9c02258a04).
Instead of documenting how to compute the number to manually verify
it, use the expression directly. This should make it significantly
easier to understand, verify, and modify.
Noteworthy:
* Language.php, I kept 31_556_952 as-is because the
calculation would otherwise involve a float. It also has the benefit
of allowing the long durations to build upon that as a given number.
* SqlBlobStore.php, remove this irrelevant default value as it is
unreachable. The only call to new SqlBlobStore is BlobStoreFactory,
which always calls setCacheExpiry. For back-compat and to keep
tests as-is, move to re-used constant between class and config.
Change-Id: I86b034883bd7efdf93b8365b43178af826f1c703
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Allows to trigger RefreshSecondaryDataUpdate jobs with a timestamp to
ensure a link update was done after that timestamp.
Since e5655255 it is possible that RefreshSecondaryDataUpdate gets
queued for api action=purge, but RefreshSecondaryDataUpdate only checks
that the links update is done after the last edit, so when jobs get
queued by action=purge, the jobs does nothing.
Ensure that page_links_updated gets updated via action=purge when the
timestamp is before the new freshness timestamp (checked in
RefreshLinksJob::isAlreadyRefreshed).
Bug: T351729
Change-Id: I85aed4c40d430ba6c30c763141f4b821c36e6eaf
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This makes the code easier to read to avoid jumps and improves
encapsulation by not allowing the rest of the class having access to the
logic. Of course, if needed then some code can be refactored out again
but for now let's not do YAGNI.
Change-Id: Ic37524e386fc04fd67e33768417ff8425f85b0ca
|
|/
|
|
|
|
|
| |
Most used non-namespaced class!
Bug: T353458
Change-Id: I4c2cbb0a808b3881a4d6ca489eee5d8c8ebf26cf
|
|
|
|
|
|
|
|
|
|
| |
For readability. Allowed since PHP 7.4.
I searched for integer literals of 6 or more digits, and also changed
some nearby smaller numbers for consistency.
Bug: T353205
Change-Id: I8518e04889ba8fd52e0f9476a74f8e3e1454b678
|
|
|
|
|
|
| |
There are no remaining callers with Wikipage
Change-Id: I33bcda004399348cab47a12673ca757668ab7d18
|
|
|
|
|
| |
Bug: T166010
Change-Id: Ibd40734b96fd2900e3ce12239d09becfb4150059
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Updated ParserOutput to set Parsoid render ids that REST API
functionality expects in ParserOutput objects.
* CacheThresholdTime functionality no longer exists since it was
implemented in ParsoidOutputAccess and ParserOutputAccess doesn't
support it. This is tracked in T346765.
* Enforce the constraint that uncacheable parses are only for fake or
mutable revisions. Updated tests that violated this constraint to
use 'getParseOutput' instead of calling the parse method directly.
* Had to make some changes in ParsoidParser around use of preferredVariant
passed to Parsoid. I also left some TODO comments for future fixes.
T267067 is also relevant here.
PARSOID-SPECIFIC OPTIONS:
* logLinterData: linter data is always logged by default -- removed
support to disable it. Linter extension handles stale lints properly
and it is better to let it handle it rather than add special cases
to the API.
* offsetType: Moved this support to ParsoidHandler as a post-processing
of byte-offset output. This eliminates the need to support this
Parsoid-specific options in the ContentHandler hierarchies.
* body_only / wrapSections: Handled this in HtmlOutputRendererHelper
as a post-processing of regular output by removing sections and
returning the body content only. This does result in some useless
section-wrapping work with Parsoid, but the simplification is probably
worth it. If in the future, we support Parsoid-specific options in
the ContentHandler hierarchy, we could re-introduce this. But, in any
case, this "fragment" flavor options is likely to get moved out of
core into the VisualEditor extension code.
DEPLOYMENT:
* This patch changes the cache key by setting the useParsoid option
in ParserOptions. The parent patch handles this to ensure we don't
encounter a cold cache on deploy.
TESTS:
* Updated tests and mocks to reflect new reality.
* Do we need any new tests?
Bug: T332931
Change-Id: Ic9b7cc0fcf365e772b7d080d76a065e3fd585f80
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, we never scheduled HTMLCacheUpdate jobs on file page edits
or creations, but it is necessary when the page's redirect target has
changed, or it's created as a redirect.
(We now do it unnecessarily when a redirect page is edited without
changing the target, but that's more difficult to detect at this
point.)
Bug: T238426
Change-Id: I6775a4fb7239d49de88e22e45082ab474cfaaa8b
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, we scheduled recursive RefreshLinks jobs on every file
page edit, but it's only necessary when the page's redirect target has
changed. Optimize this, and only schedule them when the page is or was
a redirect.
(We still do it unnecessarily when a redirect page is edited without
changing the target, but that's more difficult to detect at this
point.)
Bug: T346383
Change-Id: Ie629881c94a7a81ae7bf597aab4587921d1c25ae
|
|
|
|
|
|
|
| |
In only this code path, $this->pageState['oldRevision'] was left unset.
Other code expects it to be null, but not unset.
Change-Id: I15023834ffbac307924aee4028f3b7fe75fbabeb
|