28use Wikimedia\RequestTimeout\CriticalSectionProvider;
41 private static array $loggedDeprecations = [];
48 private CriticalSectionProvider $csProvider;
51 private ?
string $uniqueIdentifier;
68 CriticalSectionProvider $csProvider,
71 ?
string $uniqueIdentifier =
null
73 $this->readOnlyMode = $readOnlyMode;
74 $this->chronologyProtector = $chronologyProtector;
75 $this->srvCache = $srvCache;
76 $this->wanCache = $wanCache;
77 $this->csProvider = $csProvider;
78 $this->statsFactory = $statsFactory;
79 $this->tracer = $tracer;
80 $this->uniqueIdentifier = $uniqueIdentifier;
90 $profilerCallback =
null;
92 $profilerCallback =
static function ( $section ) {
93 return Profiler::instance()->scopedProfileIn( $section );
98 'profiler' => $profilerCallback,
99 'trxProfiler' => Profiler::instance()->getTransactionProfiler(),
100 'logger' => LoggerFactory::getInstance(
'rdbms' ),
101 'errorLogger' => MWExceptionHandler::logException( ... ),
102 'deprecationLogger' => static::logDeprecation( ... ),
103 'statsFactory' => $this->statsFactory,
105 'readOnlyReason' => $this->readOnlyMode->getReason(),
106 'criticalSectionProvider' => $this->csProvider,
107 'uniqueIdentifier' => $this->uniqueIdentifier,
109 $lbConf[
'chronologyProtector'] = $this->chronologyProtector;
110 $lbConf[
'srvCache'] = $this->srvCache;
111 $lbConf[
'wanCache'] = $this->wanCache;
112 $lbConf[
'tracer'] = $this->tracer;
136 $class = $config[
'class'];
137 return $compat[$class] ?? $class;
141 $domain =
DatabaseDomain::newFromId( $lbFactory->getLocalDomainID() );
144 $rawLocalDomain = strlen( $domain->getTablePrefix() )
145 ?
"{$domain->getDatabase()}-{$domain->getTablePrefix()}"
157 if ( isset( self::$loggedDeprecations[$msg] ) ) {
160 self::$loggedDeprecations[$msg] =
true;
161 MWDebug::sendRawDeprecated( $msg,
true,
wfGetCaller() );
166class_alias( MWLBFactory::class,
'MWLBFactory' );
wfGetCaller( $level=2)
Get the name of the function which called this function wfGetCaller( 1 ) is the function with the wfG...
if(!defined('MW_SETUP_CALLBACK'))
Class to handle database/schema/prefix specifications for IDatabase.