This code was partially copied into MassMessage and will hopefully
enable more places that accept arbitrary wikitext to check lint errors.
It also hides the internal details of checking with the Linter
extension's configuration in one place until it can be refactored into
something more acceptable (T360809).
Bug: T368690
Change-Id: Iaeb3ccbd61a2a8cb0d8b3dc8b06a3a10bc8fa653
Adds an experimental configuration to allow extensions to define
OutputPipelineStages to include in the DefaultOutputPipeline.
There are a lot of open questions about this api, like ordering of
execution, but adding it @experimental will help surface the
requirements.
Bug: T370541
Needed-By: I6dc92af0611c680b6e55605a7c9ff8a3fc1dfa26
Change-Id: I64baea40a1687c7a06fbcda9efe9f9a159b0ae8d
Since I72c5e6f86b7f081ab5ce7a56f5365d2f75067a78 it is part of the
contract of ContentRenderer::getParserOutput() that the render ID (and
other cache parameters) will be set when it returns.
(ContentHandler::getParserOutput() can set them even earlier if it has
custom content-based overrides.) We had a lot of temporary
backward-compatibility code "later" in the parse process to try to close
the barn door if some code path "forgot" to set them, but these are
unnecessary now.
This patch removes that backward-compatibility code in ParsoidParser;
there is similar remaining code in ParserCache etc. which can be
addressed in follow ups.
(For compatibility we do have to temporarily copy the render ID code
inside ParsoidOutputAccess::parseUncachable, but that class is
deprecated and will be removed.)
The HtmlOutputRendererHelper path which used to call
ParsoidParser::parseFakeRevision() is now replaced with a codepath that
goes through RevisionRenderer. In order to maintain the same behavior
of the ParsoidHandler, we have also added 'useParsoid' handling to the
JsonContentHandler. This support can perhaps be deprecated eventually.
Bug: T350538
Change-Id: I0853624cf785f72fd956c6c2336f979f4402a68f
This removes the last use of ParsoidOutputAccess in core, allowing it
to be deprecated and eventually removed.
Bug: T367074
Bug: T317018
Change-Id: Ica2c880e2e7c2b126aaea66a3e4be460b3f2234f
* Its not very clean to import Wikimedia\Stats in parsoid
* Mediawiki depends on parsoid
* As a workaround we can extract the 2 methods we need in SiteConfig
Bug: T354908
Change-Id: I696131cfba6ccc26ae1f705f216e221a7c3db175
And deprecated aliases for the the no namespaced classes.
ReplicatedBagOStuff that already is deprecated isn't moved.
Bug: T353458
Change-Id: Ie01962517e5b53e59b9721e9996d4f1ea95abb51
Replace UserCache with UserIdentityLookup
UserIdentityLookup is implemented by ActorStore and
there is already a cache
Change-Id: I8a59e77391da45d2726aab3d5432f08ad0c9a84f
Follow up to c33b31728d
The skin is showing up on Special:Preferences as a selectable
skin. Choosing this would make the site unreadable without applying
?useskin=vector-2022 on the URL.
The last parameter makes it an internal skin and therefore
not shown on preferences page.
Bug: T364696
Change-Id: I3f95b68692fe8ae9d05d2f3187986774ef91ba6d
This allows rendering of the data passed to the skin rendering
layer, to allow developers to debug the information used to render
a skin.
Bug: T364696
Change-Id: I32aaa6a85d24df4f4689269f6a455823bb08196b
* In queryLinks(), use the full result cache even if a limit is
specified. Truncate the result in the caller if necessary.
* Remove the confusing boolean parameter from partitionResult(). Make it
always false and fix up the results afterwards. So the batches are
always the inclusive start and end IDs, false is never returned.
* Inject a logger instead of using wfDebug()
* Use private not protected. Defaulting to protected was just a coding
style quirk I had at the time.
* In queryLinks(), use early return.
* In hooks BacklinkCacheGetConditionsHook and BacklinkCacheGetPrefixHook
adjust the parameter type hint to avoid the need for a Phan override.
Change-Id: Ia53f494633affe48316f0a8b63d03596239ad53c
Changes to the use statements done automatically via script
Addition of missing use statement done manually
Change-Id: Ic4d4dd61de5ab896fb6173eb579c81f164a1e4a3
Modifies incrStatsByContent in order to migrate cache_misses, cache_hits to Prometheus backend
Bug: T359465
Change-Id: I78afac7437bc2849b64f43c23477d702b94e907b
Refactoring:
* Break out the database access part of UserOptionsManager to a separate
class hierarchy implementing interface UserOptionsStore. It's
basically a key/key/string-value store, very simple. The complex
parts of user options storage remain in UserOptionsManager.
* Bundle the UserOptionsManager caches into a per-user cache object. I
was adding a couple more and it was getting tedious.
Start integrating GlobalPreferences with UserOptionsManager:
* Have an array of stores. There's always a local store, and extensions
can add stores via an attribute.
* Add $global parameter to UserOptionsManager::setOption(), allowing
this method to update or override global options.
* Rename loadOptionsFromDb to loadOptionsFromStore.
* Move the local override feature from GlobalPreferences to core.
Bug: T323076
Change-Id: Ib3623b723557c819bc0ffdf21a4ffcb070eb298b
I469de6f85e405e8ddbe7abaa5b99b77cb9cf415d added an initial RedirectStore
implementation, but it has remained a stub despite the corresponding
task being closed. So, flesh out the implementation by moving the
corresponding logic from WikiPage.
Soft-deprecate WikiPage::insertRedirectEntry() accordingly.
Bug: T290639
Change-Id: Ia500df45bc969ce77b6b2a06bfec10e32c00b931
Rather than have DefaultOutputPipelineFactory::CONSTRUCTOR_OPTIONS be a
union of all the options needed by all the stages, allow each stage to
define its own CONSTRUCTOR_OPTIONS and pass a Config object to the
DefaultOutputPipelineFactory service.
In the process, move the $options and $logger properties into the
abstract superclass, since they are passed to every stage.
Bug: T363764
Followup-To: I64aeb81b395ba84e1d839dfbd31decf16c337cd0
Change-Id: I7d386b22c7d8e99b6dfe4cf798069914ac9af373
One more step in gradually replacing uses of ParsoidOutputAccess with
ParserOutputAccess. This is mostly just inlining the code from
ParsoidOutputAccess (which already uses ParserOutputAccess internally)
and then removing dead code.
Change-Id: I87d6568d9dc71bc11f406ea3c31ce86e01667e05
With the ObjectCacheFactory refactor in T358346, this service is
pretty much used in 2 places, (1) service wiring which can be replaced
and (2) in MediaWikiIntegrationTestCase.
The service can be removed entirely and the local cluster cache gotten
from the ObjectCacheFactory service injected via service wiring. Hence,
usage of this internal service can be removed.
NOTE: See followup: 7475063 for the TODO to drop this service entirely.
Change-Id: I173f04456df6cc1782cec2f16d6653c6b0826dce
Why:
* When wgAutoCreateTempUser['enabled'] is true, calling ActorStore
::acquireActorId for an IP address user will throw a
CannotCreateActorException to prevent attributing actions to IP
addresses.
* When using Special:Undelete to undelete a page that has IP
addresses who have made edits, the UndeletePage call to the
ActorStore::acquireActorId causes an exception.
* However, the revisions already existed so (similar to importing
revisions) it does not represent a leak of the IP address.
* As such, it should be possible to undelete a page with revisions
performed by IP addresses.
What:
* Add ActorStore::getActorStoreForUndelete which works the same
as ActorStore::getActorStoreForImport. Having methods that
are named for undelete / import avoids the usage for other
code that should use ::getActorStore instead.
* Add RevisionStoreFactory::getRevisionStoreForUndelete which
uses the ActorStore returned by ActorStore
::getActorStoreForUndelete.
* Update the PageCommandFactory to take the RevisionStoreFactory
and then call ::getRevisionStore for all but UndeletePage where
the ::getRevisionStoreForUndelete method is called.
Bug: T362019
Bug: T365669
Change-Id: Ia7c583c625843f4f400e1c4aa7ea360519e63c87
Setting this URL parameter will replace the default skin with a
"micro-skin" that omits most of the usual interface elements,
making the page suitable to be displayed in a small popup window.
Its design (such as it is) is mostly based on Vector 2022.
In the future, we might allow normal skins to serve this mode too,
if they advise that they support it by setting a skin option.
For now that is out of scope.
The login/signup process is otherwise completely normal. To make use
of it, launch the login page in a popup, and set &returnto=... to
redirect back to your own success page, which should communicate the
successful login to your app and then close itself.
The display=popup / display=page vocabulary is borrowed from the
OpenID Connect spec.
Bug: T362706
Change-Id: Ic7cbbe98344b25d2e965750e0c4429ce157163ed
One step in gradually replacing uses of ParsoidOutputAccess with
ParserOutputAccess. This is mostly just inlining the code from
ParsoidOutputAccess (which already uses ParserOutputAccess internally)
and then removing dead code.
Change-Id: I9807149c30f4bfe06fd7ad12f96c13816c22aa9c
The `supportsContentModel` method is really querying Parsoid for the
set of content models it supports, so it makes sense to put it in the
Parsoid-specific SiteConfig service.
This is part of the work to deprecate and remove ParsoidOutputAccess.
Change-Id: I81eb2df8cef93ede95361a4e03185b3d58e5b84b
This adds MediaWiki\Watchlist namespace to the classes of watchlist
directory and adds deprecation notice since 1.43 to the just created
unnamespaced aliases of the classes.
Bug: T353458
Change-Id: I4234f8fe62bb3bde6f5271c7ba31a2420b0f4b90
This patch completes the rest of the ObjectCache refactor and
migrates methods to the appropriate class while deprecating them
in `ObjectCache.php`.
It also moves the `_LocalClusterCache` internal service logic
into ObjectCacheFactory and calls that instead making sure that
wiring code stays wiring code and let the class do the heavy lifting.
`::makeLocalServerCache()` is retained as a static method in the
ObjectCacheFactory class because it's called early in Setup.php
before the services container is available (so it needs to be stand-
alone).
To add, we also converts all global variables that were used in the
`ObjectCache.php` class into the config schema approach and retrieves
them using ServiceOptions injected in service wiring.
NOTE: MediaWikiIntegrationTestCase::setMainCache() was slightly
rewritten to take care of service reset which throws away the cache
object preserved by setInstanceForTesting() after service reset.
Instead, we preserve the object via MainConfigNames::ObjectCaches
setting with a factory closure which returns the correct cache object.
As a nice side effect of the above, the setInstanceForTesting() method
was removed entirely.
As a follow-up to this patch, I would like to remove the internal
_LocalClusterCache service in a stand-alone patch.
Bug: T363770
Change-Id: Ia2b689243980dbac37ee3bcfcbdf0683f9e1779b
This patch introduces a namespace declaration for the
MediaWiki\FileBackend to FileBackendGroup and establishes a class
alias marked as deprecated since version 1.43.
Bug: T353458
Change-Id: Id33b6bfa56131978900199786b0082481c6c54a5
This patch introduces a namespace declaration for the
MediaWiki\Watchlist to WatchedItemStore and establishes a class
alias marked as deprecated since version 1.43.
Bug: T353458
Change-Id: I820a3512440ba5a1de13e8470ccf5845918f3198