Don't pass Config to service constructors
authorAryeh Gregor <ayg@aryeh.name>
Wed, 10 Apr 2019 15:03:54 +0000 (18:03 +0300)
committerAryeh Gregor <ayg@aryeh.name>
Thu, 2 May 2019 08:33:56 +0000 (11:33 +0300)
commit18ec46863331f6674f9f943c236025827772fba2
tree752a1ca262ce44a4f65c4069c0fe4cfe5c548083
parent60599dea41b36a4045853ab75ae998cab58d75a4
Don't pass Config to service constructors

We don't want to depend on the entire site configuration when we only
need a few specific settings.

This change additionally means that these services no longer see a live
version of the settings, but rather a copy. This means in tests you
really do have to call overrideMwServices() if you want services to pick
up your config changes.

ResourceLoader and SearchEngineConfig will need more work to port,
because they expose their member Config in a getter, and the getter is
actually used.

Parser and NamespaceInfo are also relatively complicated, so I split
them into separate patches.

Tested with 100% code coverage. \o/

Depends-On: If6534b18f6657ec1aba7327463f2661037f995b3
Change-Id: I1a3f358e8659b49de4502dc8216ecb6f35f4e02a
15 files changed:
RELEASE-NOTES-1.34
autoload.php
includes/ConfiguredReadOnlyMode.php
includes/ServiceWiring.php
includes/Storage/BlobStoreFactory.php
includes/config/ServiceOptions.php [new file with mode: 0644]
includes/db/MWLBFactory.php
includes/preferences/DefaultPreferencesFactory.php
includes/specialpage/ChangesListSpecialPage.php
includes/specialpage/SpecialPageFactory.php
includes/specials/SpecialWatchlist.php
tests/phpunit/includes/ReadOnlyModeTest.php
tests/phpunit/includes/api/ApiParseTest.php
tests/phpunit/includes/config/ServiceOptionsTest.php [new file with mode: 0644]
tests/phpunit/includes/preferences/DefaultPreferencesFactoryTest.php