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