MediaWiki  1.33.0
FileBasedSiteLookup Class Reference

Provides a file-based cache of a SiteStore, using a json file. More...

Inheritance diagram for FileBasedSiteLookup:
Collaboration diagram for FileBasedSiteLookup:

Public Member Functions

 __construct ( $cacheFile)
 
 getSite ( $globalId)
 
 getSites ()
 

Private Member Functions

 loadJsonFile ()
 
 loadSitesFromCache ()
 
 newSiteFromArray (array $data)
 

Private Attributes

string $cacheFile
 
SiteList $sites = null
 

Detailed Description

Provides a file-based cache of a SiteStore, using a json file.

Since
1.25
Deprecated:
since 1.33 Use CachingSiteStore instead.

Definition at line 29 of file FileBasedSiteLookup.php.

Constructor & Destructor Documentation

◆ __construct()

FileBasedSiteLookup::__construct (   $cacheFile)
Parameters
string$cacheFile

Definition at line 44 of file FileBasedSiteLookup.php.

References $cacheFile, and wfDeprecated().

Member Function Documentation

◆ getSite()

FileBasedSiteLookup::getSite (   $globalId)
Parameters
string$globalId
Since
1.25
Returns
Site|null

Implements SiteLookup.

Definition at line 69 of file FileBasedSiteLookup.php.

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

◆ getSites()

FileBasedSiteLookup::getSites ( )
Since
1.25
Returns
SiteList

Implements SiteLookup.

Definition at line 54 of file FileBasedSiteLookup.php.

References $sites, and loadSitesFromCache().

Referenced by getSite().

◆ loadJsonFile()

FileBasedSiteLookup::loadJsonFile ( )
private
Exceptions
MWException
Returns
array see docs/sitescache.txt for format of the array.

Definition at line 95 of file FileBasedSiteLookup.php.

References $data.

Referenced by loadSitesFromCache().

◆ loadSitesFromCache()

FileBasedSiteLookup::loadSitesFromCache ( )
private
Returns
SiteList

Definition at line 78 of file FileBasedSiteLookup.php.

References $data, $sites, as, loadJsonFile(), and newSiteFromArray().

Referenced by getSites().

◆ newSiteFromArray()

FileBasedSiteLookup::newSiteFromArray ( array  $data)
private
Parameters
array$data
Returns
Site

Definition at line 117 of file FileBasedSiteLookup.php.

References $data, as, Site\newForType(), and Site\TYPE_UNKNOWN.

Referenced by loadSitesFromCache().

Member Data Documentation

◆ $cacheFile

string FileBasedSiteLookup::$cacheFile
private

Definition at line 39 of file FileBasedSiteLookup.php.

Referenced by __construct().

◆ $sites

SiteList FileBasedSiteLookup::$sites = null
private

Definition at line 34 of file FileBasedSiteLookup.php.

Referenced by getSite(), getSites(), and loadSitesFromCache().


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