36 private $sites =
null;
46 private $cacheTimeout;
70 $this->siteStore = $siteStore;
72 $this->cacheKey = $cacheKey;
73 $this->cacheTimeout = $cacheTimeout;
90 private function getCacheKey() {
91 if ( $this->cacheKey ===
null ) {
93 $this->cacheKey = $this->cache->makeKey(
"sites/$type" );
96 return $this->cacheKey;
107 if ( $this->sites ===
null ) {
108 $this->sites = $this->cache->getWithSetCallback(
109 $this->getCacheKey(),
111 [ $this->siteStore,
'getSites' ]
130 return $sites->
hasSite( $globalId ) ? $sites->
getSite( $globalId ) :
null;
156 if ( empty( $sites ) ) {
160 $success = $this->siteStore->saveSites( $sites );
178 $this->cache->delete( $this->getCacheKey() );
194 return $this->siteStore->clear();
Class representing a cache/ephemeral data store.
clear()
Clears the list of sites stored.
__construct(SiteStore $siteStore, BagOStuff $cache, $cacheKey=null, $cacheTimeout=3600)
reset()
Purges the internal and external cache of the site list, forcing the list.
static getSerialVersionId()
Returns the version ID that identifies the serialization structure used by getSerializationData() and...
hasSite( $globalSiteId)
Returns if the list contains the site with the provided global site identifier.
getSite( $globalSiteId)
Returns the Site with the provided global site identifier.