Convert Preferences class into PreferencesFactory service
authorSam Wilson <sam@samwilson.id.au>
Tue, 7 Nov 2017 03:10:14 +0000 (11:10 +0800)
committerSam Wilson <sam@samwilson.id.au>
Wed, 3 Jan 2018 01:48:25 +0000 (09:48 +0800)
commit2e248f0bb20cbdf7738a6d44a843eb546c3bbf23
tree446b4b7745b3ba87f169ec6ec04f33fdd98f2851
parent80f7ac1ccfdf71801024eb904ce8e5166c4b1042
Convert Preferences class into PreferencesFactory service

This deprecates the Preferences class and replaces it with
a PreferencesFactory service. Basically, all code from Preferences
is moved into DefaultPreferencesFactory. All Prefereces methods
are now either shims calling DefaultPreferencesFactory or just
throw exceptions.

Bug: T178449
Change-Id: Id0b2db0c2de0890f6e1609a9a0dca207c4600f99
12 files changed:
autoload.php
includes/MediaWikiServices.php
includes/Preferences.php
includes/ServiceWiring.php
includes/api/ApiOptions.php
includes/preferences/DefaultPreferencesFactory.php [new file with mode: 0644]
includes/preferences/PreferencesFactory.php [new file with mode: 0644]
includes/specials/SpecialPreferences.php
includes/user/User.php
tests/phpunit/includes/PreferencesTest.php
tests/phpunit/includes/preferences/DefaultPreferencesFactoryTest.php [new file with mode: 0644]
tests/phpunit/includes/specials/SpecialPreferencesTest.php