2020-01-15 16:08:53 +00:00
|
|
|
<?php
|
|
|
|
|
2020-09-20 22:31:41 +00:00
|
|
|
use MediaWiki\Config\ServiceOptions;
|
2020-09-18 14:49:13 +00:00
|
|
|
use MediaWiki\Extension\AbuseFilter\AbuseFilterPermissionManager as PermManager;
|
2020-10-13 16:01:18 +00:00
|
|
|
use MediaWiki\Extension\AbuseFilter\ChangeTagger;
|
2020-09-20 22:31:41 +00:00
|
|
|
use MediaWiki\Extension\AbuseFilter\FilterProfiler;
|
2020-01-15 16:08:53 +00:00
|
|
|
use MediaWiki\Extension\AbuseFilter\Hooks\AbuseFilterHookRunner;
|
|
|
|
use MediaWiki\Extension\AbuseFilter\KeywordsManager;
|
2020-09-20 22:31:41 +00:00
|
|
|
use MediaWiki\Logger\LoggerFactory;
|
2020-01-15 16:08:53 +00:00
|
|
|
use MediaWiki\MediaWikiServices;
|
|
|
|
|
|
|
|
return [
|
|
|
|
KeywordsManager::SERVICE_NAME => function ( MediaWikiServices $services ): KeywordsManager {
|
|
|
|
return new KeywordsManager(
|
|
|
|
new AbuseFilterHookRunner( $services->getHookContainer() )
|
|
|
|
);
|
|
|
|
},
|
2020-09-20 22:31:41 +00:00
|
|
|
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' )
|
|
|
|
);
|
|
|
|
},
|
2020-09-18 14:49:13 +00:00
|
|
|
PermManager::SERVICE_NAME => function ( MediaWikiServices $services ): PermManager {
|
|
|
|
return new PermManager( $services->getPermissionManager() );
|
|
|
|
},
|
2020-10-13 16:01:18 +00:00
|
|
|
ChangeTagger::SERVICE_NAME => function ( MediaWikiServices $services ) : ChangeTagger {
|
|
|
|
return new ChangeTagger();
|
|
|
|
},
|
2020-01-15 16:08:53 +00:00
|
|
|
];
|