Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
WikibaseClient.entitytypes.php File Reference

Variables

 return [ 'item'=>[Def::PREFETCHING_TERM_LOOKUP_CALLBACK=> function(DatabaseEntitySource $entitySource) { $termIdsResolver=WikibaseClient::getTermInLangIdsResolverFactory() ->getResolverForEntitySource( $entitySource);return new PrefetchingItemTermLookup( $termIdsResolver);},], 'property'=>[Def::PREFETCHING_TERM_LOOKUP_CALLBACK=> function(DatabaseEntitySource $entitySource) { $mwServices=MediaWikiServices::getInstance();$cacheSecret=hash( 'sha256', $mwServices->getMainConfig() ->get( 'SecretKey'));$bagOStuff=$mwServices->getLocalServerObjectCache();$termIdsResolver=WikibaseClient::getTermInLangIdsResolverFactory() ->getResolverForEntitySource( $entitySource);$prefetchingPropertyTermLookup=new PrefetchingPropertyTermLookup( $termIdsResolver);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']);return new CachingPrefetchingTermLookup($cache, $prefetchingPropertyTermLookup, WikibaseClient::getRedirectResolvingLatestRevisionLookup( $mwServices), WikibaseClient::getTermsLanguages( $mwServices));},]]
 

Variable Documentation

◆ return

return['item'=>[ Def::PREFETCHING_TERM_LOOKUP_CALLBACK=> function(DatabaseEntitySource $entitySource) { $termIdsResolver=WikibaseClient::getTermInLangIdsResolverFactory() ->getResolverForEntitySource($entitySource); return new PrefetchingItemTermLookup($termIdsResolver); },], 'property'=>[ Def::PREFETCHING_TERM_LOOKUP_CALLBACK=> function(DatabaseEntitySource $entitySource) { $mwServices=MediaWikiServices::getInstance(); $cacheSecret=hash('sha256', $mwServices->getMainConfig() ->get('SecretKey')); $bagOStuff=$mwServices->getLocalServerObjectCache(); $termIdsResolver=WikibaseClient::getTermInLangIdsResolverFactory() ->getResolverForEntitySource($entitySource); $prefetchingPropertyTermLookup=new PrefetchingPropertyTermLookup($termIdsResolver); 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']); return new CachingPrefetchingTermLookup( $cache, $prefetchingPropertyTermLookup, WikibaseClient::getRedirectResolvingLatestRevisionLookup($mwServices), WikibaseClient::getTermsLanguages($mwServices)); },]]