MediaWiki
REL1_22
|
Cache that uses DBA as a backend. More...
Public Member Functions | |
__construct ($params) | |
add ($key, $value, $exptime=0) | |
cas ($casToken, $key, $value, $exptime=0) | |
delete ($key, $time=0) | |
get ($key, &$casToken=null) | |
incr ($key, $step=1) | |
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, global, wfDebug(), wfTempDir(), and wfWikiID().
DBABagOStuff::add | ( | $ | key, |
$ | value, | ||
$ | exptime = 0 |
||
) |
$key | string |
$value | mixed |
$exptime | int |
Reimplemented from BagOStuff.
Definition at line 238 of file DBABagOStuff.php.
References $blob, $key, $ret, $value, decode(), encode(), getWriter(), list, wfProfileIn(), and wfProfileOut().
DBABagOStuff::cas | ( | $ | casToken, |
$ | key, | ||
$ | value, | ||
$ | exptime = 0 |
||
) |
$casToken | mixed |
$key | string |
$value | mixed |
$exptime | int |
Reimplemented from BagOStuff.
Definition at line 181 of file DBABagOStuff.php.
References $blob, $key, $ret, $value, decode(), encode(), getWriter(), list, wfDebug(), wfProfileIn(), and wfProfileOut().
DBABagOStuff::decode | ( | $ | blob | ) | [protected] |
DBABagOStuff::delete | ( | $ | key, |
$ | time = 0 |
||
) |
$key | string |
$time | int |
Reimplemented from BagOStuff.
Definition at line 215 of file DBABagOStuff.php.
References $key, $ret, 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, |
&$ | casToken = null |
||
) |
$key | string |
$casToken[optional] | mixed |
Reimplemented from BagOStuff.
Definition at line 117 of file DBABagOStuff.php.
References $key, decode(), getReader(), getWriter(), list, wfDebug(), wfProfileIn(), and wfProfileOut().
DBABagOStuff::getReader | ( | ) | [protected] |
Definition at line 85 of file DBABagOStuff.php.
References getWriter(), and wfDebug().
Referenced by get().
DBABagOStuff::getWriter | ( | ) | [protected] |
Definition at line 102 of file DBABagOStuff.php.
References wfDebug().
Referenced by add(), cas(), delete(), get(), getReader(), incr(), and set().
DBABagOStuff::incr | ( | $ | key, |
$ | step = 1 |
||
) |
$key | string |
$step | integer |
Reimplemented from BagOStuff.
Definition at line 275 of file DBABagOStuff.php.
References $blob, $key, $ret, $value, decode(), encode(), getWriter(), list, wfDebug(), wfProfileIn(), and wfProfileOut().
DBABagOStuff::set | ( | $ | key, |
$ | value, | ||
$ | exptime = 0 |
||
) |
$key | string |
$value | mixed |
$exptime | int |
Reimplemented from BagOStuff.
Definition at line 155 of file DBABagOStuff.php.
References $blob, $key, $ret, $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.