MediaWiki REL1_37
|
Database connection manager. More...
Public Member Functions | |
getReadConnection (?array $groups=null, int $flags=0) | |
getReadConnectionRef (array $groups=null) | |
getWriteConnection (int $flags=0) | |
getWriteConnectionRef () | |
prepareForUpdates () | |
Forces all future calls to getReadConnection() to return a write connection. | |
Public Member Functions inherited from Wikimedia\Rdbms\ConnectionManager | |
__construct (ILoadBalancer $loadBalancer, $domain=false, array $groups=[]) | |
getLazyReadConnectionRef (array $groups=null) | |
Returns a lazy-connecting database connection ref for reading. | |
releaseConnection (IDatabase $db) | |
Private Attributes | |
bool | $forceWriteConnection = false |
Database connection manager.
This manages access to primary and replica databases. It also manages state that indicates whether the replica databases are possibly outdated after a write operation, and thus the primary database should be used for subsequent read operations.
Definition at line 45 of file SessionConsistentConnectionManager.php.
Wikimedia\Rdbms\SessionConsistentConnectionManager::getReadConnection | ( | ?array | $groups = null , |
int | $flags = 0 |
||
) |
string[] | null | $groups | |
int | $flags |
Reimplemented from Wikimedia\Rdbms\ConnectionManager.
Definition at line 71 of file SessionConsistentConnectionManager.php.
References Wikimedia\Rdbms\ConnectionManager\$groups.
Wikimedia\Rdbms\SessionConsistentConnectionManager::getReadConnectionRef | ( | array | $groups = null | ) |
string[] | null | $groups |
Reimplemented from Wikimedia\Rdbms\ConnectionManager.
Definition at line 99 of file SessionConsistentConnectionManager.php.
References Wikimedia\Rdbms\ConnectionManager\$groups.
Wikimedia\Rdbms\SessionConsistentConnectionManager::getWriteConnection | ( | int | $flags = 0 | ) |
int | $flags |
Reimplemented from Wikimedia\Rdbms\ConnectionManager.
Definition at line 87 of file SessionConsistentConnectionManager.php.
References Wikimedia\Rdbms\SessionConsistentConnectionManager\prepareForUpdates().
Wikimedia\Rdbms\SessionConsistentConnectionManager::getWriteConnectionRef | ( | ) |
Reimplemented from Wikimedia\Rdbms\ConnectionManager.
Definition at line 112 of file SessionConsistentConnectionManager.php.
References Wikimedia\Rdbms\SessionConsistentConnectionManager\prepareForUpdates().
Wikimedia\Rdbms\SessionConsistentConnectionManager::prepareForUpdates | ( | ) |
Forces all future calls to getReadConnection() to return a write connection.
Use this before performing read operations that are critical for a future update.
Definition at line 58 of file SessionConsistentConnectionManager.php.
Referenced by Wikimedia\Rdbms\SessionConsistentConnectionManager\getWriteConnection(), and Wikimedia\Rdbms\SessionConsistentConnectionManager\getWriteConnectionRef().
|
private |
Definition at line 50 of file SessionConsistentConnectionManager.php.