MediaWiki
REL1_20
|
Cache that uses DBA as a backend. More...
Public Member Functions | |
__construct ($params) | |
add ($key, $value, $exptime=0) | |
delete ($key, $time=0) | |
get ($key) | |
incr ($key, $step=1) | |
keys () | |
set ($key, $value, $exptime=0) | |
Public Attributes | |
$mDisabled | |
$mFile | |
$mHandler | |
$mReader | |
$mWriter | |
Protected Member Functions | |
decode ($blob) | |
encode ($value, $expiry) | |
Encode value and expiry for storage. | |
getReader () | |
getWriter () |
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 (wfTempDir()).
Definition at line 35 of file DBABagOStuff.php.
DBABagOStuff::__construct | ( | $ | params | ) |
$params | array |
Definition at line 41 of file DBABagOStuff.php.
References $params, wfDebug(), wfTempDir(), and wfWikiID().
DBABagOStuff::add | ( | $ | key, |
$ | value, | ||
$ | exptime = 0 |
||
) |
$key | string |
$value | mixed |
$exptime | int |
Reimplemented from BagOStuff.
Definition at line 198 of file DBABagOStuff.php.
References $blob, $value, decode(), encode(), getWriter(), wfProfileIn(), and wfProfileOut().
DBABagOStuff::decode | ( | $ | blob | ) | [protected] |
DBABagOStuff::delete | ( | $ | key, |
$ | time = 0 |
||
) |
$key | string |
$time | int |
Reimplemented from BagOStuff.
Definition at line 175 of file DBABagOStuff.php.
References getWriter(), wfDebug(), wfProfileIn(), and wfProfileOut().
DBABagOStuff::encode | ( | $ | value, |
$ | expiry | ||
) | [protected] |
Encode value and expiry for storage.
$value | |
$expiry |
Definition at line 60 of file DBABagOStuff.php.
References $value, and BagOStuff\convertExpiry().
DBABagOStuff::get | ( | $ | key | ) |
$key | string |
Reimplemented from BagOStuff.
Definition at line 116 of file DBABagOStuff.php.
References decode(), getReader(), getWriter(), wfDebug(), wfProfileIn(), and wfProfileOut().
DBABagOStuff::getReader | ( | ) | [protected] |
Definition at line 85 of file DBABagOStuff.php.
References getWriter(), and wfDebug().
DBABagOStuff::getWriter | ( | ) | [protected] |
Definition at line 102 of file DBABagOStuff.php.
References wfDebug().
Referenced by add(), delete(), get(), getReader(), incr(), and set().
DBABagOStuff::incr | ( | $ | key, |
$ | step = 1 |
||
) |
$key | string |
$step | integer |
Reimplemented from BagOStuff.
Definition at line 235 of file DBABagOStuff.php.
References $blob, $value, decode(), encode(), getWriter(), wfDebug(), wfProfileIn(), and wfProfileOut().
Reimplemented from BagOStuff.
Definition at line 268 of file DBABagOStuff.php.
References $result, and getReader().
DBABagOStuff::set | ( | $ | key, |
$ | value, | ||
$ | exptime = 0 |
||
) |
$key | string |
$value | mixed |
$exptime | int |
Reimplemented from BagOStuff.
Definition at line 151 of file DBABagOStuff.php.
References $blob, $value, encode(), getWriter(), wfDebug(), wfProfileIn(), and wfProfileOut().
DBABagOStuff::$mDisabled |
Definition at line 36 of file DBABagOStuff.php.
DBABagOStuff::$mFile |
Definition at line 36 of file DBABagOStuff.php.
DBABagOStuff::$mHandler |
Definition at line 36 of file DBABagOStuff.php.
DBABagOStuff::$mReader |
Definition at line 36 of file DBABagOStuff.php.
DBABagOStuff::$mWriter |
Definition at line 36 of file DBABagOStuff.php.