MediaWiki  REL1_21
ExternalStoreDB Class Reference

DB accessable external objects. More...

Inheritance diagram for ExternalStoreDB:
Collaboration diagram for ExternalStoreDB:

List of all members.

Public Member Functions

fetchBlob ($cluster, $id, $itemID)
 Fetch a blob item out of the database; a cache of the last-loaded blob will be kept so that multiple loads out of a multi-item blob can avoid redundant database access and decompression.
 fetchFromURL ($url)
 The URL returned is of the form of the form DB://cluster/id or DB://cluster/id/itemid for concatened storage.
getLoadBalancer ($cluster)
 Get a LoadBalancer for the specified cluster.
getMaster ($cluster)
 Get a master database connection for the specified cluster.
getSlave ($cluster)
 Get a slave database connection for the specified cluster.
 getTable (&$db)
 Get the 'blobs' table name for this database.
 store ($cluster, $data)

Detailed Description

DB accessable external objects.

In this system, each store "location" maps to a database "cluster". The clusters must be defined in the normal LBFactory configuration.

Definition at line 31 of file ExternalStoreDB.php.


Member Function Documentation

& ExternalStoreDB::fetchBlob ( cluster,
id,
itemID 
)

Fetch a blob item out of the database; a cache of the last-loaded blob will be kept so that multiple loads out of a multi-item blob can avoid redundant database access and decompression.

Parameters:
$cluster
$id
$itemID
Returns:
mixed
Access:
private

Definition at line 145 of file ExternalStoreDB.php.

References $dbr, $ret, array(), false, getMaster(), getSlave(), getTable(), and wfDebugLog().

Referenced by fetchFromURL().

The URL returned is of the form of the form DB://cluster/id or DB://cluster/id/itemid for concatened storage.

See also:
ExternalStoreMedium::fetchFromURL()

Reimplemented from ExternalStoreMedium.

Definition at line 38 of file ExternalStoreDB.php.

References $path, $ret, $url, and fetchBlob().

Get a LoadBalancer for the specified cluster.

Parameters:
string$clustercluster name
Returns:
LoadBalancer object

Definition at line 81 of file ExternalStoreDB.php.

References wfGetLBFactory().

Referenced by getMaster(), and getSlave().

& ExternalStoreDB::getMaster ( cluster)

Get a master database connection for the specified cluster.

Parameters:
string$clustercluster name
Returns:
DatabaseBase object

Definition at line 115 of file ExternalStoreDB.php.

References $lb, array(), and getLoadBalancer().

Referenced by fetchBlob(), and store().

& ExternalStoreDB::getSlave ( cluster)

Get a slave database connection for the specified cluster.

Parameters:
string$clustercluster name
Returns:
DatabaseBase object

Definition at line 93 of file ExternalStoreDB.php.

References $lb, array(), getLoadBalancer(), global, and wfDebug().

Referenced by fetchBlob().

Get the 'blobs' table name for this database.

Parameters:
$dbDatabaseBase
Returns:
String: table name ('blobs' by default)

Definition at line 127 of file ExternalStoreDB.php.

Referenced by fetchBlob(), and store().

ExternalStoreDB::store ( cluster,
data 
)
See also:
ExternalStoreMedium::store()

Reimplemented from ExternalStoreMedium.

Definition at line 59 of file ExternalStoreDB.php.

References array(), getMaster(), and getTable().

Referenced by CompressOld\compressPage().


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