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