MediaWiki REL1_28
LCStoreDB Class Reference

LCStore implementation which uses the standard DB functions to store data. More...

Inheritance diagram for LCStoreDB:
Collaboration diagram for LCStoreDB:

Public Member Functions

 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.
 

Private Attributes

array $batch = []
 
string $currentLang
 
IDatabase $dbw
 
bool $readOnly = false
 
bool $writesDone = false
 

Detailed Description

LCStore implementation which uses the standard DB functions to store data.

This will work on any MediaWiki installation.

Definition at line 25 of file LCStoreDB.php.

Member Function Documentation

◆ finishWrite()

LCStoreDB::finishWrite ( )

Finish a write transaction.

Implements LCStore.

Definition at line 69 of file LCStoreDB.php.

References $e, as, and batch.

◆ get()

LCStoreDB::get (   $code,
  $key 
)

Get a value.

Parameters
string$codeLanguage code
string$keyCache key

Implements LCStore.

Definition at line 38 of file LCStoreDB.php.

References $code, $dbw, $value, DB_REPLICA, unserialize(), and wfGetDB().

◆ set()

LCStoreDB::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 100 of file LCStoreDB.php.

References $currentLang, $value, batch, and serialize().

◆ startWrite()

LCStoreDB::startWrite (   $code)

Start a write transaction.

Parameters
string$codeLanguage code

Implements LCStore.

Definition at line 55 of file LCStoreDB.php.

References $code, batch, DB_MASTER, and wfGetDB().

Member Data Documentation

◆ $batch

array LCStoreDB::$batch = []
private

Definition at line 34 of file LCStoreDB.php.

◆ $currentLang

string LCStoreDB::$currentLang
private

Definition at line 28 of file LCStoreDB.php.

Referenced by set().

◆ $dbw

IDatabase LCStoreDB::$dbw
private

Definition at line 32 of file LCStoreDB.php.

Referenced by get().

◆ $readOnly

bool LCStoreDB::$readOnly = false
private

Definition at line 36 of file LCStoreDB.php.

◆ $writesDone

bool LCStoreDB::$writesDone = false
private

Definition at line 30 of file LCStoreDB.php.


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