25 private $cacheKey =
null;
27 private $sites =
null;
33 $this->siteStore = $siteStore;
34 $this->cache = $cache;
51 private function getCacheKey() {
52 if ( $this->cacheKey ===
null ) {
54 $this->cacheKey = $this->cache->makeKey(
'site-SiteList', $version );
57 return $this->cacheKey;
67 if ( $this->sites ===
null ) {
68 $this->sites = $this->cache->getWithSetCallback(
72 return $this->siteStore->getSites();
90 return $sites->
hasSite( $globalId ) ? $sites->
getSite( $globalId ) :
null;
116 $success = $this->siteStore->saveSites( $sites );
131 $this->cache->delete( $this->getCacheKey() );
148 return $this->siteStore->clear();
154class_alias( CachingSiteStore::class,
'CachingSiteStore' );