2020-01-15 16:08:53 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace MediaWiki\Extension\AbuseFilter;
|
|
|
|
|
2020-11-26 15:23:22 +00:00
|
|
|
use MediaWiki\Extension\AbuseFilter\ChangeTags\ChangeTagger;
|
|
|
|
use MediaWiki\Extension\AbuseFilter\ChangeTags\ChangeTagsManager;
|
|
|
|
use MediaWiki\Extension\AbuseFilter\ChangeTags\ChangeTagValidator;
|
2020-12-18 14:05:33 +00:00
|
|
|
use MediaWiki\Extension\AbuseFilter\Consequences\ConsequencesExecutorFactory;
|
|
|
|
use MediaWiki\Extension\AbuseFilter\Consequences\ConsequencesFactory;
|
|
|
|
use MediaWiki\Extension\AbuseFilter\Consequences\ConsequencesLookup;
|
|
|
|
use MediaWiki\Extension\AbuseFilter\Consequences\ConsequencesRegistry;
|
2021-02-01 15:47:46 +00:00
|
|
|
use MediaWiki\Extension\AbuseFilter\EditBox\EditBoxBuilderFactory;
|
2019-12-16 16:19:48 +00:00
|
|
|
use MediaWiki\Extension\AbuseFilter\Parser\ParserFactory;
|
2021-01-03 13:10:20 +00:00
|
|
|
use MediaWiki\Extension\AbuseFilter\VariableGenerator\VariableGeneratorFactory;
|
2021-01-02 13:41:31 +00:00
|
|
|
use MediaWiki\Extension\AbuseFilter\Variables\LazyVariableComputer;
|
|
|
|
use MediaWiki\Extension\AbuseFilter\Variables\VariablesBlobStore;
|
|
|
|
use MediaWiki\Extension\AbuseFilter\Variables\VariablesFormatter;
|
|
|
|
use MediaWiki\Extension\AbuseFilter\Variables\VariablesManager;
|
2020-11-19 15:32:39 +00:00
|
|
|
use MediaWiki\Extension\AbuseFilter\Watcher\EmergencyWatcher;
|
2020-11-28 23:53:42 +00:00
|
|
|
use MediaWiki\Extension\AbuseFilter\Watcher\UpdateHitCountWatcher;
|
2020-01-15 16:08:53 +00:00
|
|
|
use MediaWiki\MediaWikiServices;
|
|
|
|
|
|
|
|
class AbuseFilterServices {
|
2020-09-19 09:45:25 +00:00
|
|
|
|
2020-01-15 16:08:53 +00:00
|
|
|
/**
|
|
|
|
* @return KeywordsManager
|
|
|
|
*/
|
|
|
|
public static function getKeywordsManager() : KeywordsManager {
|
|
|
|
return MediaWikiServices::getInstance()->getService( KeywordsManager::SERVICE_NAME );
|
|
|
|
}
|
2020-09-20 22:31:41 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return FilterProfiler
|
|
|
|
*/
|
|
|
|
public static function getFilterProfiler() : FilterProfiler {
|
|
|
|
return MediaWikiServices::getInstance()->getService( FilterProfiler::SERVICE_NAME );
|
|
|
|
}
|
2020-09-18 14:49:13 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return AbuseFilterPermissionManager
|
|
|
|
*/
|
|
|
|
public static function getPermissionManager() : AbuseFilterPermissionManager {
|
|
|
|
return MediaWikiServices::getInstance()->getService( AbuseFilterPermissionManager::SERVICE_NAME );
|
|
|
|
}
|
2020-10-13 16:01:18 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return ChangeTagger
|
|
|
|
*/
|
|
|
|
public static function getChangeTagger() : ChangeTagger {
|
|
|
|
return MediaWikiServices::getInstance()->getService( ChangeTagger::SERVICE_NAME );
|
|
|
|
}
|
2020-10-14 14:21:48 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return ChangeTagsManager
|
|
|
|
*/
|
|
|
|
public static function getChangeTagsManager() : ChangeTagsManager {
|
|
|
|
return MediaWikiServices::getInstance()->getService( ChangeTagsManager::SERVICE_NAME );
|
|
|
|
}
|
2020-10-21 14:18:08 +00:00
|
|
|
|
2020-11-06 12:13:02 +00:00
|
|
|
/**
|
|
|
|
* @return ChangeTagValidator
|
|
|
|
*/
|
|
|
|
public static function getChangeTagValidator() : ChangeTagValidator {
|
|
|
|
return MediaWikiServices::getInstance()->getService( ChangeTagValidator::SERVICE_NAME );
|
|
|
|
}
|
|
|
|
|
2020-10-21 14:18:08 +00:00
|
|
|
/**
|
|
|
|
* @return BlockAutopromoteStore
|
|
|
|
*/
|
|
|
|
public static function getBlockAutopromoteStore() : BlockAutopromoteStore {
|
|
|
|
return MediaWikiServices::getInstance()->getService( BlockAutopromoteStore::SERVICE_NAME );
|
|
|
|
}
|
2020-10-25 15:30:43 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return FilterUser
|
|
|
|
*/
|
|
|
|
public static function getFilterUser() : FilterUser {
|
|
|
|
return MediaWikiServices::getInstance()->getService( FilterUser::SERVICE_NAME );
|
|
|
|
}
|
2020-10-16 22:29:41 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return CentralDBManager
|
|
|
|
*/
|
|
|
|
public static function getCentralDBManager() : CentralDBManager {
|
|
|
|
return MediaWikiServices::getInstance()->getService( CentralDBManager::SERVICE_NAME );
|
|
|
|
}
|
2019-12-16 16:19:48 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return ParserFactory
|
|
|
|
*/
|
|
|
|
public static function getParserFactory() : ParserFactory {
|
|
|
|
return MediaWikiServices::getInstance()->getService( ParserFactory::SERVICE_NAME );
|
|
|
|
}
|
2020-09-20 11:30:59 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return FilterLookup
|
|
|
|
*/
|
|
|
|
public static function getFilterLookup() : FilterLookup {
|
|
|
|
return MediaWikiServices::getInstance()->getService( FilterLookup::SERVICE_NAME );
|
|
|
|
}
|
2020-10-10 17:20:21 +00:00
|
|
|
|
2021-02-10 13:13:03 +00:00
|
|
|
/**
|
|
|
|
* @return EmergencyCache
|
|
|
|
*/
|
|
|
|
public static function getEmergencyCache() : EmergencyCache {
|
|
|
|
return MediaWikiServices::getInstance()->getService( EmergencyCache::SERVICE_NAME );
|
|
|
|
}
|
|
|
|
|
2020-09-19 09:45:25 +00:00
|
|
|
/**
|
|
|
|
* @return EmergencyWatcher
|
|
|
|
*/
|
|
|
|
public static function getEmergencyWatcher() : EmergencyWatcher {
|
|
|
|
return MediaWikiServices::getInstance()->getService( EmergencyWatcher::SERVICE_NAME );
|
|
|
|
}
|
|
|
|
|
2020-11-10 12:58:11 +00:00
|
|
|
/**
|
|
|
|
* @return EchoNotifier
|
|
|
|
*/
|
|
|
|
public static function getEchoNotifier() : EchoNotifier {
|
|
|
|
return MediaWikiServices::getInstance()->getService( EchoNotifier::SERVICE_NAME );
|
|
|
|
}
|
|
|
|
|
2020-10-10 17:20:21 +00:00
|
|
|
/**
|
|
|
|
* @return FilterValidator
|
|
|
|
*/
|
|
|
|
public static function getFilterValidator() : FilterValidator {
|
|
|
|
return MediaWikiServices::getInstance()->getService( FilterValidator::SERVICE_NAME );
|
|
|
|
}
|
2020-11-07 11:40:26 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return FilterCompare
|
|
|
|
*/
|
|
|
|
public static function getFilterCompare() : FilterCompare {
|
|
|
|
return MediaWikiServices::getInstance()->getService( FilterCompare::SERVICE_NAME );
|
|
|
|
}
|
2020-10-15 22:00:32 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return FilterImporter
|
|
|
|
*/
|
|
|
|
public static function getFilterImporter() : FilterImporter {
|
|
|
|
return MediaWikiServices::getInstance()->getService( FilterImporter::SERVICE_NAME );
|
|
|
|
}
|
2020-09-19 22:16:35 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return FilterStore
|
|
|
|
*/
|
|
|
|
public static function getFilterStore() : FilterStore {
|
|
|
|
return MediaWikiServices::getInstance()->getService( FilterStore::SERVICE_NAME );
|
|
|
|
}
|
2020-10-11 21:17:41 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return ConsequencesFactory
|
|
|
|
*/
|
|
|
|
public static function getConsequencesFactory() : ConsequencesFactory {
|
|
|
|
return MediaWikiServices::getInstance()->getService( ConsequencesFactory::SERVICE_NAME );
|
|
|
|
}
|
2020-11-24 12:16:41 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return EditBoxBuilderFactory
|
|
|
|
*/
|
|
|
|
public static function getEditBoxBuilderFactory() : EditBoxBuilderFactory {
|
|
|
|
return MediaWikiServices::getInstance()->getService( EditBoxBuilderFactory::SERVICE_NAME );
|
|
|
|
}
|
2020-10-17 11:50:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return ConsequencesLookup
|
|
|
|
*/
|
|
|
|
public static function getConsequencesLookup() : ConsequencesLookup {
|
|
|
|
return MediaWikiServices::getInstance()->getService( ConsequencesLookup::SERVICE_NAME );
|
|
|
|
}
|
2020-10-24 11:58:46 +00:00
|
|
|
|
2020-11-29 22:55:34 +00:00
|
|
|
/**
|
|
|
|
* @return ConsequencesRegistry
|
|
|
|
*/
|
|
|
|
public static function getConsequencesRegistry() : ConsequencesRegistry {
|
|
|
|
return MediaWikiServices::getInstance()->getService( ConsequencesRegistry::SERVICE_NAME );
|
|
|
|
}
|
|
|
|
|
2020-10-24 11:58:46 +00:00
|
|
|
/**
|
|
|
|
* @return AbuseLoggerFactory
|
|
|
|
*/
|
|
|
|
public static function getAbuseLoggerFactory() : AbuseLoggerFactory {
|
|
|
|
return MediaWikiServices::getInstance()->getService( AbuseLoggerFactory::SERVICE_NAME );
|
|
|
|
}
|
2020-11-28 23:53:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return UpdateHitCountWatcher
|
|
|
|
*/
|
|
|
|
public static function getUpdateHitCountWatcher() : UpdateHitCountWatcher {
|
|
|
|
return MediaWikiServices::getInstance()->getService( UpdateHitCountWatcher::SERVICE_NAME );
|
|
|
|
}
|
2020-09-29 14:52:05 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return VariablesBlobStore
|
|
|
|
*/
|
|
|
|
public static function getVariablesBlobStore() : VariablesBlobStore {
|
|
|
|
return MediaWikiServices::getInstance()->getService( VariablesBlobStore::SERVICE_NAME );
|
|
|
|
}
|
2020-10-16 22:10:37 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return ConsequencesExecutorFactory
|
|
|
|
*/
|
|
|
|
public static function getConsequencesExecutorFactory() : ConsequencesExecutorFactory {
|
|
|
|
return MediaWikiServices::getInstance()->getService( ConsequencesExecutorFactory::SERVICE_NAME );
|
|
|
|
}
|
2020-11-27 14:49:41 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return FilterRunnerFactory
|
|
|
|
*/
|
|
|
|
public static function getFilterRunnerFactory() : FilterRunnerFactory {
|
|
|
|
return MediaWikiServices::getInstance()->getService( FilterRunnerFactory::SERVICE_NAME );
|
|
|
|
}
|
2020-10-02 15:08:48 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return SpecsFormatter
|
|
|
|
*/
|
|
|
|
public static function getSpecsFormatter() : SpecsFormatter {
|
|
|
|
return MediaWikiServices::getInstance()->getService( SpecsFormatter::SERVICE_NAME );
|
|
|
|
}
|
2020-09-25 22:32:01 +00:00
|
|
|
|
2020-12-31 13:29:00 +00:00
|
|
|
/**
|
|
|
|
* @return VariablesFormatter
|
|
|
|
*/
|
|
|
|
public static function getVariablesFormatter() : VariablesFormatter {
|
|
|
|
return MediaWikiServices::getInstance()->getService( VariablesFormatter::SERVICE_NAME );
|
|
|
|
}
|
|
|
|
|
2020-09-25 22:32:01 +00:00
|
|
|
/**
|
|
|
|
* @return LazyVariableComputer
|
|
|
|
*/
|
|
|
|
public static function getLazyVariableComputer() : LazyVariableComputer {
|
|
|
|
return MediaWikiServices::getInstance()->getService( LazyVariableComputer::SERVICE_NAME );
|
|
|
|
}
|
2020-09-29 18:48:51 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return TextExtractor
|
|
|
|
*/
|
|
|
|
public static function getTextExtractor() : TextExtractor {
|
|
|
|
return MediaWikiServices::getInstance()->getService( TextExtractor::SERVICE_NAME );
|
|
|
|
}
|
2020-10-18 22:25:05 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return VariablesManager
|
|
|
|
*/
|
|
|
|
public static function getVariablesManager() : VariablesManager {
|
|
|
|
return MediaWikiServices::getInstance()->getService( VariablesManager::SERVICE_NAME );
|
|
|
|
}
|
2021-01-03 13:10:20 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return VariableGeneratorFactory
|
|
|
|
*/
|
|
|
|
public static function getVariableGeneratorFactory() : VariableGeneratorFactory {
|
|
|
|
return MediaWikiServices::getInstance()->getService( VariableGeneratorFactory::SERVICE_NAME );
|
|
|
|
}
|
2021-01-05 13:33:45 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return EditRevUpdater
|
|
|
|
*/
|
|
|
|
public static function getEditRevUpdater() : EditRevUpdater {
|
|
|
|
return MediaWikiServices::getInstance()->getService( EditRevUpdater::SERVICE_NAME );
|
|
|
|
}
|
2020-01-15 16:08:53 +00:00
|
|
|
}
|