MediaWiki  1.28.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 25 of file LCStoreDB.php.

Member Function Documentation

LCStoreDB::finishWrite ( )

Finish a write transaction.

Implements LCStore.

Definition at line 69 of file LCStoreDB.php.

References $e, as, and batch.

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().

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().

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

array LCStoreDB::$batch = []
private

Definition at line 34 of file LCStoreDB.php.

string LCStoreDB::$currentLang
private

Definition at line 28 of file LCStoreDB.php.

Referenced by set().

IDatabase LCStoreDB::$dbw
private

Definition at line 32 of file LCStoreDB.php.

Referenced by get().

bool LCStoreDB::$readOnly = false
private

Definition at line 36 of file LCStoreDB.php.

bool LCStoreDB::$writesDone = false
private

Definition at line 30 of file LCStoreDB.php.


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