MediaWiki master
LoadBalancerDisabled.php
Go to the documentation of this file.
1<?php
20namespace Wikimedia\Rdbms;
21
22use RuntimeException;
23
34
35 public function __construct( $params = [] ) {
36 parent::__construct( [
37 'servers' => [ [
38 'type' => 'disabled',
39 'host' => '(disabled)',
40 'dbname' => null,
41 'load' => 1,
42 ] ],
43 'trxProfiler' => $params['trxProfiler'] ?? null,
44 'srvCache' => $params['srvCache'] ?? null,
45 'wanCache' => $params['wanCache'] ?? null,
46 'localDomain' => $params['localDomain'] ?? '(disabled)',
47 'readOnlyReason' => $params['readOnlyReason'] ?? false,
48 'clusterName' => $params['clusterName'] ?? null,
49 ] );
50 }
51
59 protected function reallyOpenConnection( $i, DatabaseDomain $domain, array $lbInfo ) {
60 throw new RuntimeException( 'Database backend disabled' );
61 }
62
71 public function getConnection( $i, $groups = [], $domain = false, $flags = 0 ) {
72 throw new RuntimeException( 'Database backend disabled' );
73 }
74
83 public function getConnectionInternal( $i, $groups = [], $domain = false, $flags = 0 ): IDatabase {
84 throw new RuntimeException( 'Database backend disabled' );
85 }
86
95 public function getConnectionRef( $i, $groups = [], $domain = false, $flags = 0 ): IDatabase {
96 throw new RuntimeException( 'Database backend disabled' );
97 }
98
107 public function getMaintenanceConnectionRef( $i, $groups = [], $domain = false, $flags = 0 ): DBConnRef {
108 throw new RuntimeException( 'Database backend disabled' );
109 }
110
111 public function reuseConnection( IDatabase $conn ) {
112 // noop
113 }
114
115}
array $params
The job parameters.
Helper class used for automatically re-using IDatabase connections and lazily establishing the actual...
Definition DBConnRef.php:36
Class to handle database/schema/prefix specifications for IDatabase.
Trivial LoadBalancer that always fails.
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)
Basic database interface for live and lazy-loaded relation database handles.
Definition IDatabase.php:36