2019-03-14 14:39:10 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use MediaWiki\Extension\OATHAuth\OATHAuth;
|
2019-10-11 17:58:52 +00:00
|
|
|
use MediaWiki\Extension\OATHAuth\OATHUserRepository;
|
2020-01-14 08:27:29 +00:00
|
|
|
use MediaWiki\MediaWikiServices;
|
2019-03-14 14:39:10 +00:00
|
|
|
|
|
|
|
return [
|
2021-05-12 03:37:42 +00:00
|
|
|
'OATHAuth' => static function ( MediaWikiServices $services ) {
|
2019-03-14 14:39:10 +00:00
|
|
|
return new OATHAuth(
|
|
|
|
$services->getMainConfig(),
|
|
|
|
$services->getDBLoadBalancerFactory()
|
|
|
|
);
|
|
|
|
},
|
2021-05-12 03:37:42 +00:00
|
|
|
'OATHUserRepository' => static function ( MediaWikiServices $services ) {
|
2019-03-14 14:39:10 +00:00
|
|
|
global $wgOATHAuthDatabase;
|
|
|
|
$auth = $services->getService( 'OATHAuth' );
|
|
|
|
return new OATHUserRepository(
|
|
|
|
$services->getDBLoadBalancerFactory()->getMainLB( $wgOATHAuthDatabase ),
|
|
|
|
new \HashBagOStuff( [
|
|
|
|
'maxKey' => 5
|
|
|
|
] ),
|
|
|
|
$auth
|
|
|
|
);
|
|
|
|
}
|
|
|
|
];
|