MediaWiki  1.34.0
DBAccessBase Class Reference
Inheritance diagram for DBAccessBase:
Collaboration diagram for DBAccessBase:

Public Member Functions

 __construct ( $dbDomain=false)
 

Protected Member Functions

 getConnection ( $id, array $groups=[])
 Returns a database connection. More...
 
 getLoadBalancer ()
 Get the database type used for read operations. More...
 
 releaseConnection (IDatabase $db)
 Releases a database connection and makes it available for recycling. More...
 

Protected Attributes

string bool $dbDomain = false
 The target wiki's DB domain. More...
 

Private Attributes

ILoadBalancer $lb
 

Additional Inherited Members

- Public Attributes inherited from IDBAccessObject
const READ_LOCKING = self::READ_LATEST | 2
 Constants for object loading bitfield flags (higher => higher QoS) More...
 
const READ_NONE = -1
 

Detailed Description

Definition at line 34 of file DBAccessBase.php.

Constructor & Destructor Documentation

◆ __construct()

DBAccessBase::__construct (   $dbDomain = false)
Parameters
string | bool$dbDomainThe target wiki's DB domain

Definition at line 44 of file DBAccessBase.php.

References $dbDomain.

Member Function Documentation

◆ getConnection()

DBAccessBase::getConnection (   $id,
array  $groups = [] 
)
protected

Returns a database connection.

See also
LoadBalancer::getConnection()
Since
1.21
Parameters
int$idWhich connection to use
array$groupsQuery groups
Returns
IDatabase

Definition at line 62 of file DBAccessBase.php.

References getLoadBalancer().

◆ getLoadBalancer()

DBAccessBase::getLoadBalancer ( )
protected

Get the database type used for read operations.

See also
MediaWikiServices::getInstance()->getDBLoadBalancer
Since
1.21
Returns
ILoadBalancer The database load balancer object

Definition at line 89 of file DBAccessBase.php.

References $lb.

Referenced by getConnection().

◆ releaseConnection()

DBAccessBase::releaseConnection ( IDatabase  $db)
protected

Releases a database connection and makes it available for recycling.

See also
LoadBalancer::reuseConnection()
Since
1.21
Parameters
IDatabase$dbThe database connection to release.
Deprecated:
Since 1.34

Definition at line 76 of file DBAccessBase.php.

Member Data Documentation

◆ $dbDomain

string bool DBAccessBase::$dbDomain = false
protected

The target wiki's DB domain.

Definition at line 39 of file DBAccessBase.php.

Referenced by __construct().

◆ $lb

ILoadBalancer DBAccessBase::$lb
private

Definition at line 36 of file DBAccessBase.php.

Referenced by getLoadBalancer().


The documentation for this class was generated from the following file: