26use InvalidArgumentException;
41 $conn = $params[
'connection'] ??
null;
43 throw new InvalidArgumentException(
"Missing 'connection' argument." );
48 parent::__construct( [
50 'type' => $conn->getType(),
51 'host' => $conn->getServer(),
52 'dbname' => $conn->getDBname(),
55 'trxProfiler' => $params[
'trxProfiler'] ??
null,
56 'srvCache' => $params[
'srvCache'] ??
null,
57 'wanCache' => $params[
'wanCache'] ??
null,
58 'localDomain' => $params[
'localDomain'] ?? $this->db->getDomainID(),
59 'readOnlyReason' => $params[
'readOnlyReason'] ??
false,
62 if ( isset( $params[
'readOnlyReason'] ) ) {
63 $conn->setLBInfo( $conn::LB_READ_ONLY_REASON, $params[
'readOnlyReason'] );
74 return new static( array_merge(
77 [
'connection' =>
$db ]
93class_alias( LoadBalancerSingle::class,
'LoadBalancerSingle' );
Class to handle database/schema/prefix specifications for IDatabase.