Right now, Extension:TimedMediaHandler hardcodes checks for
ForeignDBViaLBRepo, which makes it inoperable for wikis making use of
ForeignDBRepo or an extension-provided foreign repo that exposes direct
access to the remote MW database. Introducing a new interface in core
will allow TimedMediaHandler to check for this interface instead of
specific implementations of foreign db repos.
I wasn't quite sure what methods to populate the interface with, since
all current implementations extend from LocalRepo, and most things that
interact with it largely expect (close to) the full API surface that
LocalRepo provides. Rather than duplicating all of those methods in the
interface, I opted for providing two methods that any custom
implementations would be required to override should they extend from
LocalRepo as a base class. I'm open to other approaches here, however.
Bug: T63986
Change-Id: I76b43e77f44e90eef5f3d2ac05ef203ed3085bd2
== Background ==
In 2012, commit afe46f1403 (Id7e9b59c7e) added libs/GenericArrayObject
along with an (unused) abstract GenericArrayObjectTest case.
The same code was also added to the Wikibase extension with
change 6347b35a55cd (Ifa7f1dc702).
The code was then factored out from Wikibase into the wmde/Diff
library.
In 2013, GenericArrayObject was removed from wmde/Diff in the commit
at https://github.com/wmde/Diff/commit/d9c2bd5c140e2a783fd42298db6c.
== This change ==
Remove the GenericArrayObject indirection from SiteList as there exist
nothing outside SiteList refering to it in Codesearch Everywhere, and
even in SiteList much of the code in GenericArrayObject is overridden,
unused, or otherwise needlessly indirect.
Change-Id: Ifea09c5de50af1616058d8baa9037db273dfb0e5
* Is generally useful for Rdbms consumers.
* Has no dependencies besides stable constants and interface from Rdbms.
* Is generic, i.e. not specific to MediaWiki in its naming, purpose,
or required domain knowledge.
Current rationale is that "dao" is not a recognised component
in MediaWiki core. Its super tiny and a handful of changes in over a
decade, so seems overkill to make a big deal out of it by creating a
whole new component for it in all the usual places. Yet, having it
fall into a gap with no owner for issue tracking, code review, no
documentation, and no definition of what this directory is for
exactly, is also counter-productive. Hence, finding a suitable place
for it.
Change-Id: I8cbb9ebfa8873085a30cb355e3299493538006ae
This is necessary so that EmailUser can behave as a command. EmailUser
now takes the performer as a constructor parameter; this, in combination
with the statelessness of the service, allows it to be reused for
multiple sends. Some BC code was also moved to the factory.
Bug: T265541
Change-Id: I2568359f00f429ef3ab3bfbfb803dc8e51cd8add
Add a legend at the top of the inline diff display, showing the
meanings of the colours of the inserted and deleted highlighting.
Also add the same text as tooltips on the highlighted elements.
The legend is added as part of a new area above the diff table
that can be modified via a new TextSlotDiffRendererTablePrefix
hook, so that extensions can add other buttons etc. there as
required.
This is a follow-up to the previous attempt, which added the
legend in DifferenceEngine::showDiff() and was called from
too many places. This patch moves it to be called in
DifferenceEngine::showDiffPage().
Bug: T324759
Change-Id: I2a3c67bcfa47313dee597e602a62073e4e298cd2
Follow-up: I6de30bf79eb5ac262285951792782b870d075e00
This patch doesn't deal with the injection of dependencies
and removal of the global state, but rather moves the code
from DeferredUpdates to the new service essentially as-is,
to simplify review. The changes to inject the various
services needed and make DeferredUpdatesManager a proper
service will be done in follow-ups, to make them easier
to follow.
While almost everything is changed from static to non-static,
DeferredUpdates::$scopeStack remains static as
DeferredUpdatesManager::$scopeStack, just in case multiple
versions of the service are created, to ensure that no
updates are missed.
Bug: T265749
Change-Id: I7f07eddf2fc399b15db4fe9be4c792ef8eb0747b
This is the more native way of doing things, which avoids syncing
different states between the toggle and the hidden widget.
The DOM structure is also better and don't confuse screen readers.
Bug: T333496
Bug: T334705
Bug: T336107
Change-Id: I47de69459b96f172153065094eb4113584bb435a
Introduce two new classes, containing code split off from EditPage:
* IntroMessageBuilder (edit notices and other intro messages)
* PreloadedContentBuilder (initial text of new pages / sections)
I'm doing both of these features in one change, because they share a
lot of code. They are meant to be used by alternative editors to
support all of the features of the MediaWiki edit form. This isn't
everything you need yet (we should at least do this for the edit
checkboxes too), but it's a step.
Bug: T201613
Change-Id: If0b05710cb52a977bf4e85947d72d68683a0a29e
Better DI, cleaner code, etc.
Way more needs to be moved but let's avoid exploding the patch.
Bug: T245964
Change-Id: I63b0f60187250fabf4d17c80a794877f07d2b1a2
To implement source maps, we want FileModule::getScript() to return
an array with path information, but that would break subclasses of
FileModule which concatenate to the return value of parent::getScript().
So allow scripts to be generated by a callback, eliminating the need for
concatenation in subclasses.
* Factor out most of the loop body of expandPackageFiles() into
expandFileInfo(). Add 'name' to the return value. Ensure 'filePath'
is always a FilePath object since we need that to safely return it
to ResourceLoader later. Document the return value.
* Make sure the base path is always set in FilePath objects returned by
expandFileInfo().
* Factor out the loop body of the final stage of file info expansion
into readFileInfo(). Retain filePath, do not unset it.
* Assert that $fileInfo['content'] is definitely set.
* Convert array_map() in getDefinitionSummary() to a loop.
* Migrate LanguageDataModule.
Bug: T47514
Change-Id: I97d61b5793159cea365740e0563f7b733e0f16de
The db/ directory does not have an owner and it's a mess in general.
These classes don't depend on anything in core except the rdbms library.
Let's simply move it there. In other words, Krinkle made me do it.
Since the class was moved in I6202e52ba73 merged less than a week ago,
no need to alias anything.
Bug: T321882
Change-Id: I24ceeb8bf765a50f441270136acd612359d50aa2
An interesting portion of rdbms is building SQL and then trying to
reverse engineer what tf the given SQL is doing, whether it's a write
query or not, whether it's writing to temp tables, etc.
Let's just pass around the actual data instead.
Bug: T326181
Change-Id: I4d7c72c08c98b884de51b46abf6460229055dcc9
They are not suitable to go to rdbms library as they depend on mediawiki
pieces, the second best place is the db/ directory.
Bug: T321882
Change-Id: I6202e52ba7306d74261206c2ba7930c5f1a0a18e
Add a legend at the top of the inline diff display, showing the
meanings of the colours of the inserted and deleted highlighting.
Also add the same text as tooltips on the highlighted elements.
The legend is added as part of a new area above the diff table
that can be modified via a new DifferenceEngineBeforeDiffTable
hook, so that extensions can add other buttons etc. there as
required.
Bug: T324759
Change-Id: I6de30bf79eb5ac262285951792782b870d075e00
It's going to be a bit small and narrow but it's better than sitting in
the root of includes/ plus I hope we can hollow out SiteStatsUpdate
class into the third one and or move this under a better directory in
the future.
Bug: T321882
Change-Id: Ia503b53b31ca00600f8c18b61a2652c3e146494e
The class and all functions are deprecated:
- Http::request()
- Http::get()
- Http::post()
- Http::userAgent()
- Http::isValidURI()
- Http::getProxy()
- Http::createMultiClient()
Bug: T305813
Change-Id: Icd8af4822b16b4bf4558b756e20171c3ae9a9fa1