Commit graph

65 commits

Author SHA1 Message Date
daniel
025f15a208 Factor InterwikiLookup out of Interwiki class.
This keeps the existing app logic for looking up interwiki information
intact in ClassicInterwikiLookup. The idea is to seamlessly switch to a new
implementation when it becomes available, while also allowing us to
switch back in case of problems.

Change-Id: I7d7424345d0ce3ce90ba284006ee9615e3d99baa
2016-05-18 11:57:32 +02:00
Kunal Mehta
449084ec4e Add LinkCache to MediaWikiServices
LinkCache::singleton() is now deprecated, and the destroySingleton() and
setSingleton() methods were removed. They were not used in extensions,
and the usage in core was updated to use MediaWikiServices.

Change-Id: I08bb4f7913b03f71331ff683d0197c948aad6790
2016-05-12 15:44:33 -07:00
Kunal Mehta
f1e8d27a91 Add TitleParser and TitleFormatter to MediaWikiServices
Depends-On: Ibfd0a7f98f50506cd8402f966682f320bf715c8a
Change-Id: I81d48616afd1ab2bde1a5f1d12f4aefb1c866d43
2016-05-11 10:18:40 -07:00
addshore
b85d9f3363 Make GenderCache use MediaWikiServices
Change-Id: Id20310f78d938bdfa4d29ae483bb1a33bacd2b51
2016-05-07 13:26:26 +01:00
addshore
8a71ee8ec3 Make WatchedItemStore use MediaWikiServices
(This is a re-submi8t of I5c8c1a65 after it got reverted by Iae7f7b7)

Change-Id: I193de7ef1566336040463b71735b09db941d8ce1
2016-05-06 08:47:29 +00:00
daniel
d7410db0fd Allow reset of global services (redux).
(This is part of I6ec374ac9 wich was a re-submit of Ie98bf5af5
which got reverted by Ide7ab563)

This change provides a mechanism to reset global service instances
in an orderly manner. There are three use cases for this:

* the installation process
* integration tests (which most of the existing phpunit tests are)

In contrast to I6ec374ac9, this change does not cause singeltons
of legacy services to be reset. It is assumed that legacy services
use global state to access services and configuration, so any
change in confuguration would affect them immediately.

NOTE: the original I6ec374ac9 would cause session information to
get lost if the user session was creatsed before initialization
was complete. This was apparently triggered by the MobileFrontend
extension under some circumstances. Check with Addshore and Catrope.

Change-Id: Ie06782ffb96e675c0aa55dc26fb8f22037e8517d
2016-05-04 19:18:29 +02:00
addshore
fe87b6575a Add getSkinFactory to MediaWikiServices
Change-Id: Ife79aca542e0e85405976de7be7acebfa3359569
2016-04-27 11:18:56 +01:00
Stanislav Malyshev
34b02d87ac Convert SearchEngine to service containers
Change-Id: Icef1ecbed3d831557e0256fdfa53743b194007cc
2016-04-25 16:25:17 -07:00
Stanislav Malyshev
4f95365877 Convert EventRelayerGroup to services infrastructure
Change-Id: If55ddf441de69189c7fcdd3440f899c6b14f690f
2016-04-25 14:22:31 -07:00
addshore
029ee57a8a Add getStatsdDataFactory to MediawikiServices
Change-Id: Iaf89d5d7887f766064266874ea7ba73362531ed2
2016-04-19 13:11:38 +01:00
Catrope
1162ed5f88 Revert "Allow reset of global services."
Completely breaks login.

This reverts commit 8e7a0a0912.

Change-Id: Ide7ab5632e987e81374c21173df6ab3998649df7
2016-04-11 13:40:28 -07:00
Catrope
deb22bced7 Revert "Make WatchedItemStore use MediaWikiServices"
In order to cleanly revert "Allow reset of global services"
which breaks login.

This reverts commit 99e8d45b50.

Change-Id: Iae7f7b7b7083345dd50c313ee68e2e814f130f1a
2016-04-11 20:25:47 +00:00
addshore
99e8d45b50 Make WatchedItemStore use MediaWikiServices
Change-Id: I5c8c1a652a35e055d8d65753a60c0d1684e1c37d
2016-04-11 15:50:15 +01:00
daniel
8e7a0a0912 Allow reset of global services.
This change provides a mechanism to reset global service instances
in an orderly manner. There are three use cases for this:

* the installation process
* forking processes
* integration tests (which must of the existing phpunit tests are)

Depends-On: I5d638ad415fc3840186a0beaa09ac02ea688539b
Change-Id: Ie98bf5af59208f186dba59a9e971c72ea0b63e69
2016-04-11 16:22:40 +02:00
daniel
eb46307b00 Introduce top level service locator.
The service locator, MediaWikiServices, is intended to facilitate
"manual" dependency injection in static entry points.

See also the Dependency Injection RFC T384 and Service Locator
RFC T124792 for details.
The following key points were implemented according the
discussion surrounding these RFCs:

* a configurable DI container that allows extensions to add and replace services.
* no auto-wiring, since it's prone to add confusion in large and complex applications.
* no 3rd party framework, since they typically do too much.

The following services in MediaWiki core are made accessible via the service locator
mechanism to showcase the bootstrapping mechanism:

* ConfigFactory and MainConfig
* SiteLookup and SiteStore

However, the implementation of these services was not yet converted to using proper DI
throughout the code.

Bug: T124792
Change-Id: I3c25c0ac17300d3dd13e1cf5100558a605eee15f
2016-04-02 18:07:28 +03:00