44use Liuggio\StatsdClient\Factory\StatsdDataFactoryInterface;
185use Wikimedia\ObjectFactory\ObjectFactory;
186use Wikimedia\Parsoid\Config\Api\DataAccess as ApiDataAccess;
187use Wikimedia\Parsoid\Config\Api\SiteConfig as ApiSiteConfig;
188use Wikimedia\Parsoid\Config\DataAccess;
189use Wikimedia\Parsoid\Config\SiteConfig;
190use Wikimedia\Parsoid\Parsoid;
192use Wikimedia\RequestTimeout\CriticalSectionProvider;
193use Wikimedia\RequestTimeout\RequestTimeout;
194use Wikimedia\Services\RecursiveServiceDependencyException;
205 $services->getObjectFactory(),
206 $services->getHookContainer()
213 $services->getActorStoreFactory()
218 return $services->getActorStoreFactory()->getActorNormalization();
222 return $services->getActorStoreFactory()->getActorStore();
228 $services->getDBLoadBalancerFactory(),
229 $services->getUserNameUtils(),
236 $services->getDBLoadBalancer(),
237 $services->getRevisionStore()
244 $services->getMainConfig(),
245 $services->getObjectFactory(),
246 $services->getHookContainer(),
247 $services->getReadOnlyMode(),
248 $services->getUserNameUtils(),
249 $services->getBlockManager(),
250 $services->getWatchlistManager(),
251 $services->getDBLoadBalancer(),
252 $services->getContentLanguage(),
253 $services->getLanguageConverterFactory(),
254 $services->getBotPasswordStore(),
255 $services->getUserFactory(),
256 $services->getUserIdentityLookup(),
257 $services->getUserOptionsManager()
259 $authManager->
setLogger( LoggerFactory::getInstance(
'authentication' ) );
270 return wfMessage(
'bad_image_list' )->inContentLanguage()->plain();
272 $services->getLocalServerObjectCache(),
273 $services->getRepoGroup(),
274 $services->getTitleParser(),
275 $services->getHookContainer()
280 return $services->getService(
'_SqlBlobStore' );
285 $services->getDBLoadBalancerFactory(),
286 $services->getExternalStoreAccess(),
287 $services->getMainWANObjectCache(),
289 $services->getMainConfig() )
299 $services->getTitleFormatter()
307 $services->getMainConfig()
309 $services->getPermissionManager(),
310 $services->getUserFactory(),
312 $services->getHookContainer()
316 'BlockPermissionCheckerFactory' =>
static function (
322 $services->getMainConfig()
324 $services->getBlockUtils()
329 return $services->getBlockRestrictionStoreFactory()->getBlockRestrictionStore(
WikiAwareEntity::LOCAL );
334 $services->getDBLoadBalancerFactory()
339 return $services->getService(
'_UserBlockCommandFactory' );
346 $services->getMainConfig()
348 $services->getUserIdentityLookup(),
349 $services->getUserNameUtils()
357 $services->getMainConfig()
359 $services->getCentralIdLookup(),
360 $services->getDBLoadBalancerFactory()
365 return $services->getCentralIdLookupFactory()->getLookup();
371 $services->getObjectFactory(),
372 $services->getUserIdentityLookup()
377 return $services->getNameTableStoreFactory()->getChangeTagDef();
384 $services->getObjectFactory(),
385 $services->getHookContainer()
390 $linkRenderer = $services->getLinkRendererFactory()->create( [
'renderForComment' =>
true ] );
393 $services->getLinkBatchFactory(),
394 $services->getLinkCache(),
395 $services->getRepoGroup(),
396 RequestContext::getMain()->getLanguage(),
397 $services->getContentLanguage(),
398 $services->getTitleParser(),
399 $services->getNamespaceInfo(),
400 $services->getHookContainer()
407 $services->getContentLanguage(),
414 $registry = $services->getBootstrapConfig()->get(
MainConfigNames::ConfigRegistry );
417 foreach ( $registry as $name => $callback ) {
418 $factory->register( $name, $callback );
433 $config = $services->getMainConfig();
435 $config->get( MainConfigNames::ReadOnly ),
436 $config->get( MainConfigNames::ReadOnlyFile )
441 $contentHandlerConfig = $services->getMainConfig()->get(
MainConfigNames::ContentHandlers );
444 $contentHandlerConfig,
445 $services->getObjectFactory(),
446 $services->getHookContainer(),
447 LoggerFactory::getInstance(
'ContentHandler' )
452 return $services->getLanguageFactory()->getLanguage(
457 return $services->getService(
'_PageCommandFactory' );
461 return $services->getNameTableStoreFactory()->getContentModels();
474 $services->getRevisionStore(),
475 $services->getLinkRendererFactory(),
476 $services->getLinkBatchFactory(),
477 $services->getHookContainer(),
478 $services->getDBLoadBalancer(),
479 $services->getActorMigration(),
480 $services->getNamespaceInfo(),
481 $services->getCommentFormatter()
485 'CriticalSectionProvider' =>
static function (
MediaWikiServices $services ): CriticalSectionProvider {
486 $config = $services->getMainConfig();
487 $limit = $GLOBALS[
'wgCommandLineMode' ] ? INF : $config->get( MainConfigNames::CriticalSectionTimeLimit );
488 return RequestTimeout::singleton()->createCriticalSectionProvider( $limit );
492 $config = $services->getMainConfig();
494 $secret = $config->get( MainConfigNames::HKDFSecret ) ?: $config->get( MainConfigNames::SecretKey );
496 throw new RuntimeException(
"Cannot use MWCryptHKDF without a secret." );
501 $context = [ microtime(), getmypid(), gethostname() ];
504 $cache = $services->getLocalServerObjectCache();
509 return new CryptHKDF( $secret, $config->get( MainConfigNames::HKDFAlgorithm ),
$cache, $context );
516 $services->getMainConfig()
519 $services->getActorStoreFactory(),
520 $services->getBlockRestrictionStore(),
521 $services->getCommentStore(),
522 $services->getHookContainer(),
523 $services->getDBLoadBalancer(),
524 $services->getReadOnlyMode(),
525 $services->getUserFactory()
539 return $services->getDBLoadBalancerFactory()->getMainLB();
542 'DBLoadBalancerFactory' =>
544 $mainConfig = $services->getMainConfig();
545 $lbFactoryConfigBuilder = $services->getDBLoadBalancerFactoryConfigBuilder();
547 $lbConf = $lbFactoryConfigBuilder->applyDefaultConfig(
548 $mainConfig->get( MainConfigNames::LBFactoryConf )
551 $class = $lbFactoryConfigBuilder->getLBFactoryClass( $lbConf );
552 $instance =
new $class( $lbConf );
554 $lbFactoryConfigBuilder->setDomainAliases( $instance );
560 $lbFactoryConfigBuilder->applyGlobalState(
563 $services->getStatsdDataFactory()
570 $cpStashType = $services->getMainConfig()->get(
MainConfigNames::ChronologyProtectorStash );
571 if ( is_string( $cpStashType ) ) {
576 }
catch ( RecursiveServiceDependencyException $e ) {
582 $wanCache = $services->getMainWANObjectCache();
583 }
catch ( RecursiveServiceDependencyException $e ) {
587 $srvCache = $services->getLocalServerObjectCache();
593 new ServiceOptions( MWLBFactory::APPLY_DEFAULT_CONFIG_OPTIONS, $services->getMainConfig() ),
594 $services->getConfiguredReadOnlyMode(),
598 $services->getCriticalSectionProvider(),
599 $services->getStatsdDataFactory(),
600 $services->getDatabaseFactory()
605 return $services->getService(
'_PageCommandFactory' );
618 $services->getExternalStoreFactory(),
624 $config = $services->getMainConfig();
625 $writeStores = $config->get( MainConfigNames::DefaultExternalStore );
628 $config->get( MainConfigNames::ExternalStores ),
629 ( $writeStores !==
false ) ? (array)$writeStores : [],
630 $services->getDBLoadBalancer()->getLocalDomainID(),
636 $mainConfig = $services->getMainConfig();
643 $legacyDomainId = strlen( $ld->getTablePrefix() )
644 ?
"{$ld->getDatabase()}-{$ld->getTablePrefix()}"
645 : $ld->getDatabase();
646 if ( $ld->getSchema() !==
null && $legacyDomainId !== $fallbackWikiId ) {
648 "Legacy default 'domainId' is '$legacyDomainId' but wiki ID is '$fallbackWikiId'."
652 $cache = $services->getLocalServerObjectCache();
658 new ServiceOptions( FileBackendGroup::CONSTRUCTOR_OPTIONS, $mainConfig,
659 [
'fallbackWikiId' => $fallbackWikiId ] ),
660 $services->getConfiguredReadOnlyMode(),
662 $services->getMainWANObjectCache(),
663 $services->getMimeAnalyzer(),
664 $services->getLockManagerGroupFactory(),
665 $services->getTempFSFileFactory(),
666 $services->getObjectFactory()
671 $nsInfo = $services->getNamespaceInfo();
673 $dbLoadBalancer = $services->isServiceDisabled(
'DBLoadBalancer' )
675 : $services->getDBLoadBalancer();
676 return new GenderCache( $nsInfo, $dbLoadBalancer, $services->get(
'_DefaultOptionsLookup' ) );
680 $mainConfig = $services->getMainConfig();
683 $mainConfig->get( MainConfigNames::TmpDirectory ),
694 $services->getMainConfig()
701 $services->getGrantsInfo(),
702 $services->getLinkRenderer(),
703 $services->getLanguageFactory(),
704 $services->getContentLanguage()
716 $extDeprecatedHooks = $extRegistry->
getAttribute(
'DeprecatedHooks' );
721 $services->getObjectFactory()
726 $config = $services->getMainConfig();
729 $services->getHookContainer(),
730 $services->getTitleFactory(),
731 $config->get( MainConfigNames::CdnReboundPurgeDelay ),
732 $config->get( MainConfigNames::UseFileCache ),
733 $config->get( MainConfigNames::CdnMaxAge )
739 $services->getService(
'_Parsoid' ),
741 $services->getParsoidPageConfigFactory()
745 'HttpRequestFactory' =>
750 $services->getMainConfig()
757 $config = $services->getMainConfig();
759 $services->getContentLanguage(),
760 $services->getMainWANObjectCache(),
761 $services->getHookContainer(),
762 $services->getDBLoadBalancer(),
763 $config->get( MainConfigNames::InterwikiExpiry ),
764 $config->get( MainConfigNames::InterwikiCache ),
765 $config->get( MainConfigNames::InterwikiScopes ),
766 $config->get( MainConfigNames::InterwikiFallbackSite )
771 return $services->getJobQueueGroupFactory()->makeJobQueueGroup();
777 $services->getConfiguredReadOnlyMode(),
778 $services->getStatsdDataFactory(),
779 $services->getMainWANObjectCache(),
780 $services->getGlobalIdGenerator()
787 $services->getDBLoadBalancerFactory(),
788 $services->getJobQueueGroup(),
789 $services->getReadOnlyMode(),
790 $services->getLinkCache(),
791 $services->getStatsdDataFactory(),
801 $usePigLatinVariant = $services->getMainConfig()->get(
MainConfigNames::UsePigLatinVariant );
802 $isConversionDisabled = $services->getMainConfig()->get( MainConfigNames::DisableLangConversion );
803 $isTitleConversionDisabled = $services->getMainConfig()->get( MainConfigNames::DisableTitleConversion );
805 $services->getObjectFactory(),
807 $isConversionDisabled,
808 $isTitleConversionDisabled,
809 static function () use ( $services ) {
810 return $services->getContentLanguage();
818 $services->getNamespaceInfo(),
819 $services->getLocalisationCache(),
820 $services->getLanguageNameUtils(),
821 $services->getLanguageFallback(),
822 $services->getLanguageConverterFactory(),
823 $services->getHookContainer(),
824 $services->getMainConfig()
831 $services->getLocalisationCache(),
832 $services->getLanguageNameUtils()
840 $services->getMainConfig()
842 $services->getHookContainer()
848 $services->getLinkCache(),
849 $services->getTitleFormatter(),
850 $services->getContentLanguage(),
851 $services->getGenderCache(),
852 $services->getDBLoadBalancer(),
853 $services->getLinksMigration(),
860 $dbLoadBalancer = $services->isServiceDisabled(
'DBLoadBalancer' )
862 : $services->getDBLoadBalancer();
864 $services->getTitleFormatter(),
865 $services->getMainWANObjectCache(),
866 $services->getNamespaceInfo(),
869 $linkCache->setLogger( LoggerFactory::getInstance(
'LinkCache' ) );
874 return $services->getLinkRendererFactory()->create();
879 $services->getTitleFormatter(),
880 $services->getLinkCache(),
881 $services->getSpecialPageFactory(),
882 $services->getHookContainer()
888 $services->getMainConfig(),
889 $services->getLinkTargetLookup()
895 $services->getDBLoadBalancer(),
896 $services->getLocalServerObjectCache(),
897 $services->getMainWANObjectCache()
902 $conf = $services->getMainConfig()->get(
MainConfigNames::LocalisationCacheConf );
904 $logger = LoggerFactory::getInstance(
'localisation' );
907 $conf, $services->getMainConfig()->get( MainConfigNames::CacheDirectory ) );
908 $logger->debug(
'LocalisationCache using store ' . get_class( $store ) );
910 return new $conf[
'class'](
912 LocalisationCache::CONSTRUCTOR_OPTIONS,
917 'forceRecache' =>
false,
918 'manualRecache' =>
false,
921 $services->getMainConfig()
925 [
static function () use ( $services ) {
929 MessageBlobStore::clearGlobalCacheEntry( $services->getMainWANObjectCache() );
931 $services->getLanguageNameUtils(),
932 $services->getHookContainer()
942 WikiMap::getCurrentWikiDbDomain()->getId(),
949 $services->getContentLanguage(),
950 $services->getHookContainer()
956 return $services->getConfigFactory()->makeConfig(
'main' );
960 $mainConfig = $services->getMainConfig();
962 $id = $mainConfig->
get( MainConfigNames::MainStash );
963 $params = $mainConfig->get( MainConfigNames::ObjectCaches )[$id] ??
null;
965 throw new UnexpectedValueException(
966 "\$wgObjectCaches must have \"$id\" set (via \$wgMainStash)"
970 $params[
'stats'] = $services->getStatsdDataFactory();
973 $store->getLogger()->debug(
'MainObjectStash using store {class}', [
974 'class' => get_class( $store )
981 $mainConfig = $services->getMainConfig();
983 $wanId = $mainConfig->
get( MainConfigNames::MainWANCache );
984 $wanParams = $mainConfig->get( MainConfigNames::WANObjectCaches )[$wanId] ??
null;
986 throw new UnexpectedValueException(
987 "wgWANObjectCaches must have \"$wanId\" set (via wgMainWANCache)"
991 $cacheId = $wanParams[
'cacheId'];
992 $wanClass = $wanParams[
'class'];
993 unset( $wanParams[
'cacheId'] );
994 unset( $wanParams[
'class'] );
996 $storeParams = $mainConfig->get( MainConfigNames::ObjectCaches )[$cacheId] ??
null;
997 if ( !$storeParams ) {
998 throw new UnexpectedValueException(
999 "wgObjectCaches must have \"$cacheId\" set (via wgWANObjectCaches)"
1002 $storeParams[
'stats'] = $services->getStatsdDataFactory();
1004 $logger = $store->getLogger();
1005 $logger->debug(
'MainWANObjectCache using store {class}', [
1006 'class' => get_class( $store )
1009 $wanParams[
'cache'] = $store;
1010 $wanParams[
'logger'] = $logger;
1011 $wanParams[
'secret'] = $wanParams[
'secret'] ?? $mainConfig->get( MainConfigNames::SecretKey );
1012 if ( !$GLOBALS[
'wgCommandLineMode' ] ) {
1014 $wanParams[
'stats'] = $services->getStatsdDataFactory();
1016 $wanParams[
'asyncHandler'] = [ DeferredUpdates::class,
'addCallableUpdate' ];
1019 $instance =
new $wanClass( $wanParams );
1021 '@phan-var WANObjectCache $instance';
1033 return $services->getService(
'_PageCommandFactory' );
1037 $mainConfig = $services->getMainConfig();
1039 $srvCache = $mainConfig->get( MainConfigNames::UseLocalMessageCache )
1040 ? $services->getLocalServerObjectCache()
1043 $logger = LoggerFactory::getInstance(
'MessageCache' );
1044 $logger->debug(
'MessageCache using store {class}', [
1045 'class' => get_class( $clusterCache )
1048 $options =
new ServiceOptions( MessageCache::CONSTRUCTOR_OPTIONS, $mainConfig );
1051 $services->getMainWANObjectCache(),
1054 $services->getContentLanguage(),
1055 $services->getLanguageConverterFactory(),
1058 $services->getLanguageFactory(),
1059 $services->getLocalisationCache(),
1060 $services->getLanguageNameUtils(),
1061 $services->getLanguageFallback(),
1062 $services->getHookContainer()
1071 $config = $services->getMainConfig();
1074 'target' => $config->get( MainConfigNames::MetricsTarget ),
1075 'format' => $config->get( MainConfigNames::MetricsFormat ),
1076 'prefix' => $config->get( MainConfigNames::MetricsPrefix ),
1078 LoggerFactory::getInstance(
'Metrics' )
1082 'MimeAnalyzer' =>
static function (
MediaWikiServices $services ): MimeAnalyzer {
1084 $mainConfig = $services->getMainConfig();
1085 $hookRunner =
new HookRunner( $services->getHookContainer() );
1087 'typeFile' => $mainConfig->get( MainConfigNames::MimeTypeFile ),
1088 'infoFile' => $mainConfig->get( MainConfigNames::MimeInfoFile ),
1089 'xmlTypes' => $mainConfig->get( MainConfigNames::XMLMimeTypes ),
1091 static function ( $mimeAnalyzer, &$head, &$tail,
$file, &
$mime )
1092 use ( $logger, $hookRunner ) {
1095 if ( $deja->isValid() ) {
1096 $logger->info(
"Detected $file as image/vnd.djvu\n" );
1097 $mime =
'image/vnd.djvu';
1102 $hookRunner->onMimeMagicGuessFromContent(
1105 'extCallback' =>
static function ( $mimeAnalyzer,
$ext, &
$mime ) use ( $hookRunner ) {
1107 $hookRunner->onMimeMagicImproveFromExtension( $mimeAnalyzer,
$ext,
$mime );
1109 'initCallback' =>
static function ( $mimeAnalyzer ) use ( $hookRunner ) {
1111 $hookRunner->onMimeMagicInit( $mimeAnalyzer );
1116 if ( $params[
'infoFile'] ===
'includes/mime.info' ) {
1117 $params[
'infoFile'] = MimeAnalyzer::USE_INTERNAL;
1120 if ( $params[
'typeFile'] ===
'includes/mime.types' ) {
1121 $params[
'typeFile'] = MimeAnalyzer::USE_INTERNAL;
1124 $detectorCmd = $mainConfig->get( MainConfigNames::MimeDetectorCommand );
1125 if ( $detectorCmd ) {
1126 $factory = $services->getShellCommandFactory();
1127 $params[
'detectCallback'] =
static function (
$file ) use ( $detectorCmd, $factory ) {
1128 $result = $factory->create()
1130 ->unsafeParams( $detectorCmd )
1133 return $result->getStdout();
1137 return new MimeAnalyzer( $params );
1141 return $services->getService(
'_PageCommandFactory' );
1147 $services->getHookContainer()
1153 $services->getDBLoadBalancerFactory(),
1154 $services->getMainWANObjectCache(),
1159 'ObjectFactory' =>
static function (
MediaWikiServices $services ): ObjectFactory {
1160 return new ObjectFactory( $services );
1167 $services->getDBLoadBalancer(),
1168 $services->getRevisionStore(),
1169 $services->getSlotRoleRegistry(),
1170 $services->getWikiPageFactory(),
1171 $services->getPageUpdaterFactory(),
1172 $services->getUserFactory()
1177 $config = $services->getMainConfig();
1180 ObjectCache::getLocalClusterInstance(),
1181 $services->getDBLoadBalancer(),
1182 LoggerFactory::getInstance(
'StashEdit' ),
1183 $services->getStatsdDataFactory(),
1184 $services->getUserEditTracker(),
1185 $services->getUserFactory(),
1186 $services->getWikiPageFactory(),
1187 $services->getHookContainer(),
1188 defined(
'MEDIAWIKI_JOB_RUNNER' ) || $GLOBALS[
'wgCommandLineMode' ]
1189 ? PageEditStash::INITIATOR_JOB_OR_CLI
1196 $services->getLinkBatchFactory(),
1197 $services->getDBLoadBalancer()
1202 return $services->getPageStoreFactory()->getPageStore();
1208 $services->getMainConfig()
1213 $services->getDBLoadBalancerFactory(),
1214 $services->getNamespaceInfo(),
1215 $services->getTitleParser(),
1216 $services->getLinkCache(),
1217 $services->getStatsdDataFactory()
1221 'PageUpdaterFactory' =>
static function (
1225 $services->getMainObjectStash(),
1226 $services->getDBLoadBalancer(),
1229 $services->getMainConfig()
1234 $services->getRevisionStore(),
1235 $services->getRevisionRenderer(),
1236 $services->getSlotRoleRegistry(),
1237 $services->getParserCache(),
1238 $services->getParsoidOutputAccess(),
1239 $services->getJobQueueGroup(),
1240 $services->getMessageCache(),
1241 $services->getContentLanguage(),
1242 $services->getDBLoadBalancerFactory(),
1243 $services->getContentHandlerFactory(),
1244 $services->getHookContainer(),
1246 $services->getUserNameUtils(),
1247 LoggerFactory::getInstance(
'SavePage' ),
1249 PageUpdaterFactory::CONSTRUCTOR_OPTIONS,
1250 $services->getMainConfig()
1252 $services->getUserEditTracker(),
1253 $services->getUserGroupManager(),
1254 $services->getTitleFormatter(),
1255 $services->getContentTransformer(),
1256 $services->getPageEditStash(),
1257 $services->getTalkPageNotificationManager(),
1258 $services->getMainWANObjectCache(),
1259 $services->getPermissionManager(),
1260 $services->getWikiPageFactory(),
1266 return $services->getParserFactory()->getMainInstance();
1270 return $services->getParserCacheFactory()
1275 $config = $services->getMainConfig();
1277 $wanCache = $services->getMainWANObjectCache();
1279 $options =
new ServiceOptions( ParserCacheFactory::CONSTRUCTOR_OPTIONS, $config );
1284 $services->getHookContainer(),
1285 $services->getJsonCodec(),
1286 $services->getStatsdDataFactory(),
1287 LoggerFactory::getInstance(
'ParserCache' ),
1289 $services->getTitleFactory(),
1290 $services->getWikiPageFactory()
1296 $services->getMainConfig()
1301 $services->getMagicWordFactory(),
1302 $services->getContentLanguage(),
1303 $services->getUrlUtils(),
1304 $services->getSpecialPageFactory(),
1305 $services->getLinkRendererFactory(),
1306 $services->getNamespaceInfo(),
1307 LoggerFactory::getInstance(
'Parser' ),
1308 $services->getBadFileLookup(),
1309 $services->getLanguageConverterFactory(),
1310 $services->getHookContainer(),
1311 $services->getTidy(),
1312 $services->getMainWANObjectCache(),
1313 $services->getUserOptionsLookup(),
1314 $services->getUserFactory(),
1315 $services->getTitleFormatter(),
1316 $services->getHttpRequestFactory(),
1317 $services->getTrackingCategories(),
1318 $services->getSignatureValidatorFactory(),
1319 $services->getUserNameUtils()
1325 $services->getParserCache(),
1326 $services->getParserCacheFactory()->getRevisionOutputCache(
'rcache' ),
1327 $services->getRevisionLookup(),
1328 $services->getRevisionRenderer(),
1329 $services->getStatsdDataFactory(),
1330 $services->getDBLoadBalancerFactory(),
1332 $services->getWikiPageFactory(),
1333 $services->getTitleFormatter()
1337 'ParsoidDataAccess' =>
static function (
MediaWikiServices $services ): DataAccess {
1338 $mainConfig = $services->getMainConfig();
1339 $parsoidSettings = $mainConfig->get( MainConfigNames::ParsoidSettings );
1340 if ( !empty( $parsoidSettings[
'debugApi'] ) ) {
1341 return ApiDataAccess::fromSettings( $parsoidSettings );
1343 return new MWDataAccess(
1345 $services->getRepoGroup(),
1346 $services->getBadFileLookup(),
1347 $services->getHookContainer(),
1348 $services->getContentTransformer(),
1349 $services->getReadOnlyMode(),
1350 $services->getParserFactory()
1358 $services->getMainConfig()
1360 $services->getParserCacheFactory(),
1361 $services->getRevisionLookup(),
1362 $services->getGlobalIdGenerator(),
1363 $services->getStatsdDataFactory(),
1364 $services->getService(
'_Parsoid' ),
1365 $services->getParsoidSiteConfig(),
1366 $services->getParsoidPageConfigFactory()
1373 $config = $services->getMainConfig()->get(
MainConfigNames::ParsoidCacheConfig );
1374 $backend = $config[
'StashType']
1376 : $services->getMainObjectStash();
1381 'ParsoidPageConfigFactory' =>
static function (
MediaWikiServices $services ): MWPageConfigFactory {
1382 return new MWPageConfigFactory( $services->getRevisionStore(),
1383 $services->getSlotRoleRegistry() );
1386 'ParsoidSiteConfig' =>
static function (
MediaWikiServices $services ): SiteConfig {
1387 $mainConfig = $services->getMainConfig();
1388 $parsoidSettings = $mainConfig->get( MainConfigNames::ParsoidSettings );
1389 if ( !empty( $parsoidSettings[
'debugApi'] ) ) {
1390 return ApiSiteConfig::fromSettings( $parsoidSettings );
1392 return new MWSiteConfig(
1395 $services->getObjectFactory(),
1396 $services->getContentLanguage(),
1397 $services->getStatsdDataFactory(),
1398 $services->getMagicWordFactory(),
1399 $services->getNamespaceInfo(),
1400 $services->getSpecialPageFactory(),
1401 $services->getInterwikiLookup(),
1402 $services->getUserOptionsLookup(),
1403 $services->getLanguageFactory(),
1404 $services->getLanguageConverterFactory(),
1405 $services->getLanguageNameUtils(),
1406 $services->getUrlUtils(),
1409 $services->getParser(),
1415 $config = $services->getMainConfig();
1417 $config->get( MainConfigNames::PasswordConfig ),
1418 $config->get( MainConfigNames::PasswordDefault )
1426 LoggerFactory::getInstance(
'authentication' ),
1427 $services->getAuthManager(),
1428 $services->getHookContainer(),
1429 $services->getDBLoadBalancer(),
1430 $services->getUserFactory(),
1431 $services->getUserNameUtils(),
1432 $services->getUserOptionsLookup()
1436 'PerDbNameStatsdDataFactory' =>
1438 $config = $services->getMainConfig();
1439 $wiki = $config->get( MainConfigNames::DBname );
1441 $services->getStatsdDataFactory(),
1451 $services->getSpecialPageFactory(),
1452 $services->getNamespaceInfo(),
1453 $services->getGroupPermissionsLookup(),
1454 $services->getUserGroupManager(),
1455 $services->getBlockErrorFormatter(),
1456 $services->getHookContainer(),
1457 $services->getUserCache(),
1458 $services->getRedirectLookup(),
1459 $services->getRestrictionStore(),
1460 $services->getTitleFormatter(),
1461 $services->getTempUserConfig(),
1462 $services->getUserFactory(),
1463 $services->getActionFactory()
1471 $services->getContentLanguage(),
1472 $services->getAuthManager(),
1473 $services->getLinkRendererFactory()->create(),
1474 $services->getNamespaceInfo(),
1475 $services->getPermissionManager(),
1476 $services->getLanguageConverterFactory()->getLanguageConverter(),
1477 $services->getLanguageNameUtils(),
1478 $services->getHookContainer(),
1479 $services->getUserOptionsManager(),
1480 $services->getLanguageConverterFactory(),
1481 $services->getParser(),
1482 $services->getSkinFactory(),
1483 $services->getUserGroupManager(),
1484 $services->getSignatureValidatorFactory()
1486 $factory->setLogger( LoggerFactory::getInstance(
'preferences' ) );
1492 $mainConfig = $services->getMainConfig();
1494 $mainConfig->get( MainConfigNames::CdnServers ),
1495 $mainConfig->get( MainConfigNames::CdnServersNoPurge ),
1496 $services->getHookContainer()
1503 $services->getWRStatsFactory(),
1504 $services->getCentralIdLookupFactory()->getNonLocalLookup(),
1505 $services->getUserFactory(),
1506 $services->getUserGroupManager(),
1507 $services->getHookContainer()
1513 $services->getConfiguredReadOnlyMode(),
1514 $services->getDBLoadBalancer()
1519 return $services->getRedirectStore();
1527 $config = $services->getMainConfig();
1529 $config->get( MainConfigNames::LocalFileRepo ),
1530 $config->get( MainConfigNames::ForeignFileRepos ),
1531 $services->getMainWANObjectCache(),
1532 $services->getMimeAnalyzer()
1537 $config = $services->getMainConfig();
1539 $maxage = $config->get( MainConfigNames::ResourceLoaderMaxage );
1542 LoggerFactory::getInstance(
'resourceloader' ),
1543 $config->get( MainConfigNames::ResourceLoaderUseObjectCacheForDeps )
1548 'maxageVersioned' => $maxage[
'versioned'] ?? null,
1549 'maxageUnversioned' => $maxage[
'unversioned'] ?? null,
1556 $modules = $extRegistry->getAttribute(
'ResourceModules' )
1557 + $config->get( MainConfigNames::ResourceModules );
1558 $moduleSkinStyles = $extRegistry->getAttribute(
'ResourceModuleSkinStyles' )
1559 + $config->get( MainConfigNames::ResourceModuleSkinStyles );
1561 $rl->setModuleSkinStyles( $moduleSkinStyles );
1562 $rl->addSource( $config->get( MainConfigNames::ResourceLoaderSources ) );
1565 $baseDir = $config->get( MainConfigNames::BaseDirectory );
1566 $rl->register( include
"$baseDir/resources/Resources.php" );
1568 $hookRunner = new \MediaWiki\ResourceLoader\HookRunner( $services->getHookContainer() );
1569 $hookRunner->onResourceLoaderRegisterModules( $rl );
1571 $msgPosterAttrib = $extRegistry->getAttribute(
'MessagePosterModule' );
1572 $rl->register(
'mediawiki.messagePoster', [
1573 'localBasePath' => $baseDir,
1574 'debugRaw' =>
false,
1575 'scripts' => array_merge(
1577 "resources/src/mediawiki.messagePoster/factory.js",
1578 "resources/src/mediawiki.messagePoster/MessagePoster.js",
1579 "resources/src/mediawiki.messagePoster/WikitextMessagePoster.js",
1581 $msgPosterAttrib[
'scripts'] ?? []
1583 'dependencies' => array_merge(
1587 'mediawiki.ForeignApi',
1589 $msgPosterAttrib[
'dependencies'] ?? []
1591 'targets' => [
'desktop',
'mobile' ],
1594 if ( $config->get( MainConfigNames::EnableJavaScriptTest ) ===
true ) {
1595 $rl->registerTestModules();
1606 $services->getMainWANObjectCache(),
1607 $services->getDBLoadBalancer(),
1608 $services->getLinkCache(),
1609 $services->getLinksMigration(),
1610 $services->getCommentStore(),
1611 $services->getHookContainer(),
1612 $services->getPageStore()
1618 $services->getMainObjectStash(),
1619 $services->getDBLoadBalancer(),
1622 $services->getMainConfig()
1628 $services->getJobQueueGroup()
1633 return $services->getRevisionStore();
1637 return $services->getRevisionStore();
1642 $services->getDBLoadBalancer(),
1643 $services->getSlotRoleRegistry(),
1644 $services->getContentRenderer()
1647 $renderer->
setLogger( LoggerFactory::getInstance(
'SaveParse' ) );
1652 return $services->getRevisionStoreFactory()->getRevisionStore();
1657 $services->getDBLoadBalancerFactory(),
1658 $services->getBlobStoreFactory(),
1659 $services->getNameTableStoreFactory(),
1660 $services->getSlotRoleRegistry(),
1661 $services->getMainWANObjectCache(),
1662 $services->getLocalServerObjectCache(),
1663 $services->getCommentStore(),
1664 $services->getActorMigration(),
1665 $services->getActorStoreFactory(),
1667 $services->getContentHandlerFactory(),
1668 $services->getPageStoreFactory(),
1669 $services->getTitleFactory(),
1670 $services->getHookContainer()
1675 return $services->get(
'_PageCommandFactory' );
1680 $services->getLinkRenderer(),
1681 $services->getLinkBatchFactory(),
1682 $services->getLinkCache(),
1683 $services->getRepoGroup(),
1685 $services->getContentLanguage(),
1686 $services->getTitleParser(),
1687 $services->getNamespaceInfo(),
1688 $services->getHookContainer()
1692 $services->getCommentStore()
1700 $services->getMainConfig(),
1701 $services->getContentLanguage(),
1702 $services->getHookContainer(),
1704 $services->getUserOptionsLookup()
1710 $services->getSearchEngineConfig(),
1711 $services->getHookContainer(),
1712 $services->getDBLoadBalancer()
1717 $urls = $services->getMainConfig()->get(
MainConfigNames::ShellboxUrls );
1719 $url = $services->getMainConfig()->get( MainConfigNames::ShellboxUrl );
1720 if ( $url !==
null ) {
1721 $urls[
'default'] = $url;
1724 $services->getHttpRequestFactory(),
1726 $services->getMainConfig()->get( MainConfigNames::ShellboxSecretKey )
1731 $config = $services->getMainConfig();
1734 'time' => $config->get( MainConfigNames::MaxShellTime ),
1735 'walltime' => $config->get( MainConfigNames::MaxShellWallClockTime ),
1736 'memory' => $config->get( MainConfigNames::MaxShellMemory ),
1737 'filesize' => $config->get( MainConfigNames::MaxShellFileSize ),
1739 $cgroup = $config->get( MainConfigNames::ShellCgroup );
1740 $restrictionMethod = $config->get( MainConfigNames::ShellRestrictionMethod );
1742 $factory =
new CommandFactory( $services->getShellboxClientFactory(),
1743 $limits, $cgroup, $restrictionMethod );
1744 $factory->setLogger( LoggerFactory::getInstance(
'exec' ) );
1745 $factory->logStderr();
1754 $services->getMainConfig()
1757 static function () use ( $services ) {
1758 return $services->getParserFactory();
1760 $services->getSpecialPageFactory(),
1761 $services->getTitleFactory()
1769 return $services->getSiteStore();
1773 $rawSiteStore = new
DBSiteStore( $services->getDBLoadBalancer() );
1775 $cache = $services->getLocalServerObjectCache();
1786 $services->getObjectFactory(),
1790 $names = $services->getMainConfig()->get( MainConfigNames::ValidSkinNames );
1792 foreach ( $names as $name => $skin ) {
1793 if ( is_array( $skin ) ) {
1795 $displayName = $skin[
'displayname'] ?? $name;
1796 $skippable = $skin[
'skippable'] ??
null;
1798 $displayName = $skin;
1802 'class' =>
"Skin$skin"
1805 $factory->
register( $name, $displayName, $spec, $skippable );
1809 $factory->register(
'fallback',
'Fallback', [
1810 'class' => SkinFallback::class,
1813 'name' =>
'fallback',
1814 'styles' => [
'mediawiki.skinning.interface' ],
1815 'templateDirectory' => __DIR__ .
'/skins/templates/fallback',
1820 $factory->register(
'apioutput',
'ApiOutput', [
1821 'class' => SkinApi::class,
1824 'name' =>
'apioutput',
1825 'styles' => [
'mediawiki.skinning.interface' ],
1826 'templateDirectory' => __DIR__ .
'/skins/templates/apioutput',
1836 $services->getSlotRoleStore()
1839 $config = $services->getMainConfig();
1840 $contentHandlerFactory = $services->getContentHandlerFactory();
1841 $hookContainer = $services->getHookContainer();
1842 $titleFactory = $services->getTitleFactory();
1845 static function () use ( $config, $contentHandlerFactory, $hookContainer, $titleFactory ) {
1847 $config->get( MainConfigNames::NamespaceContentModels ),
1848 $contentHandlerFactory,
1859 return $services->getNameTableStoreFactory()->getSlotRoles();
1865 (array)$services->getMainConfig()->get(
MainConfigNames::SummarySpamRegex )
1873 $services->getContentLanguage(),
1874 $services->getObjectFactory(),
1875 $services->getTitleFactory(),
1876 $services->getHookContainer()
1882 rtrim( $services->getMainConfig()->get(
MainConfigNames::StatsdMetricPrefix ),
'.' )
1886 'TalkPageNotificationManager' =>
static function (
1893 $services->getDBLoadBalancer(),
1894 $services->getReadOnlyMode(),
1895 $services->getRevisionLookup(),
1896 $services->getHookContainer(),
1897 $services->getUserFactory()
1907 $services->getMainConfig()->get(
MainConfigNames::AutoCreateTempUser )
1912 $accountCreationThrottle = $services->getMainConfig()->get(
MainConfigNames::AccountCreationThrottle );
1914 if ( !is_array( $accountCreationThrottle ) ) {
1915 $accountCreationThrottle = [ [
1916 'count' => $accountCreationThrottle,
1922 $services->getTempUserConfig(),
1923 $services->getObjectFactory(),
1924 $services->getUserFactory(),
1925 $services->getAuthManager(),
1928 $accountCreationThrottle,
1930 'type' =>
'acctcreate',
1931 'cache' => $services->getLocalServerObjectCache()
1940 RemexDriver::CONSTRUCTOR_OPTIONS, $services->getMainConfig()
1950 return $services->getService(
'_MediaWikiTitleCodec' );
1954 return $services->getService(
'_MediaWikiTitleCodec' );
1961 $services->getMainConfig()
1963 $services->getNamespaceInfo(),
1964 $services->getTitleParser(),
1970 return $services->getService(
'_UserBlockCommandFactory' );
1974 return $services->getService(
'_PageCommandFactory' );
1985 $config = $services->getMainConfig();
1987 UrlUtils::SERVER => $config->get( MainConfigNames::Server ),
1988 UrlUtils::CANONICAL_SERVER => $config->get( MainConfigNames::CanonicalServer ),
1989 UrlUtils::INTERNAL_SERVER => $config->get( MainConfigNames::InternalServer ),
1990 UrlUtils::FALLBACK_PROTOCOL => RequestContext::getMain()->getRequest()->getProtocol(),
1991 UrlUtils::HTTPS_PORT => $config->get( MainConfigNames::HttpsPort ),
1992 UrlUtils::VALID_PROTOCOLS => $config->get( MainConfigNames::UrlProtocols ),
1999 $services->getDBLoadBalancer(),
2000 $services->getLinkBatchFactory()
2006 $services->getActorMigration(),
2007 $services->getDBLoadBalancer(),
2008 $services->getJobQueueGroup()
2014 $services->getDBLoadBalancer(),
2015 $services->getUserNameUtils()
2020 return $services->getUserGroupManagerFactory()->getUserGroupManager();
2028 $services->getConfiguredReadOnlyMode(),
2029 $services->getDBLoadBalancerFactory(),
2030 $services->getHookContainer(),
2031 $services->getUserEditTracker(),
2032 $services->getGroupPermissionsLookup(),
2033 $services->getJobQueueGroupFactory(),
2035 $services->getTempUserConfig(),
2036 [ static function (
UserIdentity $user ) use ( $services ) {
2037 $services->getPermissionManager()->invalidateUsersRightsCache( $user );
2038 $services->getUserFactory()->newFromUserIdentity( $user )->invalidateCache();
2044 return $services->getActorStoreFactory()->getUserIdentityLookup();
2049 $services->getDBLoadBalancer(),
2050 $services->getUserNameUtils()
2058 UserNameUtils::CONSTRUCTOR_OPTIONS, $services->getMainConfig()
2060 $services->getContentLanguage(),
2061 LoggerFactory::getInstance(
'UserNameUtils' ),
2062 $services->getTitleParser(),
2063 $messageFormatterFactory->getTextFormatter(
2064 $services->getContentLanguage()->getCode()
2066 $services->getHookContainer(),
2067 $services->getTempUserConfig()
2072 return $services->getUserOptionsManager();
2078 $services->get(
'_DefaultOptionsLookup' ),
2079 $services->getLanguageConverterFactory(),
2080 $services->getDBLoadBalancer(),
2082 $services->getHookContainer(),
2083 $services->getUserFactory(),
2084 $services->getContentLanguage()
2088 'VirtualRESTServiceClient' =>
2090 $config = $services->getMainConfig()->get(
MainConfigNames::VirtualRestConfig );
2093 $services->getHttpRequestFactory()->createMultiClient() );
2094 foreach ( $config[
'paths'] as $prefix => $serviceConfig ) {
2095 $class = $serviceConfig[
'class'];
2097 $constructArg = $serviceConfig[
'options'] ?? [];
2098 $constructArg += $config[
'global'];
2100 $vrsClient->mount( $prefix, [
'class' => $class,
'config' => $constructArg ] );
2106 'WatchedItemQueryService' =>
2109 $services->getDBLoadBalancer(),
2110 $services->getCommentStore(),
2111 $services->getWatchedItemStore(),
2112 $services->getHookContainer(),
2113 $services->getUserOptionsLookup(),
2115 $services->getMainConfig()->get(
MainConfigNames::MaxExecutionTimeForExpensiveQueries )
2122 $services->getMainConfig() ),
2123 $services->getDBLoadBalancerFactory(),
2124 $services->getJobQueueGroup(),
2125 $services->getMainObjectStash(),
2127 $services->getReadOnlyMode(),
2128 $services->getNamespaceInfo(),
2129 $services->getRevisionLookup(),
2130 $services->getLinkBatchFactory()
2134 if ( $services->getMainConfig()->get( MainConfigNames::ReadOnlyWatchedItemStore ) ) {
2145 $services->getMainConfig()
2147 $services->getHookContainer(),
2148 $services->getReadOnlyMode(),
2149 $services->getRevisionLookup(),
2150 $services->getTalkPageNotificationManager(),
2151 $services->getWatchedItemStore(),
2152 $services->getUserFactory(),
2153 $services->getNamespaceInfo(),
2154 $services->getWikiPageFactory()
2160 $services->getHookContainer(),
2161 $services->getRevisionStore(),
2162 $services->getTitleParser()
2168 $services->getMainConfig(),
2169 $services->getHookContainer(),
2170 $services->getContentLanguage(),
2171 $services->getNamespaceInfo(),
2172 $services->getTitleFactory(),
2173 $services->getWikiPageFactory(),
2174 $services->getWikiRevisionUploadImporter(),
2175 $services->getPermissionManager(),
2176 $services->getContentHandlerFactory(),
2177 $services->getSlotRoleRegistry()
2183 $services->getTitleFactory(),
2184 new
HookRunner( $services->getHookContainer() ),
2185 $services->getDBLoadBalancer()
2189 'WikiRevisionOldRevisionImporterNoUpdates' =>
2194 $services->getDBLoadBalancer(),
2195 $services->getRevisionStore(),
2196 $services->getSlotRoleRegistry(),
2197 $services->getWikiPageFactory(),
2198 $services->getPageUpdaterFactory(),
2199 $services->getUserFactory()
2214 $services->getContentLanguage(),
2215 $services->getHookContainer(),
2216 $services->getNamespaceInfo()
2228 $services->getMainConfig()
2233 $services->getPermissionManager(),
2236 $services->getHookContainer(),
2239 $services->getReadOnlyMode(),
2242 $services->getSpamChecker()
2248 $services->getContentLanguage(),
2249 $services->getGenderCache(),
2251 $services->getInterwikiLookup(),
2252 $services->getNamespaceInfo()
2258 $services->getMainConfig(),
2259 $services->getDBLoadBalancerFactory(),
2260 $services->getNamespaceInfo(),
2261 $services->getWatchedItemStore(),
2262 $services->getRepoGroup(),
2263 $services->getReadOnlyMode(),
2264 $services->getContentHandlerFactory(),
2265 $services->getRevisionStore(),
2266 $services->getSpamChecker(),
2267 $services->getTitleFormatter(),
2268 $services->getHookContainer(),
2269 $services->getWikiPageFactory(),
2270 $services->getUserFactory(),
2271 $services->getActorMigration(),
2272 $services->getActorNormalization(),
2273 $services->getTitleFactory(),
2274 $services->getUserEditTracker(),
2275 $services->getCollationFactory(),
2276 $services->getJobQueueGroup(),
2277 $services->getCommentStore(),
2278 $services->getMainObjectStash(),
2279 WikiMap::getCurrentWikiDbDomain()->getId(),
2281 $services->getBacklinkCacheFactory(),
2283 $services->getPageUpdaterFactory(),
2284 $services->getMessageFormatterFactory()->getTextFormatter(
2285 $services->getContentLanguage()->getCode()
2287 $services->getArchivedRevisionLookup(),
2288 $services->getRestrictionStore()
2298 $services->getParsoidSiteConfig(),
2299 $services->getParsoidDataAccess()
2304 return $services->getBlobStoreFactory()->newSqlBlobStore();
2310 $services->getHookContainer(),
2311 $services->getBlockPermissionCheckerFactory(),
2312 $services->getBlockUtils(),
2313 $services->getDatabaseBlockStore(),
2314 $services->getBlockRestrictionStore(),
2315 $services->getUserFactory(),
2316 $services->getUserEditTracker(),
2318 $services->getTitleFactory(),
2319 $services->getBlockActionInfo()
wfWarn( $msg, $callerOffset=1, $level=E_USER_NOTICE)
Send a warning either to the debug log or in a PHP error depending on $wgDevelopmentWarnings.
wfShellExec( $cmd, &$retval=null, $environ=[], $limits=[], $options=[])
Execute a shell command, with time and memory limits mirrored from the PHP configuration if supported...
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
return[ 'ActionFactory'=> static function(MediaWikiServices $services):ActionFactory { return new ActionFactory($services->getMainConfig() ->get(MainConfigNames::Actions), LoggerFactory::getInstance( 'ActionFactory'), $services->getObjectFactory(), $services->getHookContainer());}, 'ActorMigration'=> static function(MediaWikiServices $services):ActorMigration { return new ActorMigration(SCHEMA_COMPAT_NEW, $services->getActorStoreFactory());}, 'ActorNormalization'=> static function(MediaWikiServices $services):ActorNormalization { return $services->getActorStoreFactory() ->getActorNormalization();}, 'ActorStore'=> static function(MediaWikiServices $services):ActorStore { return $services->getActorStoreFactory() ->getActorStore();}, 'ActorStoreFactory'=> static function(MediaWikiServices $services):ActorStoreFactory { return new ActorStoreFactory(new ServiceOptions(ActorStoreFactory::CONSTRUCTOR_OPTIONS, $services->getMainConfig()), $services->getDBLoadBalancerFactory(), $services->getUserNameUtils(), LoggerFactory::getInstance( 'ActorStore'));}, 'ArchivedRevisionLookup'=> static function(MediaWikiServices $services):ArchivedRevisionLookup { return new ArchivedRevisionLookup($services->getDBLoadBalancer(), $services->getRevisionStore());}, 'AuthManager'=> static function(MediaWikiServices $services):AuthManager { $authManager=new AuthManager(RequestContext::getMain() ->getRequest(), $services->getMainConfig(), $services->getObjectFactory(), $services->getHookContainer(), $services->getReadOnlyMode(), $services->getUserNameUtils(), $services->getBlockManager(), $services->getWatchlistManager(), $services->getDBLoadBalancer(), $services->getContentLanguage(), $services->getLanguageConverterFactory(), $services->getBotPasswordStore(), $services->getUserFactory(), $services->getUserIdentityLookup(), $services->getUserOptionsManager());$authManager->setLogger(LoggerFactory::getInstance( 'authentication'));return $authManager;}, 'BacklinkCacheFactory'=> static function(MediaWikiServices $services):BacklinkCacheFactory { return new BacklinkCacheFactory( $services->getMainWANObjectCache());}, 'BadFileLookup'=> static function(MediaWikiServices $services):BadFileLookup { return new BadFileLookup(static function() { return wfMessage( 'bad_image_list') ->inContentLanguage() ->plain();}, $services->getLocalServerObjectCache(), $services->getRepoGroup(), $services->getTitleParser(), $services->getHookContainer());}, 'BlobStore'=> static function(MediaWikiServices $services):BlobStore { return $services->getService( '_SqlBlobStore');}, 'BlobStoreFactory'=> static function(MediaWikiServices $services):BlobStoreFactory { return new BlobStoreFactory($services->getDBLoadBalancerFactory(), $services->getExternalStoreAccess(), $services->getMainWANObjectCache(), new ServiceOptions(BlobStoreFactory::CONSTRUCTOR_OPTIONS, $services->getMainConfig()));}, 'BlockActionInfo'=> static function(MediaWikiServices $services):BlockActionInfo { return new BlockActionInfo( $services->getHookContainer());}, 'BlockErrorFormatter'=> static function(MediaWikiServices $services):BlockErrorFormatter { return new BlockErrorFormatter($services->getTitleFormatter());}, 'BlockManager'=> static function(MediaWikiServices $services):BlockManager { return new BlockManager(new ServiceOptions(BlockManager::CONSTRUCTOR_OPTIONS, $services->getMainConfig()), $services->getPermissionManager(), $services->getUserFactory(), LoggerFactory::getInstance( 'BlockManager'), $services->getHookContainer());}, 'BlockPermissionCheckerFactory'=> static function(MediaWikiServices $services):BlockPermissionCheckerFactory { return new BlockPermissionCheckerFactory(new ServiceOptions(BlockPermissionCheckerFactory::CONSTRUCTOR_OPTIONS, $services->getMainConfig()), $services->getBlockUtils());}, 'BlockRestrictionStore'=> static function(MediaWikiServices $services):BlockRestrictionStore { return $services->getBlockRestrictionStoreFactory() ->getBlockRestrictionStore(WikiAwareEntity::LOCAL);}, 'BlockRestrictionStoreFactory'=> static function(MediaWikiServices $services):BlockRestrictionStoreFactory { return new BlockRestrictionStoreFactory($services->getDBLoadBalancerFactory());}, 'BlockUserFactory'=> static function(MediaWikiServices $services):BlockUserFactory { return $services->getService( '_UserBlockCommandFactory');}, 'BlockUtils'=> static function(MediaWikiServices $services):BlockUtils { return new BlockUtils(new ServiceOptions(BlockUtils::CONSTRUCTOR_OPTIONS, $services->getMainConfig()), $services->getUserIdentityLookup(), $services->getUserNameUtils());}, 'BotPasswordStore'=> static function(MediaWikiServices $services):BotPasswordStore { return new BotPasswordStore(new ServiceOptions(BotPasswordStore::CONSTRUCTOR_OPTIONS, $services->getMainConfig()), $services->getCentralIdLookup(), $services->getDBLoadBalancerFactory());}, 'CentralIdLookup'=> static function(MediaWikiServices $services):CentralIdLookup { return $services->getCentralIdLookupFactory() ->getLookup();}, 'CentralIdLookupFactory'=> static function(MediaWikiServices $services):CentralIdLookupFactory { return new CentralIdLookupFactory(new ServiceOptions(CentralIdLookupFactory::CONSTRUCTOR_OPTIONS, $services->getMainConfig()), $services->getObjectFactory(), $services->getUserIdentityLookup());}, 'ChangeTagDefStore'=> static function(MediaWikiServices $services):NameTableStore { return $services->getNameTableStoreFactory() ->getChangeTagDef();}, 'CollationFactory'=> static function(MediaWikiServices $services):CollationFactory { return new CollationFactory(new ServiceOptions(CollationFactory::CONSTRUCTOR_OPTIONS, $services->getMainConfig()), $services->getObjectFactory(), $services->getHookContainer());}, 'CommentFormatter'=> static function(MediaWikiServices $services):CommentFormatter { $linkRenderer=$services->getLinkRendererFactory() ->create([ 'renderForComment'=> true]);$parserFactory=new CommentParserFactory($linkRenderer, $services->getLinkBatchFactory(), $services->getLinkCache(), $services->getRepoGroup(), RequestContext::getMain() ->getLanguage(), $services->getContentLanguage(), $services->getTitleParser(), $services->getNamespaceInfo(), $services->getHookContainer());return new CommentFormatter( $parserFactory);}, 'CommentStore'=> static function(MediaWikiServices $services):CommentStore { return new CommentStore($services->getContentLanguage(), MIGRATION_NEW);}, 'ConfigFactory'=> static function(MediaWikiServices $services):ConfigFactory { $registry=$services->getBootstrapConfig() ->get(MainConfigNames::ConfigRegistry);$factory=new ConfigFactory();foreach( $registry as $name=> $callback) { $factory->register( $name, $callback);} return $factory;}, 'ConfigRepository'=> static function(MediaWikiServices $services):ConfigRepository { return new ConfigRepository( $services->getConfigFactory());}, 'ConfigSchema'=> static function(MediaWikiServices $services):ConfigSchema { global $wgSettings;return $wgSettings->getConfigSchema();}, 'ConfiguredReadOnlyMode'=> static function(MediaWikiServices $services):ConfiguredReadOnlyMode { $config=$services->getMainConfig();return new ConfiguredReadOnlyMode($config->get(MainConfigNames::ReadOnly), $config->get(MainConfigNames::ReadOnlyFile));}, 'ContentHandlerFactory'=> static function(MediaWikiServices $services):IContentHandlerFactory { $contentHandlerConfig=$services->getMainConfig() ->get(MainConfigNames::ContentHandlers);return new ContentHandlerFactory($contentHandlerConfig, $services->getObjectFactory(), $services->getHookContainer(), LoggerFactory::getInstance( 'ContentHandler'));}, 'ContentLanguage'=> static function(MediaWikiServices $services):Language { return $services->getLanguageFactory() ->getLanguage($services->getMainConfig() ->get(MainConfigNames::LanguageCode));}, 'ContentModelChangeFactory'=> static function(MediaWikiServices $services):ContentModelChangeFactory { return $services->getService( '_PageCommandFactory');}, 'ContentModelStore'=> static function(MediaWikiServices $services):NameTableStore { return $services->getNameTableStoreFactory() ->getContentModels();}, 'ContentRenderer'=> static function(MediaWikiServices $services):ContentRenderer { return new ContentRenderer( $services->getContentHandlerFactory());}, 'ContentTransformer'=> static function(MediaWikiServices $services):ContentTransformer { return new ContentTransformer( $services->getContentHandlerFactory());}, 'ContributionsLookup'=> static function(MediaWikiServices $services):ContributionsLookup { return new ContributionsLookup($services->getRevisionStore(), $services->getLinkRendererFactory(), $services->getLinkBatchFactory(), $services->getHookContainer(), $services->getDBLoadBalancer(), $services->getActorMigration(), $services->getNamespaceInfo(), $services->getCommentFormatter());}, 'CriticalSectionProvider'=> static function(MediaWikiServices $services):CriticalSectionProvider { $config=$services->getMainConfig();$limit=$GLOBALS[ 'wgCommandLineMode'] ? INF :$config->get(MainConfigNames::CriticalSectionTimeLimit);return RequestTimeout::singleton() ->createCriticalSectionProvider( $limit);}, 'CryptHKDF'=> static function(MediaWikiServices $services):CryptHKDF { $config=$services->getMainConfig();$secret=$config->get(MainConfigNames::HKDFSecret) ?:$config->get(MainConfigNames::SecretKey);if(! $secret) { throw new RuntimeException("Cannot use MWCryptHKDF without a secret.");} $context=[microtime(), getmypid(), gethostname()];$cache=$services->getLocalServerObjectCache();if( $cache instanceof EmptyBagOStuff) { $cache=ObjectCache::getLocalClusterInstance();} return new CryptHKDF( $secret, $config->get(MainConfigNames::HKDFAlgorithm), $cache, $context);}, 'DatabaseBlockStore'=> static function(MediaWikiServices $services):DatabaseBlockStore { return new DatabaseBlockStore(new ServiceOptions(DatabaseBlockStore::CONSTRUCTOR_OPTIONS, $services->getMainConfig()), LoggerFactory::getInstance( 'DatabaseBlockStore'), $services->getActorStoreFactory(), $services->getBlockRestrictionStore(), $services->getCommentStore(), $services->getHookContainer(), $services->getDBLoadBalancer(), $services->getReadOnlyMode(), $services->getUserFactory());}, 'DatabaseFactory'=> static function(MediaWikiServices $services):DatabaseFactory { return new DatabaseFactory();}, 'DateFormatterFactory'=> static function(MediaWikiServices $services):DateFormatterFactory { return new DateFormatterFactory();}, 'DBLoadBalancer'=> static function(MediaWikiServices $services):Wikimedia\Rdbms\ILoadBalancer { return $services->getDBLoadBalancerFactory() ->getMainLB();}, 'DBLoadBalancerFactory'=> static function(MediaWikiServices $services):Wikimedia\Rdbms\LBFactory { $mainConfig=$services->getMainConfig();$lbFactoryConfigBuilder=$services->getDBLoadBalancerFactoryConfigBuilder();$lbConf=$lbFactoryConfigBuilder->applyDefaultConfig($mainConfig->get(MainConfigNames::LBFactoryConf));$class=$lbFactoryConfigBuilder->getLBFactoryClass( $lbConf);$instance=new $class( $lbConf);$lbFactoryConfigBuilder->setDomainAliases( $instance);$lbFactoryConfigBuilder->applyGlobalState($instance, $mainConfig, $services->getStatsdDataFactory());return $instance;}, 'DBLoadBalancerFactoryConfigBuilder'=> static function(MediaWikiServices $services):MWLBFactory { $cpStashType=$services->getMainConfig() ->get(MainConfigNames::ChronologyProtectorStash);if(is_string( $cpStashType)) { $cpStash=ObjectCache::getInstance( $cpStashType);} else { try { $cpStash=ObjectCache::getLocalClusterInstance();} catch(RecursiveServiceDependencyException $e) { $cpStash=new EmptyBagOStuff();} } try { $wanCache=$services->getMainWANObjectCache();} catch(RecursiveServiceDependencyException $e) { $wanCache=WANObjectCache::newEmpty();} $srvCache=$services->getLocalServerObjectCache();if( $srvCache instanceof EmptyBagOStuff) { $srvCache=new HashBagOStuff([ 'maxKeys'=> 100]);} return new MWLBFactory(new ServiceOptions(MWLBFactory::APPLY_DEFAULT_CONFIG_OPTIONS, $services->getMainConfig()), $services->getConfiguredReadOnlyMode(), $cpStash, $srvCache, $wanCache, $services->getCriticalSectionProvider(), $services->getStatsdDataFactory(), $services->getDatabaseFactory());}, 'DeletePageFactory'=> static function(MediaWikiServices $services):DeletePageFactory { return $services->getService( '_PageCommandFactory');}, 'Emailer'=> static function(MediaWikiServices $services):IEmailer { return new Emailer();}, 'EventRelayerGroup'=> static function(MediaWikiServices $services):EventRelayerGroup { return new EventRelayerGroup( $services->getMainConfig() ->get(MainConfigNames::EventRelayerConfig));}, 'ExternalStoreAccess'=> static function(MediaWikiServices $services):ExternalStoreAccess { return new ExternalStoreAccess($services->getExternalStoreFactory(), LoggerFactory::getInstance( 'ExternalStore'));}, 'ExternalStoreFactory'=> static function(MediaWikiServices $services):ExternalStoreFactory { $config=$services->getMainConfig();$writeStores=$config->get(MainConfigNames::DefaultExternalStore);return new ExternalStoreFactory($config->get(MainConfigNames::ExternalStores),( $writeStores !==false) ?(array) $writeStores :[], $services->getDBLoadBalancer() ->getLocalDomainID(), LoggerFactory::getInstance( 'ExternalStore'));}, 'FileBackendGroup'=> static function(MediaWikiServices $services):FileBackendGroup { $mainConfig=$services->getMainConfig();$ld=WikiMap::getCurrentWikiDbDomain();$fallbackWikiId=WikiMap::getWikiIdFromDbDomain( $ld);$legacyDomainId=strlen( $ld->getTablePrefix()) ? "{$ld->getDatabase()}-{$ld->getTablePrefix()}" :$ld->getDatabase();if( $ld->getSchema() !==null && $legacyDomainId !==$fallbackWikiId) { wfWarn("Legacy default 'domainId' is '$legacyDomainId' but wiki ID is '$fallbackWikiId'.");} $cache=$services->getLocalServerObjectCache();if( $cache instanceof EmptyBagOStuff) { $cache=new HashBagOStuff();} return new FileBackendGroup(new ServiceOptions(FileBackendGroup::CONSTRUCTOR_OPTIONS, $mainConfig, [ 'fallbackWikiId'=> $fallbackWikiId]), $services->getConfiguredReadOnlyMode(), $cache, $services->getMainWANObjectCache(), $services->getMimeAnalyzer(), $services->getLockManagerGroupFactory(), $services->getTempFSFileFactory(), $services->getObjectFactory());}, 'GenderCache'=> static function(MediaWikiServices $services):GenderCache { $nsInfo=$services->getNamespaceInfo();$dbLoadBalancer=$services->isServiceDisabled( 'DBLoadBalancer') ? null :$services->getDBLoadBalancer();return new GenderCache( $nsInfo, $dbLoadBalancer, $services->get( '_DefaultOptionsLookup'));}, 'GlobalIdGenerator'=> static function(MediaWikiServices $services):GlobalIdGenerator { $mainConfig=$services->getMainConfig();return new GlobalIdGenerator($mainConfig->get(MainConfigNames::TmpDirectory), static function( $command) { return wfShellExec( $command);});}, 'GrantsInfo'=> static function(MediaWikiServices $services):GrantsInfo { return new GrantsInfo(new ServiceOptions(GrantsInfo::CONSTRUCTOR_OPTIONS, $services->getMainConfig()));}, 'GrantsLocalization'=> static function(MediaWikiServices $services):GrantsLocalization { return new GrantsLocalization($services->getGrantsInfo(), $services->getLinkRenderer(), $services->getLanguageFactory(), $services->getContentLanguage());}, 'GroupPermissionsLookup'=> static function(MediaWikiServices $services):GroupPermissionsLookup { return new GroupPermissionsLookup(new ServiceOptions(GroupPermissionsLookup::CONSTRUCTOR_OPTIONS, $services->getMainConfig()));}, 'HookContainer'=> static function(MediaWikiServices $services):HookContainer { $extRegistry=ExtensionRegistry::getInstance();$extDeprecatedHooks=$extRegistry->getAttribute( 'DeprecatedHooks');$deprecatedHooks=new DeprecatedHooks( $extDeprecatedHooks);$hookRegistry=new GlobalHookRegistry( $extRegistry, $deprecatedHooks);return new HookContainer($hookRegistry, $services->getObjectFactory());}, 'HtmlCacheUpdater'=> static function(MediaWikiServices $services):HtmlCacheUpdater { $config=$services->getMainConfig();return new HtmlCacheUpdater($services->getHookContainer(), $services->getTitleFactory(), $config->get(MainConfigNames::CdnReboundPurgeDelay), $config->get(MainConfigNames::UseFileCache), $config->get(MainConfigNames::CdnMaxAge));}, 'HTMLTransformFactory'=> static function(MediaWikiServices $services):HTMLTransformFactory { return new HTMLTransformFactory($services->getService( '_Parsoid'), $services->getMainConfig() ->get(MainConfigNames::ParsoidSettings), $services->getParsoidPageConfigFactory());}, 'HttpRequestFactory'=> static function(MediaWikiServices $services):HttpRequestFactory { return new HttpRequestFactory(new ServiceOptions(HttpRequestFactory::CONSTRUCTOR_OPTIONS, $services->getMainConfig()), LoggerFactory::getInstance( 'http'));}, 'InterwikiLookup'=> static function(MediaWikiServices $services):InterwikiLookup { $config=$services->getMainConfig();return new ClassicInterwikiLookup($services->getContentLanguage(), $services->getMainWANObjectCache(), $services->getHookContainer(), $services->getDBLoadBalancer(), $config->get(MainConfigNames::InterwikiExpiry), $config->get(MainConfigNames::InterwikiCache), $config->get(MainConfigNames::InterwikiScopes), $config->get(MainConfigNames::InterwikiFallbackSite));}, 'JobQueueGroup'=> static function(MediaWikiServices $services):JobQueueGroup { return $services->getJobQueueGroupFactory() ->makeJobQueueGroup();}, 'JobQueueGroupFactory'=> static function(MediaWikiServices $services):JobQueueGroupFactory { return new JobQueueGroupFactory(new ServiceOptions(JobQueueGroupFactory::CONSTRUCTOR_OPTIONS, $services->getMainConfig()), $services->getConfiguredReadOnlyMode(), $services->getStatsdDataFactory(), $services->getMainWANObjectCache(), $services->getGlobalIdGenerator());}, 'JobRunner'=> static function(MediaWikiServices $services):JobRunner { return new JobRunner(new ServiceOptions(JobRunner::CONSTRUCTOR_OPTIONS, $services->getMainConfig()), $services->getDBLoadBalancerFactory(), $services->getJobQueueGroup(), $services->getReadOnlyMode(), $services->getLinkCache(), $services->getStatsdDataFactory(), LoggerFactory::getInstance( 'runJobs'));}, 'JsonCodec'=> static function(MediaWikiServices $services):JsonCodec { return new JsonCodec();}, 'LanguageConverterFactory'=> static function(MediaWikiServices $services):LanguageConverterFactory { $usePigLatinVariant=$services->getMainConfig() ->get(MainConfigNames::UsePigLatinVariant);$isConversionDisabled=$services->getMainConfig() ->get(MainConfigNames::DisableLangConversion);$isTitleConversionDisabled=$services->getMainConfig() ->get(MainConfigNames::DisableTitleConversion);return new LanguageConverterFactory($services->getObjectFactory(), $usePigLatinVariant, $isConversionDisabled, $isTitleConversionDisabled, static function() use( $services) { return $services->getContentLanguage();});}, 'LanguageFactory'=> static function(MediaWikiServices $services):LanguageFactory { return new LanguageFactory(new ServiceOptions(LanguageFactory::CONSTRUCTOR_OPTIONS, $services->getMainConfig()), $services->getNamespaceInfo(), $services->getLocalisationCache(), $services->getLanguageNameUtils(), $services->getLanguageFallback(), $services->getLanguageConverterFactory(), $services->getHookContainer(), $services->getMainConfig());}, 'LanguageFallback'=> static function(MediaWikiServices $services):LanguageFallback { return new LanguageFallback($services->getMainConfig() ->get(MainConfigNames::LanguageCode), $services->getLocalisationCache(), $services->getLanguageNameUtils());}, 'LanguageNameUtils'=> static function(MediaWikiServices $services):LanguageNameUtils { return new LanguageNameUtils(new ServiceOptions(LanguageNameUtils::CONSTRUCTOR_OPTIONS, $services->getMainConfig()), $services->getHookContainer());}, 'LinkBatchFactory'=> static function(MediaWikiServices $services):LinkBatchFactory { return new LinkBatchFactory($services->getLinkCache(), $services->getTitleFormatter(), $services->getContentLanguage(), $services->getGenderCache(), $services->getDBLoadBalancer(), $services->getLinksMigration(), LoggerFactory::getInstance( 'LinkBatch'));}, 'LinkCache'=> static function(MediaWikiServices $services):LinkCache { $dbLoadBalancer=$services->isServiceDisabled( 'DBLoadBalancer') ? null :$services->getDBLoadBalancer();$linkCache=new LinkCache($services->getTitleFormatter(), $services->getMainWANObjectCache(), $services->getNamespaceInfo(), $dbLoadBalancer);$linkCache->setLogger(LoggerFactory::getInstance( 'LinkCache'));return $linkCache;}, 'LinkRenderer'=> static function(MediaWikiServices $services):LinkRenderer { return $services->getLinkRendererFactory() ->create();}, 'LinkRendererFactory'=> static function(MediaWikiServices $services):LinkRendererFactory { return new LinkRendererFactory($services->getTitleFormatter(), $services->getLinkCache(), $services->getSpecialPageFactory(), $services->getHookContainer());}, 'LinksMigration'=> static function(MediaWikiServices $services):LinksMigration { return new LinksMigration($services->getMainConfig(), $services->getLinkTargetLookup());}, 'LinkTargetLookup'=> static function(MediaWikiServices $services):LinkTargetLookup { return new LinkTargetStore($services->getDBLoadBalancer(), $services->getLocalServerObjectCache(), $services->getMainWANObjectCache());}, 'LocalisationCache'=> static function(MediaWikiServices $services):LocalisationCache { $conf=$services->getMainConfig() ->get(MainConfigNames::LocalisationCacheConf);$logger=LoggerFactory::getInstance( 'localisation');$store=LocalisationCache::getStoreFromConf($conf, $services->getMainConfig() ->get(MainConfigNames::CacheDirectory));$logger->debug( 'LocalisationCache using store ' . get_class( $store));return new $conf['class'](new ServiceOptions(LocalisationCache::CONSTRUCTOR_OPTIONS, $conf, ['forceRecache'=> false, 'manualRecache'=> false,], $services->getMainConfig()), $store, $logger, [static function() use( $services) { MessageBlobStore::clearGlobalCacheEntry( $services->getMainWANObjectCache());}], $services->getLanguageNameUtils(), $services->getHookContainer());}, 'LocalServerObjectCache'=> static function(MediaWikiServices $services):BagOStuff { return ObjectCache::makeLocalServerCache();}, 'LockManagerGroupFactory'=> static function(MediaWikiServices $services):LockManagerGroupFactory { return new LockManagerGroupFactory(WikiMap::getCurrentWikiDbDomain() ->getId(), $services->getMainConfig() ->get(MainConfigNames::LockManagers));}, 'MagicWordFactory'=> static function(MediaWikiServices $services):MagicWordFactory { return new MagicWordFactory($services->getContentLanguage(), $services->getHookContainer());}, 'MainConfig'=> static function(MediaWikiServices $services):Config { return $services->getConfigFactory() ->makeConfig( 'main');}, 'MainObjectStash'=> static function(MediaWikiServices $services):BagOStuff { $mainConfig=$services->getMainConfig();$id=$mainConfig->get(MainConfigNames::MainStash);$params=$mainConfig->get(MainConfigNames::ObjectCaches)[$id] ?? null;if(! $params) { throw new UnexpectedValueException("\$wgObjectCaches must have \"$id\" set (via \$wgMainStash)");} $params['stats']=$services->getStatsdDataFactory();$store=ObjectCache::newFromParams( $params, $mainConfig);$store->getLogger() ->debug( 'MainObjectStash using store {class}', ['class'=> get_class( $store)]);return $store;}, 'MainWANObjectCache'=> static function(MediaWikiServices $services):WANObjectCache { $mainConfig=$services->getMainConfig();$wanId=$mainConfig->get(MainConfigNames::MainWANCache);$wanParams=$mainConfig->get(MainConfigNames::WANObjectCaches)[$wanId] ?? null;if(! $wanParams) { throw new UnexpectedValueException("wgWANObjectCaches must have \"$wanId\" set (via wgMainWANCache)");} $cacheId=$wanParams['cacheId'];$wanClass=$wanParams['class'];unset( $wanParams['cacheId']);unset( $wanParams['class']);$storeParams=$mainConfig->get(MainConfigNames::ObjectCaches)[$cacheId] ?? null;if(! $storeParams) { throw new UnexpectedValueException("wgObjectCaches must have \"$cacheId\" set (via wgWANObjectCaches)");} $storeParams['stats']=$services->getStatsdDataFactory();$store=ObjectCache::newFromParams( $storeParams, $mainConfig);$logger=$store->getLogger();$logger->debug( 'MainWANObjectCache using store {class}', ['class'=> get_class( $store)]);$wanParams['cache']=$store;$wanParams['logger']=$logger;$wanParams['secret']=$wanParams['secret'] ?? $mainConfig->get(MainConfigNames::SecretKey);if(! $GLOBALS[ 'wgCommandLineMode']) { $wanParams['stats']=$services->getStatsdDataFactory();$wanParams['asyncHandler']=[DeferredUpdates::class, 'addCallableUpdate'];} $instance=new $wanClass( $wanParams);' @phan-var WANObjectCache $instance';return $instance;}, 'MediaHandlerFactory'=> static function(MediaWikiServices $services):MediaHandlerFactory { return new MediaHandlerFactory(LoggerFactory::getInstance( 'MediaHandlerFactory'), $services->getMainConfig() ->get(MainConfigNames::MediaHandlers));}, 'MergeHistoryFactory'=> static function(MediaWikiServices $services):MergeHistoryFactory { return $services->getService( '_PageCommandFactory');}, 'MessageCache'=> static function(MediaWikiServices $services):MessageCache { $mainConfig=$services->getMainConfig();$clusterCache=ObjectCache::getInstance( $mainConfig->get(MainConfigNames::MessageCacheType));$srvCache=$mainConfig->get(MainConfigNames::UseLocalMessageCache) ? $services->getLocalServerObjectCache() :new EmptyBagOStuff();$logger=LoggerFactory::getInstance( 'MessageCache');$logger->debug( 'MessageCache using store {class}', ['class'=> get_class( $clusterCache)]);$options=new ServiceOptions(MessageCache::CONSTRUCTOR_OPTIONS, $mainConfig);return new MessageCache($services->getMainWANObjectCache(), $clusterCache, $srvCache, $services->getContentLanguage(), $services->getLanguageConverterFactory(), $logger, $options, $services->getLanguageFactory(), $services->getLocalisationCache(), $services->getLanguageNameUtils(), $services->getLanguageFallback(), $services->getHookContainer());}, 'MessageFormatterFactory'=> static function(MediaWikiServices $services):IMessageFormatterFactory { return new MessageFormatterFactory();}, 'MetricsFactory'=> static function(MediaWikiServices $services):MetricsFactory { $config=$services->getMainConfig();return new MetricsFactory(['target'=> $config->get(MainConfigNames::MetricsTarget), 'format'=> $config->get(MainConfigNames::MetricsFormat), 'prefix'=> $config->get(MainConfigNames::MetricsPrefix),], LoggerFactory::getInstance( 'Metrics'));}, 'MimeAnalyzer'=> static function(MediaWikiServices $services):MimeAnalyzer { $logger=LoggerFactory::getInstance( 'Mime');$mainConfig=$services->getMainConfig();$hookRunner=new HookRunner( $services->getHookContainer());$params=['typeFile'=> $mainConfig->get(MainConfigNames::MimeTypeFile), 'infoFile'=> $mainConfig->get(MainConfigNames::MimeInfoFile), 'xmlTypes'=> $mainConfig->get(MainConfigNames::XMLMimeTypes), 'guessCallback'=> static function( $mimeAnalyzer, &$head, &$tail, $file, &$mime) use( $logger, $hookRunner) { $deja=new DjVuImage( $file);if( $deja->isValid()) { $logger->info("Detected $file as image/vnd.djvu\n");$mime='image/vnd.djvu';return;} $hookRunner->onMimeMagicGuessFromContent($mimeAnalyzer, $head, $tail, $file, $mime);}, 'extCallback'=> static function( $mimeAnalyzer, $ext, &$mime) use( $hookRunner) { $hookRunner->onMimeMagicImproveFromExtension( $mimeAnalyzer, $ext, $mime);}, 'initCallback'=> static function( $mimeAnalyzer) use( $hookRunner) { $hookRunner->onMimeMagicInit( $mimeAnalyzer);}, 'logger'=> $logger];if( $params['infoFile']==='includes/mime.info') { $params['infoFile']=MimeAnalyzer::USE_INTERNAL;} if( $params['typeFile']==='includes/mime.types') { $params['typeFile']=MimeAnalyzer::USE_INTERNAL;} $detectorCmd=$mainConfig->get(MainConfigNames::MimeDetectorCommand);if( $detectorCmd) { $factory=$services->getShellCommandFactory();$params['detectCallback']=static function( $file) use( $detectorCmd, $factory) { $result=$factory->create() ->unsafeParams( $detectorCmd) ->params( $file) ->execute();return $result->getStdout();};} return new MimeAnalyzer( $params);}, 'MovePageFactory'=> static function(MediaWikiServices $services):MovePageFactory { return $services->getService( '_PageCommandFactory');}, 'NamespaceInfo'=> static function(MediaWikiServices $services):NamespaceInfo { return new NamespaceInfo(new ServiceOptions(NamespaceInfo::CONSTRUCTOR_OPTIONS, $services->getMainConfig()), $services->getHookContainer());}, 'NameTableStoreFactory'=> static function(MediaWikiServices $services):NameTableStoreFactory { return new NameTableStoreFactory($services->getDBLoadBalancerFactory(), $services->getMainWANObjectCache(), LoggerFactory::getInstance( 'NameTableSqlStore'));}, 'ObjectFactory'=> static function(MediaWikiServices $services):ObjectFactory { return new ObjectFactory( $services);}, 'OldRevisionImporter'=> static function(MediaWikiServices $services):OldRevisionImporter { return new ImportableOldRevisionImporter(true, LoggerFactory::getInstance( 'OldRevisionImporter'), $services->getDBLoadBalancer(), $services->getRevisionStore(), $services->getSlotRoleRegistry(), $services->getWikiPageFactory(), $services->getPageUpdaterFactory(), $services->getUserFactory());}, 'PageEditStash'=> static function(MediaWikiServices $services):PageEditStash { $config=$services->getMainConfig();return new PageEditStash(ObjectCache::getLocalClusterInstance(), $services->getDBLoadBalancer(), LoggerFactory::getInstance( 'StashEdit'), $services->getStatsdDataFactory(), $services->getUserEditTracker(), $services->getUserFactory(), $services->getWikiPageFactory(), $services->getHookContainer(), defined( 'MEDIAWIKI_JOB_RUNNER')|| $GLOBALS[ 'wgCommandLineMode'] ? PageEditStash::INITIATOR_JOB_OR_CLI :PageEditStash::INITIATOR_USER);}, 'PageProps'=> static function(MediaWikiServices $services):PageProps { return new PageProps($services->getLinkBatchFactory(), $services->getDBLoadBalancer());}, 'PageStore'=> static function(MediaWikiServices $services):PageStore { return $services->getPageStoreFactory() ->getPageStore();}, 'PageStoreFactory'=> static function(MediaWikiServices $services):PageStoreFactory { $options=new ServiceOptions(PageStoreFactory::CONSTRUCTOR_OPTIONS, $services->getMainConfig());return new PageStoreFactory($options, $services->getDBLoadBalancerFactory(), $services->getNamespaceInfo(), $services->getTitleParser(), $services->getLinkCache(), $services->getStatsdDataFactory());}, 'PageUpdaterFactory'=> static function(MediaWikiServices $services):PageUpdaterFactory { $editResultCache=new EditResultCache($services->getMainObjectStash(), $services->getDBLoadBalancer(), new ServiceOptions(EditResultCache::CONSTRUCTOR_OPTIONS, $services->getMainConfig()));return new PageUpdaterFactory($services->getRevisionStore(), $services->getRevisionRenderer(), $services->getSlotRoleRegistry(), $services->getParserCache(), $services->getParsoidOutputAccess(), $services->getJobQueueGroup(), $services->getMessageCache(), $services->getContentLanguage(), $services->getDBLoadBalancerFactory(), $services->getContentHandlerFactory(), $services->getHookContainer(), $editResultCache, $services->getUserNameUtils(), LoggerFactory::getInstance( 'SavePage'), new ServiceOptions(PageUpdaterFactory::CONSTRUCTOR_OPTIONS, $services->getMainConfig()), $services->getUserEditTracker(), $services->getUserGroupManager(), $services->getTitleFormatter(), $services->getContentTransformer(), $services->getPageEditStash(), $services->getTalkPageNotificationManager(), $services->getMainWANObjectCache(), $services->getPermissionManager(), $services->getWikiPageFactory(), ChangeTags::getSoftwareTags());}, 'Parser'=> static function(MediaWikiServices $services):Parser { return $services->getParserFactory() ->getMainInstance();}, 'ParserCache'=> static function(MediaWikiServices $services):ParserCache { return $services->getParserCacheFactory() ->getParserCache(ParserCacheFactory::DEFAULT_NAME);}, 'ParserCacheFactory'=> static function(MediaWikiServices $services):ParserCacheFactory { $config=$services->getMainConfig();$cache=ObjectCache::getInstance( $config->get(MainConfigNames::ParserCacheType));$wanCache=$services->getMainWANObjectCache();$options=new ServiceOptions(ParserCacheFactory::CONSTRUCTOR_OPTIONS, $config);return new ParserCacheFactory($cache, $wanCache, $services->getHookContainer(), $services->getJsonCodec(), $services->getStatsdDataFactory(), LoggerFactory::getInstance( 'ParserCache'), $options, $services->getTitleFactory(), $services->getWikiPageFactory());}, 'ParserFactory'=> static function(MediaWikiServices $services):ParserFactory { $options=new ServiceOptions(Parser::CONSTRUCTOR_OPTIONS, $services->getMainConfig());return new ParserFactory($options, $services->getMagicWordFactory(), $services->getContentLanguage(), $services->getUrlUtils(), $services->getSpecialPageFactory(), $services->getLinkRendererFactory(), $services->getNamespaceInfo(), LoggerFactory::getInstance( 'Parser'), $services->getBadFileLookup(), $services->getLanguageConverterFactory(), $services->getHookContainer(), $services->getTidy(), $services->getMainWANObjectCache(), $services->getUserOptionsLookup(), $services->getUserFactory(), $services->getTitleFormatter(), $services->getHttpRequestFactory(), $services->getTrackingCategories(), $services->getSignatureValidatorFactory(), $services->getUserNameUtils());}, 'ParserOutputAccess'=> static function(MediaWikiServices $services):ParserOutputAccess { return new ParserOutputAccess($services->getParserCache(), $services->getParserCacheFactory() ->getRevisionOutputCache( 'rcache'), $services->getRevisionLookup(), $services->getRevisionRenderer(), $services->getStatsdDataFactory(), $services->getDBLoadBalancerFactory(), LoggerFactory::getProvider(), $services->getWikiPageFactory(), $services->getTitleFormatter());}, 'ParsoidDataAccess'=> static function(MediaWikiServices $services):DataAccess { $mainConfig=$services->getMainConfig();$parsoidSettings=$mainConfig->get(MainConfigNames::ParsoidSettings);if(!empty( $parsoidSettings['debugApi'])) { return ApiDataAccess::fromSettings( $parsoidSettings);} return new MWDataAccess(new ServiceOptions(MWDataAccess::CONSTRUCTOR_OPTIONS, $mainConfig), $services->getRepoGroup(), $services->getBadFileLookup(), $services->getHookContainer(), $services->getContentTransformer(), $services->getReadOnlyMode(), $services->getParserFactory());}, 'ParsoidOutputAccess'=> static function(MediaWikiServices $services):ParsoidOutputAccess { return new ParsoidOutputAccess(new ServiceOptions(ParsoidOutputAccess::CONSTRUCTOR_OPTIONS, $services->getMainConfig()), $services->getParserCacheFactory(), $services->getRevisionLookup(), $services->getGlobalIdGenerator(), $services->getStatsdDataFactory(), $services->getService( '_Parsoid'), $services->getParsoidSiteConfig(), $services->getParsoidPageConfigFactory());}, 'ParsoidOutputStash'=> static function(MediaWikiServices $services):ParsoidOutputStash { $config=$services->getMainConfig() ->get(MainConfigNames::ParsoidCacheConfig);$backend=$config['StashType'] ? ObjectCache::getInstance( $config['StashType']) :$services->getMainObjectStash();return new SimpleParsoidOutputStash( $backend, $config['StashDuration']);}, 'ParsoidPageConfigFactory'=> static function(MediaWikiServices $services):MWPageConfigFactory { return new MWPageConfigFactory( $services->getRevisionStore(), $services->getSlotRoleRegistry());}, 'ParsoidSiteConfig'=> static function(MediaWikiServices $services):SiteConfig { $mainConfig=$services->getMainConfig();$parsoidSettings=$mainConfig->get(MainConfigNames::ParsoidSettings);if(!empty( $parsoidSettings['debugApi'])) { return ApiSiteConfig::fromSettings( $parsoidSettings);} return new MWSiteConfig(new ServiceOptions(MWSiteConfig::CONSTRUCTOR_OPTIONS, $mainConfig), $parsoidSettings, $services->getObjectFactory(), $services->getContentLanguage(), $services->getStatsdDataFactory(), $services->getMagicWordFactory(), $services->getNamespaceInfo(), $services->getSpecialPageFactory(), $services->getInterwikiLookup(), $services->getUserOptionsLookup(), $services->getLanguageFactory(), $services->getLanguageConverterFactory(), $services->getLanguageNameUtils(), $services->getUrlUtils(), $services->getParser(), $mainConfig);}, 'PasswordFactory'=> static function(MediaWikiServices $services):PasswordFactory { $config=$services->getMainConfig();return new PasswordFactory($config->get(MainConfigNames::PasswordConfig), $config->get(MainConfigNames::PasswordDefault));}, 'PasswordReset'=> static function(MediaWikiServices $services):PasswordReset { $options=new ServiceOptions(PasswordReset::CONSTRUCTOR_OPTIONS, $services->getMainConfig());return new PasswordReset($options, LoggerFactory::getInstance( 'authentication'), $services->getAuthManager(), $services->getHookContainer(), $services->getDBLoadBalancer(), $services->getUserFactory(), $services->getUserNameUtils(), $services->getUserOptionsLookup());}, 'PerDbNameStatsdDataFactory'=> static function(MediaWikiServices $services):StatsdDataFactoryInterface { $config=$services->getMainConfig();$wiki=$config->get(MainConfigNames::DBname);return new PrefixingStatsdDataFactoryProxy($services->getStatsdDataFactory(), $wiki);}, 'PermissionManager'=> static function(MediaWikiServices $services):PermissionManager { return new PermissionManager(new ServiceOptions(PermissionManager::CONSTRUCTOR_OPTIONS, $services->getMainConfig()), $services->getSpecialPageFactory(), $services->getNamespaceInfo(), $services->getGroupPermissionsLookup(), $services->getUserGroupManager(), $services->getBlockErrorFormatter(), $services->getHookContainer(), $services->getUserCache(), $services->getRedirectLookup(), $services->getRestrictionStore(), $services->getTitleFormatter(), $services->getTempUserConfig(), $services->getUserFactory(), $services->getActionFactory());}, 'PreferencesFactory'=> static function(MediaWikiServices $services):PreferencesFactory { $factory=new DefaultPreferencesFactory(new ServiceOptions(DefaultPreferencesFactory::CONSTRUCTOR_OPTIONS, $services->getMainConfig()), $services->getContentLanguage(), $services->getAuthManager(), $services->getLinkRendererFactory() ->create(), $services->getNamespaceInfo(), $services->getPermissionManager(), $services->getLanguageConverterFactory() ->getLanguageConverter(), $services->getLanguageNameUtils(), $services->getHookContainer(), $services->getUserOptionsManager(), $services->getLanguageConverterFactory(), $services->getParser(), $services->getSkinFactory(), $services->getUserGroupManager(), $services->getSignatureValidatorFactory());$factory->setLogger(LoggerFactory::getInstance( 'preferences'));return $factory;}, 'ProxyLookup'=> static function(MediaWikiServices $services):ProxyLookup { $mainConfig=$services->getMainConfig();return new ProxyLookup($mainConfig->get(MainConfigNames::CdnServers), $mainConfig->get(MainConfigNames::CdnServersNoPurge), $services->getHookContainer());}, 'RateLimiter'=> static function(MediaWikiServices $services):RateLimiter { return new RateLimiter(new ServiceOptions(RateLimiter::CONSTRUCTOR_OPTIONS, $services->getMainConfig()), $services->getWRStatsFactory(), $services->getCentralIdLookupFactory() ->getNonLocalLookup(), $services->getUserFactory(), $services->getUserGroupManager(), $services->getHookContainer());}, 'ReadOnlyMode'=> static function(MediaWikiServices $services):ReadOnlyMode { return new ReadOnlyMode($services->getConfiguredReadOnlyMode(), $services->getDBLoadBalancer());}, 'RedirectLookup'=> static function(MediaWikiServices $services):RedirectLookup { return $services->getRedirectStore();}, 'RedirectStore'=> static function(MediaWikiServices $services):RedirectStore { return new RedirectStore( $services->getWikiPageFactory());}, 'RepoGroup'=> static function(MediaWikiServices $services):RepoGroup { $config=$services->getMainConfig();return new RepoGroup($config->get(MainConfigNames::LocalFileRepo), $config->get(MainConfigNames::ForeignFileRepos), $services->getMainWANObjectCache(), $services->getMimeAnalyzer());}, 'ResourceLoader'=> static function(MediaWikiServices $services):ResourceLoader { $config=$services->getMainConfig();$maxage=$config->get(MainConfigNames::ResourceLoaderMaxage);$rl=new ResourceLoader($config, LoggerFactory::getInstance( 'resourceloader'), $config->get(MainConfigNames::ResourceLoaderUseObjectCacheForDeps) ? new KeyValueDependencyStore( $services->getMainObjectStash()) :new SqlModuleDependencyStore( $services->getDBLoadBalancer()), ['loadScript'=> $config->get(MainConfigNames::LoadScript), 'maxageVersioned'=> $maxage['versioned'] ?? null, 'maxageUnversioned'=> $maxage['unversioned'] ?? null, 'useFileCache'=> $config->get(MainConfigNames::UseFileCache),]);$extRegistry=ExtensionRegistry::getInstance();$modules=$extRegistry->getAttribute( 'ResourceModules')+ $config->get(MainConfigNames::ResourceModules);$moduleSkinStyles=$extRegistry->getAttribute( 'ResourceModuleSkinStyles')+ $config->get(MainConfigNames::ResourceModuleSkinStyles);$rl->setModuleSkinStyles( $moduleSkinStyles);$rl->addSource( $config->get(MainConfigNames::ResourceLoaderSources));$baseDir=$config->get(MainConfigNames::BaseDirectory);$rl->register(include "$baseDir/resources/Resources.php");$rl->register( $modules);$hookRunner=new \MediaWiki\ResourceLoader\HookRunner( $services->getHookContainer());$hookRunner->onResourceLoaderRegisterModules( $rl);$msgPosterAttrib=$extRegistry->getAttribute( 'MessagePosterModule');$rl->register( 'mediawiki.messagePoster', ['localBasePath'=> $baseDir, 'debugRaw'=> false, 'scripts'=> array_merge(["resources/src/mediawiki.messagePoster/factory.js", "resources/src/mediawiki.messagePoster/MessagePoster.js", "resources/src/mediawiki.messagePoster/WikitextMessagePoster.js",], $msgPosterAttrib['scripts'] ??[]), 'dependencies'=> array_merge(['oojs', 'mediawiki.api', 'mediawiki.ForeignApi',], $msgPosterAttrib['dependencies'] ??[]), 'targets'=>[ 'desktop', 'mobile'],]);if( $config->get(MainConfigNames::EnableJavaScriptTest)===true) { $rl->registerTestModules();} return $rl;}, 'RestrictionStore'=> static function(MediaWikiServices $services):RestrictionStore { return new RestrictionStore(new ServiceOptions(RestrictionStore::CONSTRUCTOR_OPTIONS, $services->getMainConfig()), $services->getMainWANObjectCache(), $services->getDBLoadBalancer(), $services->getLinkCache(), $services->getLinksMigration(), $services->getCommentStore(), $services->getHookContainer(), $services->getPageStore());}, 'RevertedTagUpdateManager'=> static function(MediaWikiServices $services):RevertedTagUpdateManager { $editResultCache=new EditResultCache($services->getMainObjectStash(), $services->getDBLoadBalancer(), new ServiceOptions(EditResultCache::CONSTRUCTOR_OPTIONS, $services->getMainConfig()));return new RevertedTagUpdateManager($editResultCache, $services->getJobQueueGroup());}, 'RevisionFactory'=> static function(MediaWikiServices $services):RevisionFactory { return $services->getRevisionStore();}, 'RevisionLookup'=> static function(MediaWikiServices $services):RevisionLookup { return $services->getRevisionStore();}, 'RevisionRenderer'=> static function(MediaWikiServices $services):RevisionRenderer { $renderer=new RevisionRenderer($services->getDBLoadBalancer(), $services->getSlotRoleRegistry(), $services->getContentRenderer());$renderer->setLogger(LoggerFactory::getInstance( 'SaveParse'));return $renderer;}, 'RevisionStore'=> static function(MediaWikiServices $services):RevisionStore { return $services->getRevisionStoreFactory() ->getRevisionStore();}, 'RevisionStoreFactory'=> static function(MediaWikiServices $services):RevisionStoreFactory { return new RevisionStoreFactory($services->getDBLoadBalancerFactory(), $services->getBlobStoreFactory(), $services->getNameTableStoreFactory(), $services->getSlotRoleRegistry(), $services->getMainWANObjectCache(), $services->getLocalServerObjectCache(), $services->getCommentStore(), $services->getActorMigration(), $services->getActorStoreFactory(), LoggerFactory::getInstance( 'RevisionStore'), $services->getContentHandlerFactory(), $services->getPageStoreFactory(), $services->getTitleFactory(), $services->getHookContainer());}, 'RollbackPageFactory'=> static function(MediaWikiServices $services):RollbackPageFactory { return $services->get( '_PageCommandFactory');}, 'RowCommentFormatter'=> static function(MediaWikiServices $services):RowCommentFormatter { $parserFactory=new CommentParserFactory($services->getLinkRenderer(), $services->getLinkBatchFactory(), $services->getLinkCache(), $services->getRepoGroup(), RequestContext::getMain() ->getLanguage(), $services->getContentLanguage(), $services->getTitleParser(), $services->getNamespaceInfo(), $services->getHookContainer());return new RowCommentFormatter($parserFactory, $services->getCommentStore());}, 'SearchEngineConfig'=> static function(MediaWikiServices $services):SearchEngineConfig { return new SearchEngineConfig($services->getMainConfig(), $services->getContentLanguage(), $services->getHookContainer(), ExtensionRegistry::getInstance() ->getAttribute( 'SearchMappings'), $services->getUserOptionsLookup());}, 'SearchEngineFactory'=> static function(MediaWikiServices $services):SearchEngineFactory { return new SearchEngineFactory($services->getSearchEngineConfig(), $services->getHookContainer(), $services->getDBLoadBalancer());}, 'ShellboxClientFactory'=> static function(MediaWikiServices $services):ShellboxClientFactory { $urls=$services->getMainConfig() ->get(MainConfigNames::ShellboxUrls);$url=$services->getMainConfig() ->get(MainConfigNames::ShellboxUrl);if( $url !==null) { $urls['default']=$url;} return new ShellboxClientFactory($services->getHttpRequestFactory(), $urls, $services->getMainConfig() ->get(MainConfigNames::ShellboxSecretKey));}, 'ShellCommandFactory'=> static function(MediaWikiServices $services):CommandFactory { $config=$services->getMainConfig();$limits=['time'=> $config->get(MainConfigNames::MaxShellTime), 'walltime'=> $config->get(MainConfigNames::MaxShellWallClockTime), 'memory'=> $config->get(MainConfigNames::MaxShellMemory), 'filesize'=> $config->get(MainConfigNames::MaxShellFileSize),];$cgroup=$config->get(MainConfigNames::ShellCgroup);$restrictionMethod=$config->get(MainConfigNames::ShellRestrictionMethod);$factory=new CommandFactory( $services->getShellboxClientFactory(), $limits, $cgroup, $restrictionMethod);$factory->setLogger(LoggerFactory::getInstance( 'exec'));$factory->logStderr();return $factory;}, 'SignatureValidatorFactory'=> static function(MediaWikiServices $services):SignatureValidatorFactory { return new SignatureValidatorFactory(new ServiceOptions(SignatureValidator::CONSTRUCTOR_OPTIONS, $services->getMainConfig()), static function() use( $services) { return $services->getParserFactory();}, $services->getSpecialPageFactory(), $services->getTitleFactory());}, 'SiteLookup'=> static function(MediaWikiServices $services):SiteLookup { return $services->getSiteStore();}, 'SiteStore'=> static function(MediaWikiServices $services):SiteStore { $rawSiteStore=new DBSiteStore( $services->getDBLoadBalancer());$cache=$services->getLocalServerObjectCache();if( $cache instanceof EmptyBagOStuff) { $cache=ObjectCache::getLocalClusterInstance();} return new CachingSiteStore( $rawSiteStore, $cache);}, 'SkinFactory'=> static function(MediaWikiServices $services):SkinFactory { $factory=new SkinFactory($services->getObjectFactory(),(array) $services->getMainConfig() ->get(MainConfigNames::SkipSkins));$names=$services->getMainConfig() ->get(MainConfigNames::ValidSkinNames);foreach( $names as $name=> $skin) { if(is_array( $skin)) { $spec=$skin;$displayName=$skin['displayname'] ?? $name;$skippable=$skin['skippable'] ?? null;} else { $displayName=$skin;$skippable=null;$spec=['name'=> $name, 'class'=> "Skin$skin"];} $factory->register( $name, $displayName, $spec, $skippable);} $factory->register( 'fallback', 'Fallback', ['class'=> SkinFallback::class, 'args'=>[['name'=> 'fallback', 'styles'=>[ 'mediawiki.skinning.interface'], 'templateDirectory'=> __DIR__ . '/skins/templates/fallback',]]], true);$factory->register( 'apioutput', 'ApiOutput', ['class'=> SkinApi::class, 'args'=>[['name'=> 'apioutput', 'styles'=>[ 'mediawiki.skinning.interface'], 'templateDirectory'=> __DIR__ . '/skins/templates/apioutput',]]], true);return $factory;}, 'SlotRoleRegistry'=> static function(MediaWikiServices $services):SlotRoleRegistry { $registry=new SlotRoleRegistry($services->getSlotRoleStore());$config=$services->getMainConfig();$contentHandlerFactory=$services->getContentHandlerFactory();$hookContainer=$services->getHookContainer();$titleFactory=$services->getTitleFactory();$registry->defineRole('main', static function() use( $config, $contentHandlerFactory, $hookContainer, $titleFactory) { return new MainSlotRoleHandler($config->get(MainConfigNames::NamespaceContentModels), $contentHandlerFactory, $hookContainer, $titleFactory);});return $registry;}, 'SlotRoleStore'=> static function(MediaWikiServices $services):NameTableStore { return $services->getNameTableStoreFactory() ->getSlotRoles();}, 'SpamChecker'=> static function(MediaWikiServices $services):SpamChecker { return new SpamChecker((array) $services->getMainConfig() ->get(MainConfigNames::SpamRegex),(array) $services->getMainConfig() ->get(MainConfigNames::SummarySpamRegex));}, 'SpecialPageFactory'=> static function(MediaWikiServices $services):SpecialPageFactory { return new SpecialPageFactory(new ServiceOptions(SpecialPageFactory::CONSTRUCTOR_OPTIONS, $services->getMainConfig()), $services->getContentLanguage(), $services->getObjectFactory(), $services->getTitleFactory(), $services->getHookContainer());}, 'StatsdDataFactory'=> static function(MediaWikiServices $services):IBufferingStatsdDataFactory { return new BufferingStatsdDataFactory(rtrim( $services->getMainConfig() ->get(MainConfigNames::StatsdMetricPrefix), '.'));}, 'TalkPageNotificationManager'=> static function(MediaWikiServices $services):TalkPageNotificationManager { return new TalkPageNotificationManager(new ServiceOptions(TalkPageNotificationManager::CONSTRUCTOR_OPTIONS, $services->getMainConfig()), $services->getDBLoadBalancer(), $services->getReadOnlyMode(), $services->getRevisionLookup(), $services->getHookContainer(), $services->getUserFactory());}, 'TempFSFileFactory'=> static function(MediaWikiServices $services):TempFSFileFactory { return new TempFSFileFactory( $services->getMainConfig() ->get(MainConfigNames::TmpDirectory));}, 'TempUserConfig'=> static function(MediaWikiServices $services):RealTempUserConfig { return new RealTempUserConfig($services->getMainConfig() ->get(MainConfigNames::AutoCreateTempUser));}, 'TempUserCreator'=> static function(MediaWikiServices $services):TempUserCreator { $accountCreationThrottle=$services->getMainConfig() ->get(MainConfigNames::AccountCreationThrottle);if(!is_array( $accountCreationThrottle)) { $accountCreationThrottle=[['count'=> $accountCreationThrottle, 'seconds'=> 86400,]];} return new TempUserCreator($services->getTempUserConfig(), $services->getObjectFactory(), $services->getUserFactory(), $services->getAuthManager(), new Throttler($accountCreationThrottle, ['type'=> 'acctcreate', 'cache'=> $services->getLocalServerObjectCache()]));}, 'Tidy'=> static function(MediaWikiServices $services):TidyDriverBase { return new RemexDriver(new ServiceOptions(RemexDriver::CONSTRUCTOR_OPTIONS, $services->getMainConfig()));}, 'TitleFactory'=> static function(MediaWikiServices $services):TitleFactory { return new TitleFactory();}, 'TitleFormatter'=> static function(MediaWikiServices $services):TitleFormatter { return $services->getService( '_MediaWikiTitleCodec');}, 'TitleParser'=> static function(MediaWikiServices $services):TitleParser { return $services->getService( '_MediaWikiTitleCodec');}, 'TrackingCategories'=> static function(MediaWikiServices $services):TrackingCategories { return new TrackingCategories(new ServiceOptions(TrackingCategories::CONSTRUCTOR_OPTIONS, $services->getMainConfig()), $services->getNamespaceInfo(), $services->getTitleParser(), LoggerFactory::getInstance( 'TrackingCategories'));}, 'UnblockUserFactory'=> static function(MediaWikiServices $services):UnblockUserFactory { return $services->getService( '_UserBlockCommandFactory');}, 'UndeletePageFactory'=> static function(MediaWikiServices $services):UndeletePageFactory { return $services->getService( '_PageCommandFactory');}, 'UploadRevisionImporter'=> static function(MediaWikiServices $services):UploadRevisionImporter { return new ImportableUploadRevisionImporter($services->getMainConfig() ->get(MainConfigNames::EnableUploads), LoggerFactory::getInstance( 'UploadRevisionImporter'));}, 'UrlUtils'=> static function(MediaWikiServices $services):UrlUtils { $config=$services->getMainConfig();return new UrlUtils([UrlUtils::SERVER=> $config->get(MainConfigNames::Server), UrlUtils::CANONICAL_SERVER=> $config->get(MainConfigNames::CanonicalServer), UrlUtils::INTERNAL_SERVER=> $config->get(MainConfigNames::InternalServer), UrlUtils::FALLBACK_PROTOCOL=> RequestContext::getMain() ->getRequest() ->getProtocol(), UrlUtils::HTTPS_PORT=> $config->get(MainConfigNames::HttpsPort), UrlUtils::VALID_PROTOCOLS=> $config->get(MainConfigNames::UrlProtocols),]);}, 'UserCache'=> static function(MediaWikiServices $services):UserCache { return new UserCache(LoggerFactory::getInstance( 'UserCache'), $services->getDBLoadBalancer(), $services->getLinkBatchFactory());}, 'UserEditTracker'=> static function(MediaWikiServices $services):UserEditTracker { return new UserEditTracker($services->getActorMigration(), $services->getDBLoadBalancer(), $services->getJobQueueGroup());}, 'UserFactory'=> static function(MediaWikiServices $services):UserFactory { return new UserFactory($services->getDBLoadBalancer(), $services->getUserNameUtils());}, 'UserGroupManager'=> static function(MediaWikiServices $services):UserGroupManager { return $services->getUserGroupManagerFactory() ->getUserGroupManager();}, 'UserGroupManagerFactory'=> static function(MediaWikiServices $services):UserGroupManagerFactory { return new UserGroupManagerFactory(new ServiceOptions(UserGroupManager::CONSTRUCTOR_OPTIONS, $services->getMainConfig()), $services->getConfiguredReadOnlyMode(), $services->getDBLoadBalancerFactory(), $services->getHookContainer(), $services->getUserEditTracker(), $services->getGroupPermissionsLookup(), $services->getJobQueueGroupFactory(), LoggerFactory::getInstance( 'UserGroupManager'), $services->getTempUserConfig(), [static function(UserIdentity $user) use( $services) { $services->getPermissionManager() ->invalidateUsersRightsCache( $user);$services->getUserFactory() ->newFromUserIdentity( $user) ->invalidateCache();}]);}, 'UserIdentityLookup'=> static function(MediaWikiServices $services):UserIdentityLookup { return $services->getActorStoreFactory() ->getUserIdentityLookup();}, 'UserNamePrefixSearch'=> static function(MediaWikiServices $services):UserNamePrefixSearch { return new UserNamePrefixSearch($services->getDBLoadBalancer(), $services->getUserNameUtils());}, 'UserNameUtils'=> static function(MediaWikiServices $services):UserNameUtils { $messageFormatterFactory=new MessageFormatterFactory(Message::FORMAT_PLAIN);return new UserNameUtils(new ServiceOptions(UserNameUtils::CONSTRUCTOR_OPTIONS, $services->getMainConfig()), $services->getContentLanguage(), LoggerFactory::getInstance( 'UserNameUtils'), $services->getTitleParser(), $messageFormatterFactory->getTextFormatter($services->getContentLanguage() ->getCode()), $services->getHookContainer(), $services->getTempUserConfig());}, 'UserOptionsLookup'=> static function(MediaWikiServices $services):UserOptionsLookup { return $services->getUserOptionsManager();}, 'UserOptionsManager'=> static function(MediaWikiServices $services):UserOptionsManager { return new UserOptionsManager(new ServiceOptions(UserOptionsManager::CONSTRUCTOR_OPTIONS, $services->getMainConfig()), $services->get( '_DefaultOptionsLookup'), $services->getLanguageConverterFactory(), $services->getDBLoadBalancer(), LoggerFactory::getInstance( 'UserOptionsManager'), $services->getHookContainer(), $services->getUserFactory(), $services->getContentLanguage());}, 'VirtualRESTServiceClient'=> static function(MediaWikiServices $services):VirtualRESTServiceClient { $config=$services->getMainConfig() ->get(MainConfigNames::VirtualRestConfig);$vrsClient=new VirtualRESTServiceClient($services->getHttpRequestFactory() ->createMultiClient());foreach( $config['paths'] as $prefix=> $serviceConfig) { $class=$serviceConfig['class'];$constructArg=$serviceConfig['options'] ??[];$constructArg+=$config['global'];$vrsClient->mount( $prefix, [ 'class'=> $class, 'config'=> $constructArg]);} return $vrsClient;}, 'WatchedItemQueryService'=> static function(MediaWikiServices $services):WatchedItemQueryService { return new WatchedItemQueryService($services->getDBLoadBalancer(), $services->getCommentStore(), $services->getWatchedItemStore(), $services->getHookContainer(), $services->getUserOptionsLookup(), $services->getMainConfig() ->get(MainConfigNames::WatchlistExpiry), $services->getMainConfig() ->get(MainConfigNames::MaxExecutionTimeForExpensiveQueries));}, 'WatchedItemStore'=> static function(MediaWikiServices $services):WatchedItemStore { $store=new WatchedItemStore(new ServiceOptions(WatchedItemStore::CONSTRUCTOR_OPTIONS, $services->getMainConfig()), $services->getDBLoadBalancerFactory(), $services->getJobQueueGroup(), $services->getMainObjectStash(), new HashBagOStuff([ 'maxKeys'=> 100]), $services->getReadOnlyMode(), $services->getNamespaceInfo(), $services->getRevisionLookup(), $services->getLinkBatchFactory());$store->setStatsdDataFactory( $services->getStatsdDataFactory());if( $services->getMainConfig() ->get(MainConfigNames::ReadOnlyWatchedItemStore)) { $store=new NoWriteWatchedItemStore( $store);} return $store;}, 'WatchlistManager'=> static function(MediaWikiServices $services):WatchlistManager { return new WatchlistManager(new ServiceOptions(WatchlistManager::CONSTRUCTOR_OPTIONS, $services->getMainConfig()), $services->getHookContainer(), $services->getReadOnlyMode(), $services->getRevisionLookup(), $services->getTalkPageNotificationManager(), $services->getWatchedItemStore(), $services->getUserFactory(), $services->getNamespaceInfo(), $services->getWikiPageFactory());}, 'WikiExporterFactory'=> static function(MediaWikiServices $services):WikiExporterFactory { return new WikiExporterFactory($services->getHookContainer(), $services->getRevisionStore(), $services->getTitleParser());}, 'WikiImporterFactory'=> static function(MediaWikiServices $services):WikiImporterFactory { return new WikiImporterFactory($services->getMainConfig(), $services->getHookContainer(), $services->getContentLanguage(), $services->getNamespaceInfo(), $services->getTitleFactory(), $services->getWikiPageFactory(), $services->getWikiRevisionUploadImporter(), $services->getPermissionManager(), $services->getContentHandlerFactory(), $services->getSlotRoleRegistry());}, 'WikiPageFactory'=> static function(MediaWikiServices $services):WikiPageFactory { return new WikiPageFactory($services->getTitleFactory(), new HookRunner( $services->getHookContainer()), $services->getDBLoadBalancer());}, 'WikiRevisionOldRevisionImporterNoUpdates'=> static function(MediaWikiServices $services):ImportableOldRevisionImporter { return new ImportableOldRevisionImporter(false, LoggerFactory::getInstance( 'OldRevisionImporter'), $services->getDBLoadBalancer(), $services->getRevisionStore(), $services->getSlotRoleRegistry(), $services->getWikiPageFactory(), $services->getPageUpdaterFactory(), $services->getUserFactory());}, 'WRStatsFactory'=> static function(MediaWikiServices $services):WRStatsFactory { return new WRStatsFactory(new BagOStuffStatsStore(ObjectCache::getInstance( $services->getMainConfig() ->get(MainConfigNames::StatsCacheType))));}, '_DefaultOptionsLookup'=> static function(MediaWikiServices $services):DefaultOptionsLookup { return new DefaultOptionsLookup(new ServiceOptions(DefaultOptionsLookup::CONSTRUCTOR_OPTIONS, $services->getMainConfig()), $services->getContentLanguage(), $services->getHookContainer(), $services->getNamespaceInfo());}, '_EditConstraintFactory'=> static function(MediaWikiServices $services):EditConstraintFactory { return new EditConstraintFactory(new ServiceOptions(EditConstraintFactory::CONSTRUCTOR_OPTIONS, $services->getMainConfig()), LoggerFactory::getProvider(), $services->getPermissionManager(), $services->getHookContainer(), $services->getReadOnlyMode(), $services->getSpamChecker());}, '_MediaWikiTitleCodec'=> static function(MediaWikiServices $services):MediaWikiTitleCodec { return new MediaWikiTitleCodec($services->getContentLanguage(), $services->getGenderCache(), $services->getMainConfig() ->get(MainConfigNames::LocalInterwikis), $services->getInterwikiLookup(), $services->getNamespaceInfo());}, '_PageCommandFactory'=> static function(MediaWikiServices $services):PageCommandFactory { return new PageCommandFactory($services->getMainConfig(), $services->getDBLoadBalancerFactory(), $services->getNamespaceInfo(), $services->getWatchedItemStore(), $services->getRepoGroup(), $services->getReadOnlyMode(), $services->getContentHandlerFactory(), $services->getRevisionStore(), $services->getSpamChecker(), $services->getTitleFormatter(), $services->getHookContainer(), $services->getWikiPageFactory(), $services->getUserFactory(), $services->getActorMigration(), $services->getActorNormalization(), $services->getTitleFactory(), $services->getUserEditTracker(), $services->getCollationFactory(), $services->getJobQueueGroup(), $services->getCommentStore(), $services->getMainObjectStash(), WikiMap::getCurrentWikiDbDomain() ->getId(), WebRequest::getRequestId(), $services->getBacklinkCacheFactory(), LoggerFactory::getInstance( 'UndeletePage'), $services->getPageUpdaterFactory(), $services->getMessageFormatterFactory() ->getTextFormatter($services->getContentLanguage() ->getCode()), $services->getArchivedRevisionLookup(), $services->getRestrictionStore());}, '_ParserObserver'=> static function(MediaWikiServices $services):ParserObserver { return new ParserObserver(LoggerFactory::getInstance( 'DuplicateParse'));}, '_Parsoid'=> static function(MediaWikiServices $services):Parsoid { return new Parsoid($services->getParsoidSiteConfig(), $services->getParsoidDataAccess());}, '_SqlBlobStore'=> static function(MediaWikiServices $services):SqlBlobStore { return $services->getBlobStoreFactory() ->newSqlBlobStore();}, '_UserBlockCommandFactory'=> static function(MediaWikiServices $services):UserBlockCommandFactory { return new UserBlockCommandFactory(new ServiceOptions(UserBlockCommandFactory::CONSTRUCTOR_OPTIONS, $services->getMainConfig()), $services->getHookContainer(), $services->getBlockPermissionCheckerFactory(), $services->getBlockUtils(), $services->getDatabaseBlockStore(), $services->getBlockRestrictionStore(), $services->getUserFactory(), $services->getUserEditTracker(), LoggerFactory::getInstance( 'BlockManager'), $services->getTitleFactory(), $services->getBlockActionInfo());},]
@phpcs-require-sorted-array
This is not intended to be a long-term part of MediaWiki; it will be deprecated and removed once acto...
Class representing a cache/ephemeral data store.
get( $key, $flags=0)
Get an item.
MediaWiki adaption of StatsdDataFactory that provides buffering and metric prefixing.
The CentralIdLookup service allows for connecting local users with cluster-wide IDs.
Factory class to create Config objects.
Support for detecting/validating DjVu image files and getting some basic file metadata (resolution et...
A BagOStuff object with no objects in it.
Factory class for spawning EventRelayer objects using configuration.
The Registry loads JSON files, and uses a Processor to extract information from them.
This is the main interface for fetching or inserting objects with ExternalStore.
Class to handle file backend registration.
Caches user genders when needed to use correct namespace aliases.
Simple store for keeping values in an associative array for the current process.
Class to invalidate the CDN and HTMLFileCache entries associated with URLs/titles.
Class to handle enqueueing of background jobs.
Job queue runner utility methods.
Methods for dealing with language codes.
Base class for language-specific code.
Cache for article titles (prefixed DB keys) and ids linked from one source.
Caching for the contents of localisation files.
static getStoreFromConf(array $conf, $fallbackCacheDir)
Return a suitable LCStore as specified by the given configuration.
MediaWiki-specific class for generating database load balancers.
A factory that stores information about MagicWords, and creates them on demand with caching.
A service to render content.
A service to transform content.
Constraints reflect possible errors that need to be checked.
Service to check if text (either content or a summary) qualifies as spam.
A class containing constants representing the names of configuration variables.
Implementation of various page action services.
Service for getting rendered output of a given page.
Service for storing and retreiving page redirect information.
Service for creating WikiPage objects.
Helper class used by MediaWiki to create Parsoid PageConfig objects.
A SlotRoleHandler for the main slot.
Factory for handling the special page list and generating SpecialPage objects.
Manage the pre-emptive page parsing for edits to wiki pages.
A factory for PageUpdater instances.
Manages user talk page notifications.
Cache messages that are defined by MediaWiki-namespace pages or by hooks.
The Message class deals with fetching and processing of interface message into a variety of formats.
This is a utility class for dealing with namespaces that encodes all the "magic" behaviors of them ba...
Functions to get cache objects.
static newFromParams(array $params, Config $conf=null)
Create a new cache object from parameters.
static getInstance( $id)
Get a cached instance of the specified type of cache object.
static getLocalClusterInstance()
Get the main cluster-local cache object.
Gives access to properties of a page.
Cache for ParserOutput objects corresponding to the latest page revisions.
PHP Parser - Processes wiki markup (which uses a more user-friendly syntax, such as "[[link]]" for ma...
Factory class for creating and checking Password objects.
Helper class for the password reset functionality shared by the web UI and the API.
Proxy to prefix metric keys sent to a StatsdDataFactoryInterface.
A service class for fetching the wiki's current read-only mode.
Prioritized list of file repositories.
Group all the pieces relevant to the context of a request into one instance.
Configuration handling class for SearchEngine.
Factory class for SearchEngine.
Factory class to create Skin objects.
register( $name, $displayName, $spec, bool $skippable=null)
Register a new skin.
This class performs some operations related to tracking categories, such as creating a list of all su...
Virtual HTTP service client loosely styled after a Virtual File System.
Multi-datacenter aware caching interface.
get( $key, &$curTTL=null, array $checkKeys=[], &$info=[])
Fetch the value of a key from cache.
static newEmpty()
Get an instance that wraps EmptyBagOStuff.
Storage layer class for WatchedItems.
setStatsdDataFactory(StatsdDataFactoryInterface $stats)
The WebRequest class encapsulates getting at data passed in the URL or via a POSTed form stripping il...
Factory service for WikiImporter instances.
Helper tools for dealing with other locally-hosted wikis.
static getWikiIdFromDbDomain( $domain)
Get the wiki ID of a database domain.
static getCurrentWikiDbDomain()
Interface for configuration instances.
MediaWiki adaptation of StatsdDataFactory that provides buffering functionality.
Service for changing the content model of wiki pages.
Service for page delete actions.
Service for mergehistory actions.
Service for page rename actions.
Service for resolving a wiki page redirect.
Service for page rollback actions.
Service for page undelete actions.
A title parser service for MediaWiki.
if(PHP_SAPI !='cli-server') if(!isset( $_SERVER['SCRIPT_FILENAME'])) $file
Item class for a filearchive table row.
if(!is_readable( $file)) $ext