MediaWiki
REL1_20
|
Class to store objects in the database. More...
Public Member Functions | |
__construct ($params) | |
Constructor. | |
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) | |
getMulti (array $keys) | |
incr ($key, $step=1) | |
keys () | |
set ($key, $value, $exptime=0) | |
Public Attributes | |
DatabaseBase | $db |
$lastExpireAll = 0 | |
LoadBalancer | $lb |
$purgePeriod = 100 | |
$serverInfo | |
$shards = 1 | |
$tableName = 'objectcache' | |
Protected Member Functions | |
garbageCollect () | |
getDB () | |
getMaxDateTime () | |
getTableByKey ($key) | |
Get the table name for a given key. | |
getTableByShard ($index) | |
Get the table name for a given shard index. | |
handleReadError (DBError $exception) | |
Handle a DBError which occurred during a read operation. | |
handleWriteError (DBError $exception) | |
Handle a DBQueryError which occurred during a write operation. | |
isExpired ($exptime) | |
serialize (&$data) | |
Serialize an object and, if possible, compress the representation. | |
unserialize ($serial) | |
Unserialize and, if necessary, decompress an object. | |
Protected Attributes | |
$connFailureError | |
$connFailureTime = 0 |
Class to store objects in the database.
Definition at line 29 of file SqlBagOStuff.php.
SqlBagOStuff::__construct | ( | $ | params | ) |
Constructor.
Parameters are:
$params | array |
Definition at line 70 of file SqlBagOStuff.php.
SqlBagOStuff::delete | ( | $ | key, |
$ | time = 0 |
||
) |
$key | string |
$time | int |
Reimplemented from BagOStuff.
Definition at line 280 of file SqlBagOStuff.php.
Definition at line 487 of file SqlBagOStuff.php.
SqlBagOStuff::deleteObjectsExpiringBefore | ( | $ | timestamp, |
$ | progressCallback = false |
||
) |
Delete objects from the database which expire before a certain date.
$timestamp | string |
$progressCallback | bool|callback |
Reimplemented from BagOStuff.
Definition at line 418 of file SqlBagOStuff.php.
Definition at line 408 of file SqlBagOStuff.php.
SqlBagOStuff::garbageCollect | ( | ) | [protected] |
Definition at line 391 of file SqlBagOStuff.php.
SqlBagOStuff::get | ( | $ | key | ) |
$key | string |
Reimplemented from BagOStuff.
Definition at line 162 of file SqlBagOStuff.php.
SqlBagOStuff::getDB | ( | ) | [protected] |
Definition at line 89 of file SqlBagOStuff.php.
SqlBagOStuff::getMaxDateTime | ( | ) | [protected] |
Definition at line 383 of file SqlBagOStuff.php.
SqlBagOStuff::getMulti | ( | array $ | keys | ) |
$keys | array |
Reimplemented from BagOStuff.
Definition at line 171 of file SqlBagOStuff.php.
SqlBagOStuff::getTableByKey | ( | $ | key | ) | [protected] |
Get the table name for a given key.
$key | string |
Definition at line 134 of file SqlBagOStuff.php.
SqlBagOStuff::getTableByShard | ( | $ | index | ) | [protected] |
Get the table name for a given shard index.
$index | int |
Definition at line 148 of file SqlBagOStuff.php.
SqlBagOStuff::handleReadError | ( | DBError $ | exception | ) | [protected] |
Handle a DBError which occurred during a read operation.
Definition at line 545 of file SqlBagOStuff.php.
SqlBagOStuff::handleWriteError | ( | DBError $ | exception | ) | [protected] |
Handle a DBQueryError which occurred during a write operation.
Definition at line 561 of file SqlBagOStuff.php.
SqlBagOStuff::incr | ( | $ | key, |
$ | step = 1 |
||
) |
$key | string |
$step | int |
Reimplemented from BagOStuff.
Definition at line 302 of file SqlBagOStuff.php.
SqlBagOStuff::isExpired | ( | $ | exptime | ) | [protected] |
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.
$data | mixed |
Definition at line 511 of file SqlBagOStuff.php.
SqlBagOStuff::set | ( | $ | key, |
$ | value, | ||
$ | exptime = 0 |
||
) |
$key | string |
$value | mixed |
$exptime | int |
Reimplemented from BagOStuff.
Definition at line 237 of file SqlBagOStuff.php.
SqlBagOStuff::unserialize | ( | $ | serial | ) | [protected] |
Unserialize and, if necessary, decompress an object.
$serial | string |
Definition at line 526 of file SqlBagOStuff.php.
SqlBagOStuff::$connFailureError [protected] |
Definition at line 44 of file SqlBagOStuff.php.
SqlBagOStuff::$connFailureTime = 0 [protected] |
Definition at line 43 of file SqlBagOStuff.php.
DatabaseBase SqlBagOStuff::$db |
Definition at line 36 of file SqlBagOStuff.php.
SqlBagOStuff::$lastExpireAll = 0 |
Definition at line 38 of file SqlBagOStuff.php.
LoadBalancer SqlBagOStuff::$lb |
Definition at line 32 of file SqlBagOStuff.php.
SqlBagOStuff::$purgePeriod = 100 |
Definition at line 39 of file SqlBagOStuff.php.
SqlBagOStuff::$serverInfo |
Definition at line 37 of file SqlBagOStuff.php.
SqlBagOStuff::$shards = 1 |
Definition at line 40 of file SqlBagOStuff.php.
SqlBagOStuff::$tableName = 'objectcache' |
Definition at line 41 of file SqlBagOStuff.php.