|
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 19 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 46 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 88 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 75 of file ConnectionManager.php.
References DB_PRIMARY.