Add PasswordFactory to MediaWikiServices
authorKunal Mehta <legoktm@member.fsf.org>
Sun, 2 Oct 2016 07:41:55 +0000 (00:41 -0700)
committerReedy <reedy@wikimedia.org>
Thu, 2 Aug 2018 13:46:35 +0000 (14:46 +0100)
commitfb73286fba73c399e119ef50ff036255dd6a1096
treedf023a3d20b6e9e85c46300a537667ac2e4c44fd
parent94d673389d6a38a006d129ff5560c46f8251bd44
Add PasswordFactory to MediaWikiServices

Instead of having basically every caller do:
 $pf = new PasswordFactory();
 $pf->init( RequestContext::getMain()->getConfig() );
Just create a single PasswordFactory via MediaWikiServices and pass that
around. Things that want to use their own config can still pass settings
via the new constructor.

This will eventually let us remove the init() function, removing the
only hard dependency upon MediaWiki, to make it easier to librarize
(T89742).

Change-Id: I0fc7520dc023b11a7fa66083eff7b88ebfe49c7b
15 files changed:
RELEASE-NOTES-1.32
includes/MediaWikiServices.php
includes/ServiceWiring.php
includes/auth/AbstractPasswordPrimaryAuthenticationProvider.php
includes/password/PasswordFactory.php
includes/specials/SpecialBotPasswords.php
includes/user/BotPassword.php
maintenance/wrapOldPasswords.php
tests/phpunit/includes/MediaWikiServicesTest.php
tests/phpunit/includes/TestUser.php
tests/phpunit/includes/api/ApiLoginTest.php
tests/phpunit/includes/auth/TemporaryPasswordPrimaryAuthenticationProviderTest.php
tests/phpunit/includes/password/PasswordFactoryTest.php
tests/phpunit/includes/session/BotPasswordSessionProviderTest.php
tests/phpunit/includes/user/BotPasswordTest.php