Wikibase
MediaWiki Wikibase extension
|
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();$entitySourceServices=WikibaseClient::getSingleEntitySourceServicesFactory( $mwServices) ->getServicesForSource( $entitySource);$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']);$redirectResolvingRevisionLookup=new RedirectResolvingLatestRevisionLookup($entitySourceServices->getEntityRevisionLookup());return new CachingPrefetchingTermLookup($cache, $prefetchingPropertyTermLookup, $redirectResolvingRevisionLookup, WikibaseClient::getTermsLanguages( $mwServices));},]] | |
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(); $entitySourceServices=WikibaseClient::getSingleEntitySourceServicesFactory($mwServices) ->getServicesForSource($entitySource); $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']); $redirectResolvingRevisionLookup=new RedirectResolvingLatestRevisionLookup( $entitySourceServices->getEntityRevisionLookup()); return new CachingPrefetchingTermLookup( $cache, $prefetchingPropertyTermLookup, $redirectResolvingRevisionLookup, WikibaseClient::getTermsLanguages($mwServices)); },]] |