MediaWiki REL1_39
|
Database connection manager. More...
Public Member Functions | |
__construct (ILoadBalancer $loadBalancer, $domain=false, array $groups=[]) | |
getLazyReadConnectionRef (array $groups=null) | |
Returns a lazy-connecting database connection ref for reading. | |
getLazyWriteConnectionRef () | |
Returns a lazy-connecting database connection ref for updating. | |
getReadConnection (?array $groups=null, int $flags=0) | |
Returns a database connection for reading. | |
getReadConnectionRef (array $groups=null) | |
Returns a database connection ref for reading. | |
getWriteConnection (int $flags=0) | |
Returns a connection to the primary DB, for updating. | |
getWriteConnectionRef () | |
Returns a connection ref to the primary DB, for updating. | |
releaseConnection (IDatabase $db) | |
Database connection manager.
This manages access to primary and replica databases.
Definition at line 33 of file ConnectionManager.php.
Wikimedia\Rdbms\ConnectionManager::__construct | ( | ILoadBalancer | $loadBalancer, |
$domain = false, | |||
array | $groups = [] ) |
ILoadBalancer | $loadBalancer | |
string | false | $domain | Optional logical DB name, defaults to current wiki. This follows the convention for database names used by $loadBalancer. |
string[] | $groups | see LoadBalancer::getConnection |
InvalidArgumentException |
Definition at line 60 of file ConnectionManager.php.
Wikimedia\Rdbms\ConnectionManager::getLazyReadConnectionRef | ( | array | $groups = null | ) |
Returns a lazy-connecting database connection ref for reading.
string[] | null | $groups |
Definition at line 170 of file ConnectionManager.php.
References DB_REPLICA.
Wikimedia\Rdbms\ConnectionManager::getLazyWriteConnectionRef | ( | ) |
Returns a lazy-connecting database connection ref for updating.
Definition at line 158 of file ConnectionManager.php.
Wikimedia\Rdbms\ConnectionManager::getReadConnection | ( | ?array | $groups = null, |
int | $flags = 0 ) |
Returns a database connection for reading.
string[] | null | $groups | |
int | $flags |
Reimplemented in Wikimedia\Rdbms\SessionConsistentConnectionManager.
Definition at line 112 of file ConnectionManager.php.
References DB_REPLICA.
Wikimedia\Rdbms\ConnectionManager::getReadConnectionRef | ( | array | $groups = null | ) |
Returns a database connection ref for reading.
string[] | null | $groups |
Reimplemented in Wikimedia\Rdbms\SessionConsistentConnectionManager.
Definition at line 146 of file ConnectionManager.php.
References DB_REPLICA.
Wikimedia\Rdbms\ConnectionManager::getWriteConnection | ( | int | $flags = 0 | ) |
Returns a connection to the primary DB, for updating.
int | $flags |
Reimplemented in Wikimedia\Rdbms\SessionConsistentConnectionManager.
Definition at line 99 of file ConnectionManager.php.
References DB_PRIMARY.
Wikimedia\Rdbms\ConnectionManager::getWriteConnectionRef | ( | ) |
Returns a connection ref to the primary DB, for updating.
Reimplemented in Wikimedia\Rdbms\SessionConsistentConnectionManager.
Definition at line 134 of file ConnectionManager.php.
References DB_PRIMARY.
Wikimedia\Rdbms\ConnectionManager::releaseConnection | ( | IDatabase | $db | ) |
IDatabase | $db |
Definition at line 122 of file ConnectionManager.php.