MediaWiki
1.23.5
|
Public Member Functions | |
clear () | |
Clears the list of sites stored in the database. More... | |
getSite ( $globalId, $source='cache') | |
getSites ( $source='cache') | |
reset () | |
Purges the internal and external cache of the site list, forcing the list of sites to be re-read from the database. More... | |
saveSite (Site $site) | |
saveSites (array $sites) | |
Static Public Member Functions | |
static | newInstance (ORMTable $sitesTable=null) |
Protected Member Functions | |
__construct (ORMTable $sitesTable=null) | |
Constructor. More... | |
getCacheKey () | |
Constructs a cache key to use for caching the list of sites. More... | |
getRowFromSite (Site $site) | |
Get a new ORMRow from a Site object. More... | |
loadSites () | |
Fetches the site from the database and loads them into the sites field. More... | |
newSitesTable () | |
siteFromRow (ORMRow $siteRow) | |
Returns a new Site object constructed from the provided ORMRow. More... | |
Protected Attributes | |
SiteList null | $sites = null |
ORMTable | $sitesTable |
Private Attributes | |
string null | $cacheKey = null |
int | $cacheTimeout = 3600 |
Definition at line 31 of file SiteSQLStore.php.
|
protected |
Constructor.
ORMTable | null | $sitesTable |
Definition at line 69 of file SiteSQLStore.php.
References $sitesTable, and newSitesTable().
SiteSQLStore::clear | ( | ) |
Clears the list of sites stored in the database.
Implements SiteStore.
Definition at line 391 of file SiteSQLStore.php.
References $ok, reset(), wfProfileIn(), and wfProfileOut().
|
protected |
Constructs a cache key to use for caching the list of sites.
This includes the concrete class name of the site list as well as a version identifier for the list's serialization, to avoid problems when unserializing site lists serialized by an older version, e.g. when reading from a cache.
The cache key also includes information about where the sites were loaded from, e.g. the name of a database table.
Definition at line 91 of file SiteSQLStore.php.
References $cacheKey, $source, $type, false, SiteList\getSerialVersionId(), wfMemcKey(), wfProfileIn(), and wfProfileOut().
Referenced by getSites(), loadSites(), and reset().
|
protected |
Get a new ORMRow from a Site object.
Site | $site |
Definition at line 196 of file SiteSQLStore.php.
References array(), Site\getDomain(), Site\getExtraConfig(), Site\getExtraData(), Site\getGlobalId(), Site\getGroup(), Site\getInternalId(), Site\getLanguageCode(), Site\getProtocol(), Site\getSource(), Site\getType(), and Site\shouldForward().
Referenced by saveSites().
SiteSQLStore::getSite | ( | $globalId, | |
$source = 'cache' |
|||
) |
string | $globalId | |
string | $source |
Implements SiteStore.
Definition at line 270 of file SiteSQLStore.php.
References $sites, $source, SiteList\getSite(), getSites(), SiteList\hasSite(), wfProfileIn(), and wfProfileOut().
SiteSQLStore::getSites | ( | $source = 'cache' | ) |
string | $source | either 'cache' or 'recache' |
Implements SiteStore.
Definition at line 118 of file SiteSQLStore.php.
References $cache, $sites, $source, getCacheKey(), loadSites(), wfGetMainCache(), wfProfileIn(), and wfProfileOut().
Referenced by getSite(), and Sites\getSiteGroup().
|
protected |
Fetches the site from the database and loads them into the sites field.
Definition at line 225 of file SiteSQLStore.php.
References $cache, array(), as, getCacheKey(), select(), siteFromRow(), wfGetDB(), wfGetMainCache(), wfProfileIn(), and wfProfileOut().
Referenced by getSites().
|
static |
ORMTable | null | $sitesTable |
Definition at line 58 of file SiteSQLStore.php.
References $sitesTable.
Referenced by TestSites\insertIntoDb(), SiteSQLStoreTest\testClear(), SiteSQLStoreTest\testGetSites(), SiteSQLStoreTest\testReset(), and SiteSQLStoreTest\testSaveSites().
|
protected |
Definition at line 419 of file SiteSQLStore.php.
References array(), Site\GROUP_NONE, Site\SOURCE_LOCAL, and Site\TYPE_UNKNOWN.
Referenced by __construct().
SiteSQLStore::reset | ( | ) |
Purges the internal and external cache of the site list, forcing the list of sites to be re-read from the database.
Definition at line 374 of file SiteSQLStore.php.
References $cache, getCacheKey(), wfGetMainCache(), wfProfileIn(), and wfProfileOut().
Referenced by clear(), and saveSites().
SiteSQLStore::saveSite | ( | Site | $site | ) |
Site | $site |
Implements SiteStore.
Definition at line 288 of file SiteSQLStore.php.
References array(), and saveSites().
SiteSQLStore::saveSites | ( | array | $sites | ) |
Site[] | $sites |
Implements SiteStore.
Definition at line 301 of file SiteSQLStore.php.
References $sites, $success, array(), as, getRowFromSite(), reset(), wfProfileIn(), and wfProfileOut().
Referenced by saveSite().
|
protected |
Returns a new Site object constructed from the provided ORMRow.
ORMRow | $siteRow |
Definition at line 150 of file SiteSQLStore.php.
References ORMRow\getField(), ORMRow\hasField(), Site\newForType(), Site\TYPE_UNKNOWN, wfProfileIn(), and wfProfileOut().
Referenced by loadSites().
|
private |
Definition at line 45 of file SiteSQLStore.php.
Referenced by getCacheKey().
|
private |
Definition at line 49 of file SiteSQLStore.php.
|
protected |
Definition at line 37 of file SiteSQLStore.php.
Referenced by getSite(), getSites(), and saveSites().
|
protected |
Definition at line 41 of file SiteSQLStore.php.
Referenced by __construct(), and newInstance().