MediaWiki REL1_40
CachingSiteStore Class Reference

Hold a configured list of sites (SiteList), with a caching layer. More...

Inherits SiteStore.

Collaboration diagram for CachingSiteStore:

Public Member Functions

 __construct (SiteStore $siteStore, BagOStuff $cache)
 
 clear ()
 Clears the list of sites stored.
 
 getSite ( $globalId)
 
 getSites ()
 
 reset ()
 Purge the internal and external cache of the site list, forcing the list.
 
 saveSite (Site $site)
 
 saveSites (array $sites)
 

Detailed Description

Hold a configured list of sites (SiteList), with a caching layer.

Access: internal
For use by core ServiceWiring only. The public interface is SiteStore
Author
Jeroen De Dauw < jeroe.nosp@m.nded.nosp@m.auw@g.nosp@m.mail.nosp@m..com >
Katie Filbert < aude..nosp@m.wiki.nosp@m.@gmai.nosp@m.l.co.nosp@m.m >

Definition at line 29 of file CachingSiteStore.php.

Constructor & Destructor Documentation

◆ __construct()

CachingSiteStore::__construct ( SiteStore $siteStore,
BagOStuff $cache )
Parameters
SiteStore$siteStore
BagOStuff$cache

Definition at line 44 of file CachingSiteStore.php.

Member Function Documentation

◆ clear()

CachingSiteStore::clear ( )

Clears the list of sites stored.

NOTE: The fact that this also clears the in-process cache is an internal detail for PHPUnit testing only. The injected cache is generally APCU, which is per-server, so the cache reset would not apply to any other web servers.

See also
SiteStore::clear()
Returns
bool Success

Implements SiteStore.

Definition at line 160 of file CachingSiteStore.php.

References reset().

◆ getSite()

CachingSiteStore::getSite ( $globalId)
See also
SiteStore::getSite
Since
1.25
Parameters
string$globalId
Returns
Site|null

Implements SiteLookup.

Definition at line 102 of file CachingSiteStore.php.

References SiteList\getSite(), getSites(), and SiteList\hasSite().

◆ getSites()

CachingSiteStore::getSites ( )
See also
SiteStore::getSites
Since
1.25
Returns
SiteList

Implements SiteLookup.

Definition at line 81 of file CachingSiteStore.php.

Referenced by getSite().

◆ reset()

CachingSiteStore::reset ( )

Purge the internal and external cache of the site list, forcing the list.

of sites to be reloaded.

Since
1.25

Definition at line 145 of file CachingSiteStore.php.

Referenced by clear(), and saveSites().

◆ saveSite()

CachingSiteStore::saveSite ( Site $site)
See also
SiteStore::saveSite
Since
1.25
Parameters
Site$site
Returns
bool Success indicator

Implements SiteStore.

Definition at line 115 of file CachingSiteStore.php.

References saveSites().

◆ saveSites()

CachingSiteStore::saveSites ( array $sites)
See also
SiteStore::saveSites
Since
1.25
Parameters
Site[]$sites
Returns
bool Success indicator

Implements SiteStore.

Definition at line 126 of file CachingSiteStore.php.

References $success, and reset().

Referenced by saveSite().


The documentation for this class was generated from the following file: