Wikibase
MediaWiki Wikibase extension
WikibaseRepo.ServiceWiring.php File Reference

Variables

 return [ 'WikibaseRepo.AliasTermBuffer'=> function(MediaWikiServices $services):AliasTermBuffer { return WikibaseRepo::getPrefetchingTermLookup( $services);}, 'WikibaseRepo.AllTypesEntityDeserializer'=> function(MediaWikiServices $services):DispatchableDeserializer { $deserializerFactoryCallbacks=WikibaseRepo::getEntityTypeDefinitions( $services) ->get(EntityTypeDefinitions::DESERIALIZER_FACTORY_CALLBACK);$baseDeserializerFactory=WikibaseRepo::getBaseDataModelDeserializerFactory( $services);$deserializers=[];foreach( $deserializerFactoryCallbacks as $callback) { $deserializers[]=call_user_func( $callback, $baseDeserializerFactory);} return new DispatchingDeserializer( $deserializers);}, 'WikibaseRepo.AllTypesEntitySerializer'=> function(MediaWikiServices $services):Serializer { $serializerFactoryCallbacks=WikibaseRepo::getEntityTypeDefinitions( $services) ->get(EntityTypeDefinitions::SERIALIZER_FACTORY_CALLBACK);$baseSerializerFactory=WikibaseRepo::getBaseDataModelSerializerFactory( $services);$serializers=[];foreach( $serializerFactoryCallbacks as $callback) { $serializers[]=$callback( $baseSerializerFactory);} return new DispatchingSerializer( $serializers);}, 'WikibaseRepo.BaseDataModelDeserializerFactory'=> function(MediaWikiServices $services):DeserializerFactory { return new DeserializerFactory(WikibaseRepo::getDataValueDeserializer( $services), WikibaseRepo::getEntityIdParser( $services));}, 'WikibaseRepo.BaseDataModelSerializerFactory'=> function(MediaWikiServices $services):SerializerFactory { return new SerializerFactory(new DataValueSerializer(), SerializerFactory::OPTION_DEFAULT);}, 'WikibaseRepo.ChangeNotifier'=> function(MediaWikiServices $services):ChangeNotifier { $transmitters=[new HookChangeTransmitter($services->getHookContainer(), 'WikibaseChangeNotification'),];$settings=WikibaseRepo::getSettings( $services);if( $settings->getSetting( 'useChangesTable')) { $changeStore=WikibaseRepo::getStore( $services) ->getChangeStore();$transmitters[]=new DatabaseChangeTransmitter( $changeStore);} return new ChangeNotifier(WikibaseRepo::getEntityChangeFactory( $services), $transmitters, CentralIdLookup::factoryNonLocal());}, 'WikibaseRepo.CompactBaseDataModelSerializerFactory'=> function(MediaWikiServices $services):SerializerFactory { return new SerializerFactory(new DataValueSerializer(), SerializerFactory::OPTION_SERIALIZE_MAIN_SNAKS_WITHOUT_HASH+SerializerFactory::OPTION_SERIALIZE_REFERENCE_SNAKS_WITHOUT_HASH);}, 'WikibaseRepo.CompactEntitySerializer'=> function(MediaWikiServices $services):Serializer { $serializerFactoryCallbacks=WikibaseRepo::getEntityTypeDefinitions( $services) ->get(EntityTypeDefinitions::SERIALIZER_FACTORY_CALLBACK);$baseSerializerFactory=WikibaseRepo::getCompactBaseDataModelSerializerFactory( $services);$serializers=[];foreach( $serializerFactoryCallbacks as $callback) { $serializers[]=$callback( $baseSerializerFactory);} return new DispatchingSerializer( $serializers);}, 'WikibaseRepo.ContentModelMappings'=> function(MediaWikiServices $services):array { $map=WikibaseRepo::getEntityTypeDefinitions( $services) ->get(EntityTypeDefinitions::CONTENT_MODEL_ID);$services->getHookContainer() ->run( 'WikibaseContentModelMapping', [&$map]);return $map;}, 'WikibaseRepo.DataAccessSettings'=> function(MediaWikiServices $services):DataAccessSettings { return new DataAccessSettings(WikibaseRepo::getSettings( $services) ->getSetting( 'maxSerializedEntitySize'));}, 'WikibaseRepo.DatabaseTypeIdsStore'=> function(MediaWikiServices $services):DatabaseTypeIdsStore { return new DatabaseTypeIdsStore($services->getDBLoadBalancer(), $services->getMainWANObjectCache());}, 'WikibaseRepo.DataTypeDefinitions'=> function(MediaWikiServices $services):DataTypeDefinitions { $baseDataTypes=require __DIR__ . '/../lib/WikibaseLib.datatypes.php';$repoDataTypes=require __DIR__ . '/WikibaseRepo.datatypes.php';$dataTypes=array_merge_recursive( $baseDataTypes, $repoDataTypes);$services->getHookContainer() ->run( 'WikibaseRepoDataTypes', [&$dataTypes]);$settings=WikibaseRepo::getSettings( $services);return new DataTypeDefinitions($dataTypes, $settings->getSetting( 'disabledDataTypes'));}, 'WikibaseRepo.DataTypeFactory'=> function(MediaWikiServices $services):DataTypeFactory { return new DataTypeFactory(WikibaseRepo::getDataTypeDefinitions( $services) ->getValueTypes());}, 'WikibaseRepo.DataTypeValidatorFactory'=> function(MediaWikiServices $services):DataTypeValidatorFactory { return new BuilderBasedDataTypeValidatorFactory(WikibaseRepo::getDataTypeDefinitions( $services) ->getValidatorFactoryCallbacks());}, 'WikibaseRepo.DataValueDeserializer'=> function(MediaWikiServices $services):DataValueDeserializer { return new DataValueDeserializer(['string'=> StringValue::class, 'unknown'=> UnknownValue::class, 'globecoordinate'=> GlobeCoordinateValue::class, 'monolingualtext'=> MonolingualTextValue::class, 'quantity'=> QuantityValue::class, 'time'=> TimeValue::class, 'wikibase-entityid'=> function( $value) use( $services) { if(isset( $value['id'])) { try { return new EntityIdValue(WikibaseRepo::getEntityIdParser( $services) ->parse( $value['id']));} catch(EntityIdParsingException $parsingException) { throw new InvalidArgumentException('Can not parse id \'' . $value['id'] . '\' to build EntityIdValue with', 0, $parsingException);} } else { return EntityIdValue::newFromArray( $value);} },]);}, 'WikibaseRepo.DataValueFactory'=> function(MediaWikiServices $services):DataValueFactory { return new DataValueFactory(WikibaseRepo::getDataValueDeserializer( $services));}, 'WikibaseRepo.EntityArticleIdLookup'=> function(MediaWikiServices $services):EntityArticleIdLookup { return new TypeDispatchingArticleIdLookup(WikibaseRepo::getEntityTypeDefinitions( $services) ->get(EntityTypeDefinitions::ARTICLE_ID_LOOKUP_CALLBACK), new TitleLookupBasedEntityArticleIdLookup(WikibaseRepo::getEntityTitleLookup( $services)));}, 'WikibaseRepo.EntityChangeFactory'=> function(MediaWikiServices $services):EntityChangeFactory { $changeClasses=[Item::ENTITY_TYPE=> RepoItemChange::class,];return new EntityChangeFactory(WikibaseRepo::getEntityDiffer( $services), WikibaseRepo::getEntityIdParser( $services), $changeClasses, RepoEntityChange::class, WikibaseRepo::getLogger( $services));}, 'WikibaseRepo.EntityChangeOpProvider'=> function(MediaWikiServices $services):EntityChangeOpProvider { return new EntityChangeOpProvider(WikibaseRepo::getEntityTypeDefinitions( $services) ->get(EntityTypeDefinitions::CHANGEOP_DESERIALIZER_CALLBACK));}, 'WikibaseRepo.EntityConstraintProvider'=> function(MediaWikiServices $services):EntityConstraintProvider { return new EntityConstraintProvider(new SqlSiteLinkConflictLookup(WikibaseRepo::getEntityIdComposer( $services)));}, 'WikibaseRepo.EntityContentFactory'=> function(MediaWikiServices $services):EntityContentFactory { return new EntityContentFactory(WikibaseRepo::getContentModelMappings( $services), WikibaseRepo::getEntityTypeDefinitions( $services) ->get(EntityTypeDefinitions::CONTENT_HANDLER_FACTORY_CALLBACK), WikibaseRepo::getEntitySourceDefinitions( $services), WikibaseRepo::getLocalEntitySource( $services), $services->getInterwikiLookup());}, 'WikibaseRepo.EntityDiffer'=> function(MediaWikiServices $services):EntityDiffer { $entityDiffer=new EntityDiffer();$entityTypeDefinitions=WikibaseRepo::getEntityTypeDefinitions( $services);$builders=$entityTypeDefinitions->get(EntityTypeDefinitions::ENTITY_DIFFER_STRATEGY_BUILDER);foreach( $builders as $builder) { $entityDiffer->registerEntityDifferStrategy( $builder());} return $entityDiffer;}, 'WikibaseRepo.EntityExistenceChecker'=> function(MediaWikiServices $services):EntityExistenceChecker { return new TypeDispatchingExistenceChecker(WikibaseRepo::getEntityTypeDefinitions( $services) ->get(EntityTypeDefinitions::EXISTENCE_CHECKER_CALLBACK), new TitleLookupBasedEntityExistenceChecker(WikibaseRepo::getEntityTitleLookup( $services), $services->getLinkBatchFactory()));}, 'WikibaseRepo.EntityFactory'=> function(MediaWikiServices $services):EntityFactory { $instantiators=WikibaseRepo::getEntityTypeDefinitions( $services) ->get(EntityTypeDefinitions::ENTITY_FACTORY_CALLBACK);return new EntityFactory( $instantiators);}, 'WikibaseRepo.EntityIdComposer'=> function(MediaWikiServices $services):EntityIdComposer { return new EntityIdComposer(WikibaseRepo::getEntityTypeDefinitions( $services) ->get(EntityTypeDefinitions::ENTITY_ID_COMPOSER_CALLBACK));}, 'WikibaseRepo.EntityIdLookup'=> function(MediaWikiServices $services):EntityIdLookup { return WikibaseRepo::getEntityContentFactory( $services);}, 'WikibaseRepo.EntityIdParser'=> function(MediaWikiServices $services):EntityIdParser { return new DispatchingEntityIdParser(WikibaseRepo::getEntityTypeDefinitions( $services) ->getEntityIdBuilders());}, 'WikibaseRepo.EntityLookup'=> function(MediaWikiServices $services):EntityLookup { return WikibaseRepo::getStore( $services) ->getEntityLookup(Store::LOOKUP_CACHING_ENABLED, LookupConstants::LATEST_FROM_REPLICA);}, 'WikibaseRepo.EntityNamespaceLookup'=> function(MediaWikiServices $services):EntityNamespaceLookup { return array_reduce(WikibaseRepo::getEntitySourceDefinitions( $services) ->getSources(), function(EntityNamespaceLookup $nsLookup, EntitySource $source):EntityNamespaceLookup { return $nsLookup->merge(new EntityNamespaceLookup($source->getEntityNamespaceIds(), $source->getEntitySlotNames()));}, new EntityNamespaceLookup([], []));}, 'WikibaseRepo.EntityPatcher'=> function(MediaWikiServices $services):EntityPatcher { $entityPatcher=new EntityPatcher();$entityTypeDefinitions=WikibaseRepo::getEntityTypeDefinitions( $services);$builders=$entityTypeDefinitions->get(EntityTypeDefinitions::ENTITY_PATCHER_STRATEGY_BUILDER);foreach( $builders as $builder) { $entityPatcher->registerEntityPatcherStrategy( $builder());} return $entityPatcher;}, 'WikibaseRepo.EntityPermissionChecker'=> function(MediaWikiServices $services):EntityPermissionChecker { return new WikiPageEntityStorePermissionChecker(WikibaseRepo::getEntityNamespaceLookup( $services), WikibaseRepo::getEntityTitleLookup( $services), $services->getPermissionManager(), $services->getMainConfig() ->get( 'AvailableRights'));}, 'WikibaseRepo.EntityRdfBuilderFactory'=> function(MediaWikiServices $services):EntityRdfBuilderFactory { $entityTypeDefinitions=WikibaseRepo::getEntityTypeDefinitions( $services);return new EntityRdfBuilderFactory($entityTypeDefinitions->get(EntityTypeDefinitions::RDF_BUILDER_FACTORY_CALLBACK), $entityTypeDefinitions->get(EntityTypeDefinitions::RDF_LABEL_PREDICATES));}, 'WikibaseRepo.EntityRedirectChecker'=> function(MediaWikiServices $services):EntityRedirectChecker { return new TypeDispatchingRedirectChecker(WikibaseRepo::getEntityTypeDefinitions( $services) ->get(EntityTypeDefinitions::REDIRECT_CHECKER_CALLBACK), new TitleLookupBasedEntityRedirectChecker(WikibaseRepo::getEntityTitleLookup( $services)));}, 'WikibaseRepo.EntitySourceDefinitions'=> function(MediaWikiServices $services):EntitySourceDefinitions { $settings=WikibaseRepo::getSettings( $services);$entityTypeDefinitions=WikibaseRepo::getEntityTypeDefinitions( $services);if( $settings->hasSetting( 'entitySources') &&!empty( $settings->getSetting( 'entitySources'))) { $configParser=new EntitySourceDefinitionsConfigParser();return $configParser->newDefinitionsFromConfigArray($settings->getSetting( 'entitySources'), $entityTypeDefinitions);} $parser=new EntitySourceDefinitionsLegacyRepoSettingsParser();if( $settings->getSetting( 'federatedPropertiesEnabled')) { $configParser=new FederatedPropertiesEntitySourceDefinitionsConfigParser( $settings);return $configParser->initializeDefaults($parser->newDefinitionsFromSettings( $settings, $entityTypeDefinitions), $entityTypeDefinitions);} return $parser->newDefinitionsFromSettings( $settings, $entityTypeDefinitions);}, 'WikibaseRepo.EntityStore'=> function(MediaWikiServices $services):EntityStore { return WikibaseRepo::getStore( $services) ->getEntityStore();}, 'WikibaseRepo.EntityStoreWatcher'=> function(MediaWikiServices $services):EntityStoreWatcher { return WikibaseRepo::getStore( $services) ->getEntityStoreWatcher();}, 'WikibaseRepo.EntityTitleLookup'=> function(MediaWikiServices $services):EntityTitleLookup { return WikibaseRepo::getEntityTitleStoreLookup( $services);}, 'WikibaseRepo.EntityTitleStoreLookup'=> function(MediaWikiServices $services):EntityTitleStoreLookup { return new TypeDispatchingEntityTitleStoreLookup(WikibaseRepo::getEntityTypeDefinitions( $services) ->get(EntityTypeDefinitions::ENTITY_TITLE_STORE_LOOKUP_FACTORY_CALLBACK), WikibaseRepo::getEntityContentFactory( $services));}, 'WikibaseRepo.EntityTitleTextLookup'=> function(MediaWikiServices $services):EntityTitleTextLookup { return new TypeDispatchingTitleTextLookup(WikibaseRepo::getEntityTypeDefinitions( $services) ->get(EntityTypeDefinitions::TITLE_TEXT_LOOKUP_CALLBACK), new TitleLookupBasedEntityTitleTextLookup(WikibaseRepo::getEntityTitleLookup( $services)));}, 'WikibaseRepo.EntityTypeDefinitions'=> function(MediaWikiServices $services):EntityTypeDefinitions { $baseEntityTypes=require __DIR__ . '/../lib/WikibaseLib.entitytypes.php';$repoEntityTypes=require __DIR__ . '/WikibaseRepo.entitytypes.php';$entityTypes=array_merge_recursive( $baseEntityTypes, $repoEntityTypes);$services->getHookContainer() ->run( 'WikibaseRepoEntityTypes', [&$entityTypes]);$settings=WikibaseRepo::getSettings( $services);$overrider=EntityTypeDefinitionsFedPropsOverrider::factory( $settings->getSetting( 'federatedPropertiesEnabled'));$entityTypes=$overrider->override( $entityTypes);return new EntityTypeDefinitions( $entityTypes);}, 'WikibaseRepo.EntityUrlLookup'=> function(MediaWikiServices $services):EntityUrlLookup { return new TypeDispatchingUrlLookup(WikibaseRepo::getEntityTypeDefinitions( $services) ->get(EntityTypeDefinitions::URL_LOOKUP_CALLBACK), new TitleLookupBasedEntityUrlLookup(WikibaseRepo::getEntityTitleLookup( $services)));}, 'WikibaseRepo.ExternalFormatStatementDeserializer'=> function(MediaWikiServices $services):Deserializer { return WikibaseRepo::getBaseDataModelDeserializerFactory( $services) ->newStatementDeserializer();}, 'WikibaseRepo.IdGenerator'=> function(MediaWikiServices $services):IdGenerator { $settings=WikibaseRepo::getSettings( $services);switch( $settings->getSetting( 'idGenerator')) { case 'original':$idGenerator=new SqlIdGenerator($services->getDBLoadBalancer(), $settings->getSetting( 'reservedIds'), $settings->getSetting( 'idGeneratorSeparateDbConnection'));break;case 'mysql-upsert':$idGenerator=new UpsertSqlIdGenerator($services->getDBLoadBalancer(), $settings->getSetting( 'reservedIds'), $settings->getSetting( 'idGeneratorSeparateDbConnection'));break;default:throw new InvalidArgumentException('idGenerator config option must be either \ 'original\' or \ 'mysql-upsert\'');} return new RateLimitingIdGenerator($idGenerator, RequestContext::getMain());}, 'WikibaseRepo.InternalFormatDeserializerFactory'=> function(MediaWikiServices $services):InternalDeserializerFactory { return new InternalDeserializerFactory(WikibaseRepo::getDataValueDeserializer( $services), WikibaseRepo::getEntityIdParser( $services), WikibaseRepo::getAllTypesEntityDeserializer( $services));}, 'WikibaseRepo.InternalFormatEntityDeserializer'=> function(MediaWikiServices $services):Deserializer { return WikibaseRepo::getInternalFormatDeserializerFactory( $services) ->newEntityDeserializer();}, 'WikibaseRepo.ItemTermsCollisionDetector'=> function(MediaWikiServices $services):TermsCollisionDetector { return WikibaseRepo::getTermsCollisionDetectorFactory( $services) ->getTermsCollisionDetector(Item::ENTITY_TYPE);}, 'WikibaseRepo.ItemTermStoreWriter'=> function(MediaWikiServices $services):EntityTermStoreWriter { if(!in_array(Item::ENTITY_TYPE, WikibaseRepo::getLocalEntitySource( $services) ->getEntityTypes())) { return new ThrowingEntityTermStoreWriter();} return new ItemTermStoreWriterAdapter(WikibaseRepo::getTermStoreWriterFactory( $services) ->newItemTermStoreWriter());}, 'WikibaseRepo.ItemUrlParser'=> function(MediaWikiServices $services):SuffixEntityIdParser { return new SuffixEntityIdParser(WikibaseRepo::getItemVocabularyBaseUri( $services), new ItemIdParser());}, 'WikibaseRepo.ItemVocabularyBaseUri'=> function(MediaWikiServices $services):string { $itemSource=WikibaseRepo::getEntitySourceDefinitions( $services) ->getSourceForEntityType(Item::ENTITY_TYPE);if( $itemSource===null) { throw new LogicException( 'No source providing Items configured!');} return $itemSource->getConceptBaseUri();}, 'WikibaseRepo.KartographerEmbeddingHandler'=> function(MediaWikiServices $services):?CachingKartographerEmbeddingHandler { $settings=WikibaseRepo::getSettings( $services);$config=$services->getMainConfig();if($settings->getSetting( 'useKartographerGlobeCoordinateFormatter') &&ExtensionRegistry::getInstance() ->isLoaded( 'Kartographer') &&$config->has( 'KartographerEnableMapFrame') &&$config->get( 'KartographerEnableMapFrame')) { return new CachingKartographerEmbeddingHandler($services->getParserFactory() ->create());} else { return null;} }, 'WikibaseRepo.LanguageFallbackChainFactory'=> function(MediaWikiServices $services):LanguageFallbackChainFactory { return new LanguageFallbackChainFactory($services->getLanguageFactory(), $services->getLanguageConverterFactory(), $services->getLanguageFallback());}, 'WikibaseRepo.LanguageFallbackLabelDescriptionLookupFactory'=> function(MediaWikiServices $services):LanguageFallbackLabelDescriptionLookupFactory { return new LanguageFallbackLabelDescriptionLookupFactory(WikibaseRepo::getLanguageFallbackChainFactory( $services), WikibaseRepo::getTermLookup( $services), WikibaseRepo::getTermBuffer( $services));}, 'WikibaseRepo.LinkTargetEntityIdLookup'=> function(MediaWikiServices $services):LinkTargetEntityIdLookup { return new EntityLinkTargetEntityIdLookup(WikibaseRepo::getEntityNamespaceLookup( $services), WikibaseRepo::getEntityIdParser( $services), WikibaseRepo::getEntitySourceDefinitions( $services), WikibaseRepo::getLocalEntitySource( $services));}, 'WikibaseRepo.LocalEntityNamespaceLookup'=> function(MediaWikiServices $services):EntityNamespaceLookup { $localEntitySource=WikibaseRepo::getLocalEntitySource( $services);$nsIds=$localEntitySource->getEntityNamespaceIds();$entitySlots=$localEntitySource->getEntitySlotNames();return new EntityNamespaceLookup( $nsIds, $entitySlots);}, 'WikibaseRepo.LocalEntitySource'=> function(MediaWikiServices $services):EntitySource { $localEntitySourceName=WikibaseRepo::getSettings( $services) ->getSetting( 'localEntitySourceName');$sources=WikibaseRepo::getEntitySourceDefinitions( $services) ->getSources();foreach( $sources as $source) { if( $source->getSourceName()===$localEntitySourceName) { return $source;} } throw new LogicException( 'No source configured:' . $localEntitySourceName);}, 'WikibaseRepo.LocalEntityTypes'=> function(MediaWikiServices $services):array { $localSource=WikibaseRepo::getLocalEntitySource( $services);$subEntityTypes=WikibaseRepo::getEntityTypeDefinitions( $services) ->get(EntityTypeDefinitions::SUB_ENTITY_TYPES);return array_reduce($localSource->getEntityTypes(), function( $types, $localTypeName) use( $subEntityTypes) { $types[]=$localTypeName;if(array_key_exists( $localTypeName, $subEntityTypes)) { $types=array_merge( $types, $subEntityTypes[$localTypeName]);} return $types;}, []);}, 'WikibaseRepo.LocalRepoWikiPageMetaDataAccessor'=> function(MediaWikiServices $services):WikiPageEntityMetaDataAccessor { $entityNamespaceLookup=WikibaseRepo::getEntityNamespaceLookup( $services);$repoName='';$dbName=false;$logger=WikibaseRepo::getLogger( $services);return new PrefetchingWikiPageEntityMetaDataAccessor(new TypeDispatchingWikiPageEntityMetaDataAccessor(WikibaseRepo::getEntityTypeDefinitions( $services) ->get(EntityTypeDefinitions::ENTITY_METADATA_ACCESSOR_CALLBACK), new WikiPageEntityMetaDataLookup($entityNamespaceLookup, new EntityIdLocalPartPageTableEntityQuery($entityNamespaceLookup, $services->getSlotRoleStore()), WikibaseRepo::getLocalEntitySource( $services), $logger), $dbName, $repoName), $logger);}, 'WikibaseRepo.Logger'=> function(MediaWikiServices $services):LoggerInterface { return LoggerFactory::getInstance( 'Wikibase');}, 'WikibaseRepo.MessageParameterFormatter'=> function(MediaWikiServices $services):ValueFormatter { $formatterOptions=new FormatterOptions();$valueFormatterFactory=WikibaseRepo::getValueFormatterFactory( $services);return new MessageParameterFormatter($valueFormatterFactory->getValueFormatter(SnakFormatter::FORMAT_WIKI, $formatterOptions), new EntityIdLinkFormatter(WikibaseRepo::getEntityTitleLookup( $services)), $services->getSiteLookup(), WikibaseRepo::getUserLanguage( $services));}, 'WikibaseRepo.MonolingualTextLanguages'=> function(MediaWikiServices $services):ContentLanguages { return WikibaseRepo::getWikibaseContentLanguages( $services) ->getContentLanguages(WikibaseContentLanguages::CONTEXT_MONOLINGUAL_TEXT);}, 'WikibaseRepo.PrefetchingTermLookup'=> function(MediaWikiServices $services):PrefetchingTermLookup { $entitySourceDefinitions=WikibaseRepo::getEntitySourceDefinitions( $services);$lookupFactory=WikibaseRepo::getPrefetchingTermLookupFactory( $services);$lookups=array_map([ $lookupFactory, 'getLookupForSource'], $entitySourceDefinitions->getEntityTypeToSourceMapping());return new ByTypeDispatchingPrefetchingTermLookup( $lookups);}, 'WikibaseRepo.PrefetchingTermLookupFactory'=> function(MediaWikiServices $services):PrefetchingTermLookupFactory { return new PrefetchingTermLookupFactory(WikibaseRepo::getEntitySourceDefinitions( $services), WikibaseRepo::getEntityTypeDefinitions( $services), WikibaseRepo::getSingleEntitySourceServicesFactory( $services));}, 'WikibaseRepo.PropertyTermsCollisionDetector'=> function(MediaWikiServices $services):TermsCollisionDetector { return WikibaseRepo::getTermsCollisionDetectorFactory( $services) ->getTermsCollisionDetector(Property::ENTITY_TYPE);}, 'WikibaseRepo.PropertyTermStoreWriter'=> function(MediaWikiServices $services):EntityTermStoreWriter { if(!in_array(Property::ENTITY_TYPE, WikibaseRepo::getLocalEntitySource( $services) ->getEntityTypes())) { return new ThrowingEntityTermStoreWriter();} return new PropertyTermStoreWriterAdapter(WikibaseRepo::getTermStoreWriterFactory( $services) ->newPropertyTermStoreWriter());}, 'WikibaseRepo.PropertyValueExpertsModule'=> function(MediaWikiServices $services):PropertyValueExpertsModule { return new PropertyValueExpertsModule(WikibaseRepo::getDataTypeDefinitions( $services));}, 'WikibaseRepo.RdfVocabulary'=> function(MediaWikiServices $services):RdfVocabulary { $repoSettings=WikibaseRepo::getSettings( $services);$languageCodes=array_merge($services->getMainConfig() ->get( 'DummyLanguageCodes'), $repoSettings->getSetting( 'canonicalLanguageCodes'));$entitySourceDefinitions=WikibaseRepo::getEntitySourceDefinitions( $services);$nodeNamespacePrefixes=$entitySourceDefinitions->getRdfNodeNamespacePrefixes();$predicateNamespacePrefixes=$entitySourceDefinitions->getRdfPredicateNamespacePrefixes();$urlProvider=new EntitySourceDocumentUrlProvider( $services->getTitleFactory());$canonicalDocumentUrls=$urlProvider->getCanonicalDocumentsUrls( $entitySourceDefinitions);return new RdfVocabulary($entitySourceDefinitions->getConceptBaseUris(), $canonicalDocumentUrls, $entitySourceDefinitions, $nodeNamespacePrefixes, $predicateNamespacePrefixes, $languageCodes, WikibaseRepo::getDataTypeDefinitions( $services) ->getRdfTypeUris(), $repoSettings->getSetting( 'pagePropertiesRdf') ?:[], $repoSettings->getSetting( 'rdfDataRightsUrl'));}, 'WikibaseRepo.Settings'=> function(MediaWikiServices $services):SettingsArray { return WikibaseSettings::getRepoSettings();}, 'WikibaseRepo.SingleEntitySourceServicesFactory'=> function(MediaWikiServices $services):SingleEntitySourceServicesFactory { $entityTypeDefinitions=WikibaseRepo::getEntityTypeDefinitions( $services);return new SingleEntitySourceServicesFactory(WikibaseRepo::getEntityIdParser( $services), WikibaseRepo::getEntityIdComposer( $services), WikibaseRepo::getDataValueDeserializer( $services), $services->getNameTableStoreFactory(), WikibaseRepo::getDataAccessSettings( $services), WikibaseRepo::getLanguageFallbackChainFactory( $services), WikibaseRepo::getStorageEntitySerializer( $services), $entityTypeDefinitions);}, 'WikibaseRepo.SiteLinkBadgeChangeOpSerializationValidator'=> function(MediaWikiServices $services):SiteLinkBadgeChangeOpSerializationValidator { return new SiteLinkBadgeChangeOpSerializationValidator(WikibaseRepo::getEntityTitleLookup( $services), array_keys(WikibaseRepo::getSettings( $services) ->getSetting( 'badgeItems')));}, 'WikibaseRepo.StatementGuidParser'=> function(MediaWikiServices $services):StatementGuidParser { return new StatementGuidParser(WikibaseRepo::getEntityIdParser( $services));}, 'WikibaseRepo.StatementGuidValidator'=> function(MediaWikiServices $services):StatementGuidValidator { return new StatementGuidValidator(WikibaseRepo::getEntityIdParser( $services));}, 'WikibaseRepo.StorageEntitySerializer'=> function(MediaWikiServices $services):Serializer { $serializerFactoryCallbacks=WikibaseRepo::getEntityTypeDefinitions( $services) ->get(EntityTypeDefinitions::STORAGE_SERIALIZER_FACTORY_CALLBACK);$baseSerializerFactory=WikibaseRepo::getBaseDataModelSerializerFactory( $services);$serializers=[];foreach( $serializerFactoryCallbacks as $callback) { $serializers[]=$callback( $baseSerializerFactory);} return new DispatchingSerializer( $serializers);}, 'WikibaseRepo.Store'=> function(MediaWikiServices $services):Store { return new SqlStore(WikibaseRepo::getEntityChangeFactory( $services), WikibaseRepo::getEntityIdParser( $services), WikibaseRepo::getEntityIdComposer( $services), WikibaseRepo::getEntityIdLookup( $services), WikibaseRepo::getEntityTitleStoreLookup( $services), WikibaseRepo::getEntityNamespaceLookup( $services), WikibaseRepo::getIdGenerator( $services), WikibaseRepo::getWikibaseServices( $services), WikibaseRepo::getLocalEntitySource( $services), WikibaseRepo::getSettings( $services));}, 'WikibaseRepo.StringNormalizer'=> function(MediaWikiServices $services):StringNormalizer { return new StringNormalizer();}, 'WikibaseRepo.TermBuffer'=> function(MediaWikiServices $services):TermBuffer { return WikibaseRepo::getPrefetchingTermLookup( $services);}, 'WikibaseRepo.TermFallbackCache'=> function(MediaWikiServices $services):TermFallbackCacheFacade { return new TermFallbackCacheFacade(WikibaseRepo::getTermFallbackCacheFactory( $services) ->getTermFallbackCache(), WikibaseRepo::getSettings( $services) ->getSetting( 'sharedCacheDuration'));}, 'WikibaseRepo.TermFallbackCacheFactory'=> function(MediaWikiServices $services):TermFallbackCacheFactory { $settings=WikibaseRepo::getSettings( $services);return new TermFallbackCacheFactory($settings->getSetting( 'sharedCacheType'), WikibaseRepo::getLogger( $services), $services->getStatsdDataFactory(), hash( 'sha256', $services->getMainConfig() ->get( 'SecretKey')), new TermFallbackCacheServiceFactory(), $settings->getSetting( 'termFallbackCacheVersion'));}, 'WikibaseRepo.TermLookup'=> function(MediaWikiServices $services):TermLookup { return WikibaseRepo::getPrefetchingTermLookup( $services);}, 'WikibaseRepo.TermsCollisionDetectorFactory'=> function(MediaWikiServices $services):TermsCollisionDetectorFactory { return new TermsCollisionDetectorFactory($services->getDBLoadBalancer(), WikibaseRepo::getTypeIdsLookup( $services));}, 'WikibaseRepo.TermsLanguages'=> function(MediaWikiServices $services):ContentLanguages { return WikibaseRepo::getWikibaseContentLanguages( $services) ->getContentLanguages(WikibaseContentLanguages::CONTEXT_TERM);}, 'WikibaseRepo.TermStoreWriterFactory'=> function(MediaWikiServices $services):TermStoreWriterFactory { return new TermStoreWriterFactory(WikibaseRepo::getLocalEntitySource( $services), WikibaseRepo::getStringNormalizer( $services), WikibaseRepo::getTypeIdsAcquirer( $services), WikibaseRepo::getTypeIdsLookup( $services), WikibaseRepo::getTypeIdsResolver( $services), $services->getDBLoadBalancerFactory(), $services->getMainWANObjectCache(), JobQueueGroup::singleton(), WikibaseRepo::getLogger( $services));}, 'WikibaseRepo.TermValidatorFactory'=> function(MediaWikiServices $services):TermValidatorFactory { $settings=WikibaseRepo::getSettings( $services);if( $settings->hasSetting( 'multilang-limits')) { $constraints=$settings->getSetting( 'multilang-limits');} else { $constraints=$settings->getSetting( 'string-limits')['multilang'];} $maxLength=$constraints['length'];$languages=WikibaseRepo::getTermsLanguages( $services) ->getLanguages();return new TermValidatorFactory($maxLength, $languages, WikibaseRepo::getEntityIdParser( $services), WikibaseRepo::getTermsCollisionDetectorFactory( $services), WikibaseRepo::getTermLookup( $services));}, 'WikibaseRepo.TypeIdsAcquirer'=> function(MediaWikiServices $services):TypeIdsAcquirer { return WikibaseRepo::getDatabaseTypeIdsStore( $services);}, 'WikibaseRepo.TypeIdsLookup'=> function(MediaWikiServices $services):TypeIdsLookup { return WikibaseRepo::getDatabaseTypeIdsStore( $services);}, 'WikibaseRepo.TypeIdsResolver'=> function(MediaWikiServices $services):TypeIdsResolver { return WikibaseRepo::getDatabaseTypeIdsStore( $services);}, 'WikibaseRepo.UnitConverter'=> function(MediaWikiServices $services):?UnitConverter { $settings=WikibaseRepo::getSettings( $services);if(! $settings->hasSetting( 'unitStorage')) { return null;} $unitStorage=ObjectFactory::getObjectFromSpec( $settings->getSetting( 'unitStorage'));if(!( $unitStorage instanceof UnitStorage)) { wfWarn("Bad unit storage configuration, ignoring");return null;} return new UnitConverter( $unitStorage, $settings->getSetting( 'conceptBaseUri'));}, 'WikibaseRepo.UserLanguage'=> function(MediaWikiServices $services):Language { global $wgLang;if(! $wgLang) { throw new MWException( 'Premature access:$wgLang is not yet initialized!');} StubObject::unstub( $wgLang);return $wgLang;}, 'WikibaseRepo.ValueFormatterFactory'=> function(MediaWikiServices $services):OutputFormatValueFormatterFactory { $formatterFactoryCBs=WikibaseRepo::getDataTypeDefinitions( $services) ->getFormatterFactoryCallbacks(DataTypeDefinitions::PREFIXED_MODE);return new OutputFormatValueFormatterFactory($formatterFactoryCBs, $services->getContentLanguage(), WikibaseRepo::getLanguageFallbackChainFactory( $services));}, 'WikibaseRepo.ValueParserFactory'=> function(MediaWikiServices $services):ValueParserFactory { $dataTypeDefinitions=WikibaseRepo::getDataTypeDefinitions( $services);$callbacks=$dataTypeDefinitions->getParserFactoryCallbacks();$prefixedCallbacks=$dataTypeDefinitions->getParserFactoryCallbacks(DataTypeDefinitions::PREFIXED_MODE);if(isset( $prefixedCallbacks['VT:wikibase-entityid'])) { $callbacks['wikibase-entityid']=$prefixedCallbacks['VT:wikibase-entityid'];} if(isset( $prefixedCallbacks['VT:globecoordinate'])) { $callbacks['globecoordinate']=$prefixedCallbacks['VT:globecoordinate'];} $callbacks['null']=function() { return new NullParser();};return new ValueParserFactory( $callbacks);}, 'WikibaseRepo.ValueSnakRdfBuilderFactory'=> function(MediaWikiServices $services):ValueSnakRdfBuilderFactory { return new ValueSnakRdfBuilderFactory(WikibaseRepo::getDataTypeDefinitions( $services) ->getRdfBuilderFactoryCallbacks(DataTypeDefinitions::PREFIXED_MODE));}, 'WikibaseRepo.WikibaseContentLanguages'=> function(MediaWikiServices $services):WikibaseContentLanguages { return WikibaseContentLanguages::getDefaultInstance($services->getHookContainer(), $services->getLanguageNameUtils());}, 'WikibaseRepo.WikibaseServices'=> function(MediaWikiServices $services):WikibaseServices { $entitySourceDefinitions=WikibaseRepo::getEntitySourceDefinitions( $services);$singleEntitySourceServicesFactory=WikibaseRepo::getSingleEntitySourceServicesFactory( $services);$singleSourceServices=[];foreach( $entitySourceDefinitions->getSources() as $source) { $singleSourceServices[$source->getSourceName()]=$singleEntitySourceServicesFactory ->getServicesForSource( $source);} return new MultipleEntitySourceServices($entitySourceDefinitions, $singleSourceServices);},]
 -require-sorted-array More...
 

Variable Documentation

◆ return

return['WikibaseRepo.AliasTermBuffer'=> function(MediaWikiServices $services):AliasTermBuffer { return WikibaseRepo::getPrefetchingTermLookup($services);}, 'WikibaseRepo.AllTypesEntityDeserializer'=> function(MediaWikiServices $services):DispatchableDeserializer { $deserializerFactoryCallbacks=WikibaseRepo::getEntityTypeDefinitions($services) ->get(EntityTypeDefinitions::DESERIALIZER_FACTORY_CALLBACK); $baseDeserializerFactory=WikibaseRepo::getBaseDataModelDeserializerFactory($services); $deserializers=[]; foreach($deserializerFactoryCallbacks as $callback) { $deserializers[]=call_user_func($callback, $baseDeserializerFactory); } return new DispatchingDeserializer($deserializers);}, 'WikibaseRepo.AllTypesEntitySerializer'=> function(MediaWikiServices $services):Serializer { $serializerFactoryCallbacks=WikibaseRepo::getEntityTypeDefinitions($services) ->get(EntityTypeDefinitions::SERIALIZER_FACTORY_CALLBACK); $baseSerializerFactory=WikibaseRepo::getBaseDataModelSerializerFactory($services); $serializers=[]; foreach($serializerFactoryCallbacks as $callback) { $serializers[]=$callback($baseSerializerFactory); } return new DispatchingSerializer($serializers);}, 'WikibaseRepo.BaseDataModelDeserializerFactory'=> function(MediaWikiServices $services):DeserializerFactory { return new DeserializerFactory( WikibaseRepo::getDataValueDeserializer($services), WikibaseRepo::getEntityIdParser($services));}, 'WikibaseRepo.BaseDataModelSerializerFactory'=> function(MediaWikiServices $services):SerializerFactory { return new SerializerFactory(new DataValueSerializer(), SerializerFactory::OPTION_DEFAULT);}, 'WikibaseRepo.ChangeNotifier'=> function(MediaWikiServices $services):ChangeNotifier { $transmitters=[ new HookChangeTransmitter( $services->getHookContainer(), 'WikibaseChangeNotification'),]; $settings=WikibaseRepo::getSettings($services); if($settings->getSetting('useChangesTable')) { $changeStore=WikibaseRepo::getStore($services) ->getChangeStore(); $transmitters[]=new DatabaseChangeTransmitter($changeStore); } return new ChangeNotifier( WikibaseRepo::getEntityChangeFactory($services), $transmitters, CentralIdLookup::factoryNonLocal());}, 'WikibaseRepo.CompactBaseDataModelSerializerFactory'=> function(MediaWikiServices $services):SerializerFactory { return new SerializerFactory( new DataValueSerializer(), SerializerFactory::OPTION_SERIALIZE_MAIN_SNAKS_WITHOUT_HASH+ SerializerFactory::OPTION_SERIALIZE_REFERENCE_SNAKS_WITHOUT_HASH);}, 'WikibaseRepo.CompactEntitySerializer'=> function(MediaWikiServices $services):Serializer { $serializerFactoryCallbacks=WikibaseRepo::getEntityTypeDefinitions($services) ->get(EntityTypeDefinitions::SERIALIZER_FACTORY_CALLBACK); $baseSerializerFactory=WikibaseRepo::getCompactBaseDataModelSerializerFactory($services); $serializers=[]; foreach($serializerFactoryCallbacks as $callback) { $serializers[]=$callback($baseSerializerFactory); } return new DispatchingSerializer($serializers);}, 'WikibaseRepo.ContentModelMappings'=> function(MediaWikiServices $services):array { $map=WikibaseRepo::getEntityTypeDefinitions($services) ->get(EntityTypeDefinitions::CONTENT_MODEL_ID); $services->getHookContainer() ->run('WikibaseContentModelMapping',[& $map]); return $map;}, 'WikibaseRepo.DataAccessSettings'=> function(MediaWikiServices $services):DataAccessSettings { return new DataAccessSettings( WikibaseRepo::getSettings($services) ->getSetting('maxSerializedEntitySize'));}, 'WikibaseRepo.DatabaseTypeIdsStore'=> function(MediaWikiServices $services):DatabaseTypeIdsStore { return new DatabaseTypeIdsStore( $services->getDBLoadBalancer(), $services->getMainWANObjectCache());}, 'WikibaseRepo.DataTypeDefinitions'=> function(MediaWikiServices $services):DataTypeDefinitions { $baseDataTypes=require __DIR__ . '/../lib/WikibaseLib.datatypes.php'; $repoDataTypes=require __DIR__ . '/WikibaseRepo.datatypes.php'; $dataTypes=array_merge_recursive($baseDataTypes, $repoDataTypes); $services->getHookContainer() ->run('WikibaseRepoDataTypes',[& $dataTypes]); $settings=WikibaseRepo::getSettings($services); return new DataTypeDefinitions( $dataTypes, $settings->getSetting('disabledDataTypes'));}, 'WikibaseRepo.DataTypeFactory'=> function(MediaWikiServices $services):DataTypeFactory { return new DataTypeFactory( WikibaseRepo::getDataTypeDefinitions($services) ->getValueTypes());}, 'WikibaseRepo.DataTypeValidatorFactory'=> function(MediaWikiServices $services):DataTypeValidatorFactory { return new BuilderBasedDataTypeValidatorFactory( WikibaseRepo::getDataTypeDefinitions($services) ->getValidatorFactoryCallbacks());}, 'WikibaseRepo.DataValueDeserializer'=> function(MediaWikiServices $services):DataValueDeserializer { return new DataValueDeserializer([ 'string'=> StringValue::class, 'unknown'=> UnknownValue::class, 'globecoordinate'=> GlobeCoordinateValue::class, 'monolingualtext'=> MonolingualTextValue::class, 'quantity'=> QuantityValue::class, 'time'=> TimeValue::class, 'wikibase-entityid'=> function($value) use($services) { if(isset($value[ 'id'])) { try { return new EntityIdValue(WikibaseRepo::getEntityIdParser($services) ->parse($value[ 'id'])); } catch(EntityIdParsingException $parsingException) { throw new InvalidArgumentException( 'Can not parse id \'' . $value[ 'id'] . '\' to build EntityIdValue with', 0, $parsingException); } } else { return EntityIdValue::newFromArray($value); } },]);}, 'WikibaseRepo.DataValueFactory'=> function(MediaWikiServices $services):DataValueFactory { return new DataValueFactory(WikibaseRepo::getDataValueDeserializer($services));}, 'WikibaseRepo.EntityArticleIdLookup'=> function(MediaWikiServices $services):EntityArticleIdLookup { return new TypeDispatchingArticleIdLookup( WikibaseRepo::getEntityTypeDefinitions($services) ->get(EntityTypeDefinitions::ARTICLE_ID_LOOKUP_CALLBACK), new TitleLookupBasedEntityArticleIdLookup( WikibaseRepo::getEntityTitleLookup($services)));}, 'WikibaseRepo.EntityChangeFactory'=> function(MediaWikiServices $services):EntityChangeFactory { $changeClasses=[ Item::ENTITY_TYPE=> RepoItemChange::class,]; return new EntityChangeFactory( WikibaseRepo::getEntityDiffer($services), WikibaseRepo::getEntityIdParser($services), $changeClasses, RepoEntityChange::class, WikibaseRepo::getLogger($services));}, 'WikibaseRepo.EntityChangeOpProvider'=> function(MediaWikiServices $services):EntityChangeOpProvider { return new EntityChangeOpProvider( WikibaseRepo::getEntityTypeDefinitions($services) ->get(EntityTypeDefinitions::CHANGEOP_DESERIALIZER_CALLBACK));}, 'WikibaseRepo.EntityConstraintProvider'=> function(MediaWikiServices $services):EntityConstraintProvider { return new EntityConstraintProvider( new SqlSiteLinkConflictLookup(WikibaseRepo::getEntityIdComposer($services)));}, 'WikibaseRepo.EntityContentFactory'=> function(MediaWikiServices $services):EntityContentFactory { return new EntityContentFactory( WikibaseRepo::getContentModelMappings($services), WikibaseRepo::getEntityTypeDefinitions($services) ->get(EntityTypeDefinitions::CONTENT_HANDLER_FACTORY_CALLBACK), WikibaseRepo::getEntitySourceDefinitions($services), WikibaseRepo::getLocalEntitySource($services), $services->getInterwikiLookup());}, 'WikibaseRepo.EntityDiffer'=> function(MediaWikiServices $services):EntityDiffer { $entityDiffer=new EntityDiffer(); $entityTypeDefinitions=WikibaseRepo::getEntityTypeDefinitions($services); $builders=$entityTypeDefinitions->get(EntityTypeDefinitions::ENTITY_DIFFER_STRATEGY_BUILDER); foreach($builders as $builder) { $entityDiffer->registerEntityDifferStrategy($builder()); } return $entityDiffer;}, 'WikibaseRepo.EntityExistenceChecker'=> function(MediaWikiServices $services):EntityExistenceChecker { return new TypeDispatchingExistenceChecker( WikibaseRepo::getEntityTypeDefinitions($services) ->get(EntityTypeDefinitions::EXISTENCE_CHECKER_CALLBACK), new TitleLookupBasedEntityExistenceChecker( WikibaseRepo::getEntityTitleLookup($services), $services->getLinkBatchFactory()));}, 'WikibaseRepo.EntityFactory'=> function(MediaWikiServices $services):EntityFactory { $instantiators=WikibaseRepo::getEntityTypeDefinitions($services) ->get(EntityTypeDefinitions::ENTITY_FACTORY_CALLBACK); return new EntityFactory($instantiators);}, 'WikibaseRepo.EntityIdComposer'=> function(MediaWikiServices $services):EntityIdComposer { return new EntityIdComposer( WikibaseRepo::getEntityTypeDefinitions($services) ->get(EntityTypeDefinitions::ENTITY_ID_COMPOSER_CALLBACK));}, 'WikibaseRepo.EntityIdLookup'=> function(MediaWikiServices $services):EntityIdLookup { return WikibaseRepo::getEntityContentFactory($services);}, 'WikibaseRepo.EntityIdParser'=> function(MediaWikiServices $services):EntityIdParser { return new DispatchingEntityIdParser( WikibaseRepo::getEntityTypeDefinitions($services) ->getEntityIdBuilders());}, 'WikibaseRepo.EntityLookup'=> function(MediaWikiServices $services):EntityLookup { return WikibaseRepo::getStore($services) ->getEntityLookup( Store::LOOKUP_CACHING_ENABLED, LookupConstants::LATEST_FROM_REPLICA);}, 'WikibaseRepo.EntityNamespaceLookup'=> function(MediaWikiServices $services):EntityNamespaceLookup { return array_reduce( WikibaseRepo::getEntitySourceDefinitions($services) ->getSources(), function(EntityNamespaceLookup $nsLookup, EntitySource $source):EntityNamespaceLookup { return $nsLookup->merge(new EntityNamespaceLookup( $source->getEntityNamespaceIds(), $source->getEntitySlotNames())); }, new EntityNamespaceLookup([],[]));}, 'WikibaseRepo.EntityPatcher'=> function(MediaWikiServices $services):EntityPatcher { $entityPatcher=new EntityPatcher(); $entityTypeDefinitions=WikibaseRepo::getEntityTypeDefinitions($services); $builders=$entityTypeDefinitions->get(EntityTypeDefinitions::ENTITY_PATCHER_STRATEGY_BUILDER); foreach($builders as $builder) { $entityPatcher->registerEntityPatcherStrategy($builder()); } return $entityPatcher;}, 'WikibaseRepo.EntityPermissionChecker'=> function(MediaWikiServices $services):EntityPermissionChecker { return new WikiPageEntityStorePermissionChecker( WikibaseRepo::getEntityNamespaceLookup($services), WikibaseRepo::getEntityTitleLookup($services), $services->getPermissionManager(), $services->getMainConfig() ->get('AvailableRights'));}, 'WikibaseRepo.EntityRdfBuilderFactory'=> function(MediaWikiServices $services):EntityRdfBuilderFactory { $entityTypeDefinitions=WikibaseRepo::getEntityTypeDefinitions($services); return new EntityRdfBuilderFactory( $entityTypeDefinitions->get(EntityTypeDefinitions::RDF_BUILDER_FACTORY_CALLBACK), $entityTypeDefinitions->get(EntityTypeDefinitions::RDF_LABEL_PREDICATES));}, 'WikibaseRepo.EntityRedirectChecker'=> function(MediaWikiServices $services):EntityRedirectChecker { return new TypeDispatchingRedirectChecker( WikibaseRepo::getEntityTypeDefinitions($services) ->get(EntityTypeDefinitions::REDIRECT_CHECKER_CALLBACK), new TitleLookupBasedEntityRedirectChecker( WikibaseRepo::getEntityTitleLookup($services)));}, 'WikibaseRepo.EntitySourceDefinitions'=> function(MediaWikiServices $services):EntitySourceDefinitions { $settings=WikibaseRepo::getSettings($services); $entityTypeDefinitions=WikibaseRepo::getEntityTypeDefinitions($services); if($settings->hasSetting('entitySources') &&!empty($settings->getSetting('entitySources'))) { $configParser=new EntitySourceDefinitionsConfigParser(); return $configParser->newDefinitionsFromConfigArray( $settings->getSetting('entitySources'), $entityTypeDefinitions); } $parser=new EntitySourceDefinitionsLegacyRepoSettingsParser(); if($settings->getSetting('federatedPropertiesEnabled')) { $configParser=new FederatedPropertiesEntitySourceDefinitionsConfigParser($settings); return $configParser->initializeDefaults( $parser->newDefinitionsFromSettings($settings, $entityTypeDefinitions), $entityTypeDefinitions); } return $parser->newDefinitionsFromSettings($settings, $entityTypeDefinitions);}, 'WikibaseRepo.EntityStore'=> function(MediaWikiServices $services):EntityStore { return WikibaseRepo::getStore($services) ->getEntityStore();}, 'WikibaseRepo.EntityStoreWatcher'=> function(MediaWikiServices $services):EntityStoreWatcher { return WikibaseRepo::getStore($services) ->getEntityStoreWatcher();}, 'WikibaseRepo.EntityTitleLookup'=> function(MediaWikiServices $services):EntityTitleLookup { return WikibaseRepo::getEntityTitleStoreLookup($services);}, 'WikibaseRepo.EntityTitleStoreLookup'=> function(MediaWikiServices $services):EntityTitleStoreLookup { return new TypeDispatchingEntityTitleStoreLookup( WikibaseRepo::getEntityTypeDefinitions($services) ->get(EntityTypeDefinitions::ENTITY_TITLE_STORE_LOOKUP_FACTORY_CALLBACK), WikibaseRepo::getEntityContentFactory($services));}, 'WikibaseRepo.EntityTitleTextLookup'=> function(MediaWikiServices $services):EntityTitleTextLookup { return new TypeDispatchingTitleTextLookup( WikibaseRepo::getEntityTypeDefinitions($services) ->get(EntityTypeDefinitions::TITLE_TEXT_LOOKUP_CALLBACK), new TitleLookupBasedEntityTitleTextLookup( WikibaseRepo::getEntityTitleLookup($services)));}, 'WikibaseRepo.EntityTypeDefinitions'=> function(MediaWikiServices $services):EntityTypeDefinitions { $baseEntityTypes=require __DIR__ . '/../lib/WikibaseLib.entitytypes.php'; $repoEntityTypes=require __DIR__ . '/WikibaseRepo.entitytypes.php'; $entityTypes=array_merge_recursive($baseEntityTypes, $repoEntityTypes); $services->getHookContainer() ->run('WikibaseRepoEntityTypes',[& $entityTypes]); $settings=WikibaseRepo::getSettings($services); $overrider=EntityTypeDefinitionsFedPropsOverrider::factory($settings->getSetting('federatedPropertiesEnabled')); $entityTypes=$overrider->override($entityTypes); return new EntityTypeDefinitions($entityTypes);}, 'WikibaseRepo.EntityUrlLookup'=> function(MediaWikiServices $services):EntityUrlLookup { return new TypeDispatchingUrlLookup( WikibaseRepo::getEntityTypeDefinitions($services) ->get(EntityTypeDefinitions::URL_LOOKUP_CALLBACK), new TitleLookupBasedEntityUrlLookup( WikibaseRepo::getEntityTitleLookup($services)));}, 'WikibaseRepo.ExternalFormatStatementDeserializer'=> function(MediaWikiServices $services):Deserializer { return WikibaseRepo::getBaseDataModelDeserializerFactory($services) ->newStatementDeserializer();}, 'WikibaseRepo.IdGenerator'=> function(MediaWikiServices $services):IdGenerator { $settings=WikibaseRepo::getSettings($services); switch($settings->getSetting('idGenerator')) { case 'original': $idGenerator=new SqlIdGenerator( $services->getDBLoadBalancer(), $settings->getSetting('reservedIds'), $settings->getSetting('idGeneratorSeparateDbConnection')); break; case 'mysql-upsert': $idGenerator=new UpsertSqlIdGenerator( $services->getDBLoadBalancer(), $settings->getSetting('reservedIds'), $settings->getSetting('idGeneratorSeparateDbConnection')); break; default: throw new InvalidArgumentException( 'idGenerator config option must be either \ 'original\' or \ 'mysql-upsert\''); } return new RateLimitingIdGenerator( $idGenerator, RequestContext::getMain());}, 'WikibaseRepo.InternalFormatDeserializerFactory'=> function(MediaWikiServices $services):InternalDeserializerFactory { return new InternalDeserializerFactory( WikibaseRepo::getDataValueDeserializer($services), WikibaseRepo::getEntityIdParser($services), WikibaseRepo::getAllTypesEntityDeserializer($services));}, 'WikibaseRepo.InternalFormatEntityDeserializer'=> function(MediaWikiServices $services):Deserializer { return WikibaseRepo::getInternalFormatDeserializerFactory($services) ->newEntityDeserializer();}, 'WikibaseRepo.ItemTermsCollisionDetector'=> function(MediaWikiServices $services):TermsCollisionDetector { return WikibaseRepo::getTermsCollisionDetectorFactory($services) ->getTermsCollisionDetector(Item::ENTITY_TYPE);}, 'WikibaseRepo.ItemTermStoreWriter'=> function(MediaWikiServices $services):EntityTermStoreWriter { if(!in_array( Item::ENTITY_TYPE, WikibaseRepo::getLocalEntitySource($services) ->getEntityTypes())) { return new ThrowingEntityTermStoreWriter(); } return new ItemTermStoreWriterAdapter( WikibaseRepo::getTermStoreWriterFactory($services) ->newItemTermStoreWriter());}, 'WikibaseRepo.ItemUrlParser'=> function(MediaWikiServices $services):SuffixEntityIdParser { return new SuffixEntityIdParser( WikibaseRepo::getItemVocabularyBaseUri($services), new ItemIdParser());}, 'WikibaseRepo.ItemVocabularyBaseUri'=> function(MediaWikiServices $services):string { $itemSource=WikibaseRepo::getEntitySourceDefinitions($services) ->getSourceForEntityType(Item::ENTITY_TYPE); if($itemSource===null) { throw new LogicException('No source providing Items configured!'); } return $itemSource->getConceptBaseUri();}, 'WikibaseRepo.KartographerEmbeddingHandler'=> function(MediaWikiServices $services):?CachingKartographerEmbeddingHandler { $settings=WikibaseRepo::getSettings($services); $config=$services->getMainConfig(); if( $settings->getSetting('useKartographerGlobeCoordinateFormatter') && ExtensionRegistry::getInstance() ->isLoaded('Kartographer') && $config->has('KartographerEnableMapFrame') && $config->get('KartographerEnableMapFrame')) { return new CachingKartographerEmbeddingHandler( $services->getParserFactory() ->create()); } else { return null; } }, 'WikibaseRepo.LanguageFallbackChainFactory'=> function(MediaWikiServices $services):LanguageFallbackChainFactory { return new LanguageFallbackChainFactory( $services->getLanguageFactory(), $services->getLanguageConverterFactory(), $services->getLanguageFallback());}, 'WikibaseRepo.LanguageFallbackLabelDescriptionLookupFactory'=> function( MediaWikiServices $services):LanguageFallbackLabelDescriptionLookupFactory { return new LanguageFallbackLabelDescriptionLookupFactory( WikibaseRepo::getLanguageFallbackChainFactory($services), WikibaseRepo::getTermLookup($services), WikibaseRepo::getTermBuffer($services));}, 'WikibaseRepo.LinkTargetEntityIdLookup'=> function(MediaWikiServices $services):LinkTargetEntityIdLookup { return new EntityLinkTargetEntityIdLookup( WikibaseRepo::getEntityNamespaceLookup($services), WikibaseRepo::getEntityIdParser($services), WikibaseRepo::getEntitySourceDefinitions($services), WikibaseRepo::getLocalEntitySource($services));}, 'WikibaseRepo.LocalEntityNamespaceLookup'=> function(MediaWikiServices $services):EntityNamespaceLookup { $localEntitySource=WikibaseRepo::getLocalEntitySource($services); $nsIds=$localEntitySource->getEntityNamespaceIds(); $entitySlots=$localEntitySource->getEntitySlotNames(); return new EntityNamespaceLookup($nsIds, $entitySlots);}, 'WikibaseRepo.LocalEntitySource'=> function(MediaWikiServices $services):EntitySource { $localEntitySourceName=WikibaseRepo::getSettings($services) ->getSetting('localEntitySourceName'); $sources=WikibaseRepo::getEntitySourceDefinitions($services) ->getSources(); foreach($sources as $source) { if($source->getSourceName()===$localEntitySourceName) { return $source; } } throw new LogicException('No source configured:' . $localEntitySourceName);}, 'WikibaseRepo.LocalEntityTypes'=> function(MediaWikiServices $services):array { $localSource=WikibaseRepo::getLocalEntitySource($services); $subEntityTypes=WikibaseRepo::getEntityTypeDefinitions($services) ->get(EntityTypeDefinitions::SUB_ENTITY_TYPES); return array_reduce( $localSource->getEntityTypes(), function($types, $localTypeName) use($subEntityTypes) { $types[]=$localTypeName; if(array_key_exists($localTypeName, $subEntityTypes)) { $types=array_merge($types, $subEntityTypes[ $localTypeName]); } return $types; },[]);}, 'WikibaseRepo.LocalRepoWikiPageMetaDataAccessor'=> function(MediaWikiServices $services):WikiPageEntityMetaDataAccessor { $entityNamespaceLookup=WikibaseRepo::getEntityNamespaceLookup($services); $repoName=''; $dbName=false; $logger=WikibaseRepo::getLogger($services); return new PrefetchingWikiPageEntityMetaDataAccessor( new TypeDispatchingWikiPageEntityMetaDataAccessor( WikibaseRepo::getEntityTypeDefinitions($services) ->get(EntityTypeDefinitions::ENTITY_METADATA_ACCESSOR_CALLBACK), new WikiPageEntityMetaDataLookup( $entityNamespaceLookup, new EntityIdLocalPartPageTableEntityQuery( $entityNamespaceLookup, $services->getSlotRoleStore()), WikibaseRepo::getLocalEntitySource($services), $logger), $dbName, $repoName), $logger);}, 'WikibaseRepo.Logger'=> function(MediaWikiServices $services):LoggerInterface { return LoggerFactory::getInstance('Wikibase');}, 'WikibaseRepo.MessageParameterFormatter'=> function(MediaWikiServices $services):ValueFormatter { $formatterOptions=new FormatterOptions(); $valueFormatterFactory=WikibaseRepo::getValueFormatterFactory($services); return new MessageParameterFormatter( $valueFormatterFactory->getValueFormatter(SnakFormatter::FORMAT_WIKI, $formatterOptions), new EntityIdLinkFormatter(WikibaseRepo::getEntityTitleLookup($services)), $services->getSiteLookup(), WikibaseRepo::getUserLanguage($services));}, 'WikibaseRepo.MonolingualTextLanguages'=> function(MediaWikiServices $services):ContentLanguages { return WikibaseRepo::getWikibaseContentLanguages($services) ->getContentLanguages(WikibaseContentLanguages::CONTEXT_MONOLINGUAL_TEXT);}, 'WikibaseRepo.PrefetchingTermLookup'=> function(MediaWikiServices $services):PrefetchingTermLookup { $entitySourceDefinitions=WikibaseRepo::getEntitySourceDefinitions($services); $lookupFactory=WikibaseRepo::getPrefetchingTermLookupFactory($services); $lookups=array_map([$lookupFactory, 'getLookupForSource'], $entitySourceDefinitions->getEntityTypeToSourceMapping()); return new ByTypeDispatchingPrefetchingTermLookup($lookups);}, 'WikibaseRepo.PrefetchingTermLookupFactory'=> function(MediaWikiServices $services):PrefetchingTermLookupFactory { return new PrefetchingTermLookupFactory( WikibaseRepo::getEntitySourceDefinitions($services), WikibaseRepo::getEntityTypeDefinitions($services), WikibaseRepo::getSingleEntitySourceServicesFactory($services));}, 'WikibaseRepo.PropertyTermsCollisionDetector'=> function(MediaWikiServices $services):TermsCollisionDetector { return WikibaseRepo::getTermsCollisionDetectorFactory($services) ->getTermsCollisionDetector(Property::ENTITY_TYPE);}, 'WikibaseRepo.PropertyTermStoreWriter'=> function(MediaWikiServices $services):EntityTermStoreWriter { if(!in_array( Property::ENTITY_TYPE, WikibaseRepo::getLocalEntitySource($services) ->getEntityTypes())) { return new ThrowingEntityTermStoreWriter(); } return new PropertyTermStoreWriterAdapter( WikibaseRepo::getTermStoreWriterFactory($services) ->newPropertyTermStoreWriter());}, 'WikibaseRepo.PropertyValueExpertsModule'=> function(MediaWikiServices $services):PropertyValueExpertsModule { return new PropertyValueExpertsModule(WikibaseRepo::getDataTypeDefinitions($services));}, 'WikibaseRepo.RdfVocabulary'=> function(MediaWikiServices $services):RdfVocabulary { $repoSettings=WikibaseRepo::getSettings($services); $languageCodes=array_merge( $services->getMainConfig() ->get('DummyLanguageCodes'), $repoSettings->getSetting('canonicalLanguageCodes')); $entitySourceDefinitions=WikibaseRepo::getEntitySourceDefinitions($services); $nodeNamespacePrefixes=$entitySourceDefinitions->getRdfNodeNamespacePrefixes(); $predicateNamespacePrefixes=$entitySourceDefinitions->getRdfPredicateNamespacePrefixes(); $urlProvider=new EntitySourceDocumentUrlProvider($services->getTitleFactory()); $canonicalDocumentUrls=$urlProvider->getCanonicalDocumentsUrls($entitySourceDefinitions); return new RdfVocabulary( $entitySourceDefinitions->getConceptBaseUris(), $canonicalDocumentUrls, $entitySourceDefinitions, $nodeNamespacePrefixes, $predicateNamespacePrefixes, $languageCodes, WikibaseRepo::getDataTypeDefinitions($services) ->getRdfTypeUris(), $repoSettings->getSetting('pagePropertiesRdf') ?:[], $repoSettings->getSetting('rdfDataRightsUrl'));}, 'WikibaseRepo.Settings'=> function(MediaWikiServices $services):SettingsArray { return WikibaseSettings::getRepoSettings();}, 'WikibaseRepo.SingleEntitySourceServicesFactory'=> function( MediaWikiServices $services):SingleEntitySourceServicesFactory { $entityTypeDefinitions=WikibaseRepo::getEntityTypeDefinitions($services); return new SingleEntitySourceServicesFactory( WikibaseRepo::getEntityIdParser($services), WikibaseRepo::getEntityIdComposer($services), WikibaseRepo::getDataValueDeserializer($services), $services->getNameTableStoreFactory(), WikibaseRepo::getDataAccessSettings($services), WikibaseRepo::getLanguageFallbackChainFactory($services), WikibaseRepo::getStorageEntitySerializer($services), $entityTypeDefinitions);}, 'WikibaseRepo.SiteLinkBadgeChangeOpSerializationValidator'=> function( MediaWikiServices $services):SiteLinkBadgeChangeOpSerializationValidator { return new SiteLinkBadgeChangeOpSerializationValidator( WikibaseRepo::getEntityTitleLookup($services), array_keys( WikibaseRepo::getSettings($services) ->getSetting('badgeItems')));}, 'WikibaseRepo.StatementGuidParser'=> function(MediaWikiServices $services):StatementGuidParser { return new StatementGuidParser(WikibaseRepo::getEntityIdParser($services));}, 'WikibaseRepo.StatementGuidValidator'=> function(MediaWikiServices $services):StatementGuidValidator { return new StatementGuidValidator(WikibaseRepo::getEntityIdParser($services));}, 'WikibaseRepo.StorageEntitySerializer'=> function(MediaWikiServices $services):Serializer { $serializerFactoryCallbacks=WikibaseRepo::getEntityTypeDefinitions($services) ->get(EntityTypeDefinitions::STORAGE_SERIALIZER_FACTORY_CALLBACK); $baseSerializerFactory=WikibaseRepo::getBaseDataModelSerializerFactory($services); $serializers=[]; foreach($serializerFactoryCallbacks as $callback) { $serializers[]=$callback($baseSerializerFactory); } return new DispatchingSerializer($serializers);}, 'WikibaseRepo.Store'=> function(MediaWikiServices $services):Store { return new SqlStore( WikibaseRepo::getEntityChangeFactory($services), WikibaseRepo::getEntityIdParser($services), WikibaseRepo::getEntityIdComposer($services), WikibaseRepo::getEntityIdLookup($services), WikibaseRepo::getEntityTitleStoreLookup($services), WikibaseRepo::getEntityNamespaceLookup($services), WikibaseRepo::getIdGenerator($services), WikibaseRepo::getWikibaseServices($services), WikibaseRepo::getLocalEntitySource($services), WikibaseRepo::getSettings($services));}, 'WikibaseRepo.StringNormalizer'=> function(MediaWikiServices $services):StringNormalizer { return new StringNormalizer();}, 'WikibaseRepo.TermBuffer'=> function(MediaWikiServices $services):TermBuffer { return WikibaseRepo::getPrefetchingTermLookup($services);}, 'WikibaseRepo.TermFallbackCache'=> function(MediaWikiServices $services):TermFallbackCacheFacade { return new TermFallbackCacheFacade( WikibaseRepo::getTermFallbackCacheFactory($services) ->getTermFallbackCache(), WikibaseRepo::getSettings($services) ->getSetting('sharedCacheDuration'));}, 'WikibaseRepo.TermFallbackCacheFactory'=> function(MediaWikiServices $services):TermFallbackCacheFactory { $settings=WikibaseRepo::getSettings($services); return new TermFallbackCacheFactory( $settings->getSetting('sharedCacheType'), WikibaseRepo::getLogger($services), $services->getStatsdDataFactory(), hash('sha256', $services->getMainConfig() ->get('SecretKey')), new TermFallbackCacheServiceFactory(), $settings->getSetting('termFallbackCacheVersion'));}, 'WikibaseRepo.TermLookup'=> function(MediaWikiServices $services):TermLookup { return WikibaseRepo::getPrefetchingTermLookup($services);}, 'WikibaseRepo.TermsCollisionDetectorFactory'=> function(MediaWikiServices $services):TermsCollisionDetectorFactory { return new TermsCollisionDetectorFactory( $services->getDBLoadBalancer(), WikibaseRepo::getTypeIdsLookup($services));}, 'WikibaseRepo.TermsLanguages'=> function(MediaWikiServices $services):ContentLanguages { return WikibaseRepo::getWikibaseContentLanguages($services) ->getContentLanguages(WikibaseContentLanguages::CONTEXT_TERM);}, 'WikibaseRepo.TermStoreWriterFactory'=> function(MediaWikiServices $services):TermStoreWriterFactory { return new TermStoreWriterFactory( WikibaseRepo::getLocalEntitySource($services), WikibaseRepo::getStringNormalizer($services), WikibaseRepo::getTypeIdsAcquirer($services), WikibaseRepo::getTypeIdsLookup($services), WikibaseRepo::getTypeIdsResolver($services), $services->getDBLoadBalancerFactory(), $services->getMainWANObjectCache(), JobQueueGroup::singleton(), WikibaseRepo::getLogger($services));}, 'WikibaseRepo.TermValidatorFactory'=> function(MediaWikiServices $services):TermValidatorFactory { $settings=WikibaseRepo::getSettings($services); if($settings->hasSetting('multilang-limits')) { $constraints=$settings->getSetting('multilang-limits'); } else { $constraints=$settings->getSetting('string-limits')[ 'multilang']; } $maxLength=$constraints[ 'length']; $languages=WikibaseRepo::getTermsLanguages($services) ->getLanguages(); return new TermValidatorFactory( $maxLength, $languages, WikibaseRepo::getEntityIdParser($services), WikibaseRepo::getTermsCollisionDetectorFactory($services), WikibaseRepo::getTermLookup($services));}, 'WikibaseRepo.TypeIdsAcquirer'=> function(MediaWikiServices $services):TypeIdsAcquirer { return WikibaseRepo::getDatabaseTypeIdsStore($services);}, 'WikibaseRepo.TypeIdsLookup'=> function(MediaWikiServices $services):TypeIdsLookup { return WikibaseRepo::getDatabaseTypeIdsStore($services);}, 'WikibaseRepo.TypeIdsResolver'=> function(MediaWikiServices $services):TypeIdsResolver { return WikibaseRepo::getDatabaseTypeIdsStore($services);}, 'WikibaseRepo.UnitConverter'=> function(MediaWikiServices $services):?UnitConverter { $settings=WikibaseRepo::getSettings($services); if(! $settings->hasSetting('unitStorage')) { return null; } $unitStorage=ObjectFactory::getObjectFromSpec($settings->getSetting('unitStorage')); if(!($unitStorage instanceof UnitStorage)) { wfWarn("Bad unit storage configuration, ignoring"); return null; } return new UnitConverter($unitStorage, $settings->getSetting('conceptBaseUri'));}, 'WikibaseRepo.UserLanguage'=> function(MediaWikiServices $services):Language { global $wgLang; if(! $wgLang) { throw new MWException('Premature access:$wgLang is not yet initialized!'); } StubObject::unstub($wgLang); return $wgLang;}, 'WikibaseRepo.ValueFormatterFactory'=> function(MediaWikiServices $services):OutputFormatValueFormatterFactory { $formatterFactoryCBs=WikibaseRepo::getDataTypeDefinitions($services) ->getFormatterFactoryCallbacks(DataTypeDefinitions::PREFIXED_MODE); return new OutputFormatValueFormatterFactory( $formatterFactoryCBs, $services->getContentLanguage(), WikibaseRepo::getLanguageFallbackChainFactory($services));}, 'WikibaseRepo.ValueParserFactory'=> function(MediaWikiServices $services):ValueParserFactory { $dataTypeDefinitions=WikibaseRepo::getDataTypeDefinitions($services); $callbacks=$dataTypeDefinitions->getParserFactoryCallbacks(); $prefixedCallbacks=$dataTypeDefinitions->getParserFactoryCallbacks( DataTypeDefinitions::PREFIXED_MODE); if(isset($prefixedCallbacks[ 'VT:wikibase-entityid'])) { $callbacks[ 'wikibase-entityid']=$prefixedCallbacks[ 'VT:wikibase-entityid']; } if(isset($prefixedCallbacks[ 'VT:globecoordinate'])) { $callbacks[ 'globecoordinate']=$prefixedCallbacks[ 'VT:globecoordinate']; } $callbacks[ 'null']=function() { return new NullParser(); }; return new ValueParserFactory($callbacks);}, 'WikibaseRepo.ValueSnakRdfBuilderFactory'=> function(MediaWikiServices $services):ValueSnakRdfBuilderFactory { return new ValueSnakRdfBuilderFactory( WikibaseRepo::getDataTypeDefinitions($services) ->getRdfBuilderFactoryCallbacks(DataTypeDefinitions::PREFIXED_MODE));}, 'WikibaseRepo.WikibaseContentLanguages'=> function(MediaWikiServices $services):WikibaseContentLanguages { return WikibaseContentLanguages::getDefaultInstance( $services->getHookContainer(), $services->getLanguageNameUtils());}, 'WikibaseRepo.WikibaseServices'=> function(MediaWikiServices $services):WikibaseServices { $entitySourceDefinitions=WikibaseRepo::getEntitySourceDefinitions($services); $singleEntitySourceServicesFactory=WikibaseRepo::getSingleEntitySourceServicesFactory($services); $singleSourceServices=[]; foreach($entitySourceDefinitions->getSources() as $source) { $singleSourceServices[ $source->getSourceName()]=$singleEntitySourceServicesFactory ->getServicesForSource($source); } return new MultipleEntitySourceServices( $entitySourceDefinitions, $singleSourceServices);},]

-require-sorted-array