40 private $cacheKey =
null;
42 private $sites =
null;
52 $this->siteStore = $siteStore;
53 $this->cache = $cache;
70 private function getCacheKey() {
71 if ( $this->cacheKey ===
null ) {
73 $this->cacheKey = $this->cache->makeKey(
'site-SiteList', $version );
76 return $this->cacheKey;
86 if ( $this->sites ===
null ) {
87 $this->sites = $this->cache->getWithSetCallback(
91 return $this->siteStore->getSites();
109 return $sites->
hasSite( $globalId ) ? $sites->
getSite( $globalId ) :
null;
135 $success = $this->siteStore->saveSites( $sites );
150 $this->cache->delete( $this->getCacheKey() );
167 return $this->siteStore->clear();
173class_alias( CachingSiteStore::class,
'CachingSiteStore' );