MediaWiki master
LoadBalancerDisabled.php
Go to the documentation of this file.
1<?php
6namespace Wikimedia\Rdbms;
7
8use RuntimeException;
9
19
20 public function __construct( array $params = [] ) {
21 parent::__construct( [
22 'servers' => [ [
23 'type' => 'disabled',
24 'host' => '(disabled)',
25 'dbname' => null,
26 'load' => 1,
27 ] ],
28 'trxProfiler' => $params['trxProfiler'] ?? null,
29 'srvCache' => $params['srvCache'] ?? null,
30 'wanCache' => $params['wanCache'] ?? null,
31 'localDomain' => $params['localDomain'] ?? '(disabled)',
32 'readOnlyReason' => $params['readOnlyReason'] ?? false,
33 'clusterName' => $params['clusterName'] ?? null,
34 ] );
35 }
36
44 protected function reallyOpenConnection( $i, DatabaseDomain $domain, array $lbInfo ): never {
45 throw new RuntimeException( 'Database backend disabled' );
46 }
47
56 public function getConnection( $i, $groups = [], string|false $domain = false, $flags = 0 ): never {
57 throw new RuntimeException( 'Database backend disabled' );
58 }
59
68 public function getConnectionInternal( $i, $groups = [], $domain = false, $flags = 0 ): never {
69 throw new RuntimeException( 'Database backend disabled' );
70 }
71
80 public function getMaintenanceConnectionRef( $i, $groups = [], $domain = false, $flags = 0 ): never {
81 throw new RuntimeException( 'Database backend disabled' );
82 }
83
84}
Class to handle database/schema/prefix specifications for IDatabase.
Placeholder LoadBalancer that throws an error upon attempts to access connections.
getConnection( $i, $groups=[], string|false $domain=false, $flags=0)
getConnectionInternal( $i, $groups=[], $domain=false, $flags=0)
getMaintenanceConnectionRef( $i, $groups=[], $domain=false, $flags=0)
reallyOpenConnection( $i, DatabaseDomain $domain, array $lbInfo)