MediaWiki
1.30.2
|
Database connection manager. More...
Public Member Functions | |
__construct (LoadBalancer $loadBalancer, $domain=false, array $groups=[]) | |
getReadConnection (array $groups=null) | |
Returns a database connection for reading. More... | |
getReadConnectionRef (array $groups=null) | |
Returns a database connection ref for reading. More... | |
getWriteConnection () | |
Returns a connection to the master DB, for updating. More... | |
getWriteConnectionRef () | |
Returns a connection ref to the master DB, for updating. More... | |
releaseConnection (IDatabase $db) | |
Private Member Functions | |
getConnection ( $i, array $groups=null) | |
getConnectionRef ( $i, array $groups=null) | |
Private Attributes | |
string false | $domain |
The symbolic name of the target database, or false for the local wiki's database. More... | |
string[] | $groups = [] |
LoadBalancer | $loadBalancer |
Database connection manager.
This manages access to master and replica databases.
Definition at line 17 of file ConnectionManager.php.
Wikimedia\Rdbms\ConnectionManager::__construct | ( | LoadBalancer | $loadBalancer, |
$domain = false , |
|||
array | $groups = [] |
||
) |
LoadBalancer | $loadBalancer | |
string | bool | $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 44 of file ConnectionManager.php.
References Wikimedia\Rdbms\ConnectionManager\$domain, Wikimedia\Rdbms\ConnectionManager\$groups, Wikimedia\Rdbms\ConnectionManager\$loadBalancer, and groups().
|
private |
int | $i | |
string[] | null | $groups |
Definition at line 60 of file ConnectionManager.php.
References Wikimedia\Rdbms\ConnectionManager\$groups, and groups().
Referenced by Wikimedia\Rdbms\ConnectionManager\getReadConnection(), and Wikimedia\Rdbms\ConnectionManager\getWriteConnection().
|
private |
int | $i | |
string[] | null | $groups |
Definition at line 71 of file ConnectionManager.php.
References Wikimedia\Rdbms\ConnectionManager\$groups, and groups().
Referenced by Wikimedia\Rdbms\ConnectionManager\getReadConnectionRef(), and Wikimedia\Rdbms\ConnectionManager\getWriteConnectionRef().
Wikimedia\Rdbms\ConnectionManager::getReadConnection | ( | array | $groups = null | ) |
Returns a database connection for reading.
The connection should later be released by calling releaseConnection().
string[] | null | $groups |
Reimplemented in Wikimedia\Rdbms\SessionConsistentConnectionManager.
Definition at line 98 of file ConnectionManager.php.
References Wikimedia\Rdbms\ConnectionManager\$groups, DB_REPLICA, Wikimedia\Rdbms\ConnectionManager\getConnection(), and groups().
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 132 of file ConnectionManager.php.
References Wikimedia\Rdbms\ConnectionManager\$groups, DB_REPLICA, Wikimedia\Rdbms\ConnectionManager\getConnectionRef(), and groups().
Wikimedia\Rdbms\ConnectionManager::getWriteConnection | ( | ) |
Returns a connection to the master DB, for updating.
The connection should later be released by calling releaseConnection().
Reimplemented in Wikimedia\Rdbms\SessionConsistentConnectionManager.
Definition at line 84 of file ConnectionManager.php.
References DB_MASTER, and Wikimedia\Rdbms\ConnectionManager\getConnection().
Wikimedia\Rdbms\ConnectionManager::getWriteConnectionRef | ( | ) |
Returns a connection ref to the master DB, for updating.
Reimplemented in Wikimedia\Rdbms\SessionConsistentConnectionManager.
Definition at line 119 of file ConnectionManager.php.
References DB_MASTER, and Wikimedia\Rdbms\ConnectionManager\getConnectionRef().
Wikimedia\Rdbms\ConnectionManager::releaseConnection | ( | IDatabase | $db | ) |
The symbolic name of the target database, or false for the local wiki's database.
Definition at line 29 of file ConnectionManager.php.
Referenced by Wikimedia\Rdbms\ConnectionManager\__construct().
|
private |
Definition at line 34 of file ConnectionManager.php.
Referenced by Wikimedia\Rdbms\ConnectionManager\__construct(), Wikimedia\Rdbms\ConnectionManager\getConnection(), Wikimedia\Rdbms\ConnectionManager\getConnectionRef(), Wikimedia\Rdbms\SessionConsistentConnectionManager\getReadConnection(), Wikimedia\Rdbms\ConnectionManager\getReadConnection(), Wikimedia\Rdbms\SessionConsistentConnectionManager\getReadConnectionRef(), and Wikimedia\Rdbms\ConnectionManager\getReadConnectionRef().
|
private |
Definition at line 22 of file ConnectionManager.php.
Referenced by Wikimedia\Rdbms\ConnectionManager\__construct().