mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Thanks
synced 2024-11-23 22:44:42 +00:00
e483b844c9
I've moved all API classes into a separate folder, as I felt like grouping modules improves readability. APIs themselves had storage logic which I extracted and put in another folder. I was originally going with an interface to the storage to allow for other storage methods than log entries, but the code was too tightly coupled with it, so I've left that for another day. Added dependency injection for all services and used ServiceOptions for config vars. Bug: T337002 Change-Id: Ie8a1f435d635e1d0e1286f673bfe96cc4fdfe4fe
28 lines
680 B
PHP
28 lines
680 B
PHP
<?php
|
|
|
|
use MediaWiki\Config\ServiceOptions;
|
|
use MediaWiki\Extension\Thanks\Storage\LogStore;
|
|
use MediaWiki\Extension\Thanks\ThanksQueryHelper;
|
|
use MediaWiki\MediaWikiServices;
|
|
|
|
return [
|
|
'ThanksQueryHelper' => static function (
|
|
MediaWikiServices $services
|
|
): ThanksQueryHelper {
|
|
return new ThanksQueryHelper(
|
|
$services->getTitleFactory(),
|
|
$services->getDBLoadBalancer()
|
|
);
|
|
},
|
|
'LogStore' => static function ( MediaWikiServices $services ): LogStore {
|
|
return new LogStore(
|
|
$services->getDBLoadBalancerFactory(),
|
|
$services->getActorNormalization(),
|
|
new ServiceOptions(
|
|
LogStore::CONSTRUCTOR_OPTIONS,
|
|
$services->getMainConfig()
|
|
)
|
|
);
|
|
}
|
|
];
|