39 private $cacheKey =
null;
41 private $sites =
null;
47 $this->siteStore = $siteStore;
48 $this->cache = $cache;
65 private function getCacheKey() {
66 if ( $this->cacheKey ===
null ) {
68 $this->cacheKey = $this->cache->makeKey(
'site-SiteList', $version );
71 return $this->cacheKey;
81 if ( $this->sites ===
null ) {
82 $this->sites = $this->cache->getWithSetCallback(
86 return $this->siteStore->getSites();
104 return $sites->
hasSite( $globalId ) ? $sites->
getSite( $globalId ) :
null;
130 $success = $this->siteStore->saveSites( $sites );
145 $this->cache->delete( $this->getCacheKey() );
162 return $this->siteStore->clear();
168class_alias( CachingSiteStore::class,
'CachingSiteStore' );