MediaWiki REL1_33
DBSiteStore Class Reference
Inheritance diagram for DBSiteStore:
Collaboration diagram for DBSiteStore:

Public Member Functions

 __construct (LoadBalancer $dbLoadBalancer)
 
 clear ()
 Clears the list of sites stored in the database.
 
 getSite ( $globalId)
 
 getSites ()
 
 reset ()
 Resets the SiteList.
 
 saveSite (Site $site)
 
 saveSites (array $sites)
 

Protected Member Functions

 loadSites ()
 Fetches the site from the database and loads them into the sites field.
 

Protected Attributes

SiteList null $sites = null
 

Private Attributes

LoadBalancer $dbLoadBalancer
 

Detailed Description

Definition at line 33 of file DBSiteStore.php.

Constructor & Destructor Documentation

◆ __construct()

DBSiteStore::__construct ( LoadBalancer $dbLoadBalancer)
Since
1.27
Todo
inject some kind of connection manager that is aware of the target wiki, instead of injecting a LoadBalancer.
Parameters
LoadBalancer$dbLoadBalancer

Definition at line 53 of file DBSiteStore.php.

References $dbLoadBalancer.

Member Function Documentation

◆ clear()

DBSiteStore::clear ( )

Clears the list of sites stored in the database.

See also
SiteStore::clear()
Returns
bool Success

Implements SiteStore.

Definition at line 271 of file DBSiteStore.php.

References DB_MASTER, and reset().

◆ getSite()

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

Implements SiteLookup.

Definition at line 146 of file DBSiteStore.php.

References getSites().

◆ getSites()

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

Implements SiteLookup.

Definition at line 64 of file DBSiteStore.php.

References $sites, and loadSites().

Referenced by getSite().

◆ loadSites()

DBSiteStore::loadSites ( )
protected

Fetches the site from the database and loads them into the sites field.

Since
1.25

Definition at line 75 of file DBSiteStore.php.

References $dbr, $res, and(), DB_REPLICA, Site\newForType(), and unserialize().

Referenced by getSites().

◆ reset()

DBSiteStore::reset ( )

Resets the SiteList.

Since
1.25

Definition at line 260 of file DBSiteStore.php.

Referenced by clear(), and saveSites().

◆ saveSite()

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

Implements SiteStore.

Definition at line 163 of file DBSiteStore.php.

References saveSites().

◆ saveSites()

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

Implements SiteStore.

Definition at line 176 of file DBSiteStore.php.

References $sites, $success, and(), DB_MASTER, reset(), and serialize().

Referenced by saveSite().

Member Data Documentation

◆ $dbLoadBalancer

LoadBalancer DBSiteStore::$dbLoadBalancer
private

Definition at line 43 of file DBSiteStore.php.

Referenced by __construct().

◆ $sites

SiteList null DBSiteStore::$sites = null
protected

Definition at line 38 of file DBSiteStore.php.

Referenced by getSites(), and saveSites().


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