Wikibase
MediaWiki Wikibase extension
WikibaseLib.entitytypes.php File Reference

Variables

 return [ 'item'=>[Def::SERIALIZER_FACTORY_CALLBACK=> function(SerializerFactory $serializerFactory) { return $serializerFactory->newItemSerializer();}, Def::DESERIALIZER_FACTORY_CALLBACK=> function(DeserializerFactory $deserializerFactory) { return $deserializerFactory->newItemDeserializer();}, Def::ENTITY_ID_PATTERN=> ItemId::PATTERN, Def::ENTITY_ID_BUILDER=> function( $serialization) { return new ItemId( $serialization);}, Def::ENTITY_ID_COMPOSER_CALLBACK=> function( $repositoryName, $uniquePart) { return ItemId::newFromRepositoryAndNumber( $repositoryName, $uniquePart);}, Def::ENTITY_DIFFER_STRATEGY_BUILDER=> function() { return new ItemDiffer();}, Def::ENTITY_PATCHER_STRATEGY_BUILDER=> function() { return new ItemPatcher();}, Def::PREFETCHING_TERM_LOOKUP_CALLBACK=> function(SingleEntitySourceServices $entitySourceServices) { $termIdsResolver=$entitySourceServices->getTermInLangIdsResolver();return new TermStoresDelegatingPrefetchingItemTermLookup($entitySourceServices->getDataAccessSettings(), new PrefetchingItemTermLookup( $termIdsResolver), $entitySourceServices->getTermIndexPrefetchingTermLookup());},], 'property'=>[Def::SERIALIZER_FACTORY_CALLBACK=> function(SerializerFactory $serializerFactory) { return $serializerFactory->newPropertySerializer();}, Def::DESERIALIZER_FACTORY_CALLBACK=> function(DeserializerFactory $deserializerFactory) { return $deserializerFactory->newPropertyDeserializer();}, Def::ENTITY_ID_PATTERN=> PropertyId::PATTERN, Def::ENTITY_ID_BUILDER=> function( $serialization) { return new PropertyId( $serialization);}, Def::ENTITY_ID_COMPOSER_CALLBACK=> function( $repositoryName, $uniquePart) { return PropertyId::newFromRepositoryAndNumber( $repositoryName, $uniquePart);}, Def::ENTITY_DIFFER_STRATEGY_BUILDER=> function() { return new PropertyDiffer();}, Def::ENTITY_PATCHER_STRATEGY_BUILDER=> function() { return new PropertyPatcher();}, Def::PREFETCHING_TERM_LOOKUP_CALLBACK=> function(SingleEntitySourceServices $entitySourceServices) { global $wgSecretKey;if(! $entitySourceServices->getDataAccessSettings() ->useNormalizedPropertyTerms()) { return $entitySourceServices->getTermIndexPrefetchingTermLookup();} $mwServices=MediaWikiServices::getInstance();$cacheSecret=hash( 'sha256', $wgSecretKey);$bagOStuff=$mwServices->getLocalServerObjectCache();$prefetchingPropertyTermLookup=new PrefetchingPropertyTermLookup($entitySourceServices->getTermInLangIdsResolver());if( $bagOStuff instanceof EmptyBagOStuff) { return $prefetchingPropertyTermLookup;} $cache=new SimpleCacheWithBagOStuff($bagOStuff, 'wikibase.prefetchingPropertyTermLookup.', $cacheSecret);$cache=new StatsdRecordingSimpleCache($cache, $mwServices->getStatsdDataFactory(), ['miss'=> 'wikibase.prefetchingPropertyTermLookupCache.miss', 'hit'=> 'wikibase.prefetchingPropertyTermLookupCache.hit']);$redirectResolvingRevisionLookup=new RedirectResolvingLatestRevisionLookup( $entitySourceServices->getEntityRevisionLookup());return new CachingPrefetchingTermLookup($cache, new UncachedTermsPrefetcher($prefetchingPropertyTermLookup, $redirectResolvingRevisionLookup, 60), $redirectResolvingRevisionLookup, WikibaseContentLanguages::getDefaultInstance() ->getContentLanguages(WikibaseContentLanguages::CONTEXT_TERM));},]]
 

Variable Documentation

◆ return

return['item'=>[ Def::SERIALIZER_FACTORY_CALLBACK=> function(SerializerFactory $serializerFactory) { return $serializerFactory->newItemSerializer(); }, Def::DESERIALIZER_FACTORY_CALLBACK=> function(DeserializerFactory $deserializerFactory) { return $deserializerFactory->newItemDeserializer(); }, Def::ENTITY_ID_PATTERN=> ItemId::PATTERN, Def::ENTITY_ID_BUILDER=> function($serialization) { return new ItemId($serialization); }, Def::ENTITY_ID_COMPOSER_CALLBACK=> function($repositoryName, $uniquePart) { return ItemId::newFromRepositoryAndNumber($repositoryName, $uniquePart); }, Def::ENTITY_DIFFER_STRATEGY_BUILDER=> function() { return new ItemDiffer(); }, Def::ENTITY_PATCHER_STRATEGY_BUILDER=> function() { return new ItemPatcher(); }, Def::PREFETCHING_TERM_LOOKUP_CALLBACK=> function(SingleEntitySourceServices $entitySourceServices) { $termIdsResolver=$entitySourceServices->getTermInLangIdsResolver(); return new TermStoresDelegatingPrefetchingItemTermLookup( $entitySourceServices->getDataAccessSettings(), new PrefetchingItemTermLookup($termIdsResolver), $entitySourceServices->getTermIndexPrefetchingTermLookup()); },], 'property'=>[ Def::SERIALIZER_FACTORY_CALLBACK=> function(SerializerFactory $serializerFactory) { return $serializerFactory->newPropertySerializer(); }, Def::DESERIALIZER_FACTORY_CALLBACK=> function(DeserializerFactory $deserializerFactory) { return $deserializerFactory->newPropertyDeserializer(); }, Def::ENTITY_ID_PATTERN=> PropertyId::PATTERN, Def::ENTITY_ID_BUILDER=> function($serialization) { return new PropertyId($serialization); }, Def::ENTITY_ID_COMPOSER_CALLBACK=> function($repositoryName, $uniquePart) { return PropertyId::newFromRepositoryAndNumber($repositoryName, $uniquePart); }, Def::ENTITY_DIFFER_STRATEGY_BUILDER=> function() { return new PropertyDiffer(); }, Def::ENTITY_PATCHER_STRATEGY_BUILDER=> function() { return new PropertyPatcher(); }, Def::PREFETCHING_TERM_LOOKUP_CALLBACK=> function(SingleEntitySourceServices $entitySourceServices) { global $wgSecretKey; if(! $entitySourceServices->getDataAccessSettings() ->useNormalizedPropertyTerms()) { return $entitySourceServices->getTermIndexPrefetchingTermLookup(); } $mwServices=MediaWikiServices::getInstance(); $cacheSecret=hash('sha256', $wgSecretKey); $bagOStuff=$mwServices->getLocalServerObjectCache(); $prefetchingPropertyTermLookup=new PrefetchingPropertyTermLookup( $entitySourceServices->getTermInLangIdsResolver()); if($bagOStuff instanceof EmptyBagOStuff) { return $prefetchingPropertyTermLookup; } $cache=new SimpleCacheWithBagOStuff( $bagOStuff, 'wikibase.prefetchingPropertyTermLookup.', $cacheSecret); $cache=new StatsdRecordingSimpleCache( $cache, $mwServices->getStatsdDataFactory(),[ 'miss'=> 'wikibase.prefetchingPropertyTermLookupCache.miss', 'hit'=> 'wikibase.prefetchingPropertyTermLookupCache.hit']); $redirectResolvingRevisionLookup=new RedirectResolvingLatestRevisionLookup($entitySourceServices->getEntityRevisionLookup()); return new CachingPrefetchingTermLookup( $cache, new UncachedTermsPrefetcher( $prefetchingPropertyTermLookup, $redirectResolvingRevisionLookup, 60), $redirectResolvingRevisionLookup, WikibaseContentLanguages::getDefaultInstance() ->getContentLanguages(WikibaseContentLanguages::CONTEXT_TERM)); },]]