MediaWiki master
LoadBalancer.php
Go to the documentation of this file.
1<?php
6namespace Wikimedia\Rdbms;
7
8use InvalidArgumentException;
9use LogicException;
10use Psr\Log\LoggerInterface;
11use Psr\Log\NullLogger;
12use RuntimeException;
13use Throwable;
14use UnexpectedValueException;
15use Wikimedia\ArrayUtils\ArrayUtils;
16use Wikimedia\ObjectCache\BagOStuff;
17use Wikimedia\ObjectCache\EmptyBagOStuff;
18use Wikimedia\ObjectCache\WANObjectCache;
19use Wikimedia\ScopedCallback;
20use Wikimedia\Stats\StatsFactory;
21use Wikimedia\Timestamp\ConvertibleTimestamp;
22
29 private $loadMonitor;
31 private $srvCache;
33 private $wanCache;
35 private $databaseFactory;
36
38 private $trxProfiler;
40 private $statsFactory;
42 private $logger;
44 private $errorLogger;
46 private $localDomain;
48 private $cliMode;
49
51 private $conns;
52
54 private $clusterName;
56 private $serverInfo;
58 private $loads;
60 private $defaultGroup;
61
63 private $tableAliases = [];
65 private $domainAliases = [];
67 private $trxRecurringCallbacks = [];
69 private $tempTablesOnlyMode = [];
70
72 private $trxRoundFname = null;
74 private $trxRoundStage = self::ROUND_CURSORY;
76 private $readIndexByGroup = [];
78 private $waitForPos;
80 private $laggedReplicaMode = false;
82 private $readOnlyReason = false;
84 private $connectionCounter = 0;
86 private $disabled = false;
87 private ?ChronologyProtector $chronologyProtector = null;
89 private $chronologyProtectorCalled = false;
90
92 private $lastErrorConn;
93
95 private $nonLocalDomainCache = [];
96 private ?string $uniqueIdentifier = null;
97
102 private $modcount = 0;
103
105 private const INFO_SERVER_INDEX = 'serverIndex';
107 private const INFO_CONN_CATEGORY = 'connCategory';
108
110 private const CONN_HELD_WARN_THRESHOLD = 10;
111
113 private const MAX_WAIT_DEFAULT = 10;
115 private const TTL_CACHE_READONLY = 5;
116
118 private const CATEGORY_ROUND = 'round';
120 private const CATEGORY_AUTOCOMMIT = 'auto-commit';
122 private const CATEGORY_GAUGE = 'gauge';
123
125 private const ROUND_CURSORY = 'cursory';
127 private const ROUND_FINALIZED = 'finalized';
129 private const ROUND_APPROVED = 'approved';
131 private const ROUND_COMMIT_CALLBACKS = 'commit-callbacks';
133 private const ROUND_ROLLBACK_CALLBACKS = 'rollback-callbacks';
135 private const ROUND_ERROR = 'error';
136
138 private const READER_INDEX_NONE = -1;
139
140 public function __construct( array $params ) {
141 $this->configure( $params );
142
143 $this->conns = self::newTrackedConnectionsArray();
144 }
145
151 protected function configure( array $params ): void {
152 $this->localDomain = isset( $params['localDomain'] )
153 ? DatabaseDomain::newFromId( $params['localDomain'] )
154 : DatabaseDomain::newUnspecified();
155
156 $this->serverInfo = new ServerInfo();
157 $this->loads = [];
158 foreach ( $this->serverInfo->normalizeServerMaps( $params['servers'] ?? [] ) as $i => $server ) {
159 $this->serverInfo->addServer( $i, $server );
160 $this->loads[$i] = $server['load'];
161 }
162 // If the cluster name is not specified, fallback to the current primary name
163 $this->clusterName = $params['clusterName']
164 ?? $this->serverInfo->getServerName( ServerInfo::WRITER_INDEX );
165
166 if ( isset( $params['readOnlyReason'] ) && is_string( $params['readOnlyReason'] ) ) {
167 $this->readOnlyReason = $params['readOnlyReason'];
168 }
169
170 $this->srvCache = $params['srvCache'] ?? new EmptyBagOStuff();
171 $this->wanCache = $params['wanCache'] ?? WANObjectCache::newEmpty();
172
173 // Note: this parameter is normally absent. It is injectable for testing purposes only.
174 $this->databaseFactory = $params['databaseFactory'] ?? new DatabaseFactory( $params );
175
176 $this->errorLogger = $params['errorLogger'] ?? static function ( Throwable $e ) {
177 trigger_error( get_class( $e ) . ': ' . $e->getMessage(), E_USER_WARNING );
178 };
179 $this->logger = $params['logger'] ?? new NullLogger();
180
181 $this->trxProfiler = $params['trxProfiler'] ?? new TransactionProfiler();
182 $this->statsFactory = $params['statsFactory'] ?? StatsFactory::newNull();
183
184 // Set up LoadMonitor
185 $loadMonitorConfig = $params['loadMonitor'] ?? [ 'class' => LoadMonitorNull::class ];
186 $compat = [
187 'LoadMonitor' => LoadMonitor::class,
188 'LoadMonitorNull' => LoadMonitorNull::class
189 ];
190 $class = $loadMonitorConfig['class'];
191 // @phan-suppress-next-line PhanImpossibleCondition
192 if ( isset( $compat[$class] ) ) {
193 $class = $compat[$class];
194 }
195 $this->loadMonitor = new $class(
196 $this,
197 $this->srvCache,
198 $this->wanCache,
199 $this->logger,
200 $this->statsFactory,
201 $loadMonitorConfig
202 );
203
204 if ( isset( $params['chronologyProtector'] ) ) {
205 $this->chronologyProtector = $params['chronologyProtector'];
206 }
207
208 if ( isset( $params['roundStage'] ) ) {
209 if ( $params['roundStage'] === self::STAGE_POSTCOMMIT_CALLBACKS ) {
210 $this->trxRoundStage = self::ROUND_COMMIT_CALLBACKS;
211 } elseif ( $params['roundStage'] === self::STAGE_POSTROLLBACK_CALLBACKS ) {
212 $this->trxRoundStage = self::ROUND_ROLLBACK_CALLBACKS;
213 }
214 }
215
216 $this->cliMode = $params['cliMode'] ?? ( PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg' );
217
218 $this->defaultGroup = $params['defaultGroup'] ?? self::GROUP_GENERIC;
219 if ( empty( $params['shuffleSharding'] ) ) {
220 $this->uniqueIdentifier = null;
221 } else {
222 $this->uniqueIdentifier = $params['uniqueIdentifier'] ?? null;
223 }
224 }
225
226 private static function newTrackedConnectionsArray(): array {
227 // Note that CATEGORY_GAUGE connections are untracked
228 return [
229 self::CATEGORY_ROUND => [],
230 self::CATEGORY_AUTOCOMMIT => []
231 ];
232 }
233
234 public function getClusterName(): string {
235 return $this->clusterName;
236 }
237
238 public function getLocalDomainID(): string {
239 return $this->localDomain->getId();
240 }
241
243 public function resolveDomainID( DatabaseDomain|string|false $domain ): string {
244 return $this->resolveDomainInstance( $domain )->getId();
245 }
246
247 final protected function resolveDomainInstance( DatabaseDomain|string|false $domain ): DatabaseDomain {
248 if ( $domain instanceof DatabaseDomain ) {
249 return $domain; // already a domain instance
250 } elseif ( $domain === false || $domain === $this->localDomain->getId() ) {
251 return $this->localDomain;
252 } elseif ( isset( $this->domainAliases[$domain] ) ) {
253 $this->domainAliases[$domain] =
254 DatabaseDomain::newFromId( $this->domainAliases[$domain] );
255
256 return $this->domainAliases[$domain];
257 }
258
259 $cachedDomain = $this->nonLocalDomainCache[$domain] ?? null;
260 if ( $cachedDomain === null ) {
261 $cachedDomain = DatabaseDomain::newFromId( $domain );
262 $this->nonLocalDomainCache = [ $domain => $cachedDomain ];
263 }
264
265 return $cachedDomain;
266 }
267
275 protected function sanitizeConnectionFlags( $flags, $domain ) {
276 if ( self::fieldHasBit( $flags, self::CONN_TRX_AUTOCOMMIT ) ) {
277 // Callers use CONN_TRX_AUTOCOMMIT to bypass REPEATABLE-READ staleness without
278 // resorting to row locks (e.g. FOR UPDATE) or to make small out-of-band commits
279 // during larger transactions. This is useful for avoiding lock contention.
280 // Assuming all servers are of the same type (or similar), which is overwhelmingly
281 // the case, use the primary server information to get the attributes. The information
282 // for $i cannot be used since it might be DB_REPLICA, which might require connection
283 // attempts in order to be resolved into a real server index.
284 $attributes = $this->getServerAttributes( ServerInfo::WRITER_INDEX );
285 if ( $attributes[Database::ATTR_DB_LEVEL_LOCKING] ) {
286 // The RDBMS does not support concurrent writes (e.g. SQLite), so attempts
287 // to use separate connections would just cause self-deadlocks. Note that
288 // REPEATABLE-READ staleness is not an issue since DB-level locking means
289 // that transactions are Strict Serializable anyway.
290 $flags &= ~self::CONN_TRX_AUTOCOMMIT;
291 $type = $this->serverInfo->getServerType( ServerInfo::WRITER_INDEX );
292 $this->logger->info( __METHOD__ . ": CONN_TRX_AUTOCOMMIT disallowed ($type)" );
293 } elseif ( isset( $this->tempTablesOnlyMode[$domain] ) ) {
294 // T202116: integration tests are active and queries should be all be using
295 // temporary clone tables (via prefix). Such tables are not visible across
296 // different connections nor can there be REPEATABLE-READ snapshot staleness,
297 // so use the same connection for everything.
298 $flags &= ~self::CONN_TRX_AUTOCOMMIT;
299 }
300 }
301
302 return $flags;
303 }
304
310 private function enforceConnectionFlags( IDatabase $conn, $flags ) {
311 if (
312 self::fieldHasBit( $flags, self::CONN_TRX_AUTOCOMMIT ) ||
313 // Handles with open transactions are avoided since they might be subject
314 // to REPEATABLE-READ snapshots, which could affect the lag estimate query.
315 self::fieldHasBit( $flags, self::CONN_UNTRACKED_GAUGE )
316 ) {
317 if ( $conn->trxLevel() ) {
318 throw new DBUnexpectedError(
319 $conn,
320 'Handle requested with autocommit-mode yet it has a transaction'
321 );
322 }
323
324 $conn->clearFlag( $conn::DBO_TRX ); // auto-commit mode
325 }
326 }
327
335 private function getRandomNonLagged( array $loads, $sessionLagLimit = INF ) {
336 $lags = $this->getLagTimes();
337
338 $dbs = [];
339 foreach ( $loads as $i => $load ) {
340 $srvName = $this->serverInfo->getServerName( $i );
341 $dbs[$srvName] = $i;
342 }
343 // Unset excessively lagged servers from the load group
344 foreach ( $lags as $i => $lag ) {
345 if ( $i !== ServerInfo::WRITER_INDEX ) {
346 // How much lag normally counts as "excessive" for this server
347 $maxServerLag = $this->serverInfo->getServerMaxLag( $i );
348 // How much lag counts as "excessive" for this server given the session
349 $maxServerLag = min( $maxServerLag, $sessionLagLimit );
350
351 $srvName = $this->serverInfo->getServerName( $i );
352 if ( $lag === false && !is_infinite( $maxServerLag ) ) {
353 $this->logger->debug(
354 __METHOD__ . ": server {db_server} is not replicating?",
355 [ 'db_server' => $srvName ]
356 );
357 unset( $loads[$i] );
358 unset( $dbs[$srvName] );
359 } elseif ( $lag > $maxServerLag ) {
360 $this->logger->debug(
361 __METHOD__ .
362 ": server {db_server} has {lag} seconds of lag (>= {maxlag})",
363 [ 'db_server' => $srvName, 'lag' => $lag, 'maxlag' => $maxServerLag ]
364 );
365 unset( $loads[$i] );
366 unset( $dbs[$srvName] );
367 }
368 }
369 }
370
371 if ( array_sum( $loads ) == 0 ) {
372 // All the replicas with non-zero weight are lagged and the primary has zero load.
373 // Inform caller so that it can use switch to read-only mode and use a lagged replica.
374 return false;
375 }
376
377 // Return a server index based on weighted random selection
378 return $this->shuffleSharding( $dbs, $loads );
379 }
380
393 private function shuffleSharding( $dbs, $loads ) {
394 // shuffle sharding doesn't make sense in small groups
395 if ( count( $loads ) <= 3 || $this->uniqueIdentifier === null ) {
396 return ArrayUtils::pickRandom( $loads );
397 }
398
399 ArrayUtils::consistentHashSort( $dbs, $this->uniqueIdentifier );
400 $keys = array_values( $dbs );
401 return ArrayUtils::pickRandom( [
402 $keys[0] => $loads[$keys[0]],
403 $keys[1] => $loads[$keys[1]],
404 $keys[2] => $loads[$keys[2]],
405 ] );
406 }
407
409 public function getReaderIndex( $group = false ) {
410 if ( !$this->serverInfo->hasReplicaServers() ) {
411 // There is only one possible server to use (the primary)
413 }
414
415 if (
416 $group === 'dump' ||
417 $group === 'vslow' ||
418 $group === [ 'dump' ] ||
419 $group === [ 'vslow' ] ||
420 $this->defaultGroup === 'dump' ||
421 $this->defaultGroup === 'vslow'
422 ) {
423 $group = 'vslow';
424 } else {
425 $group = self::GROUP_GENERIC;
426 }
427
428 $index = $this->getExistingReaderIndex( $group );
429 if ( $index !== self::READER_INDEX_NONE ) {
430 // A reader index was already selected for this query group. Keep using it,
431 // since any session replication position was already waited on and any
432 // active transaction will be reused (e.g. for point-in-time snapshots).
433 return $index;
434 }
435
436 // Get the server weight array for this load group
437 if ( $group === 'vslow' ) {
438 // pick the replica with the lowest weight above zero as the vslow
439 $lowestWeight = INF;
440 $loads = $this->loads;
441 foreach ( $this->loads as $index => $weight ) {
442 if ( $weight > 0 && $weight < $lowestWeight ) {
443 $loads = [ $index => $weight ];
444 $lowestWeight = $weight;
445 }
446 }
447 } else {
448 $loads = $this->loads;
449 }
450
451 if ( !$loads ) {
452 $this->logger->info( __METHOD__ . ": no loads for group $group" );
453 return false;
454 }
455
456 // Load any session replication positions, before any connection attempts,
457 // since reading them afterwards can only cause more delay due to possibly
458 // seeing even higher replication positions (e.g. from concurrent requests).
459 $this->loadSessionPrimaryPos();
460
461 // Scale the configured load weights according to each server's load/state.
462 // This can sometimes trigger server connections due to cache regeneration.
463 $this->loadMonitor->scaleLoads( $loads );
464
465 // Pick a server, accounting for load weights, lag, and session consistency
466 $i = $this->pickReaderIndex( $loads );
467 if ( $i === false ) {
468 // Connection attempts failed
469 return false;
470 }
471
472 // If data seen by queries is expected to reflect writes from a prior transaction,
473 // then wait for the chosen server to apply those changes. This is used to improve
474 // session consistency.
475 if ( !$this->awaitSessionPrimaryPos( $i ) ) {
476 // Data will be outdated compared to what was expected
477 $this->setLaggedReplicaMode();
478 }
479
480 // Keep using this server for DB_REPLICA handles for this group
481 if ( $i < 0 ) {
482 throw new UnexpectedValueException( "Cannot set a negative read server index" );
483 }
484 $this->readIndexByGroup[$group] = $i;
485
486 $serverName = $this->getServerName( $i );
487 $this->logger->debug( __METHOD__ . ": using server $serverName for group '$group'" );
488
489 return $i;
490 }
491
498 protected function getExistingReaderIndex( $group ) {
499 return $this->readIndexByGroup[$group] ?? self::READER_INDEX_NONE;
500 }
501
510 private function pickReaderIndex( array $loads ) {
511 if ( $loads === [] ) {
512 throw new InvalidArgumentException( "Load group array is empty" );
513 }
514
515 $i = false;
516 // Quickly look through the available servers for a server that meets criteria...
517 $currentLoads = $loads;
518 while ( count( $currentLoads ) ) {
519 if ( $this->waitForPos && $this->waitForPos->asOfTime() ) {
520 $this->logger->debug( __METHOD__ . ": session has replication position" );
521 // ChronologyProtector::getSessionPrimaryPos called in loadSessionPrimaryPos()
522 // sets "waitForPos" for session consistency. This triggers doWait() after
523 // connect, so it's especially good to avoid lagged servers so as to avoid
524 // excessive delay in that method.
525 $ago = microtime( true ) - $this->waitForPos->asOfTime();
526 // Aim for <= 1 second of waiting (being too picky can backfire)
527 $i = $this->getRandomNonLagged( $currentLoads, $ago + 1 );
528 } else {
529 // Any server with less lag than it's 'max lag' param is preferable
530 $i = $this->getRandomNonLagged( $currentLoads );
531 }
532
533 if ( $i === false && count( $currentLoads ) ) {
534 $this->setLaggedReplicaMode();
535 // All replica DBs lagged, just pick anything.
536 $i = ArrayUtils::pickRandom( $currentLoads );
537 }
538
539 if ( $i === false ) {
540 // pickRandom() returned false.
541 // This is permanent and means the configuration or LoadMonitor
542 // wants us to return false.
543 $this->logger->debug( __METHOD__ . ": no suitable server found" );
544 return false;
545 }
546
547 $serverName = $this->getServerName( $i );
548 $this->logger->debug( __METHOD__ . ": connecting to $serverName..." );
549
550 // Get a connection to this server without triggering complementary connections
551 // to other servers (due to things like lag or read-only checks). We want to avoid
552 // the risk of overhead and recursion here.
553 $conn = $this->getServerConnection( $i, self::DOMAIN_ANY, self::CONN_SILENCE_ERRORS );
554 if ( !$conn ) {
555 $this->logger->warning( __METHOD__ . ": failed connecting to $serverName" );
556 unset( $currentLoads[$i] ); // avoid this server next iteration
557 continue;
558 }
559
560 // Return this server
561 break;
562 }
563
564 // If all servers were down, quit now
565 if ( $currentLoads === [] ) {
566 $this->logger->error( __METHOD__ . ": all servers down" );
567 }
568
569 return $i;
570 }
571
573 public function waitForAll( DBPrimaryPos $pos, $timeout = null ) {
574 $timeout = $timeout ?: self::MAX_WAIT_DEFAULT;
575
576 $oldPos = $this->waitForPos;
577 try {
578 $this->waitForPos = $pos;
579
580 $failedReplicas = [];
581 foreach ( $this->serverInfo->getStreamingReplicaIndexes() as $i ) {
582 if ( isset( $this->loads[$i] ) && $this->loads[$i] > 0 ) {
583 $start = ConvertibleTimestamp::hrtime();
584 $ok = $this->awaitSessionPrimaryPos( $i, $timeout );
585 if ( !$ok ) {
586 $failedReplicas[] = $this->getServerName( $i );
587 }
588 $timeout -= intval( ( ConvertibleTimestamp::hrtime() - $start ) / 1e9 );
589 }
590 }
591
592 // Stop spamming logs when only one replica is lagging and we have 5+ replicas.
593 // Mediawiki automatically stops sending queries to the lagged one.
594 $failed = $failedReplicas && ( count( $failedReplicas ) > 1 || $this->getServerCount() < 5 );
595 if ( $failed ) {
596 $this->logger->error(
597 "Timed out waiting for replication to reach {raw_pos}",
598 [
599 'raw_pos' => $pos->__toString(),
600 'failed_hosts' => $failedReplicas,
601 'timeout' => $timeout,
602 'exception' => new RuntimeException()
603 ]
604 );
605 }
606
607 return !$failed;
608 } finally {
609 // Restore the old position; this is used for throttling, not lag-protection
610 $this->waitForPos = $oldPos;
611 }
612 }
613
619 public function getAnyOpenConnection( $i, $flags = 0 ) {
620 $i = ( $i === self::DB_PRIMARY ) ? ServerInfo::WRITER_INDEX : $i;
621 $conn = false;
622 foreach ( $this->conns as $type => $poolConnsByServer ) {
623 if ( $i === self::DB_REPLICA ) {
624 // Consider all existing connections to any server
625 $applicableConnsByServer = $poolConnsByServer;
626 } else {
627 // Consider all existing connections to a specific server
628 $applicableConnsByServer = isset( $poolConnsByServer[$i] )
629 ? [ $i => $poolConnsByServer[$i] ]
630 : [];
631 }
632
633 $conn = $this->pickAnyOpenConnection( $applicableConnsByServer );
634 if ( $conn ) {
635 $this->logger->debug( __METHOD__ . ": found '$type' connection to #$i." );
636 break;
637 }
638 }
639
640 if ( $conn ) {
641 $this->enforceConnectionFlags( $conn, $flags );
642 }
643
644 return $conn;
645 }
646
651 private function pickAnyOpenConnection( array $connsByServer ) {
652 foreach ( $connsByServer as $i => $conns ) {
653 foreach ( $conns as $conn ) {
654 if ( !$conn->isOpen() ) {
655 $this->logger->warning(
656 __METHOD__ .
657 ": pooled DB handle for {db_server} (#$i) has no open connection.",
658 $this->getConnLogContext( $conn )
659 );
660 continue; // some sort of error occurred?
661 }
662 return $conn;
663 }
664 }
665
666 return false;
667 }
668
678 private function awaitSessionPrimaryPos( $index, $timeout = null ) {
679 $timeout = max( 1, intval( $timeout ?: self::MAX_WAIT_DEFAULT ) );
680
681 if ( !$this->waitForPos || $index === ServerInfo::WRITER_INDEX ) {
682 return true;
683 }
684
685 $srvName = $this->getServerName( $index );
686
687 // Check if we already know that the DB has reached this point
688 $key = $this->srvCache->makeGlobalKey( __CLASS__, 'last-known-pos', $srvName, 'v2' );
689
691 $position = $this->srvCache->get( $key );
692 if ( !is_array( $position ) ) {
693 $knownReachedPos = null;
694 } else {
695 $class = $position['_type_'];
696 $knownReachedPos = $class::newFromArray( $position );
697 }
698 if (
699 $knownReachedPos instanceof DBPrimaryPos &&
700 $knownReachedPos->hasReached( $this->waitForPos )
701 ) {
702 $this->logger->debug(
703 __METHOD__ .
704 ": replica DB {db_server} known to be caught up (pos >= $knownReachedPos).",
705 [ 'db_server' => $srvName ]
706 );
707
708 return true;
709 }
710
711 $close = false; // close the connection afterwards
712 $flags = self::CONN_SILENCE_ERRORS;
713 // Check if there is an existing connection that can be used
714 $conn = $this->getAnyOpenConnection( $index, $flags );
715 if ( !$conn ) {
716 // Get a connection to this server without triggering complementary connections
717 // to other servers (due to things like lag or read-only checks). We want to avoid
718 // the risk of overhead and recursion here.
719 $conn = $this->getServerConnection( $index, self::DOMAIN_ANY, $flags );
720 if ( !$conn ) {
721 $this->logger->warning(
722 __METHOD__ . ': failed to connect to {db_server}',
723 [ 'db_server' => $srvName ]
724 );
725
726 return false;
727 }
728 // Avoid connection spam in waitForAll() when connections
729 // are made just for the sake of doing this lag check.
730 $close = true;
731 }
732
733 $this->logger->info(
734 __METHOD__ .
735 ': waiting for replica DB {db_server} to catch up...',
736 $this->getConnLogContext( $conn )
737 );
738
739 $result = $conn->primaryPosWait( $this->waitForPos, $timeout );
740
741 $ok = ( $result !== null && $result != -1 );
742 if ( $ok ) {
743 // Remember that the DB reached this point
744 $this->srvCache->set( $key, $this->waitForPos->toArray(), BagOStuff::TTL_DAY );
745 }
746
747 if ( $close ) {
748 $this->closeConnection( $conn );
749 }
750
751 return $ok;
752 }
753
755 public function getConnection( $i, $groups = [], string|false $domain = false, $flags = 0 ) {
756 if ( self::fieldHasBit( $flags, self::CONN_SILENCE_ERRORS ) ) {
757 throw new UnexpectedValueException(
758 __METHOD__ . ' got CONN_SILENCE_ERRORS; connection is already deferred'
759 );
760 }
761
762 $domain = $this->resolveDomainID( $domain );
763 $role = ( $i === self::DB_PRIMARY || $i === ServerInfo::WRITER_INDEX )
764 ? self::DB_PRIMARY
765 : self::DB_REPLICA;
766
767 return new DBConnRef( $this, [ $i, $groups, $domain, $flags ], $role, $this->modcount );
768 }
769
771 public function getConnectionInternal( $i, $groups = [], $domain = false, $flags = 0 ): IDatabase {
772 $domain = $this->resolveDomainID( $domain );
773 $flags = $this->sanitizeConnectionFlags( $flags, $domain );
774 // If given DB_PRIMARY/DB_REPLICA, resolve it to a specific server index. Resolving
775 // DB_REPLICA might trigger getServerConnection() calls due to the getReaderIndex()
776 // connectivity checks or LoadMonitor::scaleLoads() server state cache regeneration.
777 // The use of getServerConnection() instead of getConnection() avoids infinite loops.
778 $serverIndex = $i;
779 if ( $i === self::DB_PRIMARY ) {
780 $serverIndex = ServerInfo::WRITER_INDEX;
781 } elseif ( $i === self::DB_REPLICA ) {
782 $groupIndex = $this->getReaderIndex( $groups );
783 if ( $groupIndex !== false ) {
784 // Group connection succeeded
785 $serverIndex = $groupIndex;
786 }
787 if ( $serverIndex < 0 ) {
788 $this->reportConnectionError( 'could not connect to any replica DB server' );
789 }
790 } elseif ( !$this->serverInfo->hasServerIndex( $i ) ) {
791 throw new UnexpectedValueException( "Invalid server index index #$i" );
792 }
793 // Get an open connection to that server (might trigger a new connection)
794 return $this->getServerConnection( $serverIndex, $domain, $flags );
795 }
796
798 public function getServerConnection( $i, $domain, $flags = 0 ) {
799 $domainInstance = DatabaseDomain::newFromId( $domain );
800 // Number of connections made before getting the server index and handle
801 $priorConnectionsMade = $this->connectionCounter;
802 // Get an open connection to this server (might trigger a new connection)
803 $conn = $this->reuseOrOpenConnectionForNewRef( $i, $domainInstance, $flags );
804 // Throw an error or otherwise bail out if the connection attempt failed
805 if ( !( $conn instanceof IDatabaseForOwner ) ) {
806 if ( !self::fieldHasBit( $flags, self::CONN_SILENCE_ERRORS ) ) {
807 $this->reportConnectionError();
808 }
809
810 return false;
811 }
812
813 // Profile any new connections caused by this method
814 if ( $this->connectionCounter > $priorConnectionsMade ) {
815 $this->trxProfiler->recordConnection(
816 $conn->getServerName(),
817 $conn->getDBname(),
818 ( $i === ServerInfo::WRITER_INDEX && $this->hasStreamingReplicaServers() )
819 );
820 }
821
822 if ( !$conn->isOpen() ) {
823 $this->lastErrorConn = $conn;
824 // Connection was made but later unrecoverably lost for some reason.
825 // Do not return a handle that will just throw exceptions on use, but
826 // let the calling code, e.g. getReaderIndex(), try another server.
827 if ( !self::fieldHasBit( $flags, self::CONN_SILENCE_ERRORS ) ) {
828 $this->reportConnectionError();
829 }
830 return false;
831 }
832
833 return $conn;
834 }
835
838 $i,
839 $groups = [],
840 $domain = false,
841 $flags = 0
842 ): DBConnRef {
843 if ( self::fieldHasBit( $flags, self::CONN_SILENCE_ERRORS ) ) {
844 throw new UnexpectedValueException(
845 __METHOD__ . ' CONN_SILENCE_ERRORS is not supported'
846 );
847 }
848
849 $domain = $this->resolveDomainID( $domain );
850 $role = ( $i === self::DB_PRIMARY || $i === ServerInfo::WRITER_INDEX )
851 ? self::DB_PRIMARY
852 : self::DB_REPLICA;
853
854 return new DBConnRef( $this, [ $i, $groups, $domain, $flags ], $role, $this->modcount );
855 }
856
873 private function reuseOrOpenConnectionForNewRef( $i, DatabaseDomain $domain, $flags = 0 ) {
874 // Figure out which connection pool to use based on the flags
875 if ( $this->fieldHasBit( $flags, self::CONN_UNTRACKED_GAUGE ) ) {
876 // Use low timeouts, use autocommit mode, ignore transaction rounds
877 $category = self::CATEGORY_GAUGE;
878 } elseif ( self::fieldHasBit( $flags, self::CONN_TRX_AUTOCOMMIT ) ) {
879 // Use autocommit mode, ignore transaction rounds
880 $category = self::CATEGORY_AUTOCOMMIT;
881 } else {
882 // Respect DBO_DEFAULT, respect transaction rounds
883 $category = self::CATEGORY_ROUND;
884 }
885
886 $conn = null;
887 // Reuse a free connection in the pool from any domain if possible. There should only
888 // be one connection in this pool unless either:
889 // - a) IDatabase::databasesAreIndependent() returns true (e.g. postgres) and two
890 // or more database domains have been used during the load balancer's lifetime
891 // - b) Two or more nested function calls used getConnection() on different domains.
892 foreach ( ( $this->conns[$category][$i] ?? [] ) as $poolConn ) {
893 // Check if any required DB domain changes for the new reference are possible
894 // Calling selectDomain() would trigger a reconnect, which will break if a
895 // transaction is active or if there is any other meaningful session state.
896 $isShareable = !(
897 $poolConn->databasesAreIndependent() &&
898 $domain->getDatabase() !== null &&
899 $domain->getDatabase() !== $poolConn->getDBname()
900 );
901 if ( $isShareable ) {
902 $conn = $poolConn;
903 // Make any required DB domain changes for the new reference
904 if ( !$domain->isUnspecified() ) {
905 $conn->selectDomain( $domain );
906 }
907 $this->logger->debug( __METHOD__ . ": reusing connection for $i/$domain" );
908 break;
909 }
910 }
911
912 // If necessary, try to open a new connection and add it to the pool
913 if ( !$conn ) {
914 $conn = $this->reallyOpenConnection(
915 $i,
916 $domain,
917 [ self::INFO_CONN_CATEGORY => $category ]
918 );
919 if ( $conn->isOpen() ) {
920 // Make Database::isReadOnly() respect server-side and configuration-based
921 // read-only mode. Note that replica handles are always seen as read-only
922 // in Database::isReadOnly() and Database::assertIsWritablePrimary().
923 if ( $i === ServerInfo::WRITER_INDEX ) {
924 if ( $this->readOnlyReason !== false ) {
925 $readOnlyReason = $this->readOnlyReason;
926 } elseif ( $this->isPrimaryRunningReadOnly( $conn ) ) {
927 $readOnlyReason = 'The primary database server is running in read-only mode.';
928 } else {
929 $readOnlyReason = false;
930 }
931 $conn->setLBInfo( $conn::LB_READ_ONLY_REASON, $readOnlyReason );
932 }
933 // Connection obtained; check if it belongs to a tracked connection category
934 if ( isset( $this->conns[$category] ) ) {
935 // Track this connection for future reuse
936 $this->conns[$category][$i][] = $conn;
937 }
938 } else {
939 $this->logger->warning( __METHOD__ . ": connection error for $i/$domain" );
940 $this->lastErrorConn = $conn;
941 $conn = null;
942 }
943 }
944
945 if ( $conn instanceof IDatabaseForOwner ) {
946 // Check to make sure that the right domain is selected
947 $this->assertConnectionDomain( $conn, $domain );
948 // Check to make sure that the CONN_* flags are respected
949 $this->enforceConnectionFlags( $conn, $flags );
950 }
951
952 return $conn;
953 }
954
962 private function assertConnectionDomain( Database $conn, DatabaseDomain $domain ) {
963 if ( !$domain->isCompatible( $conn->getDomainID() ) ) {
964 throw new UnexpectedValueException(
965 "Got connection to '{$conn->getDomainID()}', but expected one for '{$domain}'"
966 );
967 }
968 }
969
971 public function getServerAttributes( $i ) {
972 return $this->databaseFactory->attributesFromType(
973 $this->getServerType( $i ),
974 $this->serverInfo->getServerDriver( $i )
975 );
976 }
977
990 protected function reallyOpenConnection( $i, DatabaseDomain $domain, array $lbInfo ) {
991 if ( $this->disabled ) {
992 throw new DBAccessError();
993 }
994
995 $server = $this->serverInfo->getServerInfoStrict( $i );
996 if ( $lbInfo[self::INFO_CONN_CATEGORY] === self::CATEGORY_GAUGE ) {
997 // Use low connection/read timeouts for connection used for gauging server health.
998 // Gauge information should be cached and used to avoid outages. Indefinite hanging
999 // while gauging servers would do the opposite.
1000 $server['connectTimeout'] = min( 1, $server['connectTimeout'] ?? INF );
1001 $server['receiveTimeout'] = min( 1, $server['receiveTimeout'] ?? INF );
1002 // Avoid implicit transactions and avoid any SET query for session variables during
1003 // Database::open(). If a server becomes slow, every extra query can cause significant
1004 // delays, even with low connect/receive timeouts.
1005 $server['flags'] ??= 0;
1006 $server['flags'] &= ~IDatabase::DBO_DEFAULT;
1007 $server['flags'] |= IDatabase::DBO_GAUGE;
1008 } else {
1009 // Use implicit transactions unless explicitly configured otherwise
1010 $server['flags'] ??= IDatabase::DBO_DEFAULT;
1011 }
1012
1013 if ( !empty( $server['is static'] ) ) {
1014 $topologyRole = IDatabase::ROLE_STATIC_CLONE;
1015 } else {
1016 $topologyRole = ( $i === ServerInfo::WRITER_INDEX )
1019 }
1020
1021 $conn = $this->databaseFactory->create(
1022 $server['type'],
1023 array_merge( $server, [
1024 // Basic replication role information
1025 'topologyRole' => $topologyRole,
1026 // Use the database specified in $domain (null means "none or entrypoint DB");
1027 // fallback to the $server default if the RDBMs is an embedded library using a
1028 // file on disk since there would be nothing to access to without a DB/file name.
1029 'dbname' => $this->getServerAttributes( $i )[Database::ATTR_DB_IS_FILE]
1030 ? ( $domain->getDatabase() ?? $server['dbname'] ?? null )
1031 : $domain->getDatabase(),
1032 // Override the $server default schema with that of $domain if specified
1033 'schema' => $domain->getSchema(),
1034 // Use the table prefix specified in $domain
1035 'tablePrefix' => $domain->getTablePrefix(),
1036 'srvCache' => $this->srvCache,
1037 'logger' => $this->logger,
1038 'errorLogger' => $this->errorLogger,
1039 'trxProfiler' => $this->trxProfiler,
1040 'lbInfo' => [ self::INFO_SERVER_INDEX => $i ] + $lbInfo
1041 ] ),
1042 Database::NEW_UNCONNECTED
1043 );
1044 // Set alternative table names before any queries can be issued
1045 $conn->setTableAliases( $this->tableAliases );
1046 // Account for any active transaction round and listeners
1047 $this->syncConnectionRoundState( $conn );
1048 if ( $i === ServerInfo::WRITER_INDEX ) {
1049 foreach ( $this->trxRecurringCallbacks as $name => $callback ) {
1050 $conn->setTransactionListener( $name, $callback );
1051 }
1052 }
1053
1054 // Make the connection handle live
1055 try {
1056 $conn->initConnection();
1057 ++$this->connectionCounter;
1058 } catch ( DBConnectionError ) {
1059 $this->lastErrorConn = $conn;
1060 // ignore; let the DB handle the logging
1061 }
1062
1063 if ( $conn->isOpen() ) {
1064 $this->logger->debug( __METHOD__ . ": opened new connection for $i/$domain" );
1065 } else {
1066 $this->logger->warning(
1067 __METHOD__ . ": connection error for $i/{db_domain}",
1068 [ 'db_domain' => $domain->getId() ]
1069 );
1070 }
1071
1072 // Log when many connection are made during a single request/script
1073 $count = 0;
1074 foreach ( $this->conns as $poolConnsByServer ) {
1075 foreach ( $poolConnsByServer as $serverConns ) {
1076 $count += count( $serverConns );
1077 }
1078 }
1079 if ( $count >= self::CONN_HELD_WARN_THRESHOLD ) {
1080 $this->logger->warning(
1081 __METHOD__ . ": {connections}+ connections made (primary={primarydb})",
1082 $this->getConnLogContext(
1083 $conn,
1084 [
1085 'connections' => $count,
1086 'primarydb' => $this->serverInfo->getPrimaryServerName(),
1087 'db_domain' => $domain->getId()
1088 ]
1089 )
1090 );
1091 }
1092
1093 $this->assertConnectionDomain( $conn, $domain );
1094
1095 return $conn;
1096 }
1097
1107 private function loadSessionPrimaryPos() {
1108 if ( !$this->chronologyProtectorCalled && $this->chronologyProtector ) {
1109 $this->chronologyProtectorCalled = true;
1110 $pos = $this->chronologyProtector->getSessionPrimaryPos( $this );
1111 $this->logger->debug( __METHOD__ . ': executed chronology callback.' );
1112 if ( $pos ) {
1113 if ( !$this->waitForPos || $pos->hasReached( $this->waitForPos ) ) {
1114 $this->waitForPos = $pos;
1115 }
1116 }
1117 }
1118 }
1119
1125 private function reportConnectionError( $extraLbError = '' ): never {
1126 if ( $this->lastErrorConn instanceof IDatabaseForOwner ) {
1127 $srvName = $this->lastErrorConn->getServerName();
1128 $lastDbError = $this->lastErrorConn->lastError() ?: 'unknown error';
1129
1130 $exception = new DBConnectionError(
1131 $this->lastErrorConn,
1132 $extraLbError
1133 ? "{$extraLbError}; {$lastDbError} ({$srvName})"
1134 : "{$lastDbError} ({$srvName})"
1135 );
1136
1137 if ( $extraLbError ) {
1138 $this->logger->warning(
1139 __METHOD__ . ": $extraLbError; {last_error} ({db_server})",
1140 $this->getConnLogContext(
1141 $this->lastErrorConn,
1142 [
1143 'method' => __METHOD__,
1144 'last_error' => $lastDbError
1145 ]
1146 )
1147 );
1148 }
1149 } else {
1150 $exception = new DBConnectionError(
1151 null,
1152 $extraLbError ?: 'could not connect to the DB server'
1153 );
1154
1155 if ( $extraLbError ) {
1156 $this->logger->error(
1157 __METHOD__ . ": $extraLbError",
1158 [
1159 'method' => __METHOD__,
1160 'last_error' => '(last connection error missing)'
1161 ]
1162 );
1163 }
1164 }
1165
1166 throw $exception;
1167 }
1168
1170 public function getServerCount() {
1171 return $this->serverInfo->getServerCount();
1172 }
1173
1175 public function hasReplicaServers() {
1176 return $this->serverInfo->hasReplicaServers();
1177 }
1178
1180 public function hasStreamingReplicaServers() {
1181 return $this->serverInfo->hasStreamingReplicaServers();
1182 }
1183
1185 public function getServerName( $i ): string {
1186 return $this->serverInfo->getServerName( $i );
1187 }
1188
1190 public function getServerInfo( $i ) {
1191 return $this->serverInfo->getServerInfo( $i );
1192 }
1193
1195 public function getServerType( $i ) {
1196 return $this->serverInfo->getServerType( $i );
1197 }
1198
1200 public function getPrimaryPos() {
1202 if ( $conn ) {
1203 return $conn->getPrimaryPos();
1204 }
1205
1207 $conn = $this->getConnectionInternal( ServerInfo::WRITER_INDEX, [], false, self::CONN_SILENCE_ERRORS );
1208 // @phan-suppress-next-line PhanRedundantCondition
1209 if ( !$conn ) {
1210 $this->reportConnectionError();
1211 }
1212
1213 // ::getConnectionInternal() should return IDatabaseForOwner but changing signature
1214 // is not straightforward (being implemented in Wikibase)
1215 '@phan-var IDatabaseForOwner $conn';
1216 try {
1217 return $conn->getPrimaryPos();
1218 } finally {
1219 $this->closeConnection( $conn );
1220 }
1221 }
1222
1243 public function reconfigure( array $params ) {
1244 $anyServerDepooled = false;
1245
1246 $paramServers = $params['servers'];
1247 $newIndexByServerIndex = $this->serverInfo->reconfigureServers( $paramServers );
1248 foreach ( $newIndexByServerIndex as $i => $ni ) {
1249 if ( $ni === null ) {
1250 // Server no longer exists in the new config
1251 $anyServerDepooled = true;
1252 // Note that if the primary server is depooled and a replica server promoted
1253 // to new primary, then DB_PRIMARY handles will fail with server index errors
1254 unset( $this->loads[$i] );
1255 }
1256 }
1257
1258 if ( $anyServerDepooled ) {
1259 // NOTE: We could close all connection here, but some may be in the middle of
1260 // a transaction. So instead, we leave it to DBConnRef to close the
1261 // connection when it detects that the modcount has changed and no
1262 // transaction is open.
1263 $this->logger->info( 'Reconfiguring dbs!' );
1264 // Unpin DB_REPLICA connection groups from server indexes
1265 $this->readIndexByGroup = [];
1266 // We could close all connection here, but some may be in the middle of a
1267 // transaction. So instead, we leave it to DBConnRef to close the connection
1268 // when it detects that the modcount has changed and no transaction is open.
1269 $this->conns = self::newTrackedConnectionsArray();
1270 // Bump modification counter to invalidate the connections held by DBConnRef
1271 // instances. This will cause the next call to a method on the DBConnRef
1272 // to get a new connection from getConnectionInternal()
1273 $this->modcount++;
1274 }
1275 }
1276
1278 public function disable( $fname = __METHOD__ ) {
1279 $this->closeAll( $fname );
1280 $this->disabled = true;
1281 }
1282
1284 public function closeAll( $fname = __METHOD__ ) {
1286 $scope = ScopedCallback::newScopedIgnoreUserAbort();
1287 foreach ( $this->getOpenConnections() as $conn ) {
1288 $conn->close( $fname );
1289 }
1290
1291 $this->conns = self::newTrackedConnectionsArray();
1292 }
1293
1300 private function closeConnection( IDatabaseForOwner $conn ) {
1301 if ( $conn instanceof DBConnRef ) {
1302 // Avoid calling close() but still leaving the handle in the pool
1303 throw new RuntimeException( 'Cannot close DBConnRef instance; it must be shareable' );
1304 }
1305
1306 $domain = $conn->getDomainID();
1307 $serverIndex = $conn->getLBInfo( self::INFO_SERVER_INDEX );
1308 if ( $serverIndex === null ) {
1309 throw new UnexpectedValueException( "Handle on '$domain' missing server index" );
1310 }
1311
1312 $srvName = $this->serverInfo->getServerName( $serverIndex );
1313
1314 $found = false;
1315 foreach ( $this->conns as $type => $poolConnsByServer ) {
1316 $key = array_search( $conn, $poolConnsByServer[$serverIndex] ?? [], true );
1317 if ( $key !== false ) {
1318 $found = true;
1319 unset( $this->conns[$type][$serverIndex][$key] );
1320 }
1321 }
1322
1323 if ( !$found ) {
1324 $this->logger->warning(
1325 __METHOD__ .
1326 ": orphaned connection to database {$this->stringifyConn( $conn )} at '$srvName'."
1327 );
1328 }
1329
1330 $this->logger->debug(
1331 __METHOD__ .
1332 ": closing connection to database {$this->stringifyConn( $conn )} at '$srvName'."
1333 );
1334
1335 $conn->close( __METHOD__ );
1336 }
1337
1339 public function finalizePrimaryChanges( $fname = __METHOD__ ) {
1340 $this->assertTransactionRoundStage( [ self::ROUND_CURSORY, self::ROUND_FINALIZED ] );
1342 $scope = ScopedCallback::newScopedIgnoreUserAbort();
1343
1344 $this->trxRoundStage = self::ROUND_ERROR; // "failed" until proven otherwise
1345 // Loop until callbacks stop adding callbacks on other connections
1346 $total = 0;
1347 do {
1348 $count = 0; // callbacks execution attempts
1349 foreach ( $this->getOpenPrimaryConnections() as $conn ) {
1350 // Run any pre-commit callbacks while leaving the post-commit ones suppressed.
1351 // Any error should cause all (peer) transactions to be rolled back together.
1352 $count += $conn->runOnTransactionPreCommitCallbacks();
1353 }
1354 $total += $count;
1355 } while ( $count > 0 );
1356 // Defer post-commit callbacks until after COMMIT/ROLLBACK happens on all handles
1357 foreach ( $this->getOpenPrimaryConnections() as $conn ) {
1358 $conn->setTrxEndCallbackSuppression( true );
1359 }
1360 $this->trxRoundStage = self::ROUND_FINALIZED;
1361
1362 return $total;
1363 }
1364
1366 public function approvePrimaryChanges( int $maxWriteDuration, $fname = __METHOD__ ) {
1367 $this->assertTransactionRoundStage( self::ROUND_FINALIZED );
1369 $scope = ScopedCallback::newScopedIgnoreUserAbort();
1370
1371 $this->trxRoundStage = self::ROUND_ERROR; // "failed" until proven otherwise
1372 foreach ( $this->getOpenPrimaryConnections() as $conn ) {
1373 // Any atomic sections should have been closed by now and there definitely should
1374 // not be any open transactions started by begin() from callers outside Database.
1375 if ( $conn->explicitTrxActive() ) {
1376 throw new DBTransactionError(
1377 $conn,
1378 "Explicit transaction still active; a caller might have failed to call " .
1379 "endAtomic() or cancelAtomic()."
1380 );
1381 }
1382 // Assert that the time to replicate the transaction will be reasonable.
1383 // If this fails, then all DB transactions will be rollback back together.
1384 $time = $conn->pendingWriteQueryDuration( $conn::ESTIMATE_DB_APPLY );
1385 if ( $maxWriteDuration > 0 ) {
1386 if ( $time > $maxWriteDuration ) {
1387 $humanTimeSec = round( $time, 3 );
1388 throw new DBTransactionSizeError(
1389 $conn,
1390 "Transaction spent {time}s in writes, exceeding the {$maxWriteDuration}s limit",
1391 // Message parameters for: transaction-duration-limit-exceeded
1392 [ $time, $maxWriteDuration ],
1393 null,
1394 [ 'time' => $humanTimeSec ]
1395 );
1396 } elseif ( $time > 0 ) {
1397 $timeMs = $time * 1000;
1398 $humanTimeMs = round( $timeMs, $timeMs > 1 ? 0 : 3 );
1399 $this->logger->debug(
1400 "Transaction spent {time_ms}ms in writes, under the {$maxWriteDuration}s limit",
1401 [ 'time_ms' => $humanTimeMs ]
1402 );
1403 }
1404 }
1405 // If a connection sits idle for too long it might be dropped, causing transaction
1406 // writes and session locks to be lost. Ping all the server connections before making
1407 // any attempt to commit the transactions belonging to the active transaction round.
1408 if ( $conn->writesOrCallbacksPending() || $conn->sessionLocksPending() ) {
1409 if ( !$conn->ping() ) {
1410 throw new DBTransactionError(
1411 $conn,
1412 "Pre-commit ping failed on server {$conn->getServerName()}"
1413 );
1414 }
1415 }
1416 }
1417 $this->trxRoundStage = self::ROUND_APPROVED;
1418 }
1419
1421 public function beginPrimaryChanges( $fname = __METHOD__ ) {
1422 if ( $this->trxRoundFname !== null ) {
1423 throw new DBTransactionError(
1424 null,
1425 "Transaction round '{$this->trxRoundFname}' already started"
1426 );
1427 }
1428 $this->assertTransactionRoundStage( self::ROUND_CURSORY );
1430 $scope = ScopedCallback::newScopedIgnoreUserAbort();
1431
1432 // Clear any empty transactions (no writes/callbacks) from the implicit round
1433 $this->flushPrimarySnapshots( $fname );
1434
1435 $this->trxRoundFname = $fname;
1436 $this->trxRoundStage = self::ROUND_ERROR; // "failed" until proven otherwise
1437 // Mark applicable handles as participating in this explicit transaction round.
1438 // For each of these handles, any writes and callbacks will be tied to a single
1439 // transaction. The (peer) handles will reject begin()/commit() calls unless they
1440 // are part of an en masse commit or an en masse rollback.
1441 foreach ( $this->getOpenConnections() as $conn ) {
1442 $this->syncConnectionRoundState( $conn );
1443 }
1444 $this->trxRoundStage = self::ROUND_CURSORY;
1445 }
1446
1448 public function commitPrimaryChanges( $fname = __METHOD__ ) {
1449 $this->assertTransactionRoundStage( self::ROUND_APPROVED );
1451 $scope = ScopedCallback::newScopedIgnoreUserAbort();
1452
1453 $failures = [];
1454
1455 $this->trxRoundFname = null;
1456 $this->trxRoundStage = self::ROUND_ERROR; // "failed" until proven otherwise
1457 // Commit any writes and clear any snapshots as well (callbacks require AUTOCOMMIT).
1458 // Note that callbacks should already be suppressed due to finalizePrimaryChanges().
1459 foreach ( $this->getOpenPrimaryConnections() as $conn ) {
1460 try {
1461 $conn->commit( $fname, $conn::FLUSHING_ALL_PEERS );
1462 } catch ( DBError $e ) {
1463 ( $this->errorLogger )( $e );
1464 $failures[] = "{$conn->getServerName()}: {$e->getMessage()}";
1465 }
1466 }
1467 if ( $failures ) {
1468 throw new DBTransactionError(
1469 null,
1470 "Commit failed on server(s) " . implode( "\n", array_unique( $failures ) )
1471 );
1472 }
1473 // Unmark handles as participating in this explicit transaction round
1474 foreach ( $this->getOpenConnections() as $conn ) {
1475 $this->syncConnectionRoundState( $conn );
1476 }
1477 $this->trxRoundStage = self::ROUND_COMMIT_CALLBACKS;
1478 }
1479
1481 public function runPrimaryTransactionIdleCallbacks( $fname = __METHOD__ ) {
1482 if ( $this->trxRoundStage === self::ROUND_COMMIT_CALLBACKS ) {
1484 } elseif ( $this->trxRoundStage === self::ROUND_ROLLBACK_CALLBACKS ) {
1486 } else {
1487 throw new DBTransactionError(
1488 null,
1489 "Transaction should be in the callback stage (not '{$this->trxRoundStage}')"
1490 );
1491 }
1493 $scope = ScopedCallback::newScopedIgnoreUserAbort();
1494
1495 $oldStage = $this->trxRoundStage;
1496 $this->trxRoundStage = self::ROUND_ERROR; // "failed" until proven otherwise
1497
1498 // Now that the COMMIT/ROLLBACK step is over, enable post-commit callback runs
1499 foreach ( $this->getOpenPrimaryConnections() as $conn ) {
1500 $conn->setTrxEndCallbackSuppression( false );
1501 }
1502
1503 $errors = [];
1504 $fname = __METHOD__;
1505 // Loop until callbacks stop adding callbacks on other connections
1506 do {
1507 // Run any pending callbacks for each connection...
1508 $count = 0; // callback execution attempts
1509 foreach ( $this->getOpenPrimaryConnections() as $conn ) {
1510 if ( $conn->trxLevel() ) {
1511 continue; // retry in the next iteration, after commit() is called
1512 }
1513 $count += $conn->runOnTransactionIdleCallbacks( $type, $errors );
1514 }
1515 // Clear out any active transactions left over from callbacks...
1516 foreach ( $this->getOpenPrimaryConnections() as $conn ) {
1517 if ( $conn->writesPending() ) {
1518 // A callback from another handle wrote to this one and DBO_TRX is set
1519 $fnames = implode( ', ', $conn->pendingWriteCallers() );
1520 $this->logger->info(
1521 "$fname: found writes pending ($fnames).",
1522 $this->getConnLogContext(
1523 $conn,
1524 [ 'exception' => new RuntimeException() ]
1525 )
1526 );
1527 $this->statsFactory->getCounter( 'rdbms_callback_writes_found_total' )
1528 ->setLabel( 'db_cluster', $this->getClusterName() )
1529 ->setLabel( 'db_server', $conn->getServerName() )
1530 ->increment();
1531 } elseif ( $conn->trxLevel() ) {
1532 // A callback from another handle read from this one and DBO_TRX is set,
1533 // which can easily happen if there is only one DB (no replicas)
1534 $this->logger->debug( "$fname: found empty transaction." );
1535 }
1536 try {
1537 $conn->commit( $fname, $conn::FLUSHING_ALL_PEERS );
1538 } catch ( DBError $ex ) {
1539 $errors[] = $ex;
1540 }
1541 }
1542 } while ( $count > 0 );
1543
1544 $this->trxRoundStage = $oldStage;
1545
1546 return $errors[0] ?? null;
1547 }
1548
1550 public function runPrimaryTransactionListenerCallbacks( $fname = __METHOD__ ) {
1551 if ( $this->trxRoundStage === self::ROUND_COMMIT_CALLBACKS ) {
1553 } elseif ( $this->trxRoundStage === self::ROUND_ROLLBACK_CALLBACKS ) {
1555 } else {
1556 throw new DBTransactionError(
1557 null,
1558 "Transaction should be in the callback stage (not '{$this->trxRoundStage}')"
1559 );
1560 }
1562 $scope = ScopedCallback::newScopedIgnoreUserAbort();
1563
1564 $errors = [];
1565 $this->trxRoundStage = self::ROUND_ERROR; // "failed" until proven otherwise
1566 foreach ( $this->getOpenPrimaryConnections() as $conn ) {
1567 $conn->runTransactionListenerCallbacks( $type, $errors );
1568 }
1569 $this->trxRoundStage = self::ROUND_CURSORY;
1570
1571 return $errors[0] ?? null;
1572 }
1573
1575 public function rollbackPrimaryChanges( $fname = __METHOD__ ) {
1577 $scope = ScopedCallback::newScopedIgnoreUserAbort();
1578
1579 $this->trxRoundFname = null;
1580 $this->trxRoundStage = self::ROUND_ERROR; // "failed" until proven otherwise
1581 foreach ( $this->getOpenPrimaryConnections() as $conn ) {
1582 $conn->rollback( $fname, $conn::FLUSHING_ALL_PEERS );
1583 }
1584 // Unmark handles as participating in this explicit transaction round
1585 foreach ( $this->getOpenConnections() as $conn ) {
1586 $this->syncConnectionRoundState( $conn );
1587 }
1588 $this->trxRoundStage = self::ROUND_ROLLBACK_CALLBACKS;
1589 }
1590
1592 public function flushPrimarySessions( $fname = __METHOD__ ) {
1593 $this->assertTransactionRoundStage( [ self::ROUND_CURSORY ] );
1594 if ( $this->hasPrimaryChanges() ) {
1595 // Any transaction should have been rolled back beforehand
1596 throw new DBTransactionError( null, "Cannot reset session while writes are pending" );
1597 }
1598
1599 foreach ( $this->getOpenPrimaryConnections() as $conn ) {
1600 $conn->flushSession( $fname, $conn::FLUSHING_ALL_PEERS );
1601 }
1602 }
1603
1608 private function assertTransactionRoundStage( $stage ) {
1609 $stages = (array)$stage;
1610
1611 if ( !in_array( $this->trxRoundStage, $stages, true ) ) {
1612 $stageList = implode(
1613 '/',
1614 array_map( static fn ( $v ) => "'$v'", $stages )
1615 );
1616 $transactionName = $this->trxRoundFname ?? '<unknown>';
1617 throw new DBTransactionError(
1618 null,
1619 "Transaction '$transactionName' round stage must be '$stageList' (not '{$this->trxRoundStage}')"
1620 );
1621 }
1622 }
1623
1633 private function syncConnectionRoundState( Database $conn ) {
1634 if ( $conn->getLBInfo( self::INFO_CONN_CATEGORY ) !== self::CATEGORY_ROUND ) {
1635 return; // transaction rounds do not apply to these connections
1636 }
1637
1638 if ( $this->trxRoundFname !== null ) {
1639 // Explicit transaction round
1640 $trxRoundLevel = 1;
1641 } else {
1642 // Implicit auto-commit round (cli mode) or implicit transaction round (web mode)
1643 $trxRoundLevel = ( $this->cliMode ? 0 : 1 );
1644 }
1645
1646 // CATEGORY_ROUND DB handles with DBO_DEFAULT are considered "round aware" and the
1647 // load balancer will take over the logic of when DBO_TRX is set for such DB handles.
1648 // DBO_TRX will be set only when a transaction round is active (explicit or implicit).
1649 if ( $conn->getFlag( $conn::DBO_DEFAULT ) ) {
1650 if ( $trxRoundLevel ) {
1651 // Wrap queries in a transaction joined to the active transaction round
1652 $conn->setFlag( $conn::DBO_TRX );
1653 } else {
1654 // Do not wrap queries in a transaction (no active transaction round)
1655 $conn->clearFlag( $conn::DBO_TRX );
1656 }
1657 }
1658
1659 // Note that DBO_TRX is normally only set above or by DatabaseFactory applying
1660 // DBO_DEFAULT. However, integration tests might directly force DBO_TRX in the
1661 // server configuration arrays. Such handles will still be flushed during calls
1662 // to {@link LoadBalancer::commitPrimaryChanges()}.
1663 if ( $conn->getFlag( $conn::DBO_TRX ) ) {
1664 // DB handle is participating in the active transaction round
1665 $conn->setLBInfo( $conn::LB_TRX_ROUND_LEVEL, $trxRoundLevel );
1666 $conn->setLBInfo( $conn::LB_TRX_ROUND_FNAME, $this->trxRoundFname );
1667 } else {
1668 // DB handle is not participating in any transaction rounds
1669 $conn->setLBInfo( $conn::LB_TRX_ROUND_LEVEL, 0 );
1670 $conn->setLBInfo( $conn::LB_TRX_ROUND_FNAME, null );
1671 }
1672 }
1673
1675 public function flushReplicaSnapshots( $fname = __METHOD__ ) {
1676 foreach ( $this->conns as $poolConnsByServer ) {
1677 foreach ( $poolConnsByServer as $serverIndex => $serverConns ) {
1678 if ( $serverIndex === ServerInfo::WRITER_INDEX ) {
1679 continue; // skip primary
1680 }
1681 foreach ( $serverConns as $conn ) {
1682 $conn->flushSnapshot( $fname );
1683 }
1684 }
1685 }
1686 }
1687
1689 public function flushPrimarySnapshots( $fname = __METHOD__ ) {
1690 foreach ( $this->getOpenPrimaryConnections() as $conn ) {
1691 $conn->flushSnapshot( $fname );
1692 }
1693 }
1694
1696 public function hasPrimaryConnection() {
1697 return (bool)$this->getAnyOpenConnection( ServerInfo::WRITER_INDEX );
1698 }
1699
1701 public function hasPrimaryChanges() {
1702 foreach ( $this->getOpenPrimaryConnections() as $conn ) {
1703 if ( $conn->writesOrCallbacksPending() ) {
1704 return true;
1705 }
1706 }
1707
1708 return false;
1709 }
1710
1712 public function lastPrimaryChangeTimestamp() {
1713 $lastTime = null;
1714 foreach ( $this->getOpenPrimaryConnections() as $conn ) {
1715 $lastTime = max( $lastTime, $conn->lastDoneWrites() );
1716 }
1717
1718 return $lastTime;
1719 }
1720
1722 public function hasOrMadeRecentPrimaryChanges( $age = null ) {
1723 $age ??= self::MAX_WAIT_DEFAULT;
1724
1725 return ( $this->hasPrimaryChanges()
1726 || $this->lastPrimaryChangeTimestamp() > microtime( true ) - $age );
1727 }
1728
1731 $fnames = [];
1732 foreach ( $this->getOpenPrimaryConnections() as $conn ) {
1733 $fnames = array_merge( $fnames, $conn->pendingWriteCallers() );
1734 }
1735
1736 return $fnames;
1737 }
1738
1740 public function explicitTrxActive() {
1741 foreach ( $this->getOpenPrimaryConnections() as $conn ) {
1742 if ( $conn->explicitTrxActive() ) {
1743 return true;
1744 }
1745 }
1746 return false;
1747 }
1748
1749 private function setLaggedReplicaMode(): void {
1750 $this->laggedReplicaMode = true;
1751 $this->logger->warning( __METHOD__ . ": setting lagged replica mode" );
1752 }
1753
1755 public function laggedReplicaUsed() {
1756 return $this->laggedReplicaMode;
1757 }
1758
1760 public function getReadOnlyReason() {
1761 if ( $this->readOnlyReason !== false ) {
1762 return $this->readOnlyReason;
1763 } elseif ( $this->isPrimaryRunningReadOnly() ) {
1764 return 'The primary database server is running in read-only mode.';
1765 }
1766
1767 return false;
1768 }
1769
1775 private function isPrimaryRunningReadOnly( ?IDatabaseForOwner $conn = null ) {
1776 // Context will often be HTTP GET/HEAD; heavily cache the results
1777 return (bool)$this->wanCache->getWithSetCallback(
1778 // Note that table prefixes are not related to server-side read-only mode
1779 $this->wanCache->makeGlobalKey(
1780 'rdbms-server-readonly',
1781 $this->serverInfo->getPrimaryServerName()
1782 ),
1783 self::TTL_CACHE_READONLY,
1784 function ( $oldValue ) use ( $conn ) {
1785 $scope = $this->trxProfiler->silenceForScope();
1786 $conn ??= $this->getServerConnection(
1788 self::DOMAIN_ANY,
1789 self::CONN_SILENCE_ERRORS
1790 );
1791 if ( $conn ) {
1792 try {
1793 $value = (int)$conn->serverIsReadOnly();
1794 } catch ( DBError ) {
1795 $value = is_int( $oldValue ) ? $oldValue : 0;
1796 }
1797 } else {
1798 $value = 0;
1799 }
1800 ScopedCallback::consume( $scope );
1801
1802 return $value;
1803 },
1804 [
1805 'busyValue' => 0,
1806 'pcTTL' => WANObjectCache::TTL_PROC_LONG
1807 ]
1808 );
1809 }
1810
1812 public function pingAll() {
1813 $success = true;
1814 foreach ( $this->getOpenConnections() as $conn ) {
1815 if ( !$conn->ping() ) {
1816 $success = false;
1817 }
1818 }
1819
1820 return $success;
1821 }
1822
1827 private function getOpenConnections() {
1828 foreach ( $this->conns as $poolConnsByServer ) {
1829 foreach ( $poolConnsByServer as $serverConns ) {
1830 foreach ( $serverConns as $conn ) {
1831 yield $conn;
1832 }
1833 }
1834 }
1835 }
1836
1841 private function getOpenPrimaryConnections() {
1842 foreach ( $this->conns as $poolConnsByServer ) {
1844 foreach ( ( $poolConnsByServer[ServerInfo::WRITER_INDEX] ?? [] ) as $conn ) {
1845 yield $conn;
1846 }
1847 }
1848 }
1849
1851 public function getMaxLag() {
1852 $host = '';
1853 $maxLag = -1;
1854 $maxIndex = 0;
1855
1856 if ( $this->serverInfo->hasReplicaServers() ) {
1857 $lagTimes = $this->getLagTimes();
1858 foreach ( $lagTimes as $i => $lag ) {
1859 // Allowing the value to be unset due to stale cache (T361824)
1860 $load = $this->loads[$i] ?? 0;
1861 if ( $load > 0 && $lag > $maxLag ) {
1862 $maxLag = $lag;
1863 $host = $this->serverInfo->getServerInfoStrict( $i, 'host' );
1864 $maxIndex = $i;
1865 }
1866 }
1867 }
1868
1869 return [ $host, $maxLag, $maxIndex ];
1870 }
1871
1873 public function getLagTimes() {
1874 if ( !$this->hasReplicaServers() ) {
1875 return [ ServerInfo::WRITER_INDEX => 0 ]; // no replication = no lag
1876 }
1877 $fname = __METHOD__;
1878 return $this->wanCache->getWithSetCallback(
1879 $this->wanCache->makeGlobalKey( 'rdbms-lags', $this->getClusterName() ),
1880 // Add jitter to avoid stampede
1881 10 + mt_rand( 1, 10 ),
1882 function () use ( $fname ) {
1883 $lags = [];
1884 foreach ( $this->serverInfo->getStreamingReplicaIndexes() as $i ) {
1885 $conn = $this->getServerConnection(
1886 $i,
1887 self::DOMAIN_ANY,
1888 self::CONN_SILENCE_ERRORS | self::CONN_UNTRACKED_GAUGE
1889 );
1890 if ( $conn ) {
1891 $lags[$i] = $conn->getLag();
1892 $conn->close( $fname );
1893 } else {
1894 $lags[$i] = false;
1895 }
1896 }
1897 return $lags;
1898 },
1899 [ 'lockTSE' => 30 ]
1900 );
1901 }
1902
1904 public function waitForPrimaryPos( IDatabase $conn ) {
1905 if ( $conn->getLBInfo( self::INFO_SERVER_INDEX ) === ServerInfo::WRITER_INDEX ) {
1906 return true; // not a replica DB server
1907 }
1908
1909 // Get the current primary DB position, opening a connection only if needed
1910 $flags = self::CONN_SILENCE_ERRORS;
1911 $primaryConn = $this->getAnyOpenConnection( ServerInfo::WRITER_INDEX, $flags );
1912 if ( $primaryConn ) {
1913 $pos = $primaryConn->getPrimaryPos();
1914 } else {
1915 $primaryConn = $this->getServerConnection( ServerInfo::WRITER_INDEX, self::DOMAIN_ANY, $flags );
1916 if ( !$primaryConn ) {
1917 throw new DBReplicationWaitError(
1918 null,
1919 "Could not obtain a primary database connection to get the position"
1920 );
1921 }
1922 $pos = $primaryConn->getPrimaryPos();
1923 $this->closeConnection( $primaryConn );
1924 }
1925
1926 if ( $pos instanceof DBPrimaryPos && $conn instanceof IDatabaseForOwner ) {
1927 $this->logger->debug( __METHOD__ . ': waiting' );
1928 $result = $conn->primaryPosWait( $pos, self::MAX_WAIT_DEFAULT );
1929 $ok = ( $result !== null && $result != -1 );
1930 if ( $ok ) {
1931 $this->logger->debug( __METHOD__ . ': done waiting (success)' );
1932 } else {
1933 $this->logger->debug( __METHOD__ . ': done waiting (failure)' );
1934 }
1935 } else {
1936 $ok = false; // something is misconfigured
1937 $this->logger->error(
1938 __METHOD__ . ': could not get primary pos for {db_server}',
1939 $this->getConnLogContext( $conn, [ 'exception' => new RuntimeException() ] )
1940 );
1941 }
1942
1943 return $ok;
1944 }
1945
1947 public function setTransactionListener( $name, ?callable $callback = null ) {
1948 if ( $callback ) {
1949 $this->trxRecurringCallbacks[$name] = $callback;
1950 } else {
1951 unset( $this->trxRecurringCallbacks[$name] );
1952 }
1953 foreach ( $this->getOpenPrimaryConnections() as $conn ) {
1954 $conn->setTransactionListener( $name, $callback );
1955 }
1956 }
1957
1958 public function setTableAliases( array $aliases ) {
1959 $this->tableAliases = $aliases;
1960 }
1961
1962 public function setDomainAliases( array $aliases ) {
1963 $this->domainAliases = $aliases;
1964 }
1965
1967 public function setLocalDomainPrefix( $prefix ) {
1968 $oldLocalDomain = $this->localDomain;
1969 $this->localDomain = new DatabaseDomain(
1970 $this->localDomain->getDatabase(),
1971 $this->localDomain->getSchema(),
1972 $prefix
1973 );
1974
1975 // Update the prefix for existing connections.
1976 // Existing DBConnRef handles will not be affected.
1977 foreach ( $this->getOpenConnections() as $conn ) {
1978 if ( $oldLocalDomain->equals( $conn->getDomainID() ) ) {
1979 $conn->tablePrefix( $prefix );
1980 }
1981 }
1982 }
1983
1985 public function redefineLocalDomain( $domain ) {
1986 $this->closeAll( __METHOD__ );
1987 $this->localDomain = DatabaseDomain::newFromId( $domain );
1988 }
1989
1991 public function setTempTablesOnlyMode( $value, $domain ) {
1992 $old = $this->tempTablesOnlyMode[$domain] ?? false;
1993 if ( $value ) {
1994 $this->tempTablesOnlyMode[$domain] = true;
1995 } else {
1996 unset( $this->tempTablesOnlyMode[$domain] );
1997 }
1998
1999 return $old;
2000 }
2001
2007 private function stringifyConn( IDatabase $conn ) {
2008 return $conn->getLBInfo( self::INFO_SERVER_INDEX ) . '/' . $conn->getDomainID();
2009 }
2010
2016 private function fieldHasBit( int $flags, int $bit ) {
2017 return ( ( $flags & $bit ) === $bit );
2018 }
2019
2027 protected function getConnLogContext( IDatabase $conn, array $extras = [] ) {
2028 return $extras + [
2029 'db_server' => $conn->getServerName(),
2030 'db_domain' => $conn->getDomainID(),
2031 ];
2032 }
2033
2039 public function setMockTime( &$time ) {
2040 if ( !$this->loadMonitor instanceof LoadMonitor ) {
2041 throw new LogicException( 'Cannot set mock time on ' . $this::class . ' (consider adding ' .
2042 'setMockTime to ILoadMonitor).' );
2043 }
2044 $this->loadMonitor->setMockTime( $time );
2045 }
2046
2047 public function setDefaultGroupName( string $defaultGroup ): void {
2048 $this->defaultGroup = $defaultGroup;
2049 }
2050}
const DB_REPLICA
Definition defines.php:26
const DBO_DEFAULT
Definition defines.php:13
if(!defined('MW_SETUP_CALLBACK'))
Definition WebStart.php:72
Abstract class for any ephemeral data store.
Definition BagOStuff.php:73
Multi-datacenter aware caching interface.
Provide a given client with protection against visible database lag.
Exception class for attempted DB access.
Helper class used for automatically re-using IDatabase connections and lazily establishing the actual...
Definition DBConnRef.php:39
Database error base class.
Definition DBError.php:22
Exception class for replica DB wait errors.
Class to handle database/schema/prefix specifications for IDatabase.
static newFromId(DatabaseDomain|string $domain)
Constructs Database objects.
rollbackPrimaryChanges( $fname=__METHOD__)
Issue ROLLBACK only on primary, only if queries were done on connection.1.37
getAnyOpenConnection( $i, $flags=0)
sanitizeConnectionFlags( $flags, $domain)
Sanitize connection flags provided by a call to getConnection().
flushReplicaSnapshots( $fname=__METHOD__)
Commit all replica DB transactions so as to flush any REPEATABLE-READ or SSI snapshots.
getServerAttributes( $i)
Get basic attributes of the server with the specified index without connecting.array (Database\ATTRIB...
getLocalDomainID()
Get the local (and default) database domain ID of connection handles.
hasReplicaServers()
Whether there are any replica servers configured.This scans the list of servers defined in configurat...
getServerType( $i)
Get the RDBMS type of the server with the specified index (e.g."mysql", "sqlite")string One of (mysql...
hasStreamingReplicaServers()
Whether any replica servers use streaming replication from the primary server.This scans the list of ...
setTableAliases(array $aliases)
Make certain table names use their own database, schema, and table prefix when passed into SQL querie...
lastPrimaryChangeTimestamp()
Get the last time that a tracked connection was used to commit a write.Should only be called from the...
closeAll( $fname=__METHOD__)
Close all open connections.
resolveDomainInstance(DatabaseDomain|string|false $domain)
waitForAll(DBPrimaryPos $pos, $timeout=null)
Set the primary wait position and wait for ALL replica DBs to catch up to it.This method is only inte...
getServerConnection( $i, $domain, $flags=0)
Get a DB handle for a specific server index.This is an internal utility method for methods like LoadB...
hasPrimaryChanges()
Whether there are pending changes or callbacks in a transaction by this thread.bool 1....
getMaxLag()
Get the name and lag time of the most-lagged replica server.This is useful for maintenance scripts th...
getConnLogContext(IDatabase $conn, array $extras=[])
Create a log context to pass to PSR-3 logger functions.
redefineLocalDomain( $domain)
Close all connection and redefine the local domain for testing or schema creation....
setDomainAliases(array $aliases)
Convert certain database domains to alternative ones.
hasPrimaryConnection()
bool Whether a primary connection is already open 1.37
laggedReplicaUsed()
Whether a highly "lagged" replica database connection was queried.This method will never cause a new ...
getConnection( $i, $groups=[], string|false $domain=false, $flags=0)
Get a lazy-connecting database handle for a specific or virtual (DB_PRIMARY/DB_REPLICA) server index....
getReadOnlyReason()
This method may trigger a DB connection if not yet done string|false Reason the primary is read-only ...
waitForPrimaryPos(IDatabase $conn)
Wait for a replica DB to reach a specified primary position.If $conn is not a replica server connecti...
hasOrMadeRecentPrimaryChanges( $age=null)
Check if this load balancer object had any recent or still pending writes issued against it by this P...
explicitTrxActive()
Determine whether an explicit transaction is active on any open primary connection....
setTempTablesOnlyMode( $value, $domain)
Indicate whether the tables on this domain are only temporary tables for testing.In "temporary tables...
flushPrimarySessions( $fname=__METHOD__)
Release/destroy session-level named locks, table locks, and temp tables.Only call this function right...
getExistingReaderIndex( $group)
Get the server index chosen for DB_REPLICA connections for the given query group.
beginPrimaryChanges( $fname=__METHOD__)
Flush any primary transaction snapshots and set DBO_TRX (if DBO_DEFAULT is set).The DBO_TRX setting w...
setLocalDomainPrefix( $prefix)
Set a new table prefix for the existing local domain ID for testing.1.33
approvePrimaryChanges(int $maxWriteDuration, $fname=__METHOD__)
Perform all pre-commit checks for things like replication safety.Use this only for multi-database com...
getMaintenanceConnectionRef( $i, $groups=[], $domain=false, $flags=0)
Get a DB handle, suitable for migrations and schema changes, for a server index.The DBConnRef methods...
getConnectionInternal( $i, $groups=[], $domain=false, $flags=0)
Only to be used by DBConnRef IDatabase
runPrimaryTransactionListenerCallbacks( $fname=__METHOD__)
Run all recurring post-COMMIT/ROLLBACK listener callbacks.Exception|null The first exception or null ...
pendingPrimaryChangeCallers()
Get the list of callers that have pending primary changes.string[] List of method names 1....
getServerName( $i)
Get the readable name of the server with the specified index.string Readable server name,...
reallyOpenConnection( $i, DatabaseDomain $domain, array $lbInfo)
Open a new network connection to a server (uncached).
flushPrimarySnapshots( $fname=__METHOD__)
Commit all primary DB transactions so as to flush any REPEATABLE-READ or SSI snapshots....
resolveDomainID(DatabaseDomain|string|false $domain)
string Value of $domain if it is foreign or the local domain otherwise 1.32
runPrimaryTransactionIdleCallbacks( $fname=__METHOD__)
Consume and run all pending post-COMMIT/ROLLBACK callbacks and commit dangling transactions....
setTransactionListener( $name, ?callable $callback=null)
Set a callback via IDatabase\setTransactionListener() on all current and future primary connections o...
reconfigure(array $params)
Apply updated configuration.
commitPrimaryChanges( $fname=__METHOD__)
Issue COMMIT on all open primary connections to flush changes and view snapshots.1....
getLagTimes()
Get an estimate of replication lag (in seconds) for each server.Results are cached for a short time i...
getServerInfo( $i)
Return the server configuration map for the server with the specified index.array|false Server config...
getPrimaryPos()
Get the current primary replication position.DBPrimaryPos|false Returns false if not applicable 1....
getServerCount()
Get the number of servers defined in configuration.int
disable( $fname=__METHOD__)
Close all connections and disable this load balancer.Any attempt to open a new connection will result...
getClusterName()
Get the name of the overall cluster of database servers managing the dataset.
getReaderIndex( $group=false)
Get the specific server index of the reader connection for a given group.This takes into account load...
finalizePrimaryChanges( $fname=__METHOD__)
Run pre-commit callbacks and defer execution of post-commit callbacks.Use this only for multi-databas...
setDefaultGroupName(string $defaultGroup)
Set the default group name for all load balancers.
Basic DB load monitor with no external dependencies.
Container for accessing information about the database servers in a database cluster.
Detect high-contention DB queries via profiling calls.
This is the primary interface for validating metrics definitions, caching defined metrics,...
return[ 'config-schema-inverse'=>['default'=>['ConfigRegistry'=>['main'=> 'MediaWiki\\Config\\GlobalVarConfig::newInstance',], 'Sitename'=> 'MediaWiki', 'Server'=> false, 'CanonicalServer'=> false, 'ServerName'=> false, 'AssumeProxiesUseDefaultProtocolPorts'=> true, 'HttpsPort'=> 443, 'ForceHTTPS'=> false, 'ScriptPath'=> '/wiki', 'UsePathInfo'=> null, 'Script'=> false, 'LoadScript'=> false, 'RestPath'=> false, 'StylePath'=> false, 'LocalStylePath'=> false, 'ExtensionAssetsPath'=> false, 'ExtensionDirectory'=> null, 'StyleDirectory'=> null, 'ArticlePath'=> false, 'UploadPath'=> false, 'ImgAuthPath'=> false, 'ThumbPath'=> false, 'UploadDirectory'=> false, 'FileCacheDirectory'=> false, 'Logo'=> false, 'Logos'=> false, 'Favicon'=> '/favicon.ico', 'AppleTouchIcon'=> false, 'ReferrerPolicy'=> false, 'TmpDirectory'=> false, 'UploadBaseUrl'=> '', 'UploadStashScalerBaseUrl'=> false, 'ActionPaths'=>[], 'MainPageIsDomainRoot'=> false, 'EnableUploads'=> false, 'UploadStashMaxAge'=> 21600, 'EnableAsyncUploads'=> false, 'EnableAsyncUploadsByURL'=> false, 'EnableChunkedUploads'=> false, 'UploadMaintenance'=> false, 'IllegalFileChars'=> ':\\/\\\\', 'DeletedDirectory'=> false, 'ImgAuthDetails'=> false, 'ImgAuthUrlPathMap'=>[], 'LocalFileRepo'=>['class'=> 'MediaWiki\\FileRepo\\LocalRepo', 'name'=> 'local', 'directory'=> null, 'scriptDirUrl'=> null, 'favicon'=> null, 'url'=> null, 'hashLevels'=> null, 'thumbScriptUrl'=> null, 'transformVia404'=> null, 'deletedDir'=> null, 'deletedHashLevels'=> null, 'updateCompatibleMetadata'=> null, 'reserializeMetadata'=> null,], 'ForeignFileRepos'=>[], 'UseInstantCommons'=> false, 'UseSharedUploads'=> false, 'SharedUploadDirectory'=> null, 'SharedUploadPath'=> null, 'HashedSharedUploadDirectory'=> true, 'RepositoryBaseUrl'=> 'https:'FetchCommonsDescriptions'=> false, 'SharedUploadDBname'=> false, 'SharedUploadDBprefix'=> '', 'SharedUploadDBschema'=> null, 'CacheSharedUploads'=> true, 'ForeignUploadTargets'=>['local',], 'UploadDialog'=>['fields'=>['description'=> true, 'date'=> false, 'categories'=> false,], 'licensemessages'=>['local'=> 'generic-local', 'foreign'=> 'generic-foreign',], 'comment'=>['local'=> '', 'foreign'=> '',], 'format'=>['filepage'=> ' $DESCRIPTION', 'description'=> ' $TEXT', 'ownwork'=> '', 'license'=> '', 'uncategorized'=> '',],], 'FileBackends'=>[], 'LockManagers'=>[], 'DefaultLockManager'=> null, 'ShowEXIF'=> null, 'UpdateCompatibleMetadata'=> false, 'AllowCopyUploads'=> false, 'CopyUploadsDomains'=>[], 'CopyUploadsFromSpecialUpload'=> false, 'CopyUploadProxy'=> false, 'CopyUploadTimeout'=> false, 'CopyUploadAllowOnWikiDomainConfig'=> false, 'MaxUploadSize'=> 104857600, 'MinUploadChunkSize'=> 1024, 'UploadNavigationUrl'=> false, 'UploadMissingFileUrl'=> false, 'ThumbnailScriptPath'=> false, 'SharedThumbnailScriptPath'=> false, 'HashedUploadDirectory'=> true, 'CSPUploadEntryPoint'=> true, 'FileExtensions'=>['png', 'gif', 'jpg', 'jpeg', 'webp',], 'ProhibitedFileExtensions'=>['html', 'htm', 'js', 'jsb', 'mhtml', 'mht', 'xhtml', 'xht', 'php', 'phtml', 'php3', 'php4', 'php5', 'phps', 'phar', 'shtml', 'jhtml', 'pl', 'py', 'cgi', 'exe', 'scr', 'dll', 'msi', 'vbs', 'bat', 'com', 'pif', 'cmd', 'vxd', 'cpl', 'xml',], 'MimeTypeExclusions'=>['text/html', 'application/javascript', 'text/javascript', 'text/x-javascript', 'application/x-shellscript', 'application/x-php', 'text/x-php', 'text/x-python', 'text/x-perl', 'text/x-bash', 'text/x-sh', 'text/x-csh', 'text/scriptlet', 'application/x-msdownload', 'application/x-msmetafile', 'application/java', 'application/xml', 'text/xml',], 'CheckFileExtensions'=> true, 'StrictFileExtensions'=> true, 'DisableUploadScriptChecks'=> false, 'UploadSizeWarning'=> false, 'TrustedMediaFormats'=>['BITMAP', 'AUDIO', 'VIDEO', 'image/svg+xml', 'application/pdf',], 'MediaHandlers'=>[], 'NativeImageLazyLoading'=> true, 'ParserTestMediaHandlers'=>['image/jpeg'=> 'MockBitmapHandler', 'image/png'=> 'MockBitmapHandler', 'image/gif'=> 'MockBitmapHandler', 'image/tiff'=> 'MockBitmapHandler', 'image/webp'=> 'MockBitmapHandler', 'image/x-ms-bmp'=> 'MockBitmapHandler', 'image/x-bmp'=> 'MockBitmapHandler', 'image/x-xcf'=> 'MockBitmapHandler', 'image/svg+xml'=> 'MockSvgHandler', 'image/vnd.djvu'=> 'MockDjVuHandler',], 'UseImageResize'=> true, 'UseImageMagick'=> false, 'ImageMagickConvertCommand'=> '/usr/bin/convert', 'MaxInterlacingAreas'=>[], 'SharpenParameter'=> '0x0.4', 'SharpenReductionThreshold'=> 0.85, 'ImageMagickTempDir'=> false, 'CustomConvertCommand'=> false, 'JpegTran'=> '/usr/bin/jpegtran', 'JpegPixelFormat'=> 'yuv420', 'JpegQuality'=> 80, 'Exiv2Command'=> '/usr/bin/exiv2', 'Exiftool'=> '/usr/bin/exiftool', 'SVGConverters'=>['ImageMagick'=> ' $path/convert -background "#ffffff00" -thumbnail $widthx$height\\! $input PNG:$output', 'inkscape'=> ' $path/inkscape -w $width -o $output $input', 'batik'=> 'java -Djava.awt.headless=true -jar $path/batik-rasterizer.jar -w $width -d $output $input', 'rsvg'=> ' $path/rsvg-convert -w $width -h $height -l $lang -o $output $input', 'ImagickExt'=>['SvgHandler::rasterizeImagickExt',],], 'SVGConverter'=> 'ImageMagick', 'SVGConverterPath'=> '', 'SVGMaxSize'=> 5120, 'SVGMetadataCutoff'=> 5242880, 'SVGNativeRendering'=> true, 'SVGNativeRenderingSizeLimit'=> 51200, 'MediaInTargetLanguage'=> true, 'MaxImageArea'=> 12500000, 'MaxAnimatedGifArea'=> 12500000, 'MaxAnimatedWebPArea'=> 12500000, 'TiffThumbnailType'=>[], 'ThumbnailEpoch'=> '20030516000000', 'AttemptFailureEpoch'=> 1, 'IgnoreImageErrors'=> false, 'GenerateThumbnailOnParse'=> true, 'ShowArchiveThumbnails'=> true, 'EnableAutoRotation'=> null, 'Antivirus'=> null, 'AntivirusSetup'=>['clamav'=>['command'=> 'clamscan --no-summary ', 'codemap'=>[0=> 0, 1=> 1, 52=> -1, ' *'=> false,], 'messagepattern'=> '/.*?:(.*)/sim',],], 'AntivirusRequired'=> true, 'VerifyMimeType'=> true, 'MimeTypeFile'=> 'internal', 'MimeInfoFile'=> 'internal', 'MimeDetectorCommand'=> null, 'TrivialMimeDetection'=> false, 'XMLMimeTypes'=>['http:'svg'=> 'image/svg+xml', 'http:'http:'html'=> 'text/html',], 'ImageLimits'=>[[320, 240,], [640, 480,], [800, 600,], [1024, 768,], [1280, 1024,], [2560, 2048,],], 'ThumbLimits'=>[120, 150, 180, 200, 220, 250, 300, 400,], 'ThumbnailNamespaces'=>[6,], 'ThumbnailSteps'=> null, 'ThumbnailBuckets'=> null, 'ThumbnailMinimumBucketDistance'=> 50, 'UploadThumbnailRenderMap'=>[], 'UploadThumbnailRenderMethod'=> 'jobqueue', 'UploadThumbnailRenderHttpCustomHost'=> false, 'UploadThumbnailRenderHttpCustomDomain'=> false, 'UseTinyRGBForJPGThumbnails'=> false, 'GalleryOptions'=>[], 'ThumbUpright'=> 0.75, 'DirectoryMode'=> 511, 'ResponsiveImages'=> true, 'ImagePreconnect'=> false, 'TrackMediaRequestProvenance'=> false, 'DjvuUseBoxedCommand'=> false, 'DjvuDump'=> null, 'DjvuRenderer'=> null, 'DjvuTxt'=> null, 'DjvuPostProcessor'=> 'pnmtojpeg', 'DjvuOutputExtension'=> 'jpg', 'EmergencyContact'=> false, 'PasswordSender'=> false, 'NoReplyAddress'=> false, 'EnableEmail'=> true, 'EnableUserEmail'=> true, 'UserEmailUseReplyTo'=> true, 'PasswordReminderResendTime'=> 24, 'NewPasswordExpiry'=> 604800, 'UserEmailConfirmationTokenExpiry'=> 604800, 'PasswordExpirationDays'=> false, 'PasswordExpireGrace'=> 604800, 'SMTP'=> false, 'AdditionalMailParams'=> null, 'AllowHTMLEmail'=> false, 'EnotifFromEditor'=> false, 'EmailAuthentication'=> true, 'EmailConfirmationBanner'=> false, 'EnotifWatchlist'=> false, 'EnotifUserTalk'=> false, 'EnotifRevealEditorAddress'=> false, 'EnotifMinorEdits'=> true, 'EnotifUseRealName'=> false, 'UsersNotifiedOnAllChanges'=>[], 'DBname'=> 'my_wiki', 'DBmwschema'=> null, 'DBprefix'=> '', 'DBserver'=> 'localhost', 'DBport'=> 5432, 'DBuser'=> 'wikiuser', 'DBpassword'=> '', 'DBtype'=> 'mysql', 'DBssl'=> false, 'DBcompress'=> false, 'DBStrictWarnings'=> false, 'DBadminuser'=> null, 'DBadminpassword'=> null, 'SearchType'=> null, 'SearchTypeAlternatives'=> null, 'DBTableOptions'=> 'ENGINE=InnoDB, DEFAULT CHARSET=binary', 'SQLMode'=> '', 'SQLiteDataDir'=> '', 'SharedDB'=> null, 'SharedPrefix'=> false, 'SharedTables'=>['user', 'user_properties', 'user_autocreate_serial',], 'SharedSchema'=> false, 'DBservers'=> false, 'LBFactoryConf'=>['class'=> 'Wikimedia\\Rdbms\\LBFactorySimple',], 'DataCenterUpdateStickTTL'=> 10, 'DBerrorLog'=> false, 'DBerrorLogTZ'=> false, 'LocalDatabases'=>[], 'DatabaseReplicaLagWarning'=> 10, 'DatabaseReplicaLagCritical'=> 30, 'MaxExecutionTimeForExpensiveQueries'=> 0, 'VirtualDomainsMapping'=>[], 'RemoteVirtualDomainsMapping'=>[], 'FileSchemaMigrationStage'=> 3, 'ExternalLinksDomainGaps'=>[], 'ContentHandlers'=>['wikitext'=>['class'=> 'MediaWiki\\Content\\WikitextContentHandler', 'services'=>['TitleFactory', 'ParserFactory', 'GlobalIdGenerator', 'LanguageNameUtils', 'LinkRenderer', 'MagicWordFactory', 'ParsoidParserFactory',],], 'javascript'=>['class'=> 'MediaWiki\\Content\\JavaScriptContentHandler', 'services'=>['MainConfig', 'ParserFactory', 'UserOptionsLookup', 'CodeHighlighter',],], 'json'=>['class'=> 'MediaWiki\\Content\\JsonContentHandler', 'services'=>['ParsoidParserFactory', 'TitleFactory',],], 'css'=>['class'=> 'MediaWiki\\Content\\CssContentHandler', 'services'=>['MainConfig', 'ParserFactory', 'UserOptionsLookup', 'CodeHighlighter',],], 'vue'=>['class'=> 'MediaWiki\\Content\\VueContentHandler', 'services'=>['MainConfig', 'ParserFactory', 'CodeHighlighter',],], 'text'=> 'MediaWiki\\Content\\TextContentHandler', 'unknown'=> 'MediaWiki\\Content\\FallbackContentHandler',], 'NamespaceContentModels'=>[], 'TextModelsToParse'=>['wikitext', 'javascript', 'css',], 'CompressRevisions'=> false, 'ExternalStores'=>[], 'ExternalServers'=>[], 'DefaultExternalStore'=> false, 'RevisionCacheExpiry'=> 604800, 'PageLanguageUseDB'=> false, 'DiffEngine'=> null, 'ExternalDiffEngine'=> false, 'Wikidiff2Options'=>[], 'RequestTimeLimit'=> null, 'TransactionalTimeLimit'=> 120, 'CriticalSectionTimeLimit'=> 180.0, 'MiserMode'=> false, 'DisableQueryPages'=> false, 'QueryCacheLimit'=> 1000, 'WantedPagesThreshold'=> 1, 'AllowSlowParserFunctions'=> false, 'AllowSchemaUpdates'=> true, 'MaxArticleSize'=> 2048, 'MemoryLimit'=> '50M', 'PoolCounterConf'=> null, 'PoolCountClientConf'=>['servers'=>['127.0.0.1',], 'timeout'=> 0.1,], 'MaxUserDBWriteDuration'=> false, 'MaxJobDBWriteDuration'=> false, 'LinkHolderBatchSize'=> 1000, 'MaximumMovedPages'=> 100, 'ForceDeferredUpdatesPreSend'=> false, 'MultiShardSiteStats'=> false, 'CacheDirectory'=> false, 'MainCacheType'=> 0, 'MessageCacheType'=> -1, 'ParserCacheType'=> -1, 'SessionCacheType'=> -1, 'AnonSessionCacheType'=> false, 'LanguageConverterCacheType'=> -1, 'ObjectCaches'=>[0=>['class'=> 'Wikimedia\\ObjectCache\\EmptyBagOStuff', 'reportDupes'=> false,], 1=>['class'=> 'MediaWiki\\ObjectCache\\SqlBagOStuff', 'loggroup'=> 'SQLBagOStuff',], 'memcached-php'=>['class'=> 'Wikimedia\\ObjectCache\\MemcachedPhpBagOStuff', 'loggroup'=> 'memcached',], 'memcached-pecl'=>['class'=> 'Wikimedia\\ObjectCache\\MemcachedPeclBagOStuff', 'loggroup'=> 'memcached',], 'hash'=>['class'=> 'Wikimedia\\ObjectCache\\HashBagOStuff', 'reportDupes'=> false,], 'apc'=>['class'=> 'Wikimedia\\ObjectCache\\APCUBagOStuff', 'reportDupes'=> false,], 'apcu'=>['class'=> 'Wikimedia\\ObjectCache\\APCUBagOStuff', 'reportDupes'=> false,],], 'WANObjectCache'=>[], 'MicroStashType'=> -1, 'MainStash'=> 1, 'ParsoidCacheConfig'=>['StashType'=> null, 'StashDuration'=> 86400,], 'ParsoidSelectiveUpdateSampleRate'=> 0, 'SplitParsoidParserCache'=> false, 'ParserCacheFilterConfig'=>['pcache'=>['default'=>['minCpuTime'=> 0,],], 'postproc-pcache'=>['default'=>['minCpuTime'=> 9223372036854775807,],], 'parsoid-pcache'=>['default'=>['minCpuTime'=> 0,],], 'postproc-parsoid-pcache'=>['default'=>['minCpuTime'=> 0,],],], 'ChronologyProtectorSecret'=> '', 'ParserCacheExpireTime'=> 86400, 'ParserCacheAsyncExpireTime'=> 60, 'ParserCacheAsyncRefreshJobs'=> true, 'OldRevisionParserCacheExpireTime'=> 3600, 'ObjectCacheSessionExpiry'=> 3600, 'SuspiciousIpExpiry'=> false, 'SessionPbkdf2Iterations'=> 10001, 'UseSessionCookieJwt'=> false, 'JwtSessionCookieIssuer'=> null, 'MemCachedServers'=>['127.0.0.1:11211',], 'MemCachedPersistent'=> false, 'MemCachedTimeout'=> 500000, 'UseLocalMessageCache'=> false, 'AdaptiveMessageCache'=> false, 'LocalisationCacheConf'=>['class'=> 'MediaWiki\\Language\\LocalisationCache', 'store'=> 'detect', 'storeClass'=> false, 'storeDirectory'=> false, 'storeServer'=>[], 'forceRecache'=> false, 'manualRecache'=> false,], 'CachePages'=> true, 'CacheEpoch'=> '20030516000000', 'GitInfoCacheDirectory'=> false, 'UseFileCache'=> false, 'FileCacheDepth'=> 2, 'RenderHashAppend'=> '', 'EnableSidebarCache'=> false, 'SidebarCacheExpiry'=> 86400, 'UseGzip'=> false, 'InvalidateCacheOnLocalSettingsChange'=> true, 'ExtensionInfoMTime'=> false, 'EnableRemoteBagOStuffTests'=> false, 'UseCdn'=> false, 'VaryOnXFP'=> false, 'InternalServer'=> false, 'CdnMaxAge'=> 18000, 'CdnMaxageLagged'=> 30, 'CdnMaxageStale'=> 10, 'CdnReboundPurgeDelay'=> 0, 'CdnMaxageSubstitute'=> 60, 'CdnServers'=>[], 'CdnServersNoPurge'=>[], 'HTCPRouting'=>[], 'HTCPMulticastTTL'=> 1, 'UsePrivateIPs'=> false, 'CdnMatchParameterOrder'=> true, 'LanguageCode'=> 'en', 'GrammarForms'=>[], 'InterwikiMagic'=> true, 'HideInterlanguageLinks'=> false, 'ExtraInterlanguageLinkPrefixes'=>[], 'InterlanguageLinkCodeMap'=>[], 'ExtraLanguageNames'=>[], 'ExtraLanguageCodes'=>['bh'=> 'bho', 'no'=> 'nb', 'simple'=> 'en',], 'DummyLanguageCodes'=>[], 'AllUnicodeFixes'=> false, 'LegacyEncoding'=> false, 'AmericanDates'=> false, 'TranslateNumerals'=> true, 'UseDatabaseMessages'=> true, 'MaxMsgCacheEntrySize'=> 10000, 'DisableLangConversion'=> false, 'DisableTitleConversion'=> false, 'DefaultLanguageVariant'=> false, 'UsePigLatinVariant'=> false, 'DisabledVariants'=>[], 'VariantArticlePath'=> false, 'UseXssLanguage'=> false, 'LoginLanguageSelector'=> false, 'ForceUIMsgAsContentMsg'=>[], 'RawHtmlMessages'=>[], 'Localtimezone'=> null, 'LocalTZoffset'=> null, 'OverrideUcfirstCharacters'=>[], 'MimeType'=> 'text/html', 'Html5Version'=> null, 'EditSubmitButtonLabelPublish'=> false, 'XhtmlNamespaces'=>[], 'SiteNotice'=> '', 'BrowserFormatDetection'=> 'telephone=no', 'SkinMetaTags'=>[], 'DefaultSkin'=> 'vector-2022', 'FallbackSkin'=> 'fallback', 'SkipSkins'=>[], 'DisableOutputCompression'=> false, 'FragmentMode'=>['html5', 'legacy',], 'ExternalInterwikiFragmentMode'=> 'legacy', 'FooterIcons'=>['copyright'=>['copyright'=>[],], 'poweredby'=>['mediawiki'=>['src'=> null, 'url'=> 'https:'alt'=> 'Powered by MediaWiki', 'lang'=> 'en',],],], 'EnableSectionShare'=> false, 'PageShareSkinsEnabled'=>[], 'UseCombinedLoginLink'=> false, 'Edititis'=> false, 'Send404Code'=> true, 'ShowRollbackEditCount'=> 10, 'EnableCanonicalServerLink'=> false, 'InterwikiLogoOverride'=>[], 'ResourceModules'=>[], 'ResourceModuleSkinStyles'=>[], 'ResourceLoaderSources'=>[], 'ResourceBasePath'=> null, 'ResourceLoaderMaxage'=>[], 'ResourceLoaderDebug'=> false, 'ResourceLoaderMaxQueryLength'=> false, 'ResourceLoaderValidateJS'=> true, 'ResourceLoaderEnableJSProfiler'=> false, 'ResourceLoaderStorageEnabled'=> true, 'ResourceLoaderStorageVersion'=> 1, 'ResourceLoaderEnableSourceMapLinks'=> true, 'AllowSiteCSSOnRestrictedPages'=> false, 'VueDevelopmentMode'=> false, 'CodexDevelopmentDir'=> null, 'MetaNamespace'=> false, 'MetaNamespaceTalk'=> false, 'CanonicalNamespaceNames'=>[-2=> 'Media', -1=> 'Special', 0=> '', 1=> 'Talk', 2=> 'User', 3=> 'User_talk', 4=> 'Project', 5=> 'Project_talk', 6=> 'File', 7=> 'File_talk', 8=> 'MediaWiki', 9=> 'MediaWiki_talk', 10=> 'Template', 11=> 'Template_talk', 12=> 'Help', 13=> 'Help_talk', 14=> 'Category', 15=> 'Category_talk',], 'ExtraNamespaces'=>[], 'ExtraGenderNamespaces'=>[], 'NamespaceAliases'=>[], 'LegalTitleChars'=> ' %!"$&\'()*,\\-.\\/0-9:;=?@A-Z\\\\^_`a-z~\\x80-\\xFF+', 'CapitalLinks' => true, 'CapitalLinkOverrides' => [ ], 'NamespacesWithSubpages' => [ 1 => true, 2 => true, 3 => true, 4 => true, 5 => true, 7 => true, 8 => true, 9 => true, 10 => true, 11 => true, 12 => true, 13 => true, 15 => true, ], 'NamespacesWithoutAutoSummaries' => [ ], 'ContentNamespaces' => [ 0, ], 'ShortPagesNamespaceExclusions' => [ ], 'ExtraSignatureNamespaces' => [ ], 'InvalidRedirectTargets' => [ 'Filepath', 'Mypage', 'Mytalk', 'Redirect', 'Mylog', ], 'DisableHardRedirects' => false, 'FixDoubleRedirects' => false, 'LocalInterwikis' => [ ], 'InterwikiExpiry' => 10800, 'InterwikiCache' => false, 'InterwikiScopes' => 3, 'InterwikiFallbackSite' => 'wiki', 'RedirectSources' => false, 'SiteTypes' => [ 'mediawiki' => 'MediaWiki\\Site\\MediaWikiSite', ], 'MaxTocLevel' => 999, 'MaxPPNodeCount' => 1000000, 'MaxTemplateDepth' => 100, 'MaxPPExpandDepth' => 100, 'UrlProtocols' => [ 'bitcoin:', 'ftp: 'ftps: 'geo:', 'git: 'gopher: 'http: 'https: 'irc: 'ircs: 'magnet:', 'mailto:', 'matrix:', 'mms: 'news:', 'nntp: 'redis: 'sftp: 'sip:', 'sips:', 'sms:', 'ssh: 'svn: 'tel:', 'telnet: 'urn:', 'wikipedia: 'worldwind: 'xmpp:', ' ], 'CleanSignatures' => true, 'AllowExternalImages' => false, 'AllowExternalImagesFrom' => '', 'EnableImageWhitelist' => false, 'TidyConfig' => [ ], 'ParsoidSettings' => [ 'useSelser' => true, ], 'ParsoidExperimentalParserFunctionOutput' => false, 'RawHtml' => false, 'ExternalLinkTarget' => false, 'NoFollowLinks' => true, 'NoFollowNsExceptions' => [ ], 'NoFollowDomainExceptions' => [ 'mediawiki.org', ], 'RegisterInternalExternals' => false, 'ExternalLinksIgnoreDomains' => [ ], 'AllowDisplayTitle' => true, 'RestrictDisplayTitle' => true, 'ExpensiveParserFunctionLimit' => 100, 'PreprocessorCacheThreshold' => 1000, 'EnableScaryTranscluding' => false, 'TranscludeCacheExpiry' => 3600, 'EnableMagicLinks' => [ 'ISBN' => false, 'PMID' => false, 'RFC' => false, ], 'ParserEnableUserLanguage' => false, 'ArticleCountMethod' => 'link', 'ActiveUserDays' => 30, 'LearnerEdits' => 10, 'LearnerMemberSince' => 4, 'ExperiencedUserEdits' => 500, 'ExperiencedUserMemberSince' => 30, 'ManualRevertSearchRadius' => 15, 'RevertedTagMaxDepth' => 15, 'CentralIdLookupProviders' => [ 'local' => [ 'class' => 'MediaWiki\\User\\CentralId\\LocalIdLookup', 'services' => [ 'MainConfig', 'DBLoadBalancerFactory', 'HideUserUtils', ], ], ], 'CentralIdLookupProvider' => 'local', 'UserRegistrationProviders' => [ 'local' => [ 'class' => 'MediaWiki\\User\\Registration\\LocalUserRegistrationProvider', 'services' => [ 'ConnectionProvider', ], ], ], 'PasswordPolicy' => [ 'policies' => [ 'bureaucrat' => [ 'MinimalPasswordLength' => 10, 'MinimumPasswordLengthToLogin' => 1, ], 'sysop' => [ 'MinimalPasswordLength' => 10, 'MinimumPasswordLengthToLogin' => 1, ], 'interface-admin' => [ 'MinimalPasswordLength' => 10, 'MinimumPasswordLengthToLogin' => 1, ], 'bot' => [ 'MinimalPasswordLength' => 10, 'MinimumPasswordLengthToLogin' => 1, ], 'default' => [ 'MinimalPasswordLength' => [ 'value' => 8, 'suggestChangeOnLogin' => true, ], 'PasswordCannotBeSubstringInUsername' => [ 'value' => true, 'suggestChangeOnLogin' => true, ], 'PasswordCannotMatchDefaults' => [ 'value' => true, 'suggestChangeOnLogin' => true, ], 'MaximalPasswordLength' => [ 'value' => 4096, 'suggestChangeOnLogin' => true, ], 'PasswordNotInCommonList' => [ 'value' => true, 'suggestChangeOnLogin' => true, ], ], ], 'checks' => [ 'MinimalPasswordLength' => [ 'MediaWiki\\Password\\PasswordPolicyChecks', 'checkMinimalPasswordLength', ], 'MinimumPasswordLengthToLogin' => [ 'MediaWiki\\Password\\PasswordPolicyChecks', 'checkMinimumPasswordLengthToLogin', ], 'PasswordCannotBeSubstringInUsername' => [ 'MediaWiki\\Password\\PasswordPolicyChecks', 'checkPasswordCannotBeSubstringInUsername', ], 'PasswordCannotMatchDefaults' => [ 'MediaWiki\\Password\\PasswordPolicyChecks', 'checkPasswordCannotMatchDefaults', ], 'MaximalPasswordLength' => [ 'MediaWiki\\Password\\PasswordPolicyChecks', 'checkMaximalPasswordLength', ], 'PasswordNotInCommonList' => [ 'MediaWiki\\Password\\PasswordPolicyChecks', 'checkPasswordNotInCommonList', ], ], ], 'AuthManagerConfig' => null, 'AuthManagerAutoConfig' => [ 'preauth' => [ 'MediaWiki\\Auth\\ThrottlePreAuthenticationProvider' => [ 'class' => 'MediaWiki\\Auth\\ThrottlePreAuthenticationProvider', 'sort' => 0, ], 'MediaWiki\\Auth\\PreviouslyRenamedAccountPreAuthenticationProvider' => [ 'class' => 'MediaWiki\\Auth\\PreviouslyRenamedAccountPreAuthenticationProvider', 'services' => [ 'ConnectionProvider', 'UserFactory', ], 'sort' => 0, ], ], 'primaryauth' => [ 'MediaWiki\\Auth\\TemporaryPasswordPrimaryAuthenticationProvider' => [ 'class' => 'MediaWiki\\Auth\\TemporaryPasswordPrimaryAuthenticationProvider', 'services' => [ 'DBLoadBalancerFactory', 'UserOptionsLookup', ], 'args' => [ [ 'authoritative' => false, ], ], 'sort' => 0, ], 'MediaWiki\\Auth\\LocalPasswordPrimaryAuthenticationProvider' => [ 'class' => 'MediaWiki\\Auth\\LocalPasswordPrimaryAuthenticationProvider', 'services' => [ 'DBLoadBalancerFactory', ], 'args' => [ [ 'authoritative' => true, ], ], 'sort' => 100, ], ], 'secondaryauth' => [ 'MediaWiki\\Auth\\CheckBlocksSecondaryAuthenticationProvider' => [ 'class' => 'MediaWiki\\Auth\\CheckBlocksSecondaryAuthenticationProvider', 'sort' => 0, ], 'MediaWiki\\Auth\\ResetPasswordSecondaryAuthenticationProvider' => [ 'class' => 'MediaWiki\\Auth\\ResetPasswordSecondaryAuthenticationProvider', 'sort' => 100, ], 'MediaWiki\\Auth\\EmailNotificationSecondaryAuthenticationProvider' => [ 'class' => 'MediaWiki\\Auth\\EmailNotificationSecondaryAuthenticationProvider', 'services' => [ 'DBLoadBalancerFactory', ], 'sort' => 200, ], ], ], 'RememberMe' => 'choose', 'ReauthenticateTime' => [ 'default' => 3600, ], 'ChangeCredentialsBlacklist' => [ 'MediaWiki\\Auth\\TemporaryPasswordAuthenticationRequest', ], 'RemoveCredentialsBlacklist' => [ 'MediaWiki\\Auth\\PasswordAuthenticationRequest', ], 'InvalidPasswordReset' => true, 'PasswordDefault' => 'pbkdf2', 'PasswordConfig' => [ 'A' => [ 'class' => 'MediaWiki\\Password\\MWOldPassword', ], 'B' => [ 'class' => 'MediaWiki\\Password\\MWSaltedPassword', ], 'pbkdf2-legacyA' => [ 'class' => 'MediaWiki\\Password\\LayeredParameterizedPassword', 'types' => [ 'A', 'pbkdf2', ], ], 'pbkdf2-legacyB' => [ 'class' => 'MediaWiki\\Password\\LayeredParameterizedPassword', 'types' => [ 'B', 'pbkdf2', ], ], 'bcrypt' => [ 'class' => 'MediaWiki\\Password\\BcryptPassword', 'cost' => 9, ], 'pbkdf2' => [ 'class' => 'MediaWiki\\Password\\Pbkdf2PasswordUsingOpenSSL', 'algo' => 'sha512', 'cost' => '30000', 'length' => '64', ], 'argon2' => [ 'class' => 'MediaWiki\\Password\\Argon2Password', 'algo' => 'auto', ], ], 'PasswordResetRoutes' => [ 'username' => true, 'email' => true, ], 'MaxSigChars' => 255, 'SignatureValidation' => 'warning', 'SignatureAllowedLintErrors' => [ 'obsolete-tag', ], 'MaxNameChars' => 255, 'ReservedUsernames' => [ 'MediaWiki default', 'Conversion script', 'Maintenance script', 'Template namespace initialisation script', 'ScriptImporter', 'Delete page script', 'Move page script', 'Command line script', 'Unknown user', 'msg:double-redirect-fixer', 'msg:usermessage-editor', 'msg:proxyblocker', 'msg:sorbs', 'msg:spambot_username', 'msg:autochange-username', ], 'DefaultUserOptions' => [ 'ccmeonemails' => 0, 'date' => 'default', 'diffonly' => 0, 'diff-type' => 'table', 'disablemail' => 0, 'editfont' => 'monospace', 'editondblclick' => 0, 'editrecovery' => 0, 'editsectiononrightclick' => 0, 'email-allow-new-users' => 1, 'enotifminoredits' => 0, 'enotifrevealaddr' => 0, 'enotifusertalkpages' => 1, 'enotifwatchlistpages' => 1, 'extendwatchlist' => 1, 'fancysig' => 0, 'forceeditsummary' => 0, 'forcesafemode' => 0, 'gender' => 'unknown', 'hidecategorization' => 1, 'hideminor' => 0, 'hidepatrolled' => 0, 'imagesize' => 2, 'minordefault' => 0, 'newpageshidepatrolled' => 0, 'nickname' => '', 'norollbackdiff' => 0, 'prefershttps' => 1, 'previewonfirst' => 0, 'previewontop' => 1, 'pst-cssjs' => 1, 'rcdays' => 7, 'rcenhancedfilters-disable' => 0, 'rclimit' => 50, 'requireemail' => 0, 'search-match-redirect' => true, 'search-special-page' => 'Search', 'search-thumbnail-extra-namespaces' => true, 'searchlimit' => 20, 'showhiddencats' => 0, 'shownumberswatching' => 1, 'showrollbackconfirmation' => 0, 'skin' => false, 'skin-responsive' => 1, 'thumbsize' => 5, 'underline' => 2, 'useeditwarning' => 1, 'uselivepreview' => 0, 'usenewrc' => 1, 'watchcreations' => 1, 'watchcreations-expiry' => 'infinite', 'watchdefault' => 1, 'watchdefault-expiry' => 'infinite', 'watchdeletion' => 0, 'watchlistdays' => 7, 'watchlisthideanons' => 0, 'watchlisthidebots' => 0, 'watchlisthidecategorization' => 1, 'watchlisthideliu' => 0, 'watchlisthideminor' => 0, 'watchlisthideown' => 0, 'watchlisthidepatrolled' => 0, 'watchlistreloadautomatically' => 0, 'watchlistunwatchlinks' => 0, 'watchmoves' => 0, 'watchrollback' => 0, 'watchuploads' => 1, 'watchrollback-expiry' => 'infinite', 'watchstar-expiry' => 'infinite', 'wlenhancedfilters-disable' => 0, 'wllimit' => 250, ], 'ConditionalUserOptions' => [ ], 'HiddenPrefs' => [ ], 'UserJsPrefLimit' => 100, 'InvalidUsernameCharacters' => '@:>=', 'UserrightsInterwikiDelimiter' => '@', 'SecureLogin' => false, 'AuthenticationTokenVersion' => null, 'SessionProviders' => [ 'MediaWiki\\Session\\CookieSessionProvider' => [ 'class' => 'MediaWiki\\Session\\CookieSessionProvider', 'args' => [ [ 'priority' => 30, ], ], 'services' => [ 'JwtCodec', 'UrlUtils', ], ], 'MediaWiki\\Session\\BotPasswordSessionProvider' => [ 'class' => 'MediaWiki\\Session\\BotPasswordSessionProvider', 'args' => [ [ 'priority' => 75, ], ], 'services' => [ 'GrantsInfo', ], ], ], 'AutoCreateTempUser' => [ 'known' => false, 'enabled' => false, 'actions' => [ 'edit', ], 'genPattern' => '~$1', 'matchPattern' => null, 'reservedPattern' => '~$1', 'serialProvider' => [ 'type' => 'local', 'useYear' => true, ], 'serialMapping' => [ 'type' => 'readable-numeric', ], 'expireAfterDays' => 90, 'notifyBeforeExpirationDays' => 10, ], 'AutoblockExemptions' => [ ], 'AutoblockExpiry' => 86400, 'BlockAllowsUTEdit' => true, 'BlockCIDRLimit' => [ 'IPv4' => 16, 'IPv6' => 19, ], 'BlockDisablesLogin' => false, 'EnableMultiBlocks' => false, 'WhitelistRead' => false, 'WhitelistReadRegexp' => false, 'EmailConfirmToEdit' => false, 'HideIdentifiableRedirects' => true, 'GroupPermissions' => [ '*' => [ 'createaccount' => true, 'autocreateaccount' => true, 'read' => true, 'edit' => true, 'createpage' => true, 'createtalk' => true, 'viewmyprivateinfo' => true, 'editmyprivateinfo' => true, 'editmyoptions' => true, ], 'user' => [ 'move' => true, 'move-subpages' => true, 'move-rootuserpages' => true, 'move-categorypages' => true, 'movefile' => true, 'read' => true, 'edit' => true, 'createpage' => true, 'createtalk' => true, 'upload' => true, 'reupload' => true, 'reupload-shared' => true, 'minoredit' => true, 'editmyusercss' => true, 'editmyuserjson' => true, 'editmyuserjs' => true, 'editmyuserjsredirect' => true, 'sendemail' => true, 'applychangetags' => true, 'changetags' => true, 'viewmywatchlist' => true, 'editmywatchlist' => true, 'createwithcontentmodel' => true, 'logout' => true, ], 'autoconfirmed' => [ 'autoconfirmed' => true, 'editsemiprotected' => true, ], 'bot' => [ 'bot' => true, 'autoconfirmed' => true, 'editsemiprotected' => true, 'nominornewtalk' => true, 'autopatrol' => true, 'suppressredirect' => true, 'apihighlimits' => true, ], 'sysop' => [ 'block' => true, 'createaccount' => true, 'createpreviouslyrenamedaccount' => true, 'delete' => true, 'bigdelete' => true, 'deletedhistory' => true, 'deletedtext' => true, 'undelete' => true, 'editcontentmodel' => true, 'editinterface' => true, 'editsitejson' => true, 'edituserjson' => true, 'import' => true, 'importupload' => true, 'move' => true, 'move-subpages' => true, 'move-rootuserpages' => true, 'move-categorypages' => true, 'patrol' => true, 'autopatrol' => true, 'protect' => true, 'editprotected' => true, 'rollback' => true, 'upload' => true, 'reupload' => true, 'reupload-shared' => true, 'unwatchedpages' => true, 'autoconfirmed' => true, 'editsemiprotected' => true, 'ipblock-exempt' => true, 'blockemail' => true, 'markbotedits' => true, 'apihighlimits' => true, 'browsearchive' => true, 'noratelimit' => true, 'movefile' => true, 'unblockself' => true, 'suppressredirect' => true, 'mergehistory' => true, 'managechangetags' => true, 'deletechangetags' => true, ], 'interface-admin' => [ 'editinterface' => true, 'editsitecss' => true, 'editsitejson' => true, 'editsitejs' => true, 'editusercss' => true, 'edituserjson' => true, 'edituserjs' => true, ], 'bureaucrat' => [ 'userrights' => true, 'noratelimit' => true, 'renameuser' => true, ], 'suppress' => [ 'hideuser' => true, 'suppressrevision' => true, 'viewsuppressed' => true, 'suppressionlog' => true, 'deleterevision' => true, 'deletelogentry' => true, ], ], 'PrivilegedGroups' => [ 'bureaucrat', 'interface-admin', 'suppress', 'sysop', ], 'RevokePermissions' => [ ], 'GroupInheritsPermissions' => [ ], 'ImplicitGroups' => [ '*', 'user', 'autoconfirmed', ], 'GroupsAddToSelf' => [ ], 'GroupsRemoveFromSelf' => [ ], 'RestrictedGroups' => [ ], 'UserRequirementsPrivateConditions' => [ ], 'RestrictionTypes' => [ 'create', 'edit', 'move', 'upload', ], 'RestrictionLevels' => [ '', 'autoconfirmed', 'sysop', ], 'CascadingRestrictionLevels' => [ 'sysop', ], 'SemiprotectedRestrictionLevels' => [ 'autoconfirmed', ], 'NamespaceProtection' => [ ], 'RestrictUserPageEditing' => false, 'NonincludableNamespaces' => [ ], 'AutoConfirmAge' => 0, 'AutoConfirmCount' => 0, 'Autopromote' => [ 'autoconfirmed' => [ '&', [ 1, null, ], [ 2, null, ], ], ], 'AutopromoteOnce' => [ 'onEdit' => [ ], ], 'AutopromoteOnceLogInRC' => true, 'AutopromoteOnceRCExcludedGroups' => [ ], 'AddGroups' => [ ], 'RemoveGroups' => [ ], 'AvailableRights' => [ ], 'ImplicitRights' => [ ], 'DeleteRevisionsLimit' => 0, 'DeleteRevisionsBatchSize' => 1000, 'HideUserContribLimit' => 1000, 'AccountCreationThrottle' => [ [ 'count' => 0, 'seconds' => 86400, ], ], 'TempAccountCreationThrottle' => [ [ 'count' => 1, 'seconds' => 600, ], [ 'count' => 6, 'seconds' => 86400, ], ], 'TempAccountNameAcquisitionThrottle' => [ [ 'count' => 60, 'seconds' => 86400, ], ], 'SpamRegex' => [ ], 'SummarySpamRegex' => [ ], 'EnableDnsBlacklist' => false, 'DnsBlacklistUrls' => [ ], 'ProxyList' => [ ], 'ProxyWhitelist' => [ ], 'SoftBlockRanges' => [ ], 'ApplyIpBlocksToXff' => false, 'RateLimits' => [ 'edit' => [ 'ip' => [ 8, 60, ], 'newbie' => [ 8, 60, ], 'user' => [ 90, 60, ], ], 'move' => [ 'newbie' => [ 2, 120, ], 'user' => [ 8, 60, ], ], 'upload' => [ 'ip' => [ 8, 60, ], 'newbie' => [ 8, 60, ], ], 'rollback' => [ 'user' => [ 10, 60, ], 'newbie' => [ 5, 120, ], ], 'mailpassword' => [ 'ip' => [ 5, 3600, ], ], 'sendemail' => [ 'ip' => [ 5, 86400, ], 'newbie' => [ 5, 86400, ], 'user' => [ 20, 86400, ], ], 'changeemail' => [ 'ip-all' => [ 10, 3600, ], 'user' => [ 4, 86400, ], ], 'confirmemail' => [ 'ip-all' => [ 10, 3600, ], 'user' => [ 4, 86400, ], ], 'purge' => [ 'ip' => [ 30, 60, ], 'user' => [ 30, 60, ], ], 'linkpurge' => [ 'ip' => [ 30, 60, ], 'user' => [ 30, 60, ], ], 'renderfile' => [ 'ip' => [ 700, 30, ], 'user' => [ 700, 30, ], ], 'renderfile-nonstandard' => [ 'ip' => [ 70, 30, ], 'user' => [ 70, 30, ], ], 'stashedit' => [ 'ip' => [ 30, 60, ], 'newbie' => [ 30, 60, ], ], 'stashbasehtml' => [ 'ip' => [ 5, 60, ], 'newbie' => [ 5, 60, ], ], 'changetags' => [ 'ip' => [ 8, 60, ], 'newbie' => [ 8, 60, ], ], 'editcontentmodel' => [ 'newbie' => [ 2, 120, ], 'user' => [ 8, 60, ], ], ], 'RateLimitsExcludedIPs' => [ ], 'PutIPinRC' => true, 'QueryPageDefaultLimit' => 50, 'ExternalQuerySources' => [ ], 'PasswordAttemptThrottle' => [ [ 'count' => 5, 'seconds' => 300, ], [ 'count' => 150, 'seconds' => 172800, ], ], 'GrantPermissions' => [ 'basic' => [ 'autocreateaccount' => true, 'autoconfirmed' => true, 'autopatrol' => true, 'editsemiprotected' => true, 'ipblock-exempt' => true, 'nominornewtalk' => true, 'patrolmarks' => true, 'read' => true, 'unwatchedpages' => true, ], 'highvolume' => [ 'bot' => true, 'apihighlimits' => true, 'noratelimit' => true, 'markbotedits' => true, ], 'import' => [ 'import' => true, 'importupload' => true, ], 'editpage' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => true, 'createwithcontentmodel' => true, 'pagelang' => true, ], 'editprotected' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => true, 'createwithcontentmodel' => true, 'editprotected' => true, ], 'editmycssjs' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => true, 'createwithcontentmodel' => true, 'editmyusercss' => true, 'editmyuserjson' => true, 'editmyuserjs' => true, ], 'editmyoptions' => [ 'editmyoptions' => true, 'editmyuserjson' => true, ], 'editinterface' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => true, 'createwithcontentmodel' => true, 'editinterface' => true, 'edituserjson' => true, 'editsitejson' => true, ], 'editsiteconfig' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => true, 'createwithcontentmodel' => true, 'editinterface' => true, 'edituserjson' => true, 'editsitejson' => true, 'editusercss' => true, 'edituserjs' => true, 'editsitecss' => true, 'editsitejs' => true, ], 'createeditmovepage' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => true, 'createwithcontentmodel' => true, 'createpage' => true, 'createtalk' => true, 'delete-redirect' => true, 'move' => true, 'move-rootuserpages' => true, 'move-subpages' => true, 'move-categorypages' => true, 'suppressredirect' => true, ], 'uploadfile' => [ 'upload' => true, 'reupload-own' => true, ], 'uploadeditmovefile' => [ 'upload' => true, 'reupload-own' => true, 'reupload' => true, 'reupload-shared' => true, 'upload_by_url' => true, 'movefile' => true, 'suppressredirect' => true, ], 'patrol' => [ 'patrol' => true, ], 'rollback' => [ 'rollback' => true, ], 'blockusers' => [ 'block' => true, 'blockemail' => true, 'deferredblock' => true, ], 'viewdeleted' => [ 'browsearchive' => true, 'deletedhistory' => true, 'deletedtext' => true, ], 'viewrestrictedlogs' => [ 'suppressionlog' => true, 'deferredblock' => true, ], 'delete' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => true, 'createwithcontentmodel' => true, 'browsearchive' => true, 'deletedhistory' => true, 'deletedtext' => true, 'delete' => true, 'bigdelete' => true, 'deletelogentry' => true, 'deleterevision' => true, 'undelete' => true, ], 'oversight' => [ 'suppressrevision' => true, 'viewsuppressed' => true, ], 'protect' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => true, 'createwithcontentmodel' => true, 'editprotected' => true, 'protect' => true, ], 'viewmywatchlist' => [ 'viewmywatchlist' => true, ], 'editmywatchlist' => [ 'editmywatchlist' => true, ], 'sendemail' => [ 'sendemail' => true, ], 'createaccount' => [ 'createaccount' => true, ], 'privateinfo' => [ 'viewmyprivateinfo' => true, ], 'mergehistory' => [ 'mergehistory' => true, ], 'managesessions' => [ 'logout' => true, ], ], 'GrantPermissionGroups' => [ 'basic' => 'hidden', 'editpage' => 'page-interaction', 'createeditmovepage' => 'page-interaction', 'editprotected' => 'page-interaction', 'patrol' => 'page-interaction', 'uploadfile' => 'file-interaction', 'uploadeditmovefile' => 'file-interaction', 'sendemail' => 'email', 'viewmywatchlist' => 'watchlist-interaction', 'editmywatchlist' => 'watchlist-interaction', 'editmycssjs' => 'customization', 'editmyoptions' => 'customization', 'editinterface' => 'administration', 'editsiteconfig' => 'administration', 'rollback' => 'administration', 'blockusers' => 'administration', 'delete' => 'administration', 'viewdeleted' => 'administration', 'viewrestrictedlogs' => 'administration', 'protect' => 'administration', 'oversight' => 'administration', 'createaccount' => 'administration', 'mergehistory' => 'administration', 'import' => 'administration', 'highvolume' => 'high-volume', 'privateinfo' => 'private-information', 'managesessions' => 'private-information', ], 'GrantRiskGroups' => [ 'basic' => 'low', 'editpage' => 'low', 'createeditmovepage' => 'low', 'editprotected' => 'vandalism', 'patrol' => 'low', 'uploadfile' => 'low', 'uploadeditmovefile' => 'low', 'sendemail' => 'security', 'viewmywatchlist' => 'low', 'editmywatchlist' => 'low', 'editmycssjs' => 'security', 'editmyoptions' => 'security', 'editinterface' => 'vandalism', 'editsiteconfig' => 'security', 'rollback' => 'low', 'blockusers' => 'vandalism', 'delete' => 'vandalism', 'viewdeleted' => 'vandalism', 'viewrestrictedlogs' => 'security', 'protect' => 'vandalism', 'oversight' => 'security', 'createaccount' => 'low', 'mergehistory' => 'vandalism', 'import' => 'security', 'highvolume' => 'low', 'privateinfo' => 'low', 'managesessions' => 'low', ], 'EnableBotPasswords' => true, 'BotPasswordsCluster' => false, 'BotPasswordsDatabase' => false, 'BotPasswordsLimit' => 100, 'SecretKey' => false, 'JwtPrivateKey' => false, 'JwtPublicKey' => false, 'AllowUserJs' => false, 'ReauthenticateForActions' => [ 'edituserjs' => 'edituserjscss', 'editusercss' => 'edituserjscss', 'editsitejs' => 'editsitejscss', 'editsitecss' => 'editsitejscss', ], 'AllowUserCss' => false, 'AllowUserCssPrefs' => true, 'UseSiteJs' => true, 'UseSiteCss' => true, 'BreakFrames' => false, 'EditPageFrameOptions' => 'DENY', 'ApiFrameOptions' => 'DENY', 'CSPHeader' => false, 'CSPReportOnlyHeader' => false, 'CSPUseReportURIDirective' => false, 'CSPFalsePositiveUrls' => [ 'https: 'https: 'https: 'https: 'https: 'https: 'https: 'https: 'https: 'https: 'https: 'https: 'https: 'https: 'chrome-extension' => true, ], 'AllowCrossOrigin' => false, 'RestAllowCrossOriginCookieAuth' => false, 'SessionSecret' => false, 'CookieExpiration' => 2592000, 'ExtendedLoginCookieExpiration' => 15552000, 'SessionCookieJwtExpiration' => 14400, 'CookieDomain' => '', 'CookiePath' => '/', 'CookieSecure' => 'detect', 'CookiePrefix' => false, 'CookieHttpOnly' => true, 'CookieSameSite' => null, 'CacheVaryCookies' => [ ], 'SessionName' => false, 'CookieSetOnAutoblock' => true, 'CookieSetOnIpBlock' => true, 'DeviceBoundSessions' => false, 'DeviceBoundSessionsReportOnly' => true, 'DeviceBoundSessionCookieName' => '__Host-dbsc', 'DeviceBoundSessionCredentialTTL' => 600, 'DeviceBoundSessionChallengeTTL' => 900, 'DeviceBoundSessionBindingTTL' => 2592000, 'DeviceBoundSessionScopeExcludes' => [ ], 'DebugLogFile' => '', 'DebugLogPrefix' => '', 'DebugRedirects' => false, 'DebugRawPage' => false, 'DebugComments' => false, 'DebugDumpSql' => false, 'TrxProfilerLimits' => [ 'GET' => [ 'masterConns' => 0, 'writes' => 0, 'readQueryTime' => 5, 'readQueryRows' => 10000, ], 'POST' => [ 'readQueryTime' => 5, 'writeQueryTime' => 1, 'readQueryRows' => 100000, 'maxAffected' => 1000, ], 'POST-nonwrite' => [ 'writes' => 0, 'readQueryTime' => 5, 'readQueryRows' => 10000, ], 'PostSend-GET' => [ 'readQueryTime' => 5, 'writeQueryTime' => 1, 'readQueryRows' => 10000, 'maxAffected' => 1000, 'masterConns' => 0, 'writes' => 0, ], 'PostSend-POST' => [ 'readQueryTime' => 5, 'writeQueryTime' => 1, 'readQueryRows' => 100000, 'maxAffected' => 1000, ], 'JobRunner' => [ 'readQueryTime' => 30, 'writeQueryTime' => 5, 'readQueryRows' => 100000, 'maxAffected' => 500, ], 'Maintenance' => [ 'writeQueryTime' => 5, 'maxAffected' => 1000, ], ], 'DebugLogGroups' => [ ], 'MWLoggerDefaultSpi' => [ 'class' => 'MediaWiki\\Logger\\LegacySpi', ], 'ShowDebug' => false, 'SpecialVersionShowHooks' => false, 'ShowExceptionDetails' => false, 'LogExceptionBacktrace' => true, 'PropagateErrors' => true, 'ShowHostnames' => false, 'OverrideHostname' => false, 'DevelopmentWarnings' => false, 'DeprecationReleaseLimit' => false, 'Profiler' => [ ], 'StatsTarget' => null, 'StatsFormat' => null, 'StatsPrefix' => 'mediawiki', 'OpenTelemetryConfig' => null, 'PageInfoTransclusionLimit' => 50, 'EnableJavaScriptTest' => false, 'DebugToolbar' => false, 'ApiClientErrorSampleRate' => 1.0, 'DisableTextSearch' => false, 'AdvancedSearchHighlighting' => false, 'SearchHighlightBoundaries' => '[\\p{Z}\\p{P}\\p{C}]', 'OpenSearchTemplates' => [ 'application/x-suggestions+json' => false, 'application/x-suggestions+xml' => false, ], 'OpenSearchDefaultLimit' => 10, 'OpenSearchDescriptionLength' => 100, 'SearchSuggestCacheExpiry' => 1200, 'DisableSearchUpdate' => false, 'NamespacesToBeSearchedDefault' => [ true, ], 'DisableInternalSearch' => false, 'SearchForwardUrl' => null, 'SitemapNamespaces' => false, 'SitemapNamespacesPriorities' => false, 'SitemapApiConfig' => [ ], 'SpecialSearchFormOptions' => [ ], 'SearchMatchRedirectPreference' => false, 'SearchRunSuggestedQuery' => true, 'Diff3' => '/usr/bin/diff3', 'Diff' => '/usr/bin/diff', 'PreviewOnOpenNamespaces' => [ 14 => true, ], 'UniversalEditButton' => true, 'UseAutomaticEditSummaries' => true, 'CommandLineDarkBg' => false, 'ReadOnly' => null, 'ReadOnlyWatchedItemStore' => false, 'ReadOnlyFile' => false, 'UpgradeKey' => false, 'GitBin' => '/usr/bin/git', 'GitRepositoryViewers' => [ 'https: 'ssh: 'https: 'git@github\\.com:(.*?)(\\.git)?' => 'https: ], 'InstallerInitialPages' => [ [ 'titlemsg' => 'mainpage', 'text' => '{{subst:int:mainpagetext}}{{subst:int:mainpagedocfooter}}', ], ], 'RCMaxAge' => 7776000, 'WatchersMaxAge' => 15552000, 'UnwatchedPageSecret' => 1, 'RCFilterByAge' => false, 'RCLinkLimits' => [ 50, 100, 250, 500, ], 'RCLinkDays' => [ 1, 3, 7, 14, 30, ], 'RCFeeds' => [ ], 'RCWatchCategoryMembership' => false, 'UseRCPatrol' => true, 'StructuredChangeFiltersLiveUpdatePollingRate' => 3, 'UseNPPatrol' => true, 'UseFilePatrol' => true, 'Feed' => true, 'FeedLimit' => 50, 'FeedCacheTimeout' => 60, 'FeedDiffCutoff' => 32768, 'OverrideSiteFeed' => [ ], 'FeedClasses' => [ 'rss' => 'MediaWiki\\Feed\\RSSFeed', 'atom' => 'MediaWiki\\Feed\\AtomFeed', ], 'AdvertisedFeedTypes' => [ 'atom', ], 'RCShowWatchingUsers' => false, 'RCShowChangedSize' => true, 'RCChangedSizeThreshold' => 500, 'ShowUpdatedMarker' => true, 'DisableAnonTalk' => false, 'UseTagFilter' => true, 'SoftwareTags' => [ 'mw-contentmodelchange' => true, 'mw-new-redirect' => true, 'mw-removed-redirect' => true, 'mw-changed-redirect-target' => true, 'mw-blank' => true, 'mw-replace' => true, 'mw-recreated' => true, 'mw-rollback' => true, 'mw-undo' => true, 'mw-manual-revert' => true, 'mw-reverted' => true, 'mw-server-side-upload' => true, 'mw-ipblock-appeal' => true, 'mw-edited-other-users-js' => true, 'mw-edited-other-users-css' => true, ], 'RestrictedTagViewRights' => [ ], 'UnwatchedPageThreshold' => false, 'RecentChangesFlags' => [ 'newpage' => [ 'letter' => 'newpageletter', 'title' => 'recentchanges-label-newpage', 'legend' => 'recentchanges-legend-newpage', 'grouping' => 'any', ], 'minor' => [ 'letter' => 'minoreditletter', 'title' => 'recentchanges-label-minor', 'legend' => 'recentchanges-legend-minor', 'class' => 'minoredit', 'grouping' => 'all', ], 'bot' => [ 'letter' => 'boteditletter', 'title' => 'recentchanges-label-bot', 'legend' => 'recentchanges-legend-bot', 'class' => 'botedit', 'grouping' => 'all', ], 'unpatrolled' => [ 'letter' => 'unpatrolledletter', 'title' => 'recentchanges-label-unpatrolled', 'legend' => 'recentchanges-legend-unpatrolled', 'grouping' => 'any', ], ], 'WatchlistExpiry' => false, 'EnableWatchstarPopover' => false, 'EnableWatchlistLabels' => false, 'WatchlistLabelsMaxPerUser' => 100, 'WatchlistPurgeRate' => 0.1, 'WatchlistExpiryMaxDuration' => '1 year', 'EnableChangesListQueryPartitioning' => false, 'RightsPage' => null, 'RightsUrl' => null, 'RightsText' => null, 'RightsIcon' => null, 'UseCopyrightUpload' => false, 'MaxCredits' => 0, 'ShowCreditsIfMax' => true, 'ImportSources' => [ ], 'ImportTargetNamespace' => null, 'ExportAllowHistory' => true, 'ExportMaxHistory' => 0, 'ExportAllowListContributors' => false, 'ExportMaxLinkDepth' => 0, 'ExportFromNamespaces' => false, 'ExportAllowAll' => false, 'ExportPagelistLimit' => 5000, 'XmlDumpSchemaVersion' => '0.11', 'WikiFarmSettingsDirectory' => null, 'WikiFarmSettingsExtension' => 'yaml', 'ExtensionFunctions' => [ ], 'ExtensionMessagesFiles' => [ ], 'MessagesDirs' => [ ], 'TranslationAliasesDirs' => [ ], 'ExtensionEntryPointListFiles' => [ ], 'EnableParserLimitReporting' => true, 'ValidSkinNames' => [ ], 'SpecialPages' => [ ], 'ExtensionCredits' => [ ], 'Hooks' => [ ], 'ServiceWiringFiles' => [ ], 'JobClasses' => [ 'deletePage' => 'MediaWiki\\Page\\DeletePageJob', 'refreshLinks' => 'MediaWiki\\JobQueue\\Jobs\\RefreshLinksJob', 'deleteLinks' => 'MediaWiki\\Page\\DeleteLinksJob', 'htmlCacheUpdate' => 'MediaWiki\\JobQueue\\Jobs\\HTMLCacheUpdateJob', 'sendMail' => [ 'class' => 'MediaWiki\\Mail\\EmaillingJob', 'services' => [ 'Emailer', ], ], 'enotifNotify' => [ 'class' => 'MediaWiki\\RecentChanges\\RecentChangeNotifyJob', 'services' => [ 'RecentChangeLookup', ], ], 'fixDoubleRedirect' => [ 'class' => 'MediaWiki\\JobQueue\\Jobs\\DoubleRedirectJob', 'services' => [ 'RevisionLookup', 'MagicWordFactory', 'WikiPageFactory', ], 'needsPage' => true, ], 'AssembleUploadChunks' => 'MediaWiki\\JobQueue\\Jobs\\AssembleUploadChunksJob', 'PublishStashedFile' => 'MediaWiki\\JobQueue\\Jobs\\PublishStashedFileJob', 'ThumbnailRender' => 'MediaWiki\\JobQueue\\Jobs\\ThumbnailRenderJob', 'UploadFromUrl' => 'MediaWiki\\JobQueue\\Jobs\\UploadFromUrlJob', 'recentChangesUpdate' => 'MediaWiki\\RecentChanges\\RecentChangesUpdateJob', 'refreshLinksPrioritized' => 'MediaWiki\\JobQueue\\Jobs\\RefreshLinksJob', 'refreshLinksDynamic' => 'MediaWiki\\JobQueue\\Jobs\\RefreshLinksJob', 'activityUpdateJob' => 'MediaWiki\\Watchlist\\ActivityUpdateJob', 'categoryMembershipChange' => [ 'class' => 'MediaWiki\\RecentChanges\\CategoryMembershipChangeJob', 'services' => [ 'RecentChangeFactory', ], ], 'CategoryCountUpdateJob' => [ 'class' => 'MediaWiki\\JobQueue\\Jobs\\CategoryCountUpdateJob', 'services' => [ 'ConnectionProvider', 'NamespaceInfo', ], ], 'clearUserWatchlist' => 'MediaWiki\\Watchlist\\ClearUserWatchlistJob', 'watchlistExpiry' => [ 'class' => 'MediaWiki\\Watchlist\\WatchlistExpiryJob', 'needsPage' => false, ], 'cdnPurge' => 'MediaWiki\\JobQueue\\Jobs\\CdnPurgeJob', 'userGroupExpiry' => 'MediaWiki\\User\\UserGroupExpiryJob', 'clearWatchlistNotifications' => 'MediaWiki\\Watchlist\\ClearWatchlistNotificationsJob', 'userOptionsUpdate' => 'MediaWiki\\User\\Options\\UserOptionsUpdateJob', 'revertedTagUpdate' => 'MediaWiki\\JobQueue\\Jobs\\RevertedTagUpdateJob', 'null' => 'MediaWiki\\JobQueue\\Jobs\\NullJob', 'userEditCountInit' => 'MediaWiki\\User\\UserEditCountInitJob', 'renameUserTable' => [ 'class' => 'MediaWiki\\RenameUser\\Job\\RenameUserTableJob', 'services' => [ 'MainConfig', 'DBLoadBalancerFactory', ], ], 'renameUserDerived' => [ 'class' => 'MediaWiki\\RenameUser\\Job\\RenameUserDerivedJob', 'services' => [ 'RenameUserFactory', 'UserFactory', ], ], 'renameUser' => [ 'class' => 'MediaWiki\\RenameUser\\Job\\RenameUserTableJob', 'services' => [ 'MainConfig', 'DBLoadBalancerFactory', ], ], ], 'JobTypesExcludedFromDefaultQueue' => [ 'AssembleUploadChunks', 'PublishStashedFile', 'UploadFromUrl', ], 'JobBackoffThrottling' => [ ], 'JobTypeConf' => [ 'default' => [ 'class' => 'MediaWiki\\JobQueue\\JobQueueDB', 'order' => 'random', 'claimTTL' => 3600, ], ], 'JobQueueIncludeInMaxLagFactor' => false, 'SpecialPageCacheUpdates' => [ 'Statistics' => [ 'MediaWiki\\Deferred\\SiteStatsUpdate', 'cacheUpdate', ], ], 'PagePropLinkInvalidations' => [ 'hiddencat' => 'categorylinks', ], 'CategoryMagicGallery' => true, 'CategoryPagingLimit' => 200, 'CategoryCollation' => 'uppercase', 'TempCategoryCollations' => [ ], 'SortedCategories' => false, 'TrackingCategories' => [ ], 'LogTypes' => [ '', 'block', 'deferredblock', 'protect', 'rights', 'delete', 'upload', 'move', 'import', 'interwiki', 'patrol', 'merge', 'suppress', 'tag', 'managetags', 'contentmodel', 'renameuser', ], 'LogRestrictions' => [ 'suppress' => 'suppressionlog', 'deferredblock' => 'deferredblock', ], 'FilterLogTypes' => [ 'patrol' => true, 'tag' => true, 'newusers' => false, ], 'LogNames' => [ '' => 'all-logs-page', 'block' => 'blocklogpage', 'protect' => 'protectlogpage', 'rights' => 'rightslog', 'delete' => 'dellogpage', 'upload' => 'uploadlogpage', 'move' => 'movelogpage', 'import' => 'importlogpage', 'patrol' => 'patrol-log-page', 'merge' => 'mergelog', 'suppress' => 'suppressionlog', ], 'LogHeaders' => [ '' => 'alllogstext', 'block' => 'blocklogtext', 'delete' => 'dellogpagetext', 'import' => 'importlogpagetext', 'merge' => 'mergelogpagetext', 'move' => 'movelogpagetext', 'patrol' => 'patrol-log-header', 'protect' => 'protectlogtext', 'rights' => 'rightslogtext', 'suppress' => 'suppressionlogtext', 'upload' => 'uploadlogpagetext', ], 'LogActions' => [ ], 'LogActionsHandlers' => [ 'block/block' => [ 'class' => 'MediaWiki\\Logging\\BlockLogFormatter', 'services' => [ 'TitleParser', 'NamespaceInfo', ], ], 'block/reblock' => [ 'class' => 'MediaWiki\\Logging\\BlockLogFormatter', 'services' => [ 'TitleParser', 'NamespaceInfo', ], ], 'block/unblock' => [ 'class' => 'MediaWiki\\Logging\\BlockLogFormatter', 'services' => [ 'TitleParser', 'NamespaceInfo', ], ], 'contentmodel/change' => 'MediaWiki\\Logging\\ContentModelLogFormatter', 'contentmodel/new' => 'MediaWiki\\Logging\\ContentModelLogFormatter', 'deferredblock/block' => [ 'class' => 'MediaWiki\\Logging\\BlockLogFormatter', 'services' => [ 'TitleParser', 'NamespaceInfo', ], ], 'deferredblock/reblock' => [ 'class' => 'MediaWiki\\Logging\\BlockLogFormatter', 'services' => [ 'TitleParser', 'NamespaceInfo', ], ], 'deferredblock/unblock' => [ 'class' => 'MediaWiki\\Logging\\BlockLogFormatter', 'services' => [ 'TitleParser', 'NamespaceInfo', ], ], 'delete/delete' => 'MediaWiki\\Logging\\DeleteLogFormatter', 'delete/delete_redir' => 'MediaWiki\\Logging\\DeleteLogFormatter', 'delete/delete_redir2' => 'MediaWiki\\Logging\\DeleteLogFormatter', 'delete/event' => 'MediaWiki\\Logging\\DeleteLogFormatter', 'delete/restore' => 'MediaWiki\\Logging\\DeleteLogFormatter', 'delete/revision' => 'MediaWiki\\Logging\\DeleteLogFormatter', 'import/interwiki' => 'MediaWiki\\Logging\\ImportLogFormatter', 'import/upload' => 'MediaWiki\\Logging\\ImportLogFormatter', 'interwiki/iw_add' => 'MediaWiki\\Logging\\InterwikiLogFormatter', 'interwiki/iw_delete' => 'MediaWiki\\Logging\\InterwikiLogFormatter', 'interwiki/iw_edit' => 'MediaWiki\\Logging\\InterwikiLogFormatter', 'managetags/activate' => 'MediaWiki\\Logging\\LogFormatter', 'managetags/create' => 'MediaWiki\\Logging\\LogFormatter', 'managetags/deactivate' => 'MediaWiki\\Logging\\LogFormatter', 'managetags/delete' => 'MediaWiki\\Logging\\LogFormatter', 'merge/merge' => [ 'class' => 'MediaWiki\\Logging\\MergeLogFormatter', 'services' => [ 'TitleParser', ], ], 'merge/merge-into' => [ 'class' => 'MediaWiki\\Logging\\MergeLogFormatter', 'services' => [ 'TitleParser', ], ], 'move/move' => [ 'class' => 'MediaWiki\\Logging\\MoveLogFormatter', 'services' => [ 'TitleParser', ], ], 'move/move_redir' => [ 'class' => 'MediaWiki\\Logging\\MoveLogFormatter', 'services' => [ 'TitleParser', ], ], 'patrol/patrol' => 'MediaWiki\\Logging\\PatrolLogFormatter', 'patrol/autopatrol' => 'MediaWiki\\Logging\\PatrolLogFormatter', 'protect/modify' => [ 'class' => 'MediaWiki\\Logging\\ProtectLogFormatter', 'services' => [ 'TitleParser', ], ], 'protect/move_prot' => [ 'class' => 'MediaWiki\\Logging\\ProtectLogFormatter', 'services' => [ 'TitleParser', ], ], 'protect/protect' => [ 'class' => 'MediaWiki\\Logging\\ProtectLogFormatter', 'services' => [ 'TitleParser', ], ], 'protect/unprotect' => [ 'class' => 'MediaWiki\\Logging\\ProtectLogFormatter', 'services' => [ 'TitleParser', ], ], 'renameuser/renameuser' => [ 'class' => 'MediaWiki\\Logging\\RenameuserLogFormatter', 'services' => [ 'TitleParser', ], ], 'rights/autopromote' => 'MediaWiki\\Logging\\RightsLogFormatter', 'rights/rights' => 'MediaWiki\\Logging\\RightsLogFormatter', 'suppress/block' => [ 'class' => 'MediaWiki\\Logging\\BlockLogFormatter', 'services' => [ 'TitleParser', 'NamespaceInfo', ], ], 'suppress/delete' => 'MediaWiki\\Logging\\DeleteLogFormatter', 'suppress/event' => 'MediaWiki\\Logging\\DeleteLogFormatter', 'suppress/reblock' => [ 'class' => 'MediaWiki\\Logging\\BlockLogFormatter', 'services' => [ 'TitleParser', 'NamespaceInfo', ], ], 'suppress/revision' => 'MediaWiki\\Logging\\DeleteLogFormatter', 'suppress/unblock' => [ 'class' => 'MediaWiki\\Logging\\BlockLogFormatter', 'services' => [ 'TitleParser', 'NamespaceInfo', ], ], 'tag/update' => 'MediaWiki\\Logging\\TagLogFormatter', 'upload/overwrite' => 'MediaWiki\\Logging\\UploadLogFormatter', 'upload/revert' => 'MediaWiki\\Logging\\UploadLogFormatter', 'upload/upload' => 'MediaWiki\\Logging\\UploadLogFormatter', ], 'ActionFilteredLogs' => [ 'block' => [ 'block' => [ 'block', ], 'reblock' => [ 'reblock', ], 'unblock' => [ 'unblock', ], ], 'contentmodel' => [ 'change' => [ 'change', ], 'new' => [ 'new', ], ], 'deferredblock' => [ 'block' => [ 'block', ], 'reblock' => [ 'reblock', ], 'unblock' => [ 'unblock', ], ], 'delete' => [ 'delete' => [ 'delete', ], 'delete_redir' => [ 'delete_redir', 'delete_redir2', ], 'restore' => [ 'restore', ], 'event' => [ 'event', ], 'revision' => [ 'revision', ], ], 'import' => [ 'interwiki' => [ 'interwiki', ], 'upload' => [ 'upload', ], ], 'managetags' => [ 'create' => [ 'create', ], 'delete' => [ 'delete', ], 'activate' => [ 'activate', ], 'deactivate' => [ 'deactivate', ], ], 'move' => [ 'move' => [ 'move', ], 'move_redir' => [ 'move_redir', ], ], 'newusers' => [ 'create' => [ 'create', 'newusers', ], 'create2' => [ 'create2', ], 'autocreate' => [ 'autocreate', ], 'byemail' => [ 'byemail', ], ], 'protect' => [ 'protect' => [ 'protect', ], 'modify' => [ 'modify', ], 'unprotect' => [ 'unprotect', ], 'move_prot' => [ 'move_prot', ], ], 'rights' => [ 'rights' => [ 'rights', ], 'autopromote' => [ 'autopromote', ], ], 'suppress' => [ 'event' => [ 'event', ], 'revision' => [ 'revision', ], 'delete' => [ 'delete', ], 'block' => [ 'block', ], 'reblock' => [ 'reblock', ], 'unblock' => [ 'unblock', ], ], 'upload' => [ 'upload' => [ 'upload', ], 'overwrite' => [ 'overwrite', ], 'revert' => [ 'revert', ], ], ], 'NewUserLog' => true, 'WatchUserPageOnAccountCreation' => true, 'PageCreationLog' => true, 'AllowSpecialInclusion' => true, 'DisableQueryPageUpdate' => false, 'CountCategorizedImagesAsUsed' => false, 'MaxRedirectLinksRetrieved' => 500, 'RangeContributionsCIDRLimit' => [ 'IPv4' => 16, 'IPv6' => 32, ], 'Actions' => [ ], 'DefaultRobotPolicy' => 'index,follow', 'NamespaceRobotPolicies' => [ ], 'ArticleRobotPolicies' => [ ], 'ExemptFromUserRobotsControl' => null, 'DebugAPI' => false, 'APIModules' => [ ], 'APIFormatModules' => [ ], 'APIMetaModules' => [ ], 'APIPropModules' => [ ], 'APIListModules' => [ ], 'APIMaxDBRows' => 5000, 'APIMaxResultSize' => 8388608, 'APIMaxUncachedDiffs' => 1, 'APIMaxLagThreshold' => 7, 'APICacheHelpTimeout' => 3600, 'APIUselessQueryPages' => [ 'MIMEsearch', 'LinkSearch', ], 'AjaxLicensePreview' => true, 'CrossSiteAJAXdomains' => [ ], 'CrossSiteAJAXdomainExceptions' => [ ], 'AllowedCorsHeaders' => [ 'Accept', 'Accept-Language', 'Content-Language', 'Content-Type', 'Accept-Encoding', 'DNT', 'Origin', 'User-Agent', 'Api-User-Agent', 'Promise-Non-Write-API-Action', 'Access-Control-Max-Age', 'Authorization', ], 'RestAPIAdditionalRouteFiles' => [ ], 'RestLocalModuleTestBaseUrl' => null, 'RestModuleOverrides' => [ ], 'RestExternalModules' => [ ], 'RestTermsOfServiceUrl' => null, 'MaxShellMemory' => 307200, 'MaxShellFileSize' => 102400, 'MaxShellTime' => 180, 'MaxShellWallClockTime' => 180, 'ShellCgroup' => false, 'PhpCli' => '/usr/bin/php', 'ShellRestrictionMethod' => 'autodetect', 'ShellboxUrls' => [ 'default' => null, ], 'ShellboxSecretKey' => null, 'ShellboxShell' => '/bin/sh', 'HTTPTimeout' => 25, 'HTTPConnectTimeout' => 5.0, 'HTTPMaxTimeout' => 0, 'HTTPMaxConnectTimeout' => 0, 'HTTPImportTimeout' => 25, 'HTTPUserAgentContact' => false, 'AsyncHTTPTimeout' => 25, 'HTTPProxy' => '', 'LocalVirtualHosts' => [ ], 'LocalHTTPProxy' => false, 'AllowExternalReqID' => false, 'GenerateReqIDFormat' => 'rand24', 'JobRunRate' => 1, 'RunJobsAsync' => false, 'UpdateRowsPerJob' => 300, 'UpdateRowsPerQuery' => 100, 'RedirectOnLogin' => null, 'EventRelayerConfig' => [ 'default' => [ 'class' => 'Wikimedia\\EventRelayer\\EventRelayerNull', ], ], 'Pingback' => false, 'OriginTrials' => [ ], 'ReportToExpiry' => 86400, 'ReportToEndpoints' => [ ], 'FeaturePolicyReportOnly' => [ ], 'SkinsPreferred' => [ 'vector-2022', 'vector', ], 'SpecialContributeSkinsEnabled' => [ ], 'SpecialContributeNewPageTarget' => null, 'EnableEditRecovery' => false, 'EditRecoveryExpiry' => 2592000, 'UseCodexSpecialBlock' => false, 'ShowLogoutConfirmation' => false, 'EnableProtectionIndicators' => true, 'OutputPipelineStages' => [ ], 'FeatureShutdown' => [ ], 'UseLeximorph' => false, 'UsePostprocCacheLegacy' => false, 'UsePostprocCacheParsoid' => true, 'ParserOptionsLogUnsafeSampleRate' => 0, 'ReturnExperimentalPFragmentTypes' => [ ], 'UseParsoidLinksUpdate' => null, 'UseParsoidMessages' => false, 'UseParsoidParser' => true, 'SiteLookup' => [ ], ], 'type' => [ 'ConfigRegistry' => 'object', 'AssumeProxiesUseDefaultProtocolPorts' => 'boolean', 'ForceHTTPS' => 'boolean', 'ExtensionDirectory' => [ 'string', 'null', ], 'StyleDirectory' => [ 'string', 'null', ], 'UploadDirectory' => [ 'string', 'boolean', 'null', ], 'Logos' => [ 'object', 'boolean', ], 'ReferrerPolicy' => [ 'array', 'string', 'boolean', ], 'ActionPaths' => 'object', 'MainPageIsDomainRoot' => 'boolean', 'ImgAuthUrlPathMap' => 'object', 'LocalFileRepo' => 'object', 'ForeignFileRepos' => 'array', 'UseSharedUploads' => 'boolean', 'SharedUploadDirectory' => [ 'string', 'null', ], 'SharedUploadPath' => [ 'string', 'null', ], 'HashedSharedUploadDirectory' => 'boolean', 'FetchCommonsDescriptions' => 'boolean', 'SharedUploadDBname' => [ 'boolean', 'string', ], 'SharedUploadDBprefix' => 'string', 'SharedUploadDBschema' => [ 'string', 'null', ], 'CacheSharedUploads' => 'boolean', 'ForeignUploadTargets' => 'array', 'UploadDialog' => 'object', 'FileBackends' => 'object', 'LockManagers' => 'array', 'DefaultLockManager' => [ 'string', 'null', ], 'CopyUploadsDomains' => 'array', 'CopyUploadTimeout' => [ 'boolean', 'integer', ], 'SharedThumbnailScriptPath' => [ 'string', 'boolean', ], 'HashedUploadDirectory' => 'boolean', 'CSPUploadEntryPoint' => 'boolean', 'FileExtensions' => 'array', 'ProhibitedFileExtensions' => 'array', 'MimeTypeExclusions' => 'array', 'TrustedMediaFormats' => 'array', 'MediaHandlers' => 'object', 'NativeImageLazyLoading' => 'boolean', 'ParserTestMediaHandlers' => 'object', 'MaxInterlacingAreas' => 'object', 'SVGConverters' => 'object', 'SVGNativeRendering' => [ 'string', 'boolean', ], 'MaxImageArea' => [ 'string', 'integer', 'boolean', ], 'TiffThumbnailType' => 'array', 'GenerateThumbnailOnParse' => 'boolean', 'EnableAutoRotation' => [ 'boolean', 'null', ], 'Antivirus' => [ 'string', 'null', ], 'AntivirusSetup' => 'object', 'MimeDetectorCommand' => [ 'string', 'null', ], 'XMLMimeTypes' => 'object', 'ImageLimits' => 'array', 'ThumbLimits' => 'array', 'ThumbnailNamespaces' => 'array', 'ThumbnailSteps' => [ 'array', 'null', ], 'ThumbnailBuckets' => [ 'array', 'null', ], 'UploadThumbnailRenderMap' => 'object', 'GalleryOptions' => 'object', 'DjvuDump' => [ 'string', 'null', ], 'DjvuRenderer' => [ 'string', 'null', ], 'DjvuTxt' => [ 'string', 'null', ], 'DjvuPostProcessor' => [ 'string', 'null', ], 'SMTP' => [ 'boolean', 'object', ], 'EnotifFromEditor' => 'boolean', 'EmailConfirmationBanner' => 'boolean', 'EnotifRevealEditorAddress' => 'boolean', 'UsersNotifiedOnAllChanges' => 'object', 'DBmwschema' => [ 'string', 'null', ], 'SharedTables' => 'array', 'DBservers' => [ 'boolean', 'array', ], 'LBFactoryConf' => 'object', 'LocalDatabases' => 'array', 'VirtualDomainsMapping' => 'object', 'RemoteVirtualDomainsMapping' => 'object', 'FileSchemaMigrationStage' => 'integer', 'ExternalLinksDomainGaps' => 'object', 'ContentHandlers' => 'object', 'NamespaceContentModels' => 'object', 'TextModelsToParse' => 'array', 'ExternalStores' => 'array', 'ExternalServers' => 'object', 'DefaultExternalStore' => [ 'array', 'boolean', ], 'RevisionCacheExpiry' => 'integer', 'PageLanguageUseDB' => 'boolean', 'DiffEngine' => [ 'string', 'null', ], 'ExternalDiffEngine' => [ 'string', 'boolean', ], 'Wikidiff2Options' => 'object', 'RequestTimeLimit' => [ 'integer', 'null', ], 'CriticalSectionTimeLimit' => 'number', 'PoolCounterConf' => [ 'object', 'null', ], 'PoolCountClientConf' => 'object', 'MaxUserDBWriteDuration' => [ 'integer', 'boolean', ], 'MaxJobDBWriteDuration' => [ 'integer', 'boolean', ], 'MultiShardSiteStats' => 'boolean', 'ObjectCaches' => 'object', 'WANObjectCache' => 'object', 'MicroStashType' => [ 'string', 'integer', ], 'ParsoidCacheConfig' => 'object', 'ParsoidSelectiveUpdateSampleRate' => 'integer', 'SplitParsoidParserCache' => 'boolean', 'ParserCacheFilterConfig' => 'object', 'ChronologyProtectorSecret' => 'string', 'SuspiciousIpExpiry' => [ 'integer', 'boolean', ], 'MemCachedServers' => 'array', 'LocalisationCacheConf' => 'object', 'ExtensionInfoMTime' => [ 'integer', 'boolean', ], 'CdnServers' => 'object', 'CdnServersNoPurge' => 'object', 'HTCPRouting' => 'object', 'GrammarForms' => 'object', 'ExtraInterlanguageLinkPrefixes' => 'array', 'InterlanguageLinkCodeMap' => 'object', 'ExtraLanguageNames' => 'object', 'ExtraLanguageCodes' => 'object', 'DummyLanguageCodes' => 'object', 'DisabledVariants' => 'object', 'ForceUIMsgAsContentMsg' => 'object', 'RawHtmlMessages' => 'array', 'OverrideUcfirstCharacters' => 'object', 'XhtmlNamespaces' => 'object', 'BrowserFormatDetection' => 'string', 'SkinMetaTags' => 'object', 'SkipSkins' => 'object', 'FragmentMode' => 'array', 'FooterIcons' => 'object', 'PageShareSkinsEnabled' => 'array', 'InterwikiLogoOverride' => 'array', 'ResourceModules' => 'object', 'ResourceModuleSkinStyles' => 'object', 'ResourceLoaderSources' => 'object', 'ResourceLoaderMaxage' => 'object', 'ResourceLoaderMaxQueryLength' => [ 'integer', 'boolean', ], 'CanonicalNamespaceNames' => 'object', 'ExtraNamespaces' => 'object', 'ExtraGenderNamespaces' => 'object', 'NamespaceAliases' => 'object', 'CapitalLinkOverrides' => 'object', 'NamespacesWithSubpages' => 'object', 'NamespacesWithoutAutoSummaries' => 'array', 'ContentNamespaces' => 'array', 'ShortPagesNamespaceExclusions' => 'array', 'ExtraSignatureNamespaces' => 'array', 'InvalidRedirectTargets' => 'array', 'LocalInterwikis' => 'array', 'InterwikiCache' => [ 'boolean', 'object', ], 'SiteTypes' => 'object', 'UrlProtocols' => 'array', 'TidyConfig' => 'object', 'ParsoidSettings' => 'object', 'ParsoidExperimentalParserFunctionOutput' => 'boolean', 'NoFollowNsExceptions' => 'array', 'NoFollowDomainExceptions' => 'array', 'ExternalLinksIgnoreDomains' => 'array', 'EnableMagicLinks' => 'object', 'ManualRevertSearchRadius' => 'integer', 'RevertedTagMaxDepth' => 'integer', 'CentralIdLookupProviders' => 'object', 'CentralIdLookupProvider' => 'string', 'UserRegistrationProviders' => 'object', 'PasswordPolicy' => 'object', 'AuthManagerConfig' => [ 'object', 'null', ], 'AuthManagerAutoConfig' => 'object', 'RememberMe' => 'string', 'ReauthenticateTime' => 'object', 'ChangeCredentialsBlacklist' => 'array', 'RemoveCredentialsBlacklist' => 'array', 'PasswordConfig' => 'object', 'PasswordResetRoutes' => 'object', 'SignatureAllowedLintErrors' => 'array', 'ReservedUsernames' => 'array', 'DefaultUserOptions' => 'object', 'ConditionalUserOptions' => 'object', 'HiddenPrefs' => 'array', 'UserJsPrefLimit' => 'integer', 'AuthenticationTokenVersion' => [ 'string', 'null', ], 'SessionProviders' => 'object', 'AutoCreateTempUser' => 'object', 'AutoblockExemptions' => 'array', 'BlockCIDRLimit' => 'object', 'EnableMultiBlocks' => 'boolean', 'GroupPermissions' => 'object', 'PrivilegedGroups' => 'array', 'RevokePermissions' => 'object', 'GroupInheritsPermissions' => 'object', 'ImplicitGroups' => 'array', 'GroupsAddToSelf' => 'object', 'GroupsRemoveFromSelf' => 'object', 'RestrictedGroups' => 'object', 'UserRequirementsPrivateConditions' => 'array', 'RestrictionTypes' => 'array', 'RestrictionLevels' => 'array', 'CascadingRestrictionLevels' => 'array', 'SemiprotectedRestrictionLevels' => 'array', 'NamespaceProtection' => 'object', 'RestrictUserPageEditing' => 'boolean', 'NonincludableNamespaces' => 'object', 'Autopromote' => 'object', 'AutopromoteOnce' => 'object', 'AutopromoteOnceRCExcludedGroups' => 'array', 'AddGroups' => 'object', 'RemoveGroups' => 'object', 'AvailableRights' => 'array', 'ImplicitRights' => 'array', 'AccountCreationThrottle' => [ 'integer', 'array', ], 'TempAccountCreationThrottle' => 'array', 'TempAccountNameAcquisitionThrottle' => 'array', 'SpamRegex' => 'array', 'SummarySpamRegex' => 'array', 'DnsBlacklistUrls' => 'array', 'ProxyList' => [ 'string', 'array', ], 'ProxyWhitelist' => 'array', 'SoftBlockRanges' => 'array', 'RateLimits' => 'object', 'RateLimitsExcludedIPs' => 'array', 'ExternalQuerySources' => 'object', 'PasswordAttemptThrottle' => 'array', 'GrantPermissions' => 'object', 'GrantPermissionGroups' => 'object', 'GrantRiskGroups' => 'object', 'EnableBotPasswords' => 'boolean', 'BotPasswordsCluster' => [ 'string', 'boolean', ], 'BotPasswordsDatabase' => [ 'string', 'boolean', ], 'BotPasswordsLimit' => 'integer', 'ReauthenticateForActions' => 'object', 'CSPHeader' => [ 'boolean', 'object', ], 'CSPReportOnlyHeader' => [ 'boolean', 'object', ], 'CSPUseReportURIDirective' => [ 'boolean', 'object', ], 'CSPFalsePositiveUrls' => 'object', 'AllowCrossOrigin' => 'boolean', 'RestAllowCrossOriginCookieAuth' => 'boolean', 'CookieSameSite' => [ 'string', 'null', ], 'CacheVaryCookies' => 'array', 'DeviceBoundSessions' => 'boolean', 'DeviceBoundSessionsReportOnly' => 'boolean', 'DeviceBoundSessionCookieName' => 'string', 'DeviceBoundSessionCredentialTTL' => 'integer', 'DeviceBoundSessionChallengeTTL' => 'integer', 'DeviceBoundSessionBindingTTL' => 'integer', 'DeviceBoundSessionScopeExcludes' => 'array', 'TrxProfilerLimits' => 'object', 'DebugLogGroups' => 'object', 'MWLoggerDefaultSpi' => 'object', 'Profiler' => 'object', 'StatsTarget' => [ 'string', 'null', ], 'StatsFormat' => [ 'string', 'null', ], 'StatsPrefix' => 'string', 'OpenTelemetryConfig' => [ 'object', 'null', ], 'OpenSearchTemplates' => 'object', 'NamespacesToBeSearchedDefault' => 'object', 'SitemapNamespaces' => [ 'boolean', 'array', ], 'SitemapNamespacesPriorities' => [ 'boolean', 'object', ], 'SitemapApiConfig' => 'object', 'SpecialSearchFormOptions' => 'object', 'SearchMatchRedirectPreference' => 'boolean', 'SearchRunSuggestedQuery' => 'boolean', 'PreviewOnOpenNamespaces' => 'object', 'ReadOnlyWatchedItemStore' => 'boolean', 'GitRepositoryViewers' => 'object', 'InstallerInitialPages' => 'array', 'RCLinkLimits' => 'array', 'RCLinkDays' => 'array', 'RCFeeds' => 'object', 'OverrideSiteFeed' => 'object', 'FeedClasses' => 'object', 'AdvertisedFeedTypes' => 'array', 'SoftwareTags' => 'object', 'RestrictedTagViewRights' => 'object', 'RecentChangesFlags' => 'object', 'WatchlistExpiry' => 'boolean', 'EnableWatchstarPopover' => 'boolean', 'EnableWatchlistLabels' => 'boolean', 'WatchlistLabelsMaxPerUser' => 'integer', 'WatchlistPurgeRate' => 'number', 'WatchlistExpiryMaxDuration' => [ 'string', 'null', ], 'EnableChangesListQueryPartitioning' => 'boolean', 'ImportSources' => 'object', 'ExtensionFunctions' => 'array', 'ExtensionMessagesFiles' => 'object', 'MessagesDirs' => 'object', 'TranslationAliasesDirs' => 'object', 'ExtensionEntryPointListFiles' => 'object', 'ValidSkinNames' => 'object', 'SpecialPages' => 'object', 'ExtensionCredits' => 'object', 'Hooks' => 'object', 'ServiceWiringFiles' => 'array', 'JobClasses' => 'object', 'JobTypesExcludedFromDefaultQueue' => 'array', 'JobBackoffThrottling' => 'object', 'JobTypeConf' => 'object', 'SpecialPageCacheUpdates' => 'object', 'PagePropLinkInvalidations' => 'object', 'TempCategoryCollations' => 'array', 'SortedCategories' => 'boolean', 'TrackingCategories' => 'array', 'LogTypes' => 'array', 'LogRestrictions' => 'object', 'FilterLogTypes' => 'object', 'LogNames' => 'object', 'LogHeaders' => 'object', 'LogActions' => 'object', 'LogActionsHandlers' => 'object', 'ActionFilteredLogs' => 'object', 'WatchUserPageOnAccountCreation' => 'boolean', 'RangeContributionsCIDRLimit' => 'object', 'Actions' => 'object', 'NamespaceRobotPolicies' => 'object', 'ArticleRobotPolicies' => 'object', 'ExemptFromUserRobotsControl' => [ 'array', 'null', ], 'APIModules' => 'object', 'APIFormatModules' => 'object', 'APIMetaModules' => 'object', 'APIPropModules' => 'object', 'APIListModules' => 'object', 'APIUselessQueryPages' => 'array', 'CrossSiteAJAXdomains' => 'object', 'CrossSiteAJAXdomainExceptions' => 'object', 'AllowedCorsHeaders' => 'array', 'RestAPIAdditionalRouteFiles' => 'array', 'RestLocalModuleTestBaseUrl' => [ 'string', 'null', ], 'RestModuleOverrides' => 'object', 'RestExternalModules' => 'object', 'RestTermsOfServiceUrl' => [ 'string', 'null', ], 'ShellRestrictionMethod' => [ 'string', 'boolean', ], 'ShellboxUrls' => 'object', 'ShellboxSecretKey' => [ 'string', 'null', ], 'ShellboxShell' => [ 'string', 'null', ], 'HTTPTimeout' => 'number', 'HTTPConnectTimeout' => 'number', 'HTTPMaxTimeout' => 'number', 'HTTPMaxConnectTimeout' => 'number', 'HTTPUserAgentContact' => [ 'string', 'boolean', ], 'LocalVirtualHosts' => 'object', 'LocalHTTPProxy' => [ 'string', 'boolean', ], 'GenerateReqIDFormat' => 'string', 'EventRelayerConfig' => 'object', 'Pingback' => 'boolean', 'OriginTrials' => 'array', 'ReportToExpiry' => 'integer', 'ReportToEndpoints' => 'array', 'FeaturePolicyReportOnly' => 'array', 'SkinsPreferred' => 'array', 'SpecialContributeSkinsEnabled' => 'array', 'SpecialContributeNewPageTarget' => [ 'string', 'null', ], 'EnableEditRecovery' => 'boolean', 'EditRecoveryExpiry' => 'integer', 'UseCodexSpecialBlock' => 'boolean', 'ShowLogoutConfirmation' => 'boolean', 'EnableProtectionIndicators' => 'boolean', 'OutputPipelineStages' => 'object', 'FeatureShutdown' => 'array', 'UseLeximorph' => 'boolean', 'UsePostprocCacheLegacy' => 'boolean', 'UsePostprocCacheParsoid' => 'boolean', 'ParserOptionsLogUnsafeSampleRate' => 'integer', 'ReturnExperimentalPFragmentTypes' => 'array', 'UseParsoidLinksUpdate' => [ 'boolean', 'null', ], 'UseParsoidMessages' => [ 'boolean', 'null', ], 'UseParsoidParser' => 'boolean', 'SiteLookup' => 'object', ], 'mergeStrategy' => [ 'TiffThumbnailType' => 'replace', 'LBFactoryConf' => 'replace', 'InterwikiCache' => 'replace', 'PasswordPolicy' => 'array_replace_recursive', 'AuthManagerAutoConfig' => 'array_plus_2d', 'GroupPermissions' => 'array_plus_2d', 'RevokePermissions' => 'array_plus_2d', 'AddGroups' => 'array_merge_recursive', 'RemoveGroups' => 'array_merge_recursive', 'RateLimits' => 'array_plus_2d', 'GrantPermissions' => 'array_plus_2d', 'MWLoggerDefaultSpi' => 'replace', 'Profiler' => 'replace', 'Hooks' => 'array_merge_recursive', 'RestModuleOverrides' => 'array_replace_recursive', 'RestExternalModules' => 'array_replace_recursive', ], 'dynamicDefault' => [ 'UsePathInfo' => [ 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultUsePathInfo', ], ], 'Script' => [ 'use' => [ 'ScriptPath', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultScript', ], ], 'LoadScript' => [ 'use' => [ 'ScriptPath', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultLoadScript', ], ], 'RestPath' => [ 'use' => [ 'ScriptPath', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultRestPath', ], ], 'StylePath' => [ 'use' => [ 'ResourceBasePath', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultStylePath', ], ], 'LocalStylePath' => [ 'use' => [ 'ScriptPath', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultLocalStylePath', ], ], 'ExtensionAssetsPath' => [ 'use' => [ 'ResourceBasePath', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultExtensionAssetsPath', ], ], 'ArticlePath' => [ 'use' => [ 'Script', 'UsePathInfo', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultArticlePath', ], ], 'UploadPath' => [ 'use' => [ 'ScriptPath', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultUploadPath', ], ], 'FileCacheDirectory' => [ 'use' => [ 'UploadDirectory', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultFileCacheDirectory', ], ], 'Logo' => [ 'use' => [ 'ResourceBasePath', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultLogo', ], ], 'DeletedDirectory' => [ 'use' => [ 'UploadDirectory', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultDeletedDirectory', ], ], 'ShowEXIF' => [ 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultShowEXIF', ], ], 'SharedPrefix' => [ 'use' => [ 'DBprefix', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultSharedPrefix', ], ], 'SharedSchema' => [ 'use' => [ 'DBmwschema', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultSharedSchema', ], ], 'DBerrorLogTZ' => [ 'use' => [ 'Localtimezone', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultDBerrorLogTZ', ], ], 'Localtimezone' => [ 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultLocaltimezone', ], ], 'LocalTZoffset' => [ 'use' => [ 'Localtimezone', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultLocalTZoffset', ], ], 'ResourceBasePath' => [ 'use' => [ 'ScriptPath', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultResourceBasePath', ], ], 'MetaNamespace' => [ 'use' => [ 'Sitename', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultMetaNamespace', ], ], 'CookieSecure' => [ 'use' => [ 'ForceHTTPS', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultCookieSecure', ], ], 'CookiePrefix' => [ 'use' => [ 'SharedDB', 'SharedPrefix', 'SharedTables', 'DBname', 'DBprefix', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultCookiePrefix', ], ], 'ReadOnlyFile' => [ 'use' => [ 'UploadDirectory', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultReadOnlyFile', ], ], ], ], 'config-schema' => [ 'UploadStashScalerBaseUrl' => [ 'deprecated' => 'since 1.36 Use thumbProxyUrl in $wgLocalFileRepo', ], 'IllegalFileChars' => [ 'deprecated' => 'since 1.41; no longer customizable', ], 'ThumbnailNamespaces' => [ 'items' => [ 'type' => 'integer', ], ], 'LocalDatabases' => [ 'items' => [ 'type' => 'string', ], ], 'ParserCacheFilterConfig' => [ 'additionalProperties' => [ 'type' => 'object', 'description' => 'A map of namespace IDs to filter definitions.', 'additionalProperties' => [ 'type' => 'object', 'description' => 'A map of filter names to values.', 'properties' => [ 'minCpuTime' => [ 'type' => 'number', ], ], ], ], ], 'RawHtmlMessages' => [ 'items' => [ 'type' => 'string', ], ], 'InterwikiLogoOverride' => [ 'items' => [ 'type' => 'string', ], ], 'LegalTitleChars' => [ 'deprecated' => 'since 1.41; use Extension:TitleBlacklist to customize', ], 'ReauthenticateTime' => [ 'additionalProperties' => [ 'type' => [ 'integer', 'array', ], ], ], 'ChangeCredentialsBlacklist' => [ 'items' => [ 'type' => 'string', ], ], 'RemoveCredentialsBlacklist' => [ 'items' => [ 'type' => 'string', ], ], 'GroupPermissions' => [ 'additionalProperties' => [ 'type' => 'object', 'additionalProperties' => [ 'type' => 'boolean', ], ], ], 'GroupInheritsPermissions' => [ 'additionalProperties' => [ 'type' => 'string', ], ], 'AvailableRights' => [ 'items' => [ 'type' => 'string', ], ], 'ImplicitRights' => [ 'items' => [ 'type' => 'string', ], ], 'SoftBlockRanges' => [ 'items' => [ 'type' => 'string', ], ], 'ExternalQuerySources' => [ 'additionalProperties' => [ 'type' => 'object', 'properties' => [ 'enabled' => [ 'type' => 'boolean', 'default' => false, ], 'url' => [ 'type' => 'string', 'format' => 'uri', ], 'timeout' => [ 'type' => 'integer', 'default' => 10, ], ], 'required' => [ 'enabled', 'url', ], 'additionalProperties' => false, ], ], 'GrantPermissions' => [ 'additionalProperties' => [ 'type' => 'object', 'additionalProperties' => [ 'type' => 'boolean', ], ], ], 'GrantPermissionGroups' => [ 'additionalProperties' => [ 'type' => 'string', ], ], 'SitemapNamespacesPriorities' => [ 'deprecated' => 'since 1.45 and ignored', ], 'SitemapApiConfig' => [ 'additionalProperties' => [ 'enabled' => [ 'type' => 'bool', ], 'sitemapsPerIndex' => [ 'type' => 'int', ], 'pagesPerSitemap' => [ 'type' => 'int', ], 'expiry' => [ 'type' => 'int', ], 'skipRedirects' => [ 'type' => 'bool', ], ], ], 'SoftwareTags' => [ 'additionalProperties' => [ 'type' => 'boolean', ], ], 'UseCopyrightUpload' => [ 'deprecated' => 'since 1.47 This feature is being removed.', ], 'JobBackoffThrottling' => [ 'additionalProperties' => [ 'type' => 'number', ], ], 'JobTypeConf' => [ 'additionalProperties' => [ 'type' => 'object', 'properties' => [ 'class' => [ 'type' => 'string', ], 'order' => [ 'type' => 'string', ], 'claimTTL' => [ 'type' => 'integer', ], ], ], ], 'TrackingCategories' => [ 'deprecated' => 'since 1.25 Extensions should now register tracking categories using the new extension registration system.', ], 'RangeContributionsCIDRLimit' => [ 'additionalProperties' => [ 'type' => 'integer', ], ], 'RestModuleOverrides' => [ 'additionalProperties' => [ 'type' => 'object', 'properties' => [ 'availability' => [ 'type' => 'string', ], 'groups' => [ 'type' => 'array', ], ], ], ], 'RestExternalModules' => [ 'additionalProperties' => [ 'type' => 'object', 'properties' => [ 'info' => [ 'type' => 'object', 'properties' => [ 'version' => [ 'type' => 'string', ], 'title' => [ 'type' => 'string', ], 'x-i18n-title' => [ 'type' => 'string', ], 'description' => [ 'type' => 'string', ], 'x-i18n-description' => [ 'type' => 'string', ], ], 'required' => [ 'version', ], ], 'base' => [ 'type' => 'string', 'format' => 'uri', ], 'spec' => [ 'type' => 'string', 'format' => 'uri', ], ], 'required' => [ 'info', 'base', 'spec', ], ], ], 'ShellboxUrls' => [ 'additionalProperties' => [ 'type' => [ 'string', 'boolean', 'null', ], ], ], ], 'obsolete-config' => [ 'MangleFlashPolicy' => 'Since 1.39; no longer has any effect.', 'EnableOpenSearchSuggest' => 'Since 1.35, no longer used', 'AutoloadAttemptLowercase' => 'Since 1.40; no longer has any effect.', ],]
An object representing a primary or replica DB position in a replicated setup.
const DBO_GAUGE
Optimize connection for guaging server state (e.g.
clearFlag( $flag, $remember=self::REMEMBER_NOTHING)
Clear a flag for this connection.
const DBO_DEFAULT
Join load balancer transaction rounds (which control DBO_TRX) in non-CLI mode.
Internal interface for relational database handles exposed to their owner.
Interface to a relational database.
Definition IDatabase.php:31
const ROLE_STREAMING_MASTER
Primary server than can stream writes to replica servers.
Definition IDatabase.php:94
const ROLE_STATIC_CLONE
Replica server within a static dataset.
Definition IDatabase.php:98
getLBInfo( $name=null)
Get properties passed down from the server info array of the load balancer.
const TRIGGER_ROLLBACK
Callback triggered by ROLLBACK.
Definition IDatabase.php:37
const ROLE_STREAMING_REPLICA
Replica server that receives writes from a primary server.
Definition IDatabase.php:96
trxLevel()
Gets the current transaction level.
const TRIGGER_COMMIT
Callback triggered by COMMIT.
Definition IDatabase.php:35
Internal interface for load balancer instances exposed to their owner.
const CONN_TRX_AUTOCOMMIT
Yield a tracked autocommit-mode handle (reuse existing ones).
const CONN_SILENCE_ERRORS
Yield null on connection failure instead of throwing an exception.
Database load monitoring interface.
close( $fname=__METHOD__)
Close the database connection.
getServerName()
Get the readable name for the server.
getDomainID()
Return the currently selected domain ID.
array $params
The job parameters.