Inherits BagOStuff.
Inherited by MediaWikiBagOStuff.
Public Member Functions | |
get ($key) | |
Get an item with the given key. | |
set ($key, $value, $exptime=0) | |
Set an item. | |
delete ($key, $time=0) | |
incr ($key, $step=1) | |
keys () | |
expireAll () | |
deleteAll () | |
Public Attributes | |
$lb | |
$db | |
$lastExpireAll = 0 | |
Protected Member Functions | |
getDB () | |
isExpired ($exptime) | |
getMaxDateTime () | |
garbageCollect () | |
serialize (&$data) | |
Serialize an object and, if possible, compress the representation. | |
unserialize ($serial) | |
Unserialize and, if necessary, decompress an object. | |
handleWriteError ($exception) | |
Handle a DBQueryError which occurred during a write operation. |
Definition at line 220 of file BagOStuff.php.
SqlBagOStuff::delete | ( | $ | key, | |
$ | time = 0 | |||
) |
Reimplemented from BagOStuff.
Definition at line 302 of file BagOStuff.php.
References $db, getDB(), and handleWriteError().
SqlBagOStuff::deleteAll | ( | ) |
SqlBagOStuff::expireAll | ( | ) |
Definition at line 385 of file BagOStuff.php.
References $db, getDB(), and handleWriteError().
Referenced by garbageCollect().
SqlBagOStuff::garbageCollect | ( | ) | [protected] |
SqlBagOStuff::get | ( | $ | key | ) |
Get an item with the given key.
Returns false if it does not exist.
$key | string |
Reimplemented from BagOStuff.
Definition at line 242 of file BagOStuff.php.
References $db, BagOStuff::debug(), garbageCollect(), getDB(), handleWriteError(), isExpired(), and unserialize().
SqlBagOStuff::getDB | ( | ) | [protected] |
Definition at line 224 of file BagOStuff.php.
References $wgDBtype, wfGetDB(), and wfGetLBFactory().
Referenced by delete(), deleteAll(), expireAll(), get(), getMaxDateTime(), handleWriteError(), incr(), keys(), and set().
SqlBagOStuff::getMaxDateTime | ( | ) | [protected] |
Definition at line 365 of file BagOStuff.php.
References getDB().
Referenced by isExpired(), and set().
SqlBagOStuff::handleWriteError | ( | $ | exception | ) | [protected] |
Handle a DBQueryError which occurred during a write operation.
Ignore errors which are due to a read-only database, rethrow others.
Definition at line 445 of file BagOStuff.php.
References $db, getDB(), and wfDebug().
Referenced by delete(), deleteAll(), expireAll(), get(), incr(), and set().
SqlBagOStuff::incr | ( | $ | key, | |
$ | step = 1 | |||
) |
Reimplemented from BagOStuff.
Definition at line 315 of file BagOStuff.php.
References $db, $step, getDB(), handleWriteError(), isExpired(), and unserialize().
SqlBagOStuff::isExpired | ( | $ | exptime | ) | [protected] |
SqlBagOStuff::keys | ( | ) |
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 416 of file BagOStuff.php.
SqlBagOStuff::set | ( | $ | key, | |
$ | value, | |||
$ | exptime = 0 | |||
) |
Set an item.
$key | string | |
$value | mixed | |
$exptime | int Either an interval in seconds or a unix timestamp for expiry |
Reimplemented from BagOStuff.
Definition at line 274 of file BagOStuff.php.
References $db, getDB(), getMaxDateTime(), and handleWriteError().
SqlBagOStuff::unserialize | ( | $ | serial | ) | [protected] |
Unserialize and, if necessary, decompress an object.
$serial | string |
Definition at line 430 of file BagOStuff.php.
SqlBagOStuff::$db |
Definition at line 221 of file BagOStuff.php.
Referenced by delete(), deleteAll(), expireAll(), get(), handleWriteError(), incr(), keys(), and set().
SqlBagOStuff::$lastExpireAll = 0 |
Definition at line 222 of file BagOStuff.php.
SqlBagOStuff::$lb |
Definition at line 221 of file BagOStuff.php.