MediaWiki
REL1_24
|
Class to store objects in the database. More...
Public Member Functions | |
__construct ($params) | |
Constructor. | |
cas ($casToken, $key, $value, $exptime=0) | |
createTables () | |
Create shard tables. | |
delete ($key, $time=0) | |
deleteAll () | |
deleteObjectsExpiringBefore ($timestamp, $progressCallback=false) | |
Delete objects from the database which expire before a certain date. | |
expireAll () | |
get ($key, &$casToken=null) | |
getMulti (array $keys) | |
incr ($key, $step=1) | |
set ($key, $value, $exptime=0) | |
setMulti (array $data, $expiry=0) | |
Protected Member Functions | |
garbageCollect () | |
getDB ($serverIndex) | |
Get a connection to the specified database. | |
getMaxDateTime ($db) | |
getTableByKey ($key) | |
Get the server index and table name for a given key. | |
getTableNameByShard ($index) | |
Get the table name for a given shard index. | |
handleReadError (DBError $exception, $serverIndex) | |
Handle a DBError which occurred during a read operation. | |
handleWriteError (DBError $exception, $serverIndex) | |
Handle a DBQueryError which occurred during a write operation. | |
isExpired ($db, $exptime) | |
markServerDown ($exception, $serverIndex) | |
Mark a server down due to a DBConnectionError exception. | |
serialize (&$data) | |
Serialize an object and, if possible, compress the representation. | |
unserialize ($serial) | |
Unserialize and, if necessary, decompress an object. | |
Protected Attributes | |
array | $connFailureErrors = array() |
Exceptions *. | |
array | $connFailureTimes = array() |
UNIX timestamps *. | |
array | $conns |
* | |
int | $lastExpireAll = 0 |
* | |
LoadBalancer | $lb |
* | |
int | $numServers |
* | |
int | $purgePeriod = 100 |
* | |
$serverInfos | |
array | $serverNames |
* | |
int | $shards = 1 |
* | |
string | $tableName = 'objectcache' |
* |
Class to store objects in the database.
Definition at line 29 of file SqlBagOStuff.php.
SqlBagOStuff::__construct | ( | $ | params | ) |
Constructor.
Parameters are:
array | $params |
Definition at line 80 of file SqlBagOStuff.php.
SqlBagOStuff::cas | ( | $ | casToken, |
$ | key, | ||
$ | value, | ||
$ | exptime = 0 |
||
) |
mixed | $casToken | |
string | $key | |
mixed | $value | |
int | $exptime |
Reimplemented from BagOStuff.
Definition at line 401 of file SqlBagOStuff.php.
SqlBagOStuff::delete | ( | $ | key, |
$ | time = 0 |
||
) |
string | $key | |
int | $time |
Reimplemented from BagOStuff.
Definition at line 448 of file SqlBagOStuff.php.
Definition at line 631 of file SqlBagOStuff.php.
SqlBagOStuff::deleteObjectsExpiringBefore | ( | $ | timestamp, |
$ | progressCallback = false |
||
) |
Delete objects from the database which expire before a certain date.
string | $timestamp | |
bool | callable | $progressCallback |
Reimplemented from BagOStuff.
Definition at line 561 of file SqlBagOStuff.php.
References wfTimestampNow().
Definition at line 551 of file SqlBagOStuff.php.
SqlBagOStuff::garbageCollect | ( | ) | [protected] |
Definition at line 534 of file SqlBagOStuff.php.
SqlBagOStuff::get | ( | $ | key, |
&$ | casToken = null |
||
) |
string | $key | |
mixed | $casToken | [optional] |
Reimplemented from BagOStuff.
Definition at line 204 of file SqlBagOStuff.php.
SqlBagOStuff::getDB | ( | $ | serverIndex | ) | [protected] |
Get a connection to the specified database.
int | $serverIndex |
Definition at line 112 of file SqlBagOStuff.php.
SqlBagOStuff::getMaxDateTime | ( | $ | db | ) | [protected] |
SqlBagOStuff::getMulti | ( | array $ | keys | ) |
array | $keys |
Reimplemented from BagOStuff.
Definition at line 217 of file SqlBagOStuff.php.
SqlBagOStuff::getTableByKey | ( | $ | key | ) | [protected] |
Get the server index and table name for a given key.
string | $key |
Definition at line 166 of file SqlBagOStuff.php.
SqlBagOStuff::getTableNameByShard | ( | $ | index | ) | [protected] |
Get the table name for a given shard index.
int | $index |
Definition at line 189 of file SqlBagOStuff.php.
SqlBagOStuff::handleReadError | ( | DBError $ | exception, |
$ | serverIndex | ||
) | [protected] |
Handle a DBError which occurred during a read operation.
DBError | $exception | |
int | $serverIndex |
Definition at line 691 of file SqlBagOStuff.php.
SqlBagOStuff::handleWriteError | ( | DBError $ | exception, |
$ | serverIndex | ||
) | [protected] |
Handle a DBQueryError which occurred during a write operation.
DBError | $exception | |
int | $serverIndex |
Definition at line 711 of file SqlBagOStuff.php.
SqlBagOStuff::incr | ( | $ | key, |
$ | step = 1 |
||
) |
string | $key | |
int | $step |
Reimplemented from BagOStuff.
Definition at line 469 of file SqlBagOStuff.php.
SqlBagOStuff::isExpired | ( | $ | db, |
$ | exptime | ||
) | [protected] |
DatabaseBase | $db | |
string | $exptime |
Definition at line 518 of file SqlBagOStuff.php.
SqlBagOStuff::markServerDown | ( | $ | exception, |
$ | serverIndex | ||
) | [protected] |
Mark a server down due to a DBConnectionError exception.
DBError | $exception | |
int | $serverIndex |
Definition at line 737 of file SqlBagOStuff.php.
SqlBagOStuff::serialize | ( | &$ | data | ) | [protected] |
Serialize an object and, if possible, compress the representation.
On typical message and page data, this can provide a 3X decrease in storage requirements.
mixed | $data |
Definition at line 654 of file SqlBagOStuff.php.
SqlBagOStuff::set | ( | $ | key, |
$ | value, | ||
$ | exptime = 0 |
||
) |
string | $key | |
mixed | $value | |
int | $exptime |
Reimplemented from BagOStuff.
Definition at line 357 of file SqlBagOStuff.php.
SqlBagOStuff::setMulti | ( | array $ | data, |
$ | expiry = 0 |
||
) |
array | $data | |
int | $expiry |
Reimplemented from BagOStuff.
Definition at line 288 of file SqlBagOStuff.php.
SqlBagOStuff::unserialize | ( | $ | serial | ) | [protected] |
Unserialize and, if necessary, decompress an object.
string | $serial |
Definition at line 669 of file SqlBagOStuff.php.
Exceptions *.
Definition at line 50 of file SqlBagOStuff.php.
UNIX timestamps *.
Definition at line 48 of file SqlBagOStuff.php.
array SqlBagOStuff::$conns [protected] |
*
Definition at line 38 of file SqlBagOStuff.php.
int SqlBagOStuff::$lastExpireAll = 0 [protected] |
*
Definition at line 40 of file SqlBagOStuff.php.
LoadBalancer SqlBagOStuff::$lb [protected] |
*
Definition at line 30 of file SqlBagOStuff.php.
int SqlBagOStuff::$numServers [protected] |
*
Definition at line 36 of file SqlBagOStuff.php.
int SqlBagOStuff::$purgePeriod = 100 [protected] |
*
Definition at line 42 of file SqlBagOStuff.php.
SqlBagOStuff::$serverInfos [protected] |
Definition at line 32 of file SqlBagOStuff.php.
array SqlBagOStuff::$serverNames [protected] |
*
Definition at line 34 of file SqlBagOStuff.php.
int SqlBagOStuff::$shards = 1 [protected] |
*
Definition at line 44 of file SqlBagOStuff.php.
string SqlBagOStuff::$tableName = 'objectcache' [protected] |
*
Definition at line 46 of file SqlBagOStuff.php.