MediaWiki master
MediaWiki\Site\CachingSiteStore Class Reference

Wrap SiteList with an in-process cache and (optionally) a local-server cache. More...

Inherits MediaWiki\Site\SiteStore.

Collaboration diagram for MediaWiki\Site\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

Wrap SiteList with an in-process cache and (optionally) a local-server cache.

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 33 of file CachingSiteStore.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Site\CachingSiteStore::__construct ( SiteStore $siteStore,
BagOStuff $cache )

Definition at line 43 of file CachingSiteStore.php.

Member Function Documentation

◆ clear()

MediaWiki\Site\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 MediaWiki\Site\SiteStore.

Definition at line 159 of file CachingSiteStore.php.

References MediaWiki\Site\CachingSiteStore\reset().

◆ getSite()

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

Implements MediaWiki\Site\SiteLookup.

Definition at line 101 of file CachingSiteStore.php.

References MediaWiki\Site\SiteList\getSite(), MediaWiki\Site\CachingSiteStore\getSites(), and MediaWiki\Site\SiteList\hasSite().

◆ getSites()

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

Implements MediaWiki\Site\SiteLookup.

Definition at line 80 of file CachingSiteStore.php.

Referenced by MediaWiki\Site\CachingSiteStore\getSite().

◆ reset()

MediaWiki\Site\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 144 of file CachingSiteStore.php.

Referenced by MediaWiki\Site\CachingSiteStore\clear(), and MediaWiki\Site\CachingSiteStore\saveSites().

◆ saveSite()

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

Implements MediaWiki\Site\SiteStore.

Definition at line 114 of file CachingSiteStore.php.

References MediaWiki\Site\CachingSiteStore\saveSites().

◆ saveSites()

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

Implements MediaWiki\Site\SiteStore.

Definition at line 125 of file CachingSiteStore.php.

References $success, and MediaWiki\Site\CachingSiteStore\reset().

Referenced by MediaWiki\Site\CachingSiteStore\saveSite().


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