40 private $cacheKey =
null;
42 private $sites =
null;
48 $this->siteStore = $siteStore;
49 $this->cache = $cache;
66 private function getCacheKey() {
67 if ( $this->cacheKey ===
null ) {
69 $this->cacheKey = $this->cache->makeKey(
'site-SiteList', $version );
72 return $this->cacheKey;
82 if ( $this->sites ===
null ) {
83 $this->sites = $this->cache->getWithSetCallback(
87 return $this->siteStore->getSites();
105 return $sites->
hasSite( $globalId ) ? $sites->
getSite( $globalId ) :
null;
131 $success = $this->siteStore->saveSites( $sites );
146 $this->cache->delete( $this->getCacheKey() );
163 return $this->siteStore->clear();
169class_alias( CachingSiteStore::class,
'CachingSiteStore' );