47use Liuggio\StatsdClient\Factory\StatsdDataFactoryInterface;
152use Wikimedia\ObjectFactory;
153use Wikimedia\RequestTimeout\CriticalSectionProvider;
154use Wikimedia\RequestTimeout\RequestTimeout;
155use Wikimedia\Services\RecursiveServiceDependencyException;
162 $services->getMainConfig()->get(
'Actions' ),
164 $services->getObjectFactory(),
165 $services->getHookContainer()
171 $services->getMainConfig()->get(
'ActorTableSchemaMigrationStage' ),
172 $services->getActorStoreFactory()
177 return $services->getActorStoreFactory()->getActorNormalization();
181 return $services->getActorStoreFactory()->getActorStore();
187 $services->getDBLoadBalancerFactory(),
188 $services->getUserNameUtils(),
196 $services->getMainConfig(),
197 $services->getObjectFactory(),
198 $services->getHookContainer(),
199 $services->getReadOnlyMode(),
200 $services->getUserNameUtils(),
201 $services->getBlockManager(),
202 $services->getWatchlistManager(),
203 $services->getDBLoadBalancer(),
204 $services->getContentLanguage(),
205 $services->getLanguageConverterFactory(),
206 $services->getBotPasswordStore(),
207 $services->getUserFactory(),
208 $services->getUserIdentityLookup(),
209 $services->getUserOptionsManager()
211 $authManager->
setLogger( LoggerFactory::getInstance(
'authentication' ) );
222 return wfMessage(
'bad_image_list' )->inContentLanguage()->plain();
224 $services->getLocalServerObjectCache(),
225 $services->getRepoGroup(),
226 $services->getTitleParser(),
227 $services->getHookContainer()
232 return $services->getService(
'_SqlBlobStore' );
237 $services->getDBLoadBalancerFactory(),
238 $services->getExternalStoreAccess(),
239 $services->getMainWANObjectCache(),
241 $services->getMainConfig() )
251 $services->getTitleFormatter()
259 $services->getMainConfig()
261 $services->getPermissionManager(),
262 $services->getUserFactory(),
264 $services->getHookContainer()
268 'BlockPermissionCheckerFactory' =>
static function (
274 $services->getMainConfig()
276 $services->getBlockUtils()
282 $services->getDBLoadBalancer()
287 return $services->getService(
'_UserBlockCommandFactory' );
294 $services->getMainConfig()
296 $services->getUserIdentityLookup(),
297 $services->getUserNameUtils()
305 $services->getMainConfig()
307 $services->getCentralIdLookup(),
308 $services->getDBLoadBalancerFactory()
313 return $services->getCentralIdLookupFactory()->getLookup();
319 $services->getObjectFactory(),
320 $services->getUserIdentityLookup()
325 return $services->getNameTableStoreFactory()->getChangeTagDef();
332 $services->getObjectFactory(),
333 $services->getHookContainer()
339 $services->getContentLanguage(),
346 $registry = $services->getBootstrapConfig()->get(
'ConfigRegistry' );
349 foreach ( $registry as $name => $callback ) {
350 $factory->register( $name, $callback );
360 $config = $services->getMainConfig();
362 $config->get(
'ReadOnly' ),
363 $config->get(
'ReadOnlyFile' )
368 $contentHandlerConfig = $services->getMainConfig()->get(
'ContentHandlers' );
371 $contentHandlerConfig,
372 $services->getObjectFactory(),
373 $services->getHookContainer(),
374 LoggerFactory::getInstance(
'ContentHandler' )
379 return $services->getLanguageFactory()->getLanguage(
380 $services->getMainConfig()->get(
'LanguageCode' ) );
384 return $services->getService(
'_PageCommandFactory' );
388 return $services->getNameTableStoreFactory()->getContentModels();
397 $services->getRevisionStore(),
398 $services->getLinkRendererFactory(),
399 $services->getLinkBatchFactory(),
400 $services->getHookContainer(),
401 $services->getDBLoadBalancer(),
402 $services->getActorMigration(),
403 $services->getNamespaceInfo()
407 'CriticalSectionProvider' =>
static function (
MediaWikiServices $services ): CriticalSectionProvider {
408 $config = $services->getMainConfig();
409 $limit = $config->get(
'CommandLineMode' ) ? INF : $config->get(
'CriticalSectionTimeLimit' );
410 return RequestTimeout::singleton()->createCriticalSectionProvider( $limit );
414 $config = $services->getMainConfig();
416 $secret = $config->get(
'HKDFSecret' ) ?: $config->get(
'SecretKey' );
418 throw new RuntimeException(
"Cannot use MWCryptHKDF without a secret." );
423 $context = [ microtime(), getmypid(), gethostname() ];
426 $cache = $services->getLocalServerObjectCache();
431 return new CryptHKDF( $secret, $config->get(
'HKDFAlgorithm' ),
$cache, $context );
438 $services->getMainConfig()
441 $services->getActorStoreFactory(),
442 $services->getBlockRestrictionStore(),
443 $services->getCommentStore(),
444 $services->getHookContainer(),
445 $services->getDBLoadBalancer(),
446 $services->getReadOnlyMode(),
447 $services->getUserFactory()
457 return $services->getDBLoadBalancerFactory()->getMainLB();
460 'DBLoadBalancerFactory' =>
462 $mainConfig = $services->getMainConfig();
464 $cpStashType = $mainConfig->get(
'ChronologyProtectorStash' );
465 if ( is_string( $cpStashType ) ) {
470 }
catch ( RecursiveServiceDependencyException $e ) {
474 LoggerFactory::getInstance(
'DBReplication' )->debug(
475 'ChronologyProtector using store {class}',
476 [
'class' => get_class( $cpStash ) ]
480 $wanCache = $services->getMainWANObjectCache();
481 }
catch ( RecursiveServiceDependencyException $e ) {
485 $srvCache = $services->getLocalServerObjectCache();
492 $mainConfig->get(
'LBFactoryConf' ),
494 $services->getConfiguredReadOnlyMode(),
498 $services->getCriticalSectionProvider()
502 $instance =
new $class( $lbConf );
513 $services->getStatsdDataFactory()
520 return $services->getService(
'_PageCommandFactory' );
533 $services->getExternalStoreFactory(),
539 $config = $services->getMainConfig();
540 $writeStores = $config->get(
'DefaultExternalStore' );
543 $config->get(
'ExternalStores' ),
544 ( $writeStores !==
false ) ? (array)$writeStores : [],
545 $services->getDBLoadBalancer()->getLocalDomainID(),
551 $mainConfig = $services->getMainConfig();
558 $legacyDomainId = strlen( $ld->getTablePrefix() )
559 ?
"{$ld->getDatabase()}-{$ld->getTablePrefix()}"
560 : $ld->getDatabase();
561 if ( $ld->getSchema() !==
null && $legacyDomainId !== $fallbackWikiId ) {
563 "Legacy default 'domainId' is '$legacyDomainId' but wiki ID is '$fallbackWikiId'."
567 $cache = $services->getLocalServerObjectCache();
573 new ServiceOptions( FileBackendGroup::CONSTRUCTOR_OPTIONS, $mainConfig,
574 [
'fallbackWikiId' => $fallbackWikiId ] ),
575 $services->getConfiguredReadOnlyMode(),
577 $services->getMainWANObjectCache(),
578 $services->getMimeAnalyzer(),
579 $services->getLockManagerGroupFactory(),
580 $services->getTempFSFileFactory(),
581 $services->getObjectFactory()
586 $nsInfo = $services->getNamespaceInfo();
588 $dbLoadBalancer = $services->isServiceDisabled(
'DBLoadBalancer' )
590 : $services->getDBLoadBalancer();
591 return new GenderCache( $nsInfo, $dbLoadBalancer, $services->get(
'_DefaultOptionsLookup' ) );
595 $mainConfig = $services->getMainConfig();
598 $mainConfig->get(
'TmpDirectory' ),
613 $extDeprecatedHooks = $extRegistry->
getAttribute(
'DeprecatedHooks' );
618 $services->getObjectFactory()
623 $config = $services->getMainConfig();
626 $services->getHookContainer(),
627 $services->getTitleFactory(),
628 $config->get(
'CdnReboundPurgeDelay' ),
629 $config->get(
'UseFileCache' ),
630 $config->get(
'CdnMaxAge' )
634 'HttpRequestFactory' =>
639 $services->getMainConfig()
646 $config = $services->getMainConfig();
648 $services->getContentLanguage(),
649 $services->getMainWANObjectCache(),
650 $services->getHookContainer(),
651 $services->getDBLoadBalancer(),
652 $config->get(
'InterwikiExpiry' ),
653 $config->get(
'InterwikiCache' ),
654 $config->get(
'InterwikiScopes' ),
655 $config->get(
'InterwikiFallbackSite' )
660 return $services->getJobQueueGroupFactory()->makeJobQueueGroup();
666 $services->getConfiguredReadOnlyMode(),
667 $services->getStatsdDataFactory(),
668 $services->getMainWANObjectCache(),
669 $services->getGlobalIdGenerator()
676 $services->getDBLoadBalancerFactory(),
677 $services->getJobQueueGroup(),
678 $services->getReadOnlyMode(),
679 $services->getLinkCache(),
680 $services->getStatsdDataFactory(),
690 $usePigLatinVariant = $services->getMainConfig()->get(
'UsePigLatinVariant' );
691 $isConversionDisabled = $services->getMainConfig()->get(
'DisableLangConversion' );
692 $isTitleConversionDisabled = $services->getMainConfig()->get(
'DisableTitleConversion' );
695 $isConversionDisabled,
696 $isTitleConversionDisabled,
697 static function () use ( $services ) {
698 return $services->getContentLanguage();
706 $services->getLocalisationCache(),
707 $services->getLanguageNameUtils(),
708 $services->getLanguageFallback(),
709 $services->getLanguageConverterFactory(),
710 $services->getHookContainer()
716 $services->getMainConfig()->get(
'LanguageCode' ),
717 $services->getLocalisationCache(),
718 $services->getLanguageNameUtils()
726 $services->getMainConfig()
728 $services->getHookContainer()
734 $services->getLinkCache(),
735 $services->getTitleFormatter(),
736 $services->getContentLanguage(),
737 $services->getGenderCache(),
738 $services->getDBLoadBalancer()
744 $dbLoadBalancer = $services->isServiceDisabled(
'DBLoadBalancer' )
746 : $services->getDBLoadBalancer();
748 $services->getTitleFormatter(),
749 $services->getMainWANObjectCache(),
750 $services->getNamespaceInfo(),
753 $linkCache->setLogger( LoggerFactory::getInstance(
'LinkCache' ) );
758 return $services->getLinkRendererFactory()->create();
763 $services->getTitleFormatter(),
764 $services->getLinkCache(),
765 $services->getNamespaceInfo(),
766 $services->getSpecialPageFactory(),
767 $services->getHookContainer()
772 $conf = $services->getMainConfig()->get(
'LocalisationCacheConf' );
774 $logger = LoggerFactory::getInstance(
'localisation' );
777 $conf, $services->getMainConfig()->get(
'CacheDirectory' ) );
778 $logger->debug(
'LocalisationCache using store ' . get_class( $store ) );
780 return new $conf[
'class'](
782 LocalisationCache::CONSTRUCTOR_OPTIONS,
787 'forceRecache' =>
false,
788 'manualRecache' =>
false,
791 $services->getMainConfig()
795 [
static function () use ( $services ) {
801 $services->getLanguageNameUtils(),
802 $services->getHookContainer()
812 WikiMap::getCurrentWikiDbDomain()->getId(),
813 $services->getMainConfig()->get(
'LockManagers' ),
814 $services->getDBLoadBalancerFactory()
820 $services->getContentLanguage(),
821 $services->getHookContainer()
827 return $services->getConfigFactory()->makeConfig(
'main' );
831 $mainConfig = $services->getMainConfig();
833 $id = $mainConfig->
get(
'MainStash' );
834 if ( !isset( $mainConfig->get(
'ObjectCaches' )[$id] ) ) {
835 throw new UnexpectedValueException(
836 "Cache type \"$id\" is not present in \$wgObjectCaches." );
839 $params = $mainConfig->get(
'ObjectCaches' )[$id];
840 $params[
'stats'] = $services->getStatsdDataFactory();
843 $store->getLogger()->debug(
'MainObjectStash using store {class}', [
844 'class' => get_class( $store )
851 $mainConfig = $services->getMainConfig();
853 $wanId = $mainConfig->
get(
'MainWANCache' );
854 $wanParams = $mainConfig->get(
'WANObjectCaches' )[$wanId] ??
null;
856 throw new UnexpectedValueException(
857 "wgWANObjectCaches must have \"$wanId\" set (via wgMainWANCache)"
861 $cacheId = $wanParams[
'cacheId'];
862 $wanClass = $wanParams[
'class'];
863 unset( $wanParams[
'cacheId'] );
864 unset( $wanParams[
'class'] );
866 $storeParams = $mainConfig->get(
'ObjectCaches' )[$cacheId] ??
null;
867 if ( !$storeParams ) {
868 throw new UnexpectedValueException(
869 "wgObjectCaches must have \"$cacheId\" set (via wgWANObjectCaches)"
872 $storeParams[
'stats'] = $services->getStatsdDataFactory();
874 $logger = $store->getLogger();
875 $logger->debug(
'MainWANObjectCache using store {class}', [
876 'class' => get_class( $store )
879 $wanParams[
'cache'] = $store;
880 $wanParams[
'logger'] = $logger;
881 $wanParams[
'secret'] = $wanParams[
'secret'] ?? $mainConfig->get(
'SecretKey' );
882 if ( !$mainConfig->get(
'CommandLineMode' ) ) {
884 $wanParams[
'stats'] = $services->getStatsdDataFactory();
886 $wanParams[
'asyncHandler'] = [ DeferredUpdates::class,
'addCallableUpdate' ];
889 $instance =
new $wanClass( $wanParams );
891 '@phan-var WANObjectCache $instance';
898 $services->getMainConfig()->get(
'MediaHandlers' )
903 return $services->getService(
'_PageCommandFactory' );
907 $mainConfig = $services->getMainConfig();
909 $srvCache = $mainConfig->get(
'UseLocalMessageCache' )
910 ? $services->getLocalServerObjectCache()
913 $logger = LoggerFactory::getInstance(
'MessageCache' );
914 $logger->debug(
'MessageCache using store {class}', [
915 'class' => get_class( $clusterCache )
919 $services->getMainWANObjectCache(),
922 $services->getContentLanguage(),
923 $services->getLanguageConverterFactory()->getLanguageConverter(),
925 [
'useDB' => $mainConfig->get(
'UseDatabaseMessages' ) ],
926 $services->getLanguageFactory(),
927 $services->getLocalisationCache(),
928 $services->getLanguageNameUtils(),
929 $services->getLanguageFallback(),
930 $services->getHookContainer()
938 'MimeAnalyzer' =>
static function (
MediaWikiServices $services ): MimeAnalyzer {
940 $mainConfig = $services->getMainConfig();
941 $hookRunner =
new HookRunner( $services->getHookContainer() );
943 'typeFile' => $mainConfig->get(
'MimeTypeFile' ),
944 'infoFile' => $mainConfig->get(
'MimeInfoFile' ),
945 'xmlTypes' => $mainConfig->get(
'XMLMimeTypes' ),
947 static function ( $mimeAnalyzer, &$head, &$tail,
$file, &
$mime )
948 use ( $logger, $hookRunner ) {
951 if ( $deja->isValid() ) {
952 $logger->info(
"Detected $file as image/vnd.djvu\n" );
953 $mime =
'image/vnd.djvu';
958 $hookRunner->onMimeMagicGuessFromContent(
961 'extCallback' =>
static function ( $mimeAnalyzer,
$ext, &
$mime ) use ( $hookRunner ) {
963 $hookRunner->onMimeMagicImproveFromExtension( $mimeAnalyzer,
$ext,
$mime );
965 'initCallback' =>
static function ( $mimeAnalyzer ) use ( $hookRunner ) {
967 $hookRunner->onMimeMagicInit( $mimeAnalyzer );
972 if ( $params[
'infoFile'] ===
'includes/mime.info' ) {
973 $params[
'infoFile'] = MimeAnalyzer::USE_INTERNAL;
976 if ( $params[
'typeFile'] ===
'includes/mime.types' ) {
977 $params[
'typeFile'] = MimeAnalyzer::USE_INTERNAL;
980 $detectorCmd = $mainConfig->get(
'MimeDetectorCommand' );
981 if ( $detectorCmd ) {
982 $factory = $services->getShellCommandFactory();
983 $params[
'detectCallback'] =
static function (
$file ) use ( $detectorCmd, $factory ) {
984 $result = $factory->create()
986 ->unsafeParams( $detectorCmd )
989 return $result->getStdout();
993 return new MimeAnalyzer( $params );
997 return $services->getService(
'_PageCommandFactory' );
1003 $services->getHookContainer()
1009 $services->getDBLoadBalancerFactory(),
1010 $services->getMainWANObjectCache(),
1015 'ObjectFactory' =>
static function (
MediaWikiServices $services ): ObjectFactory {
1016 return new ObjectFactory( $services );
1023 $services->getDBLoadBalancer(),
1024 $services->getRevisionStore(),
1025 $services->getSlotRoleRegistry(),
1026 $services->getWikiPageFactory()
1031 $config = $services->getMainConfig();
1034 ObjectCache::getLocalClusterInstance(),
1035 $services->getDBLoadBalancer(),
1036 LoggerFactory::getInstance(
'StashEdit' ),
1037 $services->getStatsdDataFactory(),
1038 $services->getUserEditTracker(),
1039 $services->getUserFactory(),
1040 $services->getHookContainer(),
1041 defined(
'MEDIAWIKI_JOB_RUNNER' ) || $config->get(
'CommandLineMode' )
1042 ? PageEditStash::INITIATOR_JOB_OR_CLI
1049 $services->getLinkBatchFactory(),
1050 $services->getDBLoadBalancer()
1055 return $services->getPageStoreFactory()->getPageStore();
1061 $services->getMainConfig()
1066 $services->getDBLoadBalancerFactory(),
1067 $services->getNamespaceInfo(),
1068 $services->getTitleParser(),
1069 $services->getLinkCache(),
1070 $services->getStatsdDataFactory()
1074 'PageUpdaterFactory' =>
static function (
1078 $services->getMainObjectStash(),
1079 $services->getDBLoadBalancer(),
1082 $services->getMainConfig()
1087 $services->getRevisionStore(),
1088 $services->getRevisionRenderer(),
1089 $services->getSlotRoleRegistry(),
1090 $services->getParserCache(),
1091 $services->getJobQueueGroup(),
1092 $services->getMessageCache(),
1093 $services->getContentLanguage(),
1094 $services->getDBLoadBalancerFactory(),
1095 $services->getContentHandlerFactory(),
1096 $services->getHookContainer(),
1098 $services->getUserNameUtils(),
1099 LoggerFactory::getInstance(
'SavePage' ),
1101 PageUpdaterFactory::CONSTRUCTOR_OPTIONS,
1102 $services->getMainConfig()
1104 $services->getUserEditTracker(),
1105 $services->getUserGroupManager(),
1106 $services->getTitleFormatter(),
1107 $services->getContentTransformer(),
1108 $services->getPageEditStash(),
1109 $services->getTalkPageNotificationManager(),
1110 $services->getMainWANObjectCache(),
1111 $services->getPermissionManager(),
1117 return $services->getParserFactory()->create();
1121 return $services->getParserCacheFactory()
1126 $config = $services->getMainConfig();
1128 $wanCache = $services->getMainWANObjectCache();
1130 $options =
new ServiceOptions( ParserCacheFactory::CONSTRUCTOR_OPTIONS, $config );
1135 $services->getHookContainer(),
1136 $services->getJsonCodec(),
1137 $services->getStatsdDataFactory(),
1138 LoggerFactory::getInstance(
'ParserCache' ),
1140 $services->getTitleFactory(),
1141 $services->getWikiPageFactory()
1147 $services->getMainConfig()
1152 $services->getMagicWordFactory(),
1153 $services->getContentLanguage(),
1155 $services->getSpecialPageFactory(),
1156 $services->getLinkRendererFactory(),
1157 $services->getNamespaceInfo(),
1158 LoggerFactory::getInstance(
'Parser' ),
1159 $services->getBadFileLookup(),
1160 $services->getLanguageConverterFactory(),
1161 $services->getHookContainer(),
1162 $services->getTidy(),
1163 $services->getMainWANObjectCache(),
1164 $services->getUserOptionsLookup(),
1165 $services->getUserFactory(),
1166 $services->getTitleFormatter(),
1167 $services->getHttpRequestFactory()
1173 $services->getParserCache(),
1174 $services->getParserCacheFactory()->getRevisionOutputCache(
'rcache' ),
1175 $services->getRevisionLookup(),
1176 $services->getRevisionRenderer(),
1177 $services->getStatsdDataFactory(),
1178 $services->getDBLoadBalancerFactory(),
1180 $services->getWikiPageFactory(),
1181 $services->getTitleFormatter()
1186 $config = $services->getMainConfig();
1188 $config->get(
'PasswordConfig' ),
1189 $config->get(
'PasswordDefault' )
1197 LoggerFactory::getInstance(
'authentication' ),
1198 $services->getAuthManager(),
1199 $services->getHookContainer(),
1200 $services->getDBLoadBalancer(),
1201 $services->getUserFactory(),
1202 $services->getUserNameUtils(),
1203 $services->getUserOptionsLookup()
1207 'PerDbNameStatsdDataFactory' =>
1209 $config = $services->getMainConfig();
1210 $wiki = $config->get(
'DBname' );
1212 $services->getStatsdDataFactory(),
1222 $services->getSpecialPageFactory(),
1223 $services->getRevisionLookup(),
1224 $services->getNamespaceInfo(),
1225 $services->getGroupPermissionsLookup(),
1226 $services->getUserGroupManager(),
1227 $services->getBlockErrorFormatter(),
1228 $services->getHookContainer(),
1229 $services->getUserCache()
1237 $services->getContentLanguage(),
1238 $services->getAuthManager(),
1239 $services->getLinkRendererFactory()->create(),
1240 $services->getNamespaceInfo(),
1241 $services->getPermissionManager(),
1242 $services->getLanguageConverterFactory()->getLanguageConverter(),
1243 $services->getLanguageNameUtils(),
1244 $services->getHookContainer(),
1245 $services->getUserOptionsManager(),
1246 $services->getLanguageConverterFactory(),
1247 $services->getParser(),
1248 $services->getSkinFactory(),
1249 $services->getUserGroupManager()
1251 $factory->setLogger( LoggerFactory::getInstance(
'preferences' ) );
1257 $mainConfig = $services->getMainConfig();
1259 $mainConfig->get(
'CdnServers' ),
1260 $mainConfig->get(
'CdnServersNoPurge' ),
1261 $services->getHookContainer()
1267 $services->getConfiguredReadOnlyMode(),
1268 $services->getDBLoadBalancer()
1273 $config = $services->getMainConfig();
1275 $config->get(
'LocalFileRepo' ),
1276 $config->get(
'ForeignFileRepos' ),
1277 $services->getMainWANObjectCache(),
1278 $services->getMimeAnalyzer()
1286 $config = $services->getMainConfig();
1290 LoggerFactory::getInstance(
'resourceloader' ),
1291 $config->get(
'ResourceLoaderUseObjectCacheForDeps' )
1298 $modules = $extRegistry->getAttribute(
'ResourceModules' )
1299 + $config->get(
'ResourceModules' );
1300 $moduleSkinStyles = $extRegistry->getAttribute(
'ResourceModuleSkinStyles' )
1301 + $config->get(
'ResourceModuleSkinStyles' );
1303 $rl->setModuleSkinStyles( $moduleSkinStyles );
1304 $rl->addSource( $config->get(
'ResourceLoaderSources' ) );
1307 $rl->register( include
"$IP/resources/Resources.php" );
1309 $hookRunner = new \MediaWiki\ResourceLoader\HookRunner( $services->getHookContainer() );
1310 $hookRunner->onResourceLoaderRegisterModules( $rl );
1312 $msgPosterAttrib = $extRegistry->getAttribute(
'MessagePosterModule' );
1313 $rl->register(
'mediawiki.messagePoster', [
1314 'localBasePath' =>
$IP,
1315 'debugRaw' =>
false,
1316 'scripts' => array_merge(
1318 "resources/src/mediawiki.messagePoster/factory.js",
1319 "resources/src/mediawiki.messagePoster/MessagePoster.js",
1320 "resources/src/mediawiki.messagePoster/WikitextMessagePoster.js",
1322 $msgPosterAttrib[
'scripts'] ?? []
1324 'dependencies' => array_merge(
1328 'mediawiki.ForeignApi',
1330 $msgPosterAttrib[
'dependencies'] ?? []
1332 'targets' => [
'desktop',
'mobile' ],
1335 if ( $config->get(
'EnableJavaScriptTest' ) ===
true ) {
1336 $rl->registerTestModules();
1347 $services->getMainWANObjectCache(),
1348 $services->getDBLoadBalancer(),
1349 $services->getLinkCache(),
1350 $services->getCommentStore(),
1351 $services->getHookContainer(),
1352 $services->getPageStore()
1358 $services->getMainObjectStash(),
1359 $services->getDBLoadBalancer(),
1362 $services->getMainConfig()
1368 $services->getJobQueueGroup()
1373 return $services->getRevisionStore();
1377 return $services->getRevisionStore();
1382 $services->getDBLoadBalancer(),
1383 $services->getSlotRoleRegistry()
1386 $renderer->
setLogger( LoggerFactory::getInstance(
'SaveParse' ) );
1391 return $services->getRevisionStoreFactory()->getRevisionStore();
1395 $config = $services->getMainConfig();
1397 if ( $config->has(
'MultiContentRevisionSchemaMigrationStage' ) ) {
1398 if ( $config->get(
'MultiContentRevisionSchemaMigrationStage' ) !==
SCHEMA_COMPAT_NEW ) {
1399 throw new UnexpectedValueException(
1400 'The MultiContentRevisionSchemaMigrationStage setting is no longer supported!'
1406 $services->getDBLoadBalancerFactory(),
1407 $services->getBlobStoreFactory(),
1408 $services->getNameTableStoreFactory(),
1409 $services->getSlotRoleRegistry(),
1410 $services->getMainWANObjectCache(),
1411 $services->getCommentStore(),
1412 $services->getActorMigration(),
1413 $services->getActorStoreFactory(),
1414 LoggerFactory::getInstance(
'RevisionStore' ),
1415 $services->getContentHandlerFactory(),
1416 $services->getPageStoreFactory(),
1417 $services->getTitleFactory(),
1418 $services->getHookContainer()
1425 return $services->get(
'_PageCommandFactory' );
1432 $services->getMainConfig(),
1433 $services->getContentLanguage(),
1434 $services->getHookContainer(),
1441 $services->getSearchEngineConfig(),
1442 $services->getHookContainer(),
1443 $services->getDBLoadBalancer()
1448 $urls = $services->getMainConfig()->get(
'ShellboxUrls' );
1450 $url = $services->getMainConfig()->get(
'ShellboxUrl' );
1451 if ( $url !==
null ) {
1452 $urls[
'default'] = $url;
1455 $services->getHttpRequestFactory(),
1457 $services->getMainConfig()->get(
'ShellboxSecretKey' )
1462 $config = $services->getMainConfig();
1465 'time' => $config->get(
'MaxShellTime' ),
1466 'walltime' => $config->get(
'MaxShellWallClockTime' ),
1467 'memory' => $config->get(
'MaxShellMemory' ),
1468 'filesize' => $config->get(
'MaxShellFileSize' ),
1470 $cgroup = $config->get(
'ShellCgroup' );
1471 $restrictionMethod = $config->get(
'ShellRestrictionMethod' );
1473 $factory =
new CommandFactory( $services->getShellboxClientFactory(),
1474 $limits, $cgroup, $restrictionMethod );
1475 $factory->setLogger( LoggerFactory::getInstance(
'exec' ) );
1476 $factory->logStderr();
1485 return $services->getSiteStore();
1489 $rawSiteStore = new
DBSiteStore( $services->getDBLoadBalancer() );
1491 $cache = $services->getLocalServerObjectCache();
1502 $services->getObjectFactory(),
1503 (array)$services->getMainConfig()->get(
'SkipSkins' )
1506 $names = $services->getMainConfig()->get(
'ValidSkinNames' );
1508 foreach ( $names as $name => $skin ) {
1509 if ( is_array( $skin ) ) {
1511 $displayName = $skin[
'displayname'] ?? $name;
1513 $displayName = $skin;
1516 'class' =>
"Skin$skin"
1519 $factory->
register( $name, $displayName, $spec );
1523 $factory->register(
'fallback',
'Fallback', [
1524 'class' => SkinFallback::class,
1527 'name' =>
'fallback',
1528 'styles' => [
'mediawiki.skinning.interface' ],
1529 'templateDirectory' => __DIR__ .
'/skins/templates/fallback',
1534 $factory->register(
'apioutput',
'ApiOutput', [
1535 'class' => SkinApi::class,
1538 'name' =>
'apioutput',
1539 'styles' => [
'mediawiki.skinning.interface' ],
1540 'templateDirectory' => __DIR__ .
'/skins/templates/apioutput',
1550 $services->getSlotRoleStore()
1553 $config = $services->getMainConfig();
1554 $contentHandlerFactory = $services->getContentHandlerFactory();
1555 $hookContainer = $services->getHookContainer();
1556 $titleFactory = $services->getTitleFactory();
1559 static function () use ( $config, $contentHandlerFactory, $hookContainer, $titleFactory ) {
1561 $config->get(
'NamespaceContentModels' ),
1562 $contentHandlerFactory,
1573 return $services->getNameTableStoreFactory()->getSlotRoles();
1578 (array)$services->getMainConfig()->get(
'SpamRegex' ),
1579 (array)$services->getMainConfig()->get(
'SummarySpamRegex' )
1587 $services->getContentLanguage(),
1588 $services->getObjectFactory(),
1589 $services->getTitleFactory(),
1590 $services->getHookContainer()
1596 rtrim( $services->getMainConfig()->get(
'StatsdMetricPrefix' ),
'.' )
1600 'TalkPageNotificationManager' =>
static function (
1607 $services->getDBLoadBalancer(),
1608 $services->getReadOnlyMode(),
1609 $services->getRevisionLookup()
1620 RemexDriver::CONSTRUCTOR_OPTIONS, $services->getMainConfig()
1630 return $services->getService(
'_MediaWikiTitleCodec' );
1634 return $services->getService(
'_MediaWikiTitleCodec' );
1638 return $services->getService(
'_UserBlockCommandFactory' );
1643 $services->getMainConfig()->get(
'EnableUploads' ),
1651 $services->getDBLoadBalancer(),
1652 $services->getLinkBatchFactory()
1658 $services->getActorMigration(),
1659 $services->getDBLoadBalancer(),
1660 $services->getJobQueueGroup()
1666 $services->getDBLoadBalancer(),
1667 $services->getUserNameUtils()
1672 return $services->getUserGroupManagerFactory()->getUserGroupManager();
1680 $services->getConfiguredReadOnlyMode(),
1681 $services->getDBLoadBalancerFactory(),
1682 $services->getHookContainer(),
1683 $services->getUserEditTracker(),
1684 $services->getGroupPermissionsLookup(),
1685 $services->getJobQueueGroupFactory(),
1687 [ static function (
UserIdentity $user ) use ( $services ) {
1688 $services->getPermissionManager()->invalidateUsersRightsCache( $user );
1689 $services->getUserFactory()->newFromUserIdentity( $user )->invalidateCache();
1695 return $services->getActorStoreFactory()->getUserIdentityLookup();
1700 $services->getDBLoadBalancer(),
1701 $services->getUserFactory(),
1702 $services->getUserNameUtils()
1710 UserNameUtils::CONSTRUCTOR_OPTIONS, $services->getMainConfig()
1712 $services->getContentLanguage(),
1713 LoggerFactory::getInstance(
'UserNameUtils' ),
1714 $services->getTitleParser(),
1715 $messageFormatterFactory->getTextFormatter(
1716 $services->getContentLanguage()->getCode()
1718 $services->getHookContainer()
1723 return $services->getUserOptionsManager();
1729 $services->get(
'_DefaultOptionsLookup' ),
1730 $services->getLanguageConverterFactory(),
1731 $services->getDBLoadBalancer(),
1733 $services->getHookContainer()
1737 'VirtualRESTServiceClient' =>
1739 $config = $services->getMainConfig()->get(
'VirtualRestConfig' );
1742 $services->getHttpRequestFactory()->createMultiClient() );
1743 foreach ( $config[
'paths'] as $prefix => $serviceConfig ) {
1744 $class = $serviceConfig[
'class'];
1746 $constructArg = $serviceConfig[
'options'] ?? [];
1747 $constructArg += $config[
'global'];
1749 $vrsClient->mount( $prefix, [
'class' => $class,
'config' => $constructArg ] );
1755 'WatchedItemQueryService' =>
1758 $services->getDBLoadBalancer(),
1759 $services->getCommentStore(),
1760 $services->getWatchedItemStore(),
1761 $services->getHookContainer(),
1762 $services->getMainConfig()->get(
'WatchlistExpiry' ),
1763 $services->getMainConfig()->get(
'MaxExecutionTimeForExpensiveQueries' )
1770 $services->getMainConfig() ),
1771 $services->getDBLoadBalancerFactory(),
1772 $services->getJobQueueGroup(),
1773 $services->getMainObjectStash(),
1775 $services->getReadOnlyMode(),
1776 $services->getNamespaceInfo(),
1777 $services->getRevisionLookup(),
1778 $services->getHookContainer(),
1779 $services->getLinkBatchFactory(),
1780 $services->getUserFactory(),
1781 $services->getTitleFactory()
1785 if ( $services->getMainConfig()->get(
'ReadOnlyWatchedItemStore' ) ) {
1796 $services->getMainConfig()
1798 $services->getHookContainer(),
1799 $services->getReadOnlyMode(),
1800 $services->getRevisionLookup(),
1801 $services->getTalkPageNotificationManager(),
1802 $services->getWatchedItemStore(),
1803 $services->getUserFactory(),
1804 $services->getNamespaceInfo(),
1805 $services->getWikiPageFactory()
1811 $services->getMainConfig(),
1812 $services->getHookContainer(),
1813 $services->getContentLanguage(),
1814 $services->getNamespaceInfo(),
1815 $services->getTitleFactory(),
1816 $services->getWikiPageFactory(),
1817 $services->getWikiRevisionUploadImporter(),
1818 $services->getPermissionManager(),
1819 $services->getContentHandlerFactory(),
1820 $services->getSlotRoleRegistry()
1826 $services->getTitleFactory(),
1827 new
HookRunner( $services->getHookContainer() ),
1828 $services->getDBLoadBalancer()
1832 'WikiRevisionOldRevisionImporterNoUpdates' =>
1837 $services->getDBLoadBalancer(),
1838 $services->getRevisionStore(),
1839 $services->getSlotRoleRegistry(),
1840 $services->getWikiPageFactory()
1847 $services->getContentLanguage(),
1848 $services->getHookContainer()
1860 $services->getMainConfig()
1865 $services->getPermissionManager(),
1868 $services->getHookContainer(),
1871 $services->getReadOnlyMode(),
1874 $services->getSpamChecker()
1880 $services->getContentLanguage(),
1881 $services->getGenderCache(),
1882 $services->getMainConfig()->get(
'LocalInterwikis' ),
1883 $services->getInterwikiLookup(),
1884 $services->getNamespaceInfo()
1890 $services->getMainConfig(),
1891 $services->getDBLoadBalancerFactory(),
1892 $services->getNamespaceInfo(),
1893 $services->getWatchedItemStore(),
1894 $services->getRepoGroup(),
1895 $services->getReadOnlyMode(),
1896 $services->getContentHandlerFactory(),
1897 $services->getRevisionStore(),
1898 $services->getSpamChecker(),
1899 $services->getTitleFormatter(),
1900 $services->getHookContainer(),
1901 $services->getWikiPageFactory(),
1902 $services->getUserFactory(),
1903 $services->getActorMigration(),
1904 $services->getActorNormalization(),
1905 $services->getTitleFactory(),
1906 $services->getUserEditTracker(),
1907 $services->getCollationFactory(),
1908 $services->getJobQueueGroup(),
1909 $services->getCommentStore(),
1911 WikiMap::getCurrentWikiDbDomain()->getId(),
1913 $services->getBacklinkCacheFactory()
1918 return $services->getBlobStoreFactory()->newSqlBlobStore();
1924 $services->getHookContainer(),
1925 $services->getBlockPermissionCheckerFactory(),
1926 $services->getBlockUtils(),
1927 $services->getDatabaseBlockStore(),
1928 $services->getBlockRestrictionStore(),
1929 $services->getUserFactory(),
1930 $services->getUserEditTracker(),
1932 $services->getTitleFactory(),
1933 $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...
wfUrlProtocols( $includeProtocolRelative=true)
Returns a regular expression of url protocols.
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( 'Actions'), LoggerFactory::getInstance( 'ActionFactory'), $services->getObjectFactory(), $services->getHookContainer());}, 'ActorMigration'=> static function(MediaWikiServices $services):ActorMigration { return new ActorMigration($services->getMainConfig() ->get( 'ActorTableSchemaMigrationStage'), $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'));}, '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 new BlockRestrictionStore($services->getDBLoadBalancer());}, '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());}, 'CommentStore'=> static function(MediaWikiServices $services):CommentStore { return new CommentStore($services->getContentLanguage(), MIGRATION_NEW);}, 'ConfigFactory'=> static function(MediaWikiServices $services):ConfigFactory { $registry=$services->getBootstrapConfig() ->get( '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());}, 'ConfiguredReadOnlyMode'=> static function(MediaWikiServices $services):ConfiguredReadOnlyMode { $config=$services->getMainConfig();return new ConfiguredReadOnlyMode($config->get( 'ReadOnly'), $config->get( 'ReadOnlyFile'));}, 'ContentHandlerFactory'=> static function(MediaWikiServices $services):IContentHandlerFactory { $contentHandlerConfig=$services->getMainConfig() ->get( '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( 'LanguageCode'));}, 'ContentModelChangeFactory'=> static function(MediaWikiServices $services):ContentModelChangeFactory { return $services->getService( '_PageCommandFactory');}, 'ContentModelStore'=> static function(MediaWikiServices $services):NameTableStore { return $services->getNameTableStoreFactory() ->getContentModels();}, '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());}, 'CriticalSectionProvider'=> static function(MediaWikiServices $services):CriticalSectionProvider { $config=$services->getMainConfig();$limit=$config->get( 'CommandLineMode') ? INF :$config->get( 'CriticalSectionTimeLimit');return RequestTimeout::singleton() ->createCriticalSectionProvider( $limit);}, 'CryptHKDF'=> static function(MediaWikiServices $services):CryptHKDF { $config=$services->getMainConfig();$secret=$config->get( 'HKDFSecret') ?:$config->get( '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( '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());}, '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();$cpStashType=$mainConfig->get( 'ChronologyProtectorStash');if(is_string( $cpStashType)) { $cpStash=ObjectCache::getInstance( $cpStashType);} else { try { $cpStash=ObjectCache::getLocalClusterInstance();} catch(RecursiveServiceDependencyException $e) { $cpStash=new EmptyBagOStuff();} } LoggerFactory::getInstance( 'DBReplication') ->debug('ChronologyProtector using store {class}', [ 'class'=> get_class( $cpStash)]);try { $wanCache=$services->getMainWANObjectCache();} catch(RecursiveServiceDependencyException $e) { $wanCache=WANObjectCache::newEmpty();} $srvCache=$services->getLocalServerObjectCache();if( $srvCache instanceof EmptyBagOStuff) { $srvCache=new HashBagOStuff([ 'maxKeys'=> 100]);} $lbConf=MWLBFactory::applyDefaultConfig($mainConfig->get( 'LBFactoryConf'), new ServiceOptions(MWLBFactory::APPLY_DEFAULT_CONFIG_OPTIONS, $mainConfig), $services->getConfiguredReadOnlyMode(), $cpStash, $srvCache, $wanCache, $services->getCriticalSectionProvider());$class=MWLBFactory::getLBFactoryClass( $lbConf);$instance=new $class( $lbConf);MWLBFactory::setDomainAliases( $instance);MWLBFactory::applyGlobalState($instance, $mainConfig, $services->getStatsdDataFactory());return $instance;}, '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( '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( 'DefaultExternalStore');return new ExternalStoreFactory($config->get( '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( 'TmpDirectory'), static function( $command) { return wfShellExec( $command);});}, '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( 'CdnReboundPurgeDelay'), $config->get( 'UseFileCache'), $config->get( 'CdnMaxAge'));}, '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( 'InterwikiExpiry'), $config->get( 'InterwikiCache'), $config->get( 'InterwikiScopes'), $config->get( '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( 'UsePigLatinVariant');$isConversionDisabled=$services->getMainConfig() ->get( 'DisableLangConversion');$isTitleConversionDisabled=$services->getMainConfig() ->get( 'DisableTitleConversion');return new LanguageConverterFactory($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->getLocalisationCache(), $services->getLanguageNameUtils(), $services->getLanguageFallback(), $services->getLanguageConverterFactory(), $services->getHookContainer());}, 'LanguageFallback'=> static function(MediaWikiServices $services):LanguageFallback { return new LanguageFallback($services->getMainConfig() ->get( '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());}, '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->getNamespaceInfo(), $services->getSpecialPageFactory(), $services->getHookContainer());}, 'LocalisationCache'=> static function(MediaWikiServices $services):LocalisationCache { $conf=$services->getMainConfig() ->get( 'LocalisationCacheConf');$logger=LoggerFactory::getInstance( 'localisation');$store=LocalisationCache::getStoreFromConf($conf, $services->getMainConfig() ->get( '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( 'LockManagers'), $services->getDBLoadBalancerFactory());}, '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( 'MainStash');if(!isset( $mainConfig->get( 'ObjectCaches')[$id])) { throw new UnexpectedValueException("Cache type \"$id\" is not present in \$wgObjectCaches.");} $params=$mainConfig->get( 'ObjectCaches')[$id];$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( 'MainWANCache');$wanParams=$mainConfig->get( '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( '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( 'SecretKey');if(! $mainConfig->get( 'CommandLineMode')) { $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( '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( 'MessageCacheType'));$srvCache=$mainConfig->get( 'UseLocalMessageCache') ? $services->getLocalServerObjectCache() :new EmptyBagOStuff();$logger=LoggerFactory::getInstance( 'MessageCache');$logger->debug( 'MessageCache using store {class}', ['class'=> get_class( $clusterCache)]);return new MessageCache($services->getMainWANObjectCache(), $clusterCache, $srvCache, $services->getContentLanguage(), $services->getLanguageConverterFactory() ->getLanguageConverter(), $logger, [ 'useDB'=> $mainConfig->get( 'UseDatabaseMessages')], $services->getLanguageFactory(), $services->getLocalisationCache(), $services->getLanguageNameUtils(), $services->getLanguageFallback(), $services->getHookContainer());}, 'MessageFormatterFactory'=> static function(MediaWikiServices $services):IMessageFormatterFactory { return new MessageFormatterFactory();}, 'MimeAnalyzer'=> static function(MediaWikiServices $services):MimeAnalyzer { $logger=LoggerFactory::getInstance( 'Mime');$mainConfig=$services->getMainConfig();$hookRunner=new HookRunner( $services->getHookContainer());$params=['typeFile'=> $mainConfig->get( 'MimeTypeFile'), 'infoFile'=> $mainConfig->get( 'MimeInfoFile'), 'xmlTypes'=> $mainConfig->get( '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( '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());}, '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->getHookContainer(), defined( 'MEDIAWIKI_JOB_RUNNER')|| $config->get( 'CommandLineMode') ? 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->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(), ChangeTags::getSoftwareTags());}, 'Parser'=> static function(MediaWikiServices $services):Parser { return $services->getParserFactory() ->create();}, '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( '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(), wfUrlProtocols(), $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());}, '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());}, 'PasswordFactory'=> static function(MediaWikiServices $services):PasswordFactory { $config=$services->getMainConfig();return new PasswordFactory($config->get( 'PasswordConfig'), $config->get( '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( '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->getRevisionLookup(), $services->getNamespaceInfo(), $services->getGroupPermissionsLookup(), $services->getUserGroupManager(), $services->getBlockErrorFormatter(), $services->getHookContainer(), $services->getUserCache());}, '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());$factory->setLogger(LoggerFactory::getInstance( 'preferences'));return $factory;}, 'ProxyLookup'=> static function(MediaWikiServices $services):ProxyLookup { $mainConfig=$services->getMainConfig();return new ProxyLookup($mainConfig->get( 'CdnServers'), $mainConfig->get( 'CdnServersNoPurge'), $services->getHookContainer());}, 'ReadOnlyMode'=> static function(MediaWikiServices $services):ReadOnlyMode { return new ReadOnlyMode($services->getConfiguredReadOnlyMode(), $services->getDBLoadBalancer());}, 'RepoGroup'=> static function(MediaWikiServices $services):RepoGroup { $config=$services->getMainConfig();return new RepoGroup($config->get( 'LocalFileRepo'), $config->get( 'ForeignFileRepos'), $services->getMainWANObjectCache(), $services->getMimeAnalyzer());}, 'ResourceLoader'=> static function(MediaWikiServices $services):ResourceLoader { global $IP;$config=$services->getMainConfig();$rl=new ResourceLoader($config, LoggerFactory::getInstance( 'resourceloader'), $config->get( 'ResourceLoaderUseObjectCacheForDeps') ? new KeyValueDependencyStore( $services->getMainObjectStash()) :new SqlModuleDependencyStore( $services->getDBLoadBalancer()));$extRegistry=ExtensionRegistry::getInstance();$modules=$extRegistry->getAttribute( 'ResourceModules')+ $config->get( 'ResourceModules');$moduleSkinStyles=$extRegistry->getAttribute( 'ResourceModuleSkinStyles')+ $config->get( 'ResourceModuleSkinStyles');$rl->setModuleSkinStyles( $moduleSkinStyles);$rl->addSource( $config->get( 'ResourceLoaderSources'));$rl->register(include "$IP/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'=> $IP, '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( '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->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());$renderer->setLogger(LoggerFactory::getInstance( 'SaveParse'));return $renderer;}, 'RevisionStore'=> static function(MediaWikiServices $services):RevisionStore { return $services->getRevisionStoreFactory() ->getRevisionStore();}, 'RevisionStoreFactory'=> static function(MediaWikiServices $services):RevisionStoreFactory { $config=$services->getMainConfig();if( $config->has( 'MultiContentRevisionSchemaMigrationStage')) { if( $config->get( 'MultiContentRevisionSchemaMigrationStage') !==SCHEMA_COMPAT_NEW) { throw new UnexpectedValueException('The MultiContentRevisionSchemaMigrationStage setting is no longer supported!');} } $store=new RevisionStoreFactory($services->getDBLoadBalancerFactory(), $services->getBlobStoreFactory(), $services->getNameTableStoreFactory(), $services->getSlotRoleRegistry(), $services->getMainWANObjectCache(), $services->getCommentStore(), $services->getActorMigration(), $services->getActorStoreFactory(), LoggerFactory::getInstance( 'RevisionStore'), $services->getContentHandlerFactory(), $services->getPageStoreFactory(), $services->getTitleFactory(), $services->getHookContainer());return $store;}, 'RollbackPageFactory'=> static function(MediaWikiServices $services):RollbackPageFactory { return $services->get( '_PageCommandFactory');}, 'SearchEngineConfig'=> static function(MediaWikiServices $services):SearchEngineConfig { return new SearchEngineConfig($services->getMainConfig(), $services->getContentLanguage(), $services->getHookContainer(), ExtensionRegistry::getInstance() ->getAttribute( 'SearchMappings'));}, '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( 'ShellboxUrls');$url=$services->getMainConfig() ->get( 'ShellboxUrl');if( $url !==null) { $urls['default']=$url;} return new ShellboxClientFactory($services->getHttpRequestFactory(), $urls, $services->getMainConfig() ->get( 'ShellboxSecretKey'));}, 'ShellCommandFactory'=> static function(MediaWikiServices $services):CommandFactory { $config=$services->getMainConfig();$limits=['time'=> $config->get( 'MaxShellTime'), 'walltime'=> $config->get( 'MaxShellWallClockTime'), 'memory'=> $config->get( 'MaxShellMemory'), 'filesize'=> $config->get( 'MaxShellFileSize'),];$cgroup=$config->get( 'ShellCgroup');$restrictionMethod=$config->get( 'ShellRestrictionMethod');$factory=new CommandFactory( $services->getShellboxClientFactory(), $limits, $cgroup, $restrictionMethod);$factory->setLogger(LoggerFactory::getInstance( 'exec'));$factory->logStderr();return $factory;}, '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( 'SkipSkins'));$names=$services->getMainConfig() ->get( 'ValidSkinNames');foreach( $names as $name=> $skin) { if(is_array( $skin)) { $spec=$skin;$displayName=$skin['displayname'] ?? $name;} else { $displayName=$skin;$spec=['name'=> $name, 'class'=> "Skin$skin"];} $factory->register( $name, $displayName, $spec);} $factory->register( 'fallback', 'Fallback', ['class'=> SkinFallback::class, 'args'=>[['name'=> 'fallback', 'styles'=>[ 'mediawiki.skinning.interface'], 'templateDirectory'=> __DIR__ . '/skins/templates/fallback',]]]);$factory->register( 'apioutput', 'ApiOutput', ['class'=> SkinApi::class, 'args'=>[['name'=> 'apioutput', 'styles'=>[ 'mediawiki.skinning.interface'], 'templateDirectory'=> __DIR__ . '/skins/templates/apioutput',]]]);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( '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( 'SpamRegex'),(array) $services->getMainConfig() ->get( '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( 'StatsdMetricPrefix'), '.'));}, 'TalkPageNotificationManager'=> static function(MediaWikiServices $services):TalkPageNotificationManager { return new TalkPageNotificationManager(new ServiceOptions(TalkPageNotificationManager::CONSTRUCTOR_OPTIONS, $services->getMainConfig()), $services->getDBLoadBalancer(), $services->getReadOnlyMode(), $services->getRevisionLookup());}, 'TempFSFileFactory'=> static function(MediaWikiServices $services):TempFSFileFactory { return new TempFSFileFactory( $services->getMainConfig() ->get( 'TmpDirectory'));}, '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');}, 'UnblockUserFactory'=> static function(MediaWikiServices $services):UnblockUserFactory { return $services->getService( '_UserBlockCommandFactory');}, 'UploadRevisionImporter'=> static function(MediaWikiServices $services):UploadRevisionImporter { return new ImportableUploadRevisionImporter($services->getMainConfig() ->get( 'EnableUploads'), LoggerFactory::getInstance( 'UploadRevisionImporter'));}, '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'), [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->getUserFactory(), $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());}, '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());}, 'VirtualRESTServiceClient'=> static function(MediaWikiServices $services):VirtualRESTServiceClient { $config=$services->getMainConfig() ->get( '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->getMainConfig() ->get( 'WatchlistExpiry'), $services->getMainConfig() ->get( '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->getHookContainer(), $services->getLinkBatchFactory(), $services->getUserFactory(), $services->getTitleFactory());$store->setStatsdDataFactory( $services->getStatsdDataFactory());if( $services->getMainConfig() ->get( '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());}, '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());}, '_DefaultOptionsLookup'=> static function(MediaWikiServices $services):DefaultOptionsLookup { return new DefaultOptionsLookup(new ServiceOptions(DefaultOptionsLookup::CONSTRUCTOR_OPTIONS, $services->getMainConfig()), $services->getContentLanguage(), $services->getHookContainer());}, '_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( '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(), ObjectCache::getInstance( 'db-replicated'), WikiMap::getCurrentWikiDbDomain() ->getId(), WebRequest::getRequestId(), $services->getBacklinkCacheFactory());}, '_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 with the given key.
A factory for application metric data.
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.
Key/value blob storage for a collection of storage medium types (e.g.
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.
Internationalisation code See https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation for more...
Cache for article titles (prefixed DB keys) and ids linked from one source.
Class for caching the contents of localisation files, Messages*.php and *.i18n.php.
static getStoreFromConf(array $conf, $fallbackCacheDir)
Return a suitable LCStore as specified by the given configuration.
static setDomainAliases(ILBFactory $lbFactory)
const APPLY_DEFAULT_CONFIG_OPTIONS
static applyDefaultConfig(array $lbConf, ServiceOptions $options, ConfiguredReadOnlyMode $readOnlyMode, BagOStuff $cpStash, BagOStuff $srvCache, WANObjectCache $wanCache, CriticalSectionProvider $csProvider)
static getLBFactoryClass(array $config)
Decide which LBFactory class to use.
static applyGlobalState(ILBFactory $lbFactory, Config $config, IBufferingStatsdDataFactory $stats)
Apply global state from the current web request or other PHP process.
A factory that stores information about MagicWords, and creates them on demand with caching.
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.
Common factory to construct page handling classes.
Service for getting rendered output of a given page.
A SlotRoleHandler for the main slot.
Factory for handling the special page list and generating SpecialPage objects.
Class for managing stashed edits used by the page updater classes.
A factory for PageUpdater instances.
Manages user talk page notifications.
static clearGlobalCacheEntry(WANObjectCache $cache)
Invalidate cache keys for all known modules.
Cache of 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 @newable.
ResourceLoader is a loading system for JavaScript and CSS resources.
Configuration handling class for SearchEngine.
Factory class for SearchEngine.
Factory class to create Skin objects.
register( $name, $displayName, $spec)
Register a new Skin factory function.
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.
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