MediaWiki REL1_37
|
LCStore implementation which uses the standard DB functions to store data. More...
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 = [] |
Rows buffered for insertion. | |
string | $code |
Language code. | |
IDatabase null | $dbw |
bool | $readOnly = false |
Whether the DB is read-only or otherwise unavailable for writes. | |
array | $server |
Server configuration map. | |
bool | $writesDone = false |
Whether a batch of writes were recently written. | |
LCStore implementation which uses the standard DB functions to store data.
This will work on any MediaWiki installation.
Definition at line 30 of file LCStoreDB.php.
LCStoreDB::__construct | ( | $params | ) |
Definition at line 46 of file LCStoreDB.php.
LCStoreDB::finishWrite | ( | ) |
Finish a write transaction.
Implements LCStore.
Definition at line 84 of file LCStoreDB.php.
References $dbw, Wikimedia\Rdbms\IDatabase\delete(), Wikimedia\Rdbms\IDatabase\endAtomic(), getWriteConnection(), Wikimedia\Rdbms\IDatabase\insert(), Wikimedia\Rdbms\IDatabase\startAtomic(), and Wikimedia\Rdbms\IDatabase\wasReadOnlyError().
LCStoreDB::get | ( | $code, | |
$key | |||
) |
Get a value.
string | $code | Language code |
string | $key | Cache key |
Implements LCStore.
Definition at line 50 of file LCStoreDB.php.
References $code, DB_REPLICA, getWriteConnection(), unserialize(), and wfGetDB().
|
private |
Definition at line 133 of file LCStoreDB.php.
References $dbw, DB_PRIMARY, and wfGetDB().
Referenced by finishWrite(), get(), set(), and startWrite().
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.
string | $key | |
mixed | $value |
Implements LCStore.
Definition at line 114 of file LCStoreDB.php.
References $code, $dbw, Wikimedia\Rdbms\IDatabase\encodeBlob(), getWriteConnection(), and serialize().
LCStoreDB::startWrite | ( | $code | ) |
Start a write transaction.
string | $code | Language code |
Implements LCStore.
Definition at line 70 of file LCStoreDB.php.
References $code, $dbw, getWriteConnection(), and Wikimedia\Rdbms\IDatabase\isReadOnly().
|
private |
Rows buffered for insertion.
Definition at line 37 of file LCStoreDB.php.
|
private |
Language code.
Definition at line 32 of file LCStoreDB.php.
Referenced by get(), set(), and startWrite().
|
private |
Definition at line 40 of file LCStoreDB.php.
Referenced by finishWrite(), getWriteConnection(), set(), and startWrite().
|
private |
Whether the DB is read-only or otherwise unavailable for writes.
Definition at line 44 of file LCStoreDB.php.
|
private |
Server configuration map.
Definition at line 34 of file LCStoreDB.php.
|
private |
Whether a batch of writes were recently written.
Definition at line 42 of file LCStoreDB.php.