MediaWiki master
LoadBalancerDisabled.php
Go to the documentation of this file.
1<?php
20namespace Wikimedia\Rdbms;
21
22use RuntimeException;
23
33
34 public function __construct( $params = [] ) {
35 parent::__construct( [
36 'servers' => [ [
37 'type' => 'disabled',
38 'host' => '(disabled)',
39 'dbname' => null,
40 'load' => 1,
41 ] ],
42 'trxProfiler' => $params['trxProfiler'] ?? null,
43 'srvCache' => $params['srvCache'] ?? null,
44 'wanCache' => $params['wanCache'] ?? null,
45 'localDomain' => $params['localDomain'] ?? '(disabled)',
46 'readOnlyReason' => $params['readOnlyReason'] ?? false,
47 'clusterName' => $params['clusterName'] ?? null,
48 ] );
49 }
50
58 protected function reallyOpenConnection( $i, DatabaseDomain $domain, array $lbInfo ) {
59 throw new RuntimeException( 'Database backend disabled' );
60 }
61
70 public function getConnection( $i, $groups = [], $domain = false, $flags = 0 ) {
71 throw new RuntimeException( 'Database backend disabled' );
72 }
73
82 public function getConnectionInternal( $i, $groups = [], $domain = false, $flags = 0 ): IDatabase {
83 throw new RuntimeException( 'Database backend disabled' );
84 }
85
94 public function getConnectionRef( $i, $groups = [], $domain = false, $flags = 0 ): DBConnRef {
95 throw new RuntimeException( 'Database backend disabled' );
96 }
97
106 public function getMaintenanceConnectionRef( $i, $groups = [], $domain = false, $flags = 0 ): DBConnRef {
107 throw new RuntimeException( 'Database backend disabled' );
108 }
109
110}
array $params
The job parameters.
Helper class used for automatically re-using IDatabase connections and lazily establishing the actual...
Definition DBConnRef.php:37
Class to handle database/schema/prefix specifications for IDatabase.
Placeholder LoadBalancer that throws an error upon attempts to access connections.
getConnectionInternal( $i, $groups=[], $domain=false, $flags=0)
getMaintenanceConnectionRef( $i, $groups=[], $domain=false, $flags=0)
getConnection( $i, $groups=[], $domain=false, $flags=0)
reallyOpenConnection( $i, DatabaseDomain $domain, array $lbInfo)
getConnectionRef( $i, $groups=[], $domain=false, $flags=0)
Interface to a relational database.
Definition IDatabase.php:48