MediaWiki master
LCStoreCDB Class Reference

LCStore implementation which stores data as a collection of CDB files. More...

Inherits LCStore.

Collaboration diagram for LCStoreCDB:

Public Member Functions

 __construct (array $conf=[])
 
 finishWrite ()
 Finish a cache write transaction.
 
 get ( $code, $key)
 Get a value.
Parameters
string$codeLanguage code
string$keyCache key

 
 set ( $key, $value)
 Set a key to a given value.startWrite() must be called before this is called, and finishWrite() must be called after.
Parameters
string$key
mixed$value

 
 startWrite ( $code)
 Start a cache write transaction.
Parameters
string$codeLanguage code

 

Protected Member Functions

 getFileName ( $code)
 

Detailed Description

LCStore implementation which stores data as a collection of CDB files.

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 22 of file LCStoreCDB.php.

Constructor & Destructor Documentation

◆ __construct()

LCStoreCDB::__construct ( array $conf = [])

Definition at line 36 of file LCStoreCDB.php.

Member Function Documentation

◆ finishWrite()

LCStoreCDB::finishWrite ( )

Finish a cache write transaction.

Implements LCStore.

Definition at line 89 of file LCStoreCDB.php.

◆ get()

LCStoreCDB::get ( $code,
$key )

Get a value.

Parameters
string$codeLanguage code
string$keyCache key

Implements LCStore.

Definition at line 41 of file LCStoreCDB.php.

References getFileName(), and wfDebug().

◆ getFileName()

LCStoreCDB::getFileName ( $code)
protected
Parameters
string | null$code
Returns
string

Definition at line 108 of file LCStoreCDB.php.

Referenced by get(), and startWrite().

◆ set()

LCStoreCDB::set ( $key,
$value )

Set a key to a given value.startWrite() must be called before this is called, and finishWrite() must be called after.

Parameters
string$key
mixed$value

Implements LCStore.

Definition at line 97 of file LCStoreCDB.php.

◆ startWrite()

LCStoreCDB::startWrite ( $code)

Start a cache write transaction.

Parameters
string$codeLanguage code

Implements LCStore.

Definition at line 74 of file LCStoreCDB.php.

References getFileName(), and wfMkdirParents().


The documentation for this class was generated from the following file: