MediaWiki master
|
Database connection manager. More...
Inherited by Wikimedia\Rdbms\SessionConsistentConnectionManager.
Public Member Functions | |
__construct (ILoadBalancer $loadBalancer, $domain=false, array $groups=[]) | |
getReadConnection (?array $groups=null, int $flags=0) | |
Returns a database connection for reading. | |
getWriteConnection (int $flags=0) | |
Returns a connection to the primary DB, for updating. | |
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::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 102 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 89 of file ConnectionManager.php.
References DB_PRIMARY.