mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-15 10:15:24 +00:00
2026e3ac3a
This service should act as a mediator between the AF code and the permission manager, and it should know what are the permissions required by each action. Change-Id: Ieb177d9992147b11fa7b8f05929da6c182cc2286
33 lines
1.1 KiB
PHP
33 lines
1.1 KiB
PHP
<?php
|
|
|
|
use MediaWiki\Config\ServiceOptions;
|
|
use MediaWiki\Extension\AbuseFilter\AbuseFilterPermissionManager as PermManager;
|
|
use MediaWiki\Extension\AbuseFilter\FilterProfiler;
|
|
use MediaWiki\Extension\AbuseFilter\Hooks\AbuseFilterHookRunner;
|
|
use MediaWiki\Extension\AbuseFilter\KeywordsManager;
|
|
use MediaWiki\Logger\LoggerFactory;
|
|
use MediaWiki\MediaWikiServices;
|
|
|
|
return [
|
|
KeywordsManager::SERVICE_NAME => function ( MediaWikiServices $services ): KeywordsManager {
|
|
return new KeywordsManager(
|
|
new AbuseFilterHookRunner( $services->getHookContainer() )
|
|
);
|
|
},
|
|
FilterProfiler::SERVICE_NAME => function ( MediaWikiServices $services ): FilterProfiler {
|
|
return new FilterProfiler(
|
|
$services->getMainObjectStash(),
|
|
new ServiceOptions(
|
|
FilterProfiler::CONSTRUCTOR_OPTIONS,
|
|
$services->getMainConfig()
|
|
),
|
|
WikiMap::getCurrentWikiDbDomain()->getId(),
|
|
$services->getStatsdDataFactory(),
|
|
LoggerFactory::getInstance( 'AbuseFilter' )
|
|
);
|
|
},
|
|
PermManager::SERVICE_NAME => function ( MediaWikiServices $services ): PermManager {
|
|
return new PermManager( $services->getPermissionManager() );
|
|
},
|
|
];
|