This is the first step to split parts of Database that doesn't require a
connection and are used for query parts.
Bug: T299691
Change-Id: I140aa4328865994499926f898233867ce383908c
It calls the Shell class, which uses MediaWikiServices. Why was this not
causing test failures on CI?
Change-Id: Id953c1425659ede158034988dd652b59a0e9811b
I would like to argue that it's useful to know if an error message is
returned, and if it's the correct one.
Bug: T306568
Change-Id: I865fa4c8a5b2d2d88d26c190352c852e63913a56
Also add a method for setting changes that should be reapplied after
loading the setting files, and set $wgShowHostnames in TestSetup, since
it seems like it may be useful when running all kind of tests.
Bug: T90875
Change-Id: I0d54c9a23f6cebf91bbb5a3a5f03b3d650e386e9
Since no mysql-specific queries are required, allow sqlite and
Postgres setups to use "multiPrimaryMode" for easier testing.
Avoid "CASE types text and integer cannot be matched" Postgres
error by making dbEncodeSerialValue() cast the result to a string
so that addQuotes() applies in buildUpsertSetForOverwrite().
Bug: T212129
Change-Id: Ic84a804c272a7070779c8d41d3a33003852d0839
When restoring a talk page via undeletion of the associated
page, the recorded reason should specified that it was restored
via that method
Follow-Up: I7b30863060974d4079639
Bug: T305523
Change-Id: I18ec58e6df00b038542868ce5de6c23fd700d749
All revision related classes are namespaced MediaWiki\Revision
instead of MediaWiki\Storage since 1.32. The old namespaced
class names are deprecated and only kept for backwards-compatibility.
Bug: T305784
Change-Id: I34e492d84d9fc4bc78481667202716d93b3c43cb
Rename canRecoverFromDisconnect() in order to better describe
its function. Make it use the transaction ID and query walltime
as arguments and return an ERR_* class constant instead of a bool.
Avoid retries of slow queries that yield lost connection errors.
Track session state errors caused by the loss of named locks or
temp tables (e.g. during connection loss). Such errors will prevent
further queries except for rollback() and flushSession(), which must
be issued to resolve the error.
Add flushPrimarySessions() methods to LBFactory/LoadBalancer
and use it in places where session state loss is meant to be
safely aknowledged.
Change-Id: I60532f86e629c83b357d4832d1963eca17752944
We really don't need this complexity and it prevents us from improving
connection management.
MaintainableDatabase should stay but the connection ref shouldn't.
Bug: T255493
Change-Id: I867301dc7fa07cac298f8faba9cf82ca4617f50e
Add services and utilities for automatic creation of temporary user
accounts on page save, in order to avoid exposing the user's IP
address.
* Add $wgAutoCreateTempUser, for configuring the system
* Add TempUserConfig service, which interprets the config.
* Add TempUserCreator service, which creates users during page save as
requested by EditPage. With proxy methods to TempUserConfig for
convenience.
* Add table user_autocreate_serial. Table creation is necessary before
the feature is enabled but is not necessary before deployment of this
commit.
Bug: T300263
Change-Id: Ib14a352490fc42039106523118e8d021844e3dfb
(int) removes the leading zero from '0720-01-05',
just check it as string.
Add test for the Y2K38 check
Bug: T287621
Change-Id: I83400066ee4ab58c1c27ca1041c495dc0e16531f
These three endpoints have been experimental for many months:
revision/{id}
revision/{id}/html
revision/{id}/with_html
Promote them to officially released. This completes the
basic "revision" endpoint support, and helps clear out
the coreDevelopmentRoutes.json file for unrelated
experiments.
This also modifies the existing revision/{id}/bare endpoint
response, which previously pointed callers to the experimental
endpoint for html. It now points callers to the official one.
Bug: T305506
Change-Id: Iee8d1723e98dd3e3e389a0514dde28799914b2fd
Parser is using the service container to get a SignatureValidator
because, as noted in Gerrit comments on the relevant commit, there is a
circular dependency Parser -> SignatureValidatorFactory -> Parser.
So, have SignatureValidatorFactory::__construct() take a closure which
returns a Parser, instead of an actual Parser or ParserFactory.
Change-Id: I7bf4660f84ec8c8fb1d5b3b8581fe5d82bc3156e
This allows the API to consistently return the new value for old rows.
Bug: T241709
Follow-Up: I36f49dc83718cc78f17fc340e6445030b8fd0c66
Change-Id: Ida69980f62a6ef070ba41b7e826967f424881716
MWGrants is deprecated and should be replaced with the GrantsInfo and
the GrantsLocalization services.
Bug: T253077
Change-Id: I3cbf568b6de654acb6b06b4ab5d9d97a09f78ece
To do so, we move the relevant parts to a separate include file that's
included both by Setup and the test.
The --color-moved option is highly recommended when reviewing this patch
to verify correctness.
More tests to come.
Bug: T305093
Change-Id: I931b92357ec48db4665891c8546f86264885e881
The new class, UrlUtils, is usable standalone or as a service. Using it
as a service will just automatically load a few settings from site
configuration.
In addition to just making our code cleaner, this will enable making
some of Setup.php's dynamic configuration more sane.
Test coverage is all lines except invalid URLs -- I couldn't find any.
Bug: T305093
Change-Id: I706ef8a50aafb518e13222719575d274c3583b90
- In Info action and its API counter part
- In LinkBatch::constructSet
- In Title::getLinksFrom
Bug: T304780
Change-Id: I449f041986acdd16feecac818e3579987b4b11be
BundleSizeTest is mainly used by skins to test the size of the modules
of the skin. Using default skin may cause unexpected results.
Bug: T305779
Change-Id: Id77c6124c9b1fd20633cda47bbca89f9b6724a63
The wfDeprecated is called directly from __get/__set/__isset which needs
only a 2, not 3. That means the message is one caller of.
Change-Id: Ia29fb0a07841f69a4d8b95431f0915df9793c340
This can be done when relevant communities have been notified
and the classes have rolled out of cached HTML.
Bug: T270796
Change-Id: If35ebe88702bf97f2306c77b26d8b3cab4c0420d
Displaying each row requires the revision ID from the next row, to
create the 'undo' and 'prev' links. (These links specifically refer to
the next displayed row, according to the current filters, and not just
the previous revision, like the byte diff numbers.)
Previously this class would override normal row formatting to display
the previous row instead when the normal pager would display the
current row, and then handled the last row specially. This code dates
back to 2006: 20949b0961. It was complicated, and got more complicated
when grouping by dates was introduced (ed63ede657), when it caused the
last row to be displayed in a separate list.
Thanks to the addition of batch processing in f7f84dddb3, we don't
need to do that any more: the necessary information about revisions is
pre-computed and we can just look up the ID for next row while
displaying the previous one.
Bug: T303210
Change-Id: I838b0bd4c04faf4f83b21282deb757207ab1732a
These two interfaces' methods have tentative return types in PHP 8.1,
which causes code without the type hints to raise warnings. Where the
type hint is "mixed", we need to use the special declaration
[\ReturnTypeWillChange] in a comment to suppress the warning as long as
we still support PHP < 8.0, which doesn't have a "mixed" type hint.
Bug: T289879
Change-Id: I1a126e602e92b8d13c7795eb6d790effd5ddc986