MediaWiki
REL1_19
|
Cache that uses DBA as a backend. More...
Public Member Functions | |
__construct ($params) | |
add ($key, $value, $exptime=0) | |
decode ($blob) | |
delete ($key, $time=0) | |
Delete an item. | |
encode ($value, $expiry) | |
Encode value and expiry for storage. | |
get ($key) | |
Get an item with the given key. | |
getReader () | |
getWriter () | |
keys () | |
set ($key, $value, $exptime=0) | |
Set an item. | |
Public Attributes | |
$mDisabled | |
$mFile | |
$mHandler | |
$mReader | |
$mWriter |
Cache that uses DBA as a backend.
Slow due to the need to constantly open and close the file to avoid holding writer locks. Intended for development use only, as a memcached workalike for systems that don't have it.
On construction you can pass array( 'dir' => '/some/path' ); as a parameter to override the default DBA files directory (wgTmpDirectory).
Definition at line 14 of file DBABagOStuff.php.
DBABagOStuff::__construct | ( | $ | params | ) |
Definition at line 17 of file DBABagOStuff.php.
References $wgDBAhandler, $wgTmpDirectory, wfDebug(), and wfWikiID().
DBABagOStuff::add | ( | $ | key, |
$ | value, | ||
$ | exptime = 0 |
||
) |
Reimplemented from BagOStuff.
Definition at line 148 of file DBABagOStuff.php.
References $blob, decode(), encode(), getWriter(), wfProfileIn(), and wfProfileOut().
DBABagOStuff::decode | ( | $ | blob | ) |
Definition at line 48 of file DBABagOStuff.php.
References $blob.
Referenced by add(), and get().
DBABagOStuff::delete | ( | $ | key, |
$ | time = 0 |
||
) |
Delete an item.
$key | string |
$time | int Amount of time to delay the operation (mostly memcached-specific) |
Reimplemented from BagOStuff.
Definition at line 131 of file DBABagOStuff.php.
References getWriter(), wfDebug(), wfProfileIn(), and wfProfileOut().
DBABagOStuff::encode | ( | $ | value, |
$ | expiry | ||
) |
Encode value and expiry for storage.
$value | |
$expiry |
Definition at line 38 of file DBABagOStuff.php.
References BagOStuff\convertExpiry().
Referenced by add(), and set().
DBABagOStuff::get | ( | $ | key | ) |
Get an item with the given key.
Returns false if it does not exist.
$key | string |
Reimplemented from BagOStuff.
Definition at line 83 of file DBABagOStuff.php.
References decode(), getReader(), getWriter(), wfDebug(), wfProfileIn(), and wfProfileOut().
Definition at line 59 of file DBABagOStuff.php.
References getWriter(), and wfDebug().
Referenced by get(), and keys().
Definition at line 73 of file DBABagOStuff.php.
References wfDebug().
Referenced by add(), delete(), get(), getReader(), and set().
Reimplemented from BagOStuff.
Definition at line 180 of file DBABagOStuff.php.
References $result, and getReader().
DBABagOStuff::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 112 of file DBABagOStuff.php.
References $blob, encode(), getWriter(), wfDebug(), wfProfileIn(), and wfProfileOut().
DBABagOStuff::$mDisabled |
Definition at line 15 of file DBABagOStuff.php.
DBABagOStuff::$mFile |
Definition at line 15 of file DBABagOStuff.php.
DBABagOStuff::$mHandler |
Definition at line 15 of file DBABagOStuff.php.
DBABagOStuff::$mReader |
Definition at line 15 of file DBABagOStuff.php.
DBABagOStuff::$mWriter |
Definition at line 15 of file DBABagOStuff.php.