MediaWiki REL1_32
|
LCStore implementation which stores data as a collection of CDB files in the directory given by $wgCacheDirectory. More...
Public Member Functions | |
__construct ( $conf=[]) | |
finishWrite () | |
Finish a write transaction. | |
get ( $code, $key) | |
Get a value. | |
set ( $key, $value) | |
Set a key to a given value. | |
startWrite ( $code) | |
Start a write transaction. | |
Protected Member Functions | |
getFileName ( $code) | |
Private Attributes | |
string | $currentLang |
Current language code. | |
bool string | $directory |
Cache directory. | |
Reader[] | $readers |
Writer | $writer |
LCStore implementation which stores data as a collection of CDB files in the directory given by $wgCacheDirectory.
If $wgCacheDirectory is not set, this will throw an exception.
Profiling indicates that on Linux, this implementation outperforms MySQL if the directory is on a local filesystem and there is ample kernel cache space. The performance advantage is greater when the DBA extension is available than it is with the PHP port.
See Cdb.php and https://cr.yp.to/cdb.html
Definition at line 36 of file LCStoreCDB.php.
LCStoreCDB::__construct | ( | $conf = [] | ) |
Definition at line 50 of file LCStoreCDB.php.
References $wgCacheDirectory, and directory.
LCStoreCDB::finishWrite | ( | ) |
LCStoreCDB::get | ( | $code, | |
$key ) |
Get a value.
string | $code | Language code |
string | $key | Cache key |
Implements LCStore.
Definition at line 60 of file LCStoreCDB.php.
References $code, $e, $value, getFileName(), unserialize(), and wfDebug().
|
protected |
Definition at line 136 of file LCStoreCDB.php.
References $code.
Referenced by get(), and startWrite().
LCStoreCDB::set | ( | $key, | |
$value ) |
Set a key to a given value.
startWrite() must be called before this is called, and finishWrite() must be called afterwards.
string | $key | |
mixed | $value |
Implements LCStore.
Definition at line 125 of file LCStoreCDB.php.
References $e, $value, serialize(), and writer.
LCStoreCDB::startWrite | ( | $code | ) |
Start a write transaction.
string | $code | Language code |
Implements LCStore.
Definition at line 92 of file LCStoreCDB.php.
References $code, $e, directory, getFileName(), wfMkdirParents(), and writer.
|
private |
Current language code.
Definition at line 45 of file LCStoreCDB.php.
|
private |
|
private |
Definition at line 39 of file LCStoreCDB.php.
|
private |
Definition at line 42 of file LCStoreCDB.php.