Commit graph

6 commits

Author SHA1 Message Date
Max Semenik
48a323f702 tests: Add explicit return type void to setUp() and tearDown()
Bug: T192167
Depends-On: I581e54278ac5da3f4e399e33f2c7ad468bae6b43
Change-Id: I3a21fb55db76bac51afdd399cf40ed0760e4f343
2019-10-30 14:31:22 -07:00
Aryeh Gregor
e787246ce8 LanguageFactory to replace Language::factory()
Languages with variants no longer can override the parent's constructor
(which is now used for injecting services). Instead, they need to
override Language::newConverter().

Bug: T201405
Change-Id: I923400d61763cf1db88cb0c3f684c9c10e58032d
2019-10-23 10:48:23 -07:00
mainframe98
eb8823743c Use ObjectFactory to create API modules
This will allow constructing API modules that need services.

This overhauls some of the internals of the ApiModuleManager,
but the public interface remains unchanged.
The $class parameter of addModule, (now called $spec)
also allows passing an array with the spec of the module.
Note that this spec requires the attribute 'class' to be present,
even when 'factory' is specified. This is the same as before,
where $class was always required.

In a perfect DI world ObjectFactory would be injected into
ApiMain::__construct and ApiMain would pass that to its instance
of ApiModuleManager, but that is currently not possible, so for now
it is injected in ApiModuleManager by having ApiMain::__construct
call the service locator.

Bug: T222388
Change-Id: Iee04afc27283547dd68d6db93f44ac2e0ebf1258
2019-09-09 18:50:16 +00:00
Lucas Werkmeister
49c4a68a22 Fix and re-enable ApiQueryLanguageinfoTest
Anomie discovered (T225244#5250241) that we need to clear the language
cache here; with that, the test should work again, so re-enable it.

Bug: T225244
Change-Id: I67e8446a4ff64d12ab3a3a52a432a728d4139a69
2019-06-12 17:36:40 +02:00
Timo Tijhof
2e0e0919fd api: Temporarily disable ApiQueryLanguageinfoTest
Bug: T225244
Change-Id: I0f778f1b4f8bd53bd8d52540afbe6927a14b583a
2019-06-10 16:13:19 +01:00
Lucas Werkmeister
67b3cdc004 Add action=query&meta=languageinfo API module
This API module can be used to get information about all the languages
supported by this MediaWiki installation. Since parts of this
information, such as the fallback chain, are expensive to retrieve if
the localization cache is not populated, we apply continuation if the
request is taking too long (suggested by Anomie in T217239#4994301); we
don’t expect this to happen in Wikimedia production, though.

Bug: T74153
Bug: T220415
Change-Id: Ic66991cd85ed4439a47bfb1412dbe24c23bd9819
2019-06-03 12:46:03 +02:00