MediaWiki master
MediaWiki\Language\LCStoreCDB Class Reference

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

Inherits MediaWiki\Language\LCStore.

Collaboration diagram for MediaWiki\Language\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

 
 lateFallback ()
 Can this cache type delay fallback lookups to read time?Returning true will cause the fallbacks to be skipped when recaching data, and instead performed via multiple reads if necessary at runtime.This is best when performing lookups is extremely low-cost, such as LCStoreStaticArray with the lateFallback option.When reading from disk or network, trading off the space for fewer lookups may still be a win. Returning false will keep the classic behavior of pre-filling all the fallback chains for each language.
 
 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 28 of file LCStoreCDB.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Language\LCStoreCDB::__construct ( array $conf = [])

Definition at line 42 of file LCStoreCDB.php.

Member Function Documentation

◆ finishWrite()

MediaWiki\Language\LCStoreCDB::finishWrite ( )

Finish a cache write transaction.

Implements MediaWiki\Language\LCStore.

Definition at line 95 of file LCStoreCDB.php.

◆ get()

MediaWiki\Language\LCStoreCDB::get ( $code,
$key )

Get a value.

Parameters
string$codeLanguage code
string$keyCache key

Implements MediaWiki\Language\LCStore.

Definition at line 47 of file LCStoreCDB.php.

References MediaWiki\Language\LCStoreCDB\getFileName(), and wfDebug().

◆ getFileName()

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

Definition at line 114 of file LCStoreCDB.php.

Referenced by MediaWiki\Language\LCStoreCDB\get(), and MediaWiki\Language\LCStoreCDB\startWrite().

◆ lateFallback()

MediaWiki\Language\LCStoreCDB::lateFallback ( )

Can this cache type delay fallback lookups to read time?Returning true will cause the fallbacks to be skipped when recaching data, and instead performed via multiple reads if necessary at runtime.This is best when performing lookups is extremely low-cost, such as LCStoreStaticArray with the lateFallback option.When reading from disk or network, trading off the space for fewer lookups may still be a win. Returning false will keep the classic behavior of pre-filling all the fallback chains for each language.

Implements MediaWiki\Language\LCStore.

Definition at line 123 of file LCStoreCDB.php.

◆ set()

MediaWiki\Language\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 MediaWiki\Language\LCStore.

Definition at line 103 of file LCStoreCDB.php.

◆ startWrite()

MediaWiki\Language\LCStoreCDB::startWrite ( $code)

Start a cache write transaction.

Parameters
string$codeLanguage code

Implements MediaWiki\Language\LCStore.

Definition at line 80 of file LCStoreCDB.php.

References MediaWiki\Language\LCStoreCDB\getFileName(), and wfMkdirParents().


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