MediaWiki fundraising/REL1_35
LCStoreCDB Class Reference

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

Inheritance diagram for LCStoreCDB:
Collaboration diagram for LCStoreCDB:

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.
 
string $directory
 Cache directory.
 
Reader[] false[] $readers
 
Writer $writer
 

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

Constructor & Destructor Documentation

◆ __construct()

LCStoreCDB::__construct ( $conf = [])

Definition at line 48 of file LCStoreCDB.php.

Member Function Documentation

◆ finishWrite()

LCStoreCDB::finishWrite ( )

Finish a write transaction.

Implements LCStore.

Definition at line 103 of file LCStoreCDB.php.

◆ get()

LCStoreCDB::get ( $code,
$key )

Get a value.

Parameters
string$codeLanguage code
string$keyCache key

Implements LCStore.

Definition at line 52 of file LCStoreCDB.php.

References getFileName(), unserialize(), and wfDebug().

◆ getFileName()

LCStoreCDB::getFileName ( $code)
protected

Definition at line 126 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 afterwards.

Parameters
string$key
mixed$value

Implements LCStore.

Definition at line 115 of file LCStoreCDB.php.

References serialize().

◆ startWrite()

LCStoreCDB::startWrite ( $code)

Start a write transaction.

Parameters
string$codeLanguage code

Implements LCStore.

Definition at line 84 of file LCStoreCDB.php.

References getFileName(), and wfMkdirParents().

Member Data Documentation

◆ $currentLang

string LCStoreCDB::$currentLang
private

Current language code.

Definition at line 43 of file LCStoreCDB.php.

◆ $directory

string LCStoreCDB::$directory
private

Cache directory.

Definition at line 46 of file LCStoreCDB.php.

◆ $readers

Reader [] false [] LCStoreCDB::$readers
private

Definition at line 37 of file LCStoreCDB.php.

◆ $writer

Writer LCStoreCDB::$writer
private

Definition at line 40 of file LCStoreCDB.php.


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