| 1 |
<?php |
| 2 |
|
| 3 |
namespace MediaWiki\Extension\AbuseFilter; |
| 4 |
|
| 5 |
use MediaWiki\Extension\AbuseFilter\ChangeTags\ChangeTagger; |
| 6 |
use MediaWiki\Extension\AbuseFilter\ChangeTags\ChangeTagsManager; |
| 7 |
use MediaWiki\Extension\AbuseFilter\ChangeTags\ChangeTagValidator; |
| 8 |
use MediaWiki\Extension\AbuseFilter\Consequences\ConsequencesExecutorFactory; |
| 9 |
use MediaWiki\Extension\AbuseFilter\Consequences\ConsequencesFactory; |
| 10 |
use MediaWiki\Extension\AbuseFilter\Consequences\ConsequencesLookup; |
| 11 |
use MediaWiki\Extension\AbuseFilter\Consequences\ConsequencesRegistry; |
| 12 |
use MediaWiki\Extension\AbuseFilter\EditBox\EditBoxBuilderFactory; |
| 13 |
use MediaWiki\Extension\AbuseFilter\Hooks\AbuseFilterHookRunner; |
| 14 |
use MediaWiki\Extension\AbuseFilter\Parser\RuleCheckerFactory; |
| 15 |
use MediaWiki\Extension\AbuseFilter\VariableGenerator\VariableGeneratorFactory; |
| 16 |
use MediaWiki\Extension\AbuseFilter\Variables\LazyVariableComputer; |
| 17 |
use MediaWiki\Extension\AbuseFilter\Variables\VariablesBlobStore; |
| 18 |
use MediaWiki\Extension\AbuseFilter\Variables\VariablesFormatter; |
| 19 |
use MediaWiki\Extension\AbuseFilter\Variables\VariablesManager; |
| 20 |
use MediaWiki\Extension\AbuseFilter\Watcher\EmergencyWatcher; |
| 21 |
use MediaWiki\Extension\AbuseFilter\Watcher\UpdateHitCountWatcher; |
| 22 |
use MediaWiki\MediaWikiServices; |
| 23 |
use Psr\Container\ContainerInterface; |
| 24 |
|
| 25 |
class AbuseFilterServices { |
| 26 |
|
| 27 |
public static function getHookRunner( ?ContainerInterface $services = null ): AbuseFilterHookRunner { |
| 28 |
return ( $services ?? MediaWikiServices::getInstance() )->get( AbuseFilterHookRunner::SERVICE_NAME ); |
| 29 |
} |
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
public static function getKeywordsManager( ?ContainerInterface $services = null ): KeywordsManager { |
| 36 |
return ( $services ?? MediaWikiServices::getInstance() )->get( KeywordsManager::SERVICE_NAME ); |
| 37 |
} |
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
public static function getFilterProfiler( ?ContainerInterface $services = null ): FilterProfiler { |
| 44 |
return ( $services ?? MediaWikiServices::getInstance() )->get( FilterProfiler::SERVICE_NAME ); |
| 45 |
} |
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
public static function getPermissionManager( ?ContainerInterface $services = null ): AbuseFilterPermissionManager { |
| 52 |
return ( $services ?? MediaWikiServices::getInstance() )->get( AbuseFilterPermissionManager::SERVICE_NAME ); |
| 53 |
} |
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
public static function getChangeTagger( ?ContainerInterface $services = null ): ChangeTagger { |
| 60 |
return ( $services ?? MediaWikiServices::getInstance() )->get( ChangeTagger::SERVICE_NAME ); |
| 61 |
} |
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
public static function getChangeTagsManager( ?ContainerInterface $services = null ): ChangeTagsManager { |
| 68 |
return ( $services ?? MediaWikiServices::getInstance() )->get( ChangeTagsManager::SERVICE_NAME ); |
| 69 |
} |
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
public static function getChangeTagValidator( ?ContainerInterface $services = null ): ChangeTagValidator { |
| 76 |
return ( $services ?? MediaWikiServices::getInstance() )->get( ChangeTagValidator::SERVICE_NAME ); |
| 77 |
} |
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
public static function getBlockAutopromoteStore( ?ContainerInterface $services = null ): BlockAutopromoteStore { |
| 84 |
return ( $services ?? MediaWikiServices::getInstance() )->get( BlockAutopromoteStore::SERVICE_NAME ); |
| 85 |
} |
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
public static function getFilterUser( ?ContainerInterface $services = null ): FilterUser { |
| 92 |
return ( $services ?? MediaWikiServices::getInstance() )->get( FilterUser::SERVICE_NAME ); |
| 93 |
} |
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
public static function getCentralDBManager( ?ContainerInterface $services = null ): CentralDBManager { |
| 100 |
return ( $services ?? MediaWikiServices::getInstance() )->get( CentralDBManager::SERVICE_NAME ); |
| 101 |
} |
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
public static function getRuleCheckerFactory( ?ContainerInterface $services = null ): RuleCheckerFactory { |
| 108 |
return ( $services ?? MediaWikiServices::getInstance() )->get( RuleCheckerFactory::SERVICE_NAME ); |
| 109 |
} |
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
public static function getFilterLookup( ?ContainerInterface $services = null ): FilterLookup { |
| 116 |
return ( $services ?? MediaWikiServices::getInstance() )->get( FilterLookup::SERVICE_NAME ); |
| 117 |
} |
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
public static function getEmergencyCache( ?ContainerInterface $services = null ): EmergencyCache { |
| 124 |
return ( $services ?? MediaWikiServices::getInstance() )->get( EmergencyCache::SERVICE_NAME ); |
| 125 |
} |
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
public static function getEmergencyWatcher( ?ContainerInterface $services = null ): EmergencyWatcher { |
| 132 |
return ( $services ?? MediaWikiServices::getInstance() )->get( EmergencyWatcher::SERVICE_NAME ); |
| 133 |
} |
| 134 |
|
| 135 |
|
| 136 |
|
| 137 |
|
| 138 |
|
| 139 |
public static function getEchoNotifier( ?ContainerInterface $services = null ): EchoNotifier { |
| 140 |
return ( $services ?? MediaWikiServices::getInstance() )->get( EchoNotifier::SERVICE_NAME ); |
| 141 |
} |
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
public static function getFilterValidator( ?ContainerInterface $services = null ): FilterValidator { |
| 148 |
return ( $services ?? MediaWikiServices::getInstance() )->get( FilterValidator::SERVICE_NAME ); |
| 149 |
} |
| 150 |
|
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
public static function getFilterCompare( ?ContainerInterface $services = null ): FilterCompare { |
| 156 |
return ( $services ?? MediaWikiServices::getInstance() )->get( FilterCompare::SERVICE_NAME ); |
| 157 |
} |
| 158 |
|
| 159 |
|
| 160 |
|
| 161 |
|
| 162 |
|
| 163 |
public static function getFilterImporter( ?ContainerInterface $services = null ): FilterImporter { |
| 164 |
return ( $services ?? MediaWikiServices::getInstance() )->get( FilterImporter::SERVICE_NAME ); |
| 165 |
} |
| 166 |
|
| 167 |
|
| 168 |
|
| 169 |
|
| 170 |
|
| 171 |
public static function getFilterStore( ?ContainerInterface $services = null ): FilterStore { |
| 172 |
return ( $services ?? MediaWikiServices::getInstance() )->get( FilterStore::SERVICE_NAME ); |
| 173 |
} |
| 174 |
|
| 175 |
|
| 176 |
|
| 177 |
|
| 178 |
|
| 179 |
public static function getConsequencesFactory( ?ContainerInterface $services = null ): ConsequencesFactory { |
| 180 |
return ( $services ?? MediaWikiServices::getInstance() )->get( ConsequencesFactory::SERVICE_NAME ); |
| 181 |
} |
| 182 |
|
| 183 |
|
| 184 |
|
| 185 |
|
| 186 |
|
| 187 |
public static function getEditBoxBuilderFactory( ?ContainerInterface $services = null ): EditBoxBuilderFactory { |
| 188 |
return ( $services ?? MediaWikiServices::getInstance() )->get( EditBoxBuilderFactory::SERVICE_NAME ); |
| 189 |
} |
| 190 |
|
| 191 |
|
| 192 |
|
| 193 |
|
| 194 |
|
| 195 |
public static function getConsequencesLookup( ?ContainerInterface $services = null ): ConsequencesLookup { |
| 196 |
return ( $services ?? MediaWikiServices::getInstance() )->get( ConsequencesLookup::SERVICE_NAME ); |
| 197 |
} |
| 198 |
|
| 199 |
|
| 200 |
|
| 201 |
|
| 202 |
|
| 203 |
public static function getConsequencesRegistry( ?ContainerInterface $services = null ): ConsequencesRegistry { |
| 204 |
return ( $services ?? MediaWikiServices::getInstance() )->get( ConsequencesRegistry::SERVICE_NAME ); |
| 205 |
} |
| 206 |
|
| 207 |
|
| 208 |
|
| 209 |
|
| 210 |
|
| 211 |
public static function getAbuseLoggerFactory( ?ContainerInterface $services = null ): AbuseLoggerFactory { |
| 212 |
return ( $services ?? MediaWikiServices::getInstance() )->get( AbuseLoggerFactory::SERVICE_NAME ); |
| 213 |
} |
| 214 |
|
| 215 |
|
| 216 |
|
| 217 |
|
| 218 |
|
| 219 |
public static function getUpdateHitCountWatcher( ?ContainerInterface $services = null ): UpdateHitCountWatcher { |
| 220 |
return ( $services ?? MediaWikiServices::getInstance() )->get( UpdateHitCountWatcher::SERVICE_NAME ); |
| 221 |
} |
| 222 |
|
| 223 |
|
| 224 |
|
| 225 |
|
| 226 |
|
| 227 |
public static function getVariablesBlobStore( ?ContainerInterface $services = null ): VariablesBlobStore { |
| 228 |
return ( $services ?? MediaWikiServices::getInstance() )->get( VariablesBlobStore::SERVICE_NAME ); |
| 229 |
} |
| 230 |
|
| 231 |
|
| 232 |
|
| 233 |
|
| 234 |
|
| 235 |
public static function getConsequencesExecutorFactory( |
| 236 |
?ContainerInterface $services = null |
| 237 |
): ConsequencesExecutorFactory { |
| 238 |
return ( $services ?? MediaWikiServices::getInstance() )->get( ConsequencesExecutorFactory::SERVICE_NAME ); |
| 239 |
} |
| 240 |
|
| 241 |
|
| 242 |
|
| 243 |
|
| 244 |
|
| 245 |
public static function getFilterRunnerFactory( ?ContainerInterface $services = null ): FilterRunnerFactory { |
| 246 |
return ( $services ?? MediaWikiServices::getInstance() )->get( FilterRunnerFactory::SERVICE_NAME ); |
| 247 |
} |
| 248 |
|
| 249 |
|
| 250 |
|
| 251 |
|
| 252 |
|
| 253 |
public static function getSpecsFormatter( ?ContainerInterface $services = null ): SpecsFormatter { |
| 254 |
return ( $services ?? MediaWikiServices::getInstance() )->get( SpecsFormatter::SERVICE_NAME ); |
| 255 |
} |
| 256 |
|
| 257 |
|
| 258 |
|
| 259 |
|
| 260 |
|
| 261 |
public static function getVariablesFormatter( ?ContainerInterface $services = null ): VariablesFormatter { |
| 262 |
return ( $services ?? MediaWikiServices::getInstance() )->get( VariablesFormatter::SERVICE_NAME ); |
| 263 |
} |
| 264 |
|
| 265 |
|
| 266 |
|
| 267 |
|
| 268 |
|
| 269 |
public static function getLazyVariableComputer( ?ContainerInterface $services = null ): LazyVariableComputer { |
| 270 |
return ( $services ?? MediaWikiServices::getInstance() )->get( LazyVariableComputer::SERVICE_NAME ); |
| 271 |
} |
| 272 |
|
| 273 |
|
| 274 |
|
| 275 |
|
| 276 |
|
| 277 |
public static function getTextExtractor( ?ContainerInterface $services = null ): TextExtractor { |
| 278 |
return ( $services ?? MediaWikiServices::getInstance() )->get( TextExtractor::SERVICE_NAME ); |
| 279 |
} |
| 280 |
|
| 281 |
|
| 282 |
|
| 283 |
|
| 284 |
|
| 285 |
public static function getVariablesManager( ?ContainerInterface $services = null ): VariablesManager { |
| 286 |
return ( $services ?? MediaWikiServices::getInstance() )->get( VariablesManager::SERVICE_NAME ); |
| 287 |
} |
| 288 |
|
| 289 |
|
| 290 |
|
| 291 |
|
| 292 |
|
| 293 |
public static function getVariableGeneratorFactory( |
| 294 |
?ContainerInterface $services = null |
| 295 |
): VariableGeneratorFactory { |
| 296 |
return ( $services ?? MediaWikiServices::getInstance() )->get( VariableGeneratorFactory::SERVICE_NAME ); |
| 297 |
} |
| 298 |
|
| 299 |
|
| 300 |
|
| 301 |
|
| 302 |
|
| 303 |
public static function getEditRevUpdater( ?ContainerInterface $services = null ): EditRevUpdater { |
| 304 |
return ( $services ?? MediaWikiServices::getInstance() )->get( EditRevUpdater::SERVICE_NAME ); |
| 305 |
} |
| 306 |
|
| 307 |
|
| 308 |
|
| 309 |
|
| 310 |
|
| 311 |
public static function getBlockedDomainStorage( ?ContainerInterface $services = null ): BlockedDomainStorage { |
| 312 |
return ( $services ?? MediaWikiServices::getInstance() )->get( BlockedDomainStorage::SERVICE_NAME ); |
| 313 |
} |
| 314 |
|
| 315 |
|
| 316 |
|
| 317 |
|
| 318 |
|
| 319 |
public static function getBlockedDomainFilter( ?ContainerInterface $services = null ): BlockedDomainFilter { |
| 320 |
return ( $services ?? MediaWikiServices::getInstance() )->get( BlockedDomainFilter::SERVICE_NAME ); |
| 321 |
} |
| 322 |
} |