MediaWiki REL1_32
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

 __construct ( $params)
 
 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 Member Functions

 getWriteConnection ()
 

Private Attributes

array $batch = []
 
string $currentLang
 
IDatabase null $dbw
 
bool $readOnly = false
 
array $server
 Server configuration map.
 
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 29 of file LCStoreDB.php.

Constructor & Destructor Documentation

◆ __construct()

LCStoreDB::__construct (   $params)

Definition at line 43 of file LCStoreDB.php.

References $params, and server.

Member Function Documentation

◆ finishWrite()

◆ get()

LCStoreDB::get (   $code,
  $key 
)

Get a value.

Parameters
string$codeLanguage code
string$keyCache key

Implements LCStore.

Definition at line 47 of file LCStoreDB.php.

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

◆ getWriteConnection()

LCStoreDB::getWriteConnection ( )
private
Returns
IDatabase

Definition at line 134 of file LCStoreDB.php.

References $dbw, DB_MASTER, server, and wfGetDB().

Referenced by finishWrite(), get(), set(), and startWrite().

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

References $currentLang, $dbw, $value, batch, Wikimedia\Rdbms\IDatabase\encodeBlob(), getWriteConnection(), and serialize().

◆ startWrite()

LCStoreDB::startWrite (   $code)

Start a write transaction.

Parameters
string$codeLanguage code

Implements LCStore.

Definition at line 67 of file LCStoreDB.php.

References $code, $dbw, batch, getWriteConnection(), and Wikimedia\Rdbms\IDatabase\isReadOnly().

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 null LCStoreDB::$dbw
private

Definition at line 35 of file LCStoreDB.php.

Referenced by finishWrite(), getWriteConnection(), set(), and startWrite().

◆ $readOnly

bool LCStoreDB::$readOnly = false
private

Definition at line 39 of file LCStoreDB.php.

◆ $server

array LCStoreDB::$server
private

Server configuration map.

Definition at line 41 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: