MediaWiki  1.29.1
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. More...
 
 get ( $code, $key)
 Get a value. More...
 
 set ( $key, $value)
 Set a key to a given value. More...
 
 startWrite ( $code)
 Start a write transaction. More...
 

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

Member Function Documentation

◆ finishWrite()

LCStoreDB::finishWrite ( )

Finish a write transaction.

Implements LCStore.

Definition at line 72 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 41 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 103 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 58 of file LCStoreDB.php.

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

Member Data Documentation

◆ $batch

array LCStoreDB::$batch = []
private

Definition at line 37 of file LCStoreDB.php.

◆ $currentLang

string LCStoreDB::$currentLang
private

Definition at line 31 of file LCStoreDB.php.

Referenced by set().

◆ $dbw

IDatabase LCStoreDB::$dbw
private

Definition at line 35 of file LCStoreDB.php.

Referenced by get().

◆ $readOnly

bool LCStoreDB::$readOnly = false
private

Definition at line 39 of file LCStoreDB.php.

◆ $writesDone

bool LCStoreDB::$writesDone = false
private

Definition at line 33 of file LCStoreDB.php.


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