MediaWiki master
WANObjectCache.php
Go to the documentation of this file.
1<?php
8
9use ArrayIterator;
10use Closure;
11use Exception;
12use Psr\Log\LoggerAwareInterface;
13use Psr\Log\LoggerInterface;
14use Psr\Log\NullLogger;
15use RuntimeException;
16use UnexpectedValueException;
23
149class WANObjectCache implements
152 LoggerAwareInterface
153{
155 protected $cache;
157 protected $processCaches = [];
159 protected $logger;
161 protected $stats;
163 protected $asyncHandler;
164
176 protected $epoch;
179
181 private $tracer;
182
184 private $missLog;
185
187 private $callbackDepth = 0;
189 private $warmupCache = [];
191 private $warmupKeyMisses = 0;
192
194 private $wallClockOverride;
195
197 private const MAX_COMMIT_DELAY = 3;
199 private const MAX_READ_LAG = 7;
201 public const HOLDOFF_TTL = self::MAX_COMMIT_DELAY + self::MAX_READ_LAG + 1;
202
204 private const LOW_TTL = 60;
206 public const TTL_LAGGED = 30;
207
209 private const HOT_TTR = 900;
211 private const AGE_NEW = 60;
212
214 private const TSE_NONE = -1;
215
217 public const STALE_TTL_NONE = 0;
219 public const GRACE_TTL_NONE = 0;
221 public const HOLDOFF_TTL_NONE = 0;
222
224 public const MIN_TIMESTAMP_NONE = 0.0;
225
227 private const PC_PRIMARY = 'primary:1000';
228
230 public const PASS_BY_REF = [];
231
233 private const SCHEME_HASH_TAG = 1;
235 private const SCHEME_HASH_STOP = 2;
236
238 private const CHECK_KEY_TTL = self::TTL_YEAR;
240 private const INTERIM_KEY_TTL = 2;
241
243 private const LOCK_TTL = 10;
245 private const RAMPUP_TTL = 30;
246
248 private const TINY_NEGATIVE = -0.000001;
250 private const TINY_POSITIVE = 0.000001;
251
253 private const RECENT_SET_LOW_MS = 50;
255 private const RECENT_SET_HIGH_MS = 100;
256
258 private const GENERATION_HIGH_SEC = 0.2;
259
261 private const PURGE_TIME = 0;
263 private const PURGE_HOLDOFF = 1;
264
266 private const VERSION = 1;
267
269 public const KEY_VERSION = 'version';
271 public const KEY_AS_OF = 'asOf';
273 public const KEY_TTL = 'ttl';
275 public const KEY_CUR_TTL = 'curTTL';
277 public const KEY_TOMB_AS_OF = 'tombAsOf';
279 public const KEY_CHECK_AS_OF = 'lastCKPurge';
280
282 private const RES_VALUE = 0;
284 private const RES_VERSION = 1;
286 private const RES_AS_OF = 2;
288 private const RES_TTL = 3;
290 private const RES_TOMB_AS_OF = 4;
292 private const RES_CHECK_AS_OF = 5;
294 private const RES_TOUCH_AS_OF = 6;
296 private const RES_CUR_TTL = 7;
297
299 private const FLD_FORMAT_VERSION = 0;
301 private const FLD_VALUE = 1;
303 private const FLD_TTL = 2;
305 private const FLD_TIME = 3;
307 private const FLD_FLAGS = 4;
309 private const FLD_VALUE_VERSION = 5;
310 private const FLD_GENERATION_TIME = 6;
311
313 private const TYPE_VALUE = 'v';
315 private const TYPE_TIMESTAMP = 't';
317 private const TYPE_MUTEX = 'm';
319 private const TYPE_INTERIM = 'i';
320
322 private const PURGE_VAL_PREFIX = 'PURGED';
323
351 public function __construct( array $params ) {
352 $this->cache = $params['cache'];
353 $this->broadcastRoute = $params['broadcastRoutingPrefix'] ?? null;
354 $this->epoch = $params['epoch'] ?? 0;
355 if ( ( $params['coalesceScheme'] ?? '' ) === 'hash_tag' ) {
356 // https://redis.io/topics/cluster-spec
357 // https://github.com/twitter/twemproxy/blob/v0.4.1/notes/recommendation.md#hash-tags
358 // https://github.com/Netflix/dynomite/blob/v0.7.0/notes/recommendation.md#hash-tags
359 $this->coalesceScheme = self::SCHEME_HASH_TAG;
360 } else {
361 // https://github.com/facebook/mcrouter/wiki/Key-syntax
362 $this->coalesceScheme = self::SCHEME_HASH_STOP;
363 }
364
365 $this->setLogger( $params['logger'] ?? new NullLogger() );
366 $this->tracer = $params['tracer'] ?? new NoopTracer();
367 $this->stats = $params['stats'] ?? StatsFactory::newNull();
368
369 $this->asyncHandler = $params['asyncHandler'] ?? null;
370 $this->missLog = array_fill( 0, 10, [ '', 0.0 ] );
371 }
372
373 public function setLogger( LoggerInterface $logger ): void {
374 $this->logger = $logger;
375 }
376
380 public static function newEmpty(): static {
381 return new static( [ 'cache' => new EmptyBagOStuff() ] );
382 }
383
439 final public function get( $key, &$curTTL = null, array $checkKeys = [], &$info = [] ) {
440 // Note that an undeclared variable passed as $info starts as null (not the default).
441 // Also, if no $info parameter is provided, then it doesn't matter how it changes here.
442 $legacyInfo = ( $info !== self::PASS_BY_REF );
443
445 $span = $this->startOperationSpan( __FUNCTION__, $key, $checkKeys );
446
447 $now = $this->getCurrentTime();
448 $res = $this->fetchKeys( [ $key ], $checkKeys, $now )[$key];
449
450 $curTTL = $res[self::RES_CUR_TTL];
451 $info = $legacyInfo
452 ? $res[self::RES_AS_OF]
453 : [
454 self::KEY_VERSION => $res[self::RES_VERSION],
455 self::KEY_AS_OF => $res[self::RES_AS_OF],
456 self::KEY_TTL => $res[self::RES_TTL],
457 self::KEY_CUR_TTL => $res[self::RES_CUR_TTL],
458 self::KEY_TOMB_AS_OF => $res[self::RES_TOMB_AS_OF],
459 self::KEY_CHECK_AS_OF => $res[self::RES_CHECK_AS_OF]
460 ];
461
462 if ( $curTTL === null || $curTTL <= 0 ) {
463 // Log the timestamp in case a corresponding set() call does not provide "walltime"
464 unset( $this->missLog[array_key_first( $this->missLog )] );
465 $this->missLog[] = [ $key, $this->getCurrentTime() ];
466 }
467
468 return $res[self::RES_VALUE];
469 }
470
495 final public function getMulti(
496 array $keys,
497 &$curTTLs = [],
498 array $checkKeys = [],
499 &$info = []
500 ) {
501 // Note that an undeclared variable passed as $info starts as null (not the default).
502 // Also, if no $info parameter is provided, then it doesn't matter how it changes here.
503 $legacyInfo = ( $info !== self::PASS_BY_REF );
504
506 $span = $this->startOperationSpan( __FUNCTION__, $keys, $checkKeys );
507
508 $curTTLs = [];
509 $info = [];
510 $valuesByKey = [];
511
512 $now = $this->getCurrentTime();
513 $resByKey = $this->fetchKeys( $keys, $checkKeys, $now );
514 foreach ( $resByKey as $key => $res ) {
515 if ( $res[self::RES_VALUE] !== false ) {
516 $valuesByKey[$key] = $res[self::RES_VALUE];
517 }
518
519 if ( $res[self::RES_CUR_TTL] !== null ) {
520 $curTTLs[$key] = $res[self::RES_CUR_TTL];
521 }
522 $info[$key] = $legacyInfo
523 ? $res[self::RES_AS_OF]
524 : [
525 self::KEY_VERSION => $res[self::RES_VERSION],
526 self::KEY_AS_OF => $res[self::RES_AS_OF],
527 self::KEY_TTL => $res[self::RES_TTL],
528 self::KEY_CUR_TTL => $res[self::RES_CUR_TTL],
529 self::KEY_TOMB_AS_OF => $res[self::RES_TOMB_AS_OF],
530 self::KEY_CHECK_AS_OF => $res[self::RES_CHECK_AS_OF]
531 ];
532 }
533
534 return $valuesByKey;
535 }
536
552 protected function fetchKeys( array $keys, array $checkKeys, float $now, $touchedCb = null ) {
553 $resByKey = [];
554
555 // List of all sister keys that need to be fetched from cache
556 $allSisterKeys = [];
557 // Order-corresponding value sister key list for the base key list ($keys)
558 $valueSisterKeys = [];
559 // List of "check" sister keys to compare all value sister keys against
560 $checkSisterKeysForAll = [];
561 // Map of (base key => additional "check" sister key(s) to compare against)
562 $checkSisterKeysByKey = [];
563
564 foreach ( $keys as $key ) {
565 $sisterKey = $this->makeSisterKey( $key, self::TYPE_VALUE );
566 $allSisterKeys[] = $sisterKey;
567 $valueSisterKeys[] = $sisterKey;
568 }
569
570 foreach ( $checkKeys as $i => $checkKeyOrKeyGroup ) {
571 // Note: avoid array_merge() inside loop in case there are many keys
572 if ( is_int( $i ) ) {
573 // Single "check" key that applies to all base keys
574 $sisterKey = $this->makeSisterKey( $checkKeyOrKeyGroup, self::TYPE_TIMESTAMP );
575 $allSisterKeys[] = $sisterKey;
576 $checkSisterKeysForAll[] = $sisterKey;
577 } else {
578 // List of "check" keys that apply to a specific base key
579 foreach ( (array)$checkKeyOrKeyGroup as $checkKey ) {
580 $sisterKey = $this->makeSisterKey( $checkKey, self::TYPE_TIMESTAMP );
581 $allSisterKeys[] = $sisterKey;
582 $checkSisterKeysByKey[$i][] = $sisterKey;
583 }
584 }
585 }
586
587 if ( $this->warmupCache ) {
588 // Get the wrapped values of the sister keys from the warmup cache
589 $wrappedBySisterKey = $this->warmupCache;
590 $sisterKeysMissing = array_diff( $allSisterKeys, array_keys( $wrappedBySisterKey ) );
591 if ( $sisterKeysMissing ) {
592 $this->warmupKeyMisses += count( $sisterKeysMissing );
593 $wrappedBySisterKey += $this->cache->getMulti( $sisterKeysMissing );
594 }
595 } else {
596 // Fetch the wrapped values of the sister keys from the backend
597 $wrappedBySisterKey = $this->cache->getMulti( $allSisterKeys );
598 }
599
600 // List of "check" sister key purge timestamps to compare all value sister keys against
601 $ckPurgesForAll = $this->processCheckKeys(
602 $checkSisterKeysForAll,
603 $wrappedBySisterKey,
604 $now
605 );
606 // Map of (base key => extra "check" sister key purge timestamp(s) to compare against)
607 $ckPurgesByKey = [];
608 foreach ( $checkSisterKeysByKey as $keyWithCheckKeys => $checkKeysForKey ) {
609 $ckPurgesByKey[$keyWithCheckKeys] = $this->processCheckKeys(
610 $checkKeysForKey,
611 $wrappedBySisterKey,
612 $now
613 );
614 }
615
616 // Unwrap and validate any value found for each base key (under the value sister key)
617 foreach (
618 array_map( null, $valueSisterKeys, $keys )
619 as [ $valueSisterKey, $key ]
620 ) {
621 if ( array_key_exists( $valueSisterKey, $wrappedBySisterKey ) ) {
622 // Key exists as either a live value or tombstone value
623 $wrapped = $wrappedBySisterKey[$valueSisterKey];
624 } else {
625 // Key does not exist
626 $wrapped = false;
627 }
628
629 $res = $this->unwrap( $wrapped, $now );
630 $value = $res[self::RES_VALUE];
631
632 foreach ( array_merge( $ckPurgesForAll, $ckPurgesByKey[$key] ?? [] ) as $ckPurge ) {
633 $res[self::RES_CHECK_AS_OF] = max(
634 $ckPurge[self::PURGE_TIME],
635 $res[self::RES_CHECK_AS_OF]
636 );
637 // Timestamp marking the end of the hold-off period for this purge
638 $holdoffDeadline = $ckPurge[self::PURGE_TIME] + $ckPurge[self::PURGE_HOLDOFF];
639 // Check if the value was generated during the hold-off period
640 if ( $value !== false && $holdoffDeadline >= $res[self::RES_AS_OF] ) {
641 // How long ago this value was purged by *this* "check" key
642 $ago = min( $ckPurge[self::PURGE_TIME] - $now, self::TINY_NEGATIVE );
643 // How long ago this value was purged by *any* known "check" key
644 $res[self::RES_CUR_TTL] = min( $res[self::RES_CUR_TTL], $ago );
645 }
646 }
647
648 if ( $touchedCb !== null && $value !== false ) {
649 $touched = $touchedCb( $value );
650 if ( $touched !== null && $touched >= $res[self::RES_AS_OF] ) {
651 $res[self::RES_CUR_TTL] = min(
652 $res[self::RES_CUR_TTL],
653 $res[self::RES_AS_OF] - $touched,
654 self::TINY_NEGATIVE
655 );
656 }
657 } else {
658 $touched = null;
659 }
660
661 $res[self::RES_TOUCH_AS_OF] = max( $res[self::RES_TOUCH_AS_OF], $touched );
662
663 $resByKey[$key] = $res;
664 }
665
666 return $resByKey;
667 }
668
675 private function processCheckKeys(
676 array $checkSisterKeys,
677 array $wrappedBySisterKey,
678 float $now
679 ) {
680 $purges = [];
681
682 foreach ( $checkSisterKeys as $timeKey ) {
683 $purge = isset( $wrappedBySisterKey[$timeKey] )
684 ? $this->parsePurgeValue( $wrappedBySisterKey[$timeKey] )
685 : null;
686
687 if ( $purge === null ) {
688 // No holdoff when lazy creating a check key, use cache right away (T344191)
689 $wrapped = $this->makeCheckPurgeValue( $now, self::HOLDOFF_TTL_NONE, $purge );
690 $this->cache->add(
691 $timeKey,
692 $wrapped,
693 self::CHECK_KEY_TTL,
694 $this->cache::WRITE_BACKGROUND
695 );
696 }
697
698 $purges[] = $purge;
699 }
700
701 return $purges;
702 }
703
787 final public function set( $key, $value, $ttl = self::TTL_INDEFINITE, array $opts = [] ) {
789 $span = $this->startOperationSpan( __FUNCTION__, $key );
790
791 $keygroup = $this->determineKeyGroupForStats( $key );
792
793 $ok = $this->setMainValue(
794 $key,
795 $value,
796 $ttl,
797 $opts['version'] ?? null,
798 $opts['walltime'] ?? null,
799 $opts['lag'] ?? 0,
800 $opts['since'] ?? null,
801 $opts['pending'] ?? false,
802 $opts['lockTSE'] ?? self::TSE_NONE,
803 $opts['staleTTL'] ?? self::STALE_TTL_NONE,
804 $opts['segmentable'] ?? false,
805 $opts['creating'] ?? false
806 );
807
808 $this->stats->getCounter( 'wanobjectcache_set_total' )
809 ->setLabel( 'keygroup', $keygroup )
810 ->setLabel( 'result', ( $ok ? 'ok' : 'error' ) )
811 ->increment();
812
813 return $ok;
814 }
815
831 private function setMainValue(
832 $key,
833 $value,
834 $ttl,
835 ?int $version,
836 ?float $walltime,
837 $dataReplicaLag,
838 $dataReadSince,
839 bool $dataPendingCommit,
840 int $lockTSE,
841 int $staleTTL,
842 bool $segmentable,
843 bool $creating
844 ) {
845 if ( $ttl < 0 ) {
846 // not cacheable
847 return true;
848 }
849
850 $now = $this->getCurrentTime();
851
852 // T413673: Handle PHP8.5 case where TTL is infinite.
853 if ( is_finite( $ttl ) ) {
854 $ttl = (int)$ttl;
855 } else {
856 $ttl = self::TTL_INDEFINITE;
857 }
858 $walltime ??= $this->timeSinceLoggedMiss( $key, $now );
859 $dataSnapshotLag = ( $dataReadSince !== null ) ? max( 0, $now - $dataReadSince ) : 0;
860 $dataCombinedLag = $dataReplicaLag + $dataSnapshotLag;
861
862 // Forbid caching data that only exists within an uncommitted transaction. Also, lower
863 // the TTL when the data has a "since" time so far in the past that a delete() tombstone,
864 // made after that time, could have already expired (the key is no longer write-holed).
865 // The mitigation TTL depends on whether this data lag is assumed to systemically effect
866 // regeneration attempts in the near future. The TTL also reflects regeneration wall time.
867 if ( $dataPendingCommit ) {
868 // Case A: data comes from an uncommitted write transaction
869 $mitigated = 'pending writes';
870 // Data might never be committed; rely on a less problematic regeneration attempt
871 $mitigationTTL = self::TTL_UNCACHEABLE;
872 } elseif ( $dataSnapshotLag > self::MAX_READ_LAG ) {
873 // Case B: high snapshot lag
874 $pregenSnapshotLag = ( $walltime !== null ) ? ( $dataSnapshotLag - $walltime ) : 0;
875 if ( ( $pregenSnapshotLag + self::GENERATION_HIGH_SEC ) > self::MAX_READ_LAG ) {
876 // Case B1: generation started when transaction duration was already long
877 $mitigated = 'snapshot lag (late generation)';
878 // Probably non-systemic; rely on a less problematic regeneration attempt
879 $mitigationTTL = self::TTL_UNCACHEABLE;
880 } else {
881 // Case B2: slow generation made transaction duration long
882 $mitigated = 'snapshot lag (high generation time)';
883 // Probably systemic; use a low TTL to avoid stampedes/uncacheability
884 $mitigationTTL = self::TTL_LAGGED;
885 }
886 } elseif ( $dataReplicaLag === false || $dataReplicaLag > self::MAX_READ_LAG ) {
887 // Case C: low/medium snapshot lag with high replication lag
888 $mitigated = 'replication lag';
889 // Probably systemic; use a low TTL to avoid stampedes/uncacheability
890 $mitigationTTL = self::TTL_LAGGED;
891 } elseif ( $dataCombinedLag > self::MAX_READ_LAG ) {
892 $pregenCombinedLag = ( $walltime !== null ) ? ( $dataCombinedLag - $walltime ) : 0;
893 // Case D: medium snapshot lag with medium replication lag
894 if ( ( $pregenCombinedLag + self::GENERATION_HIGH_SEC ) > self::MAX_READ_LAG ) {
895 // Case D1: generation started when read lag was too high
896 $mitigated = 'read lag (late generation)';
897 // Probably non-systemic; rely on a less problematic regeneration attempt
898 $mitigationTTL = self::TTL_UNCACHEABLE;
899 } else {
900 // Case D2: slow generation made read lag too high
901 $mitigated = 'read lag (high generation time)';
902 // Probably systemic; use a low TTL to avoid stampedes/uncacheability
903 $mitigationTTL = self::TTL_LAGGED;
904 }
905 } else {
906 // Case E: new value generated with recent data
907 $mitigated = null;
908 // Nothing to mitigate
909 $mitigationTTL = null;
910 }
911
912 if ( $mitigationTTL === self::TTL_UNCACHEABLE ) {
913 $this->logger->warning(
914 "Rejected set() for {cachekey} due to $mitigated.",
915 [
916 'cachekey' => $key,
917 'lag' => $dataReplicaLag,
918 'age' => $dataSnapshotLag,
919 'walltime' => $walltime
920 ]
921 );
922
923 // no-op the write for being unsafe
924 return true;
925 }
926
927 // TTL to use in staleness checks (does not effect persistence layer TTL)
928 $logicalTTL = null;
929
930 if ( $mitigationTTL !== null ) {
931 // New value was generated from data that is old enough to be risky
932 if ( $lockTSE >= 0 ) {
933 // Persist the value as long as normal, but make it count as stale sooner
934 $logicalTTL = min( $ttl ?: INF, $mitigationTTL );
935 } else {
936 // Persist the value for a shorter duration
937 $ttl = min( $ttl ?: INF, $mitigationTTL );
938 }
939
940 $this->logger->warning(
941 "Lowered set() TTL for {cachekey} due to $mitigated.",
942 [
943 'cachekey' => $key,
944 'lag' => $dataReplicaLag,
945 'age' => $dataSnapshotLag,
946 'walltime' => $walltime
947 ]
948 );
949 }
950
951 // Wrap that value with time/TTL/version metadata
952 $wrapped = $this->wrap( $value, $logicalTTL ?: $ttl, $version, $now );
953 $storeTTL = $ttl + $staleTTL;
954
955 $flags = $this->cache::WRITE_BACKGROUND;
956 if ( $segmentable ) {
957 $flags |= $this->cache::WRITE_ALLOW_SEGMENTS;
958 }
959
960 if ( $creating ) {
961 $ok = $this->cache->add(
962 $this->makeSisterKey( $key, self::TYPE_VALUE ),
963 $wrapped,
964 $storeTTL,
965 $flags
966 );
967 } else {
968 $ok = $this->cache->merge(
969 $this->makeSisterKey( $key, self::TYPE_VALUE ),
970 static function ( $cache, $key, $cWrapped ) use ( $wrapped ) {
971 // A string value means that it is a tombstone; do nothing in that case
972 return ( is_string( $cWrapped ) ) ? false : $wrapped;
973 },
974 $storeTTL,
975 $this->cache::MAX_CONFLICTS_ONE,
976 $flags
977 );
978 }
979
980 return $ok;
981 }
982
1045 final public function delete( $key, $ttl = self::HOLDOFF_TTL ) {
1047 $span = $this->startOperationSpan( __FUNCTION__, $key );
1048
1049 // Purge values must be stored under the value key so that WANObjectCache::set()
1050 // can atomically merge values without accidentally undoing a recent purge and thus
1051 // violating the holdoff TTL restriction.
1052 $valueSisterKey = $this->makeSisterKey( $key, self::TYPE_VALUE );
1053
1054 if ( $ttl <= 0 ) {
1055 // A client or cache cleanup script is requesting a cache purge, so there is no
1056 // volatility period due to replica DB lag. Any recent change to an entity cached
1057 // in this key should have triggered an appropriate purge event.
1058 $ok = $this->cache->delete( $this->getRouteKey( $valueSisterKey ), $this->cache::WRITE_BACKGROUND );
1059 } else {
1060 // A cacheable entity recently changed, so there might be a volatility period due
1061 // to replica DB lag. Clients usually expect their actions to be reflected in any
1062 // of their subsequent web request. This is attainable if (a) purge relay lag is
1063 // lower than the time it takes for subsequent request by the client to arrive,
1064 // and, (b) DB replica queries have "read-your-writes" consistency due to DB lag
1065 // mitigation systems.
1066 $now = $this->getCurrentTime();
1067 // Set the key to the purge value in all datacenters
1068 $purge = self::PURGE_VAL_PREFIX . ':' . (int)$now;
1069 $ok = $this->cache->set(
1070 $this->getRouteKey( $valueSisterKey ),
1071 $purge,
1072 $ttl,
1073 $this->cache::WRITE_BACKGROUND
1074 );
1075 }
1076
1077 $keygroup = $this->determineKeyGroupForStats( $key );
1078
1079 $this->stats->getCounter( 'wanobjectcache_delete_total' )
1080 ->setLabel( 'keygroup', $keygroup )
1081 ->setLabel( 'result', ( $ok ? 'ok' : 'error' ) )
1082 ->increment();
1083
1084 return $ok;
1085 }
1086
1106 final public function getCheckKeyTime( $key ) {
1108 $span = $this->startOperationSpan( __FUNCTION__, $key );
1109
1110 return $this->getMultiCheckKeyTime( [ $key ] )[$key];
1111 }
1112
1174 final public function getMultiCheckKeyTime( array $keys ) {
1176 $span = $this->startOperationSpan( __FUNCTION__, $keys );
1177
1178 $checkSisterKeysByKey = [];
1179 foreach ( $keys as $key ) {
1180 $checkSisterKeysByKey[$key] = $this->makeSisterKey( $key, self::TYPE_TIMESTAMP );
1181 }
1182
1183 $wrappedBySisterKey = $this->cache->getMulti( $checkSisterKeysByKey );
1184 $wrappedBySisterKey += array_fill_keys( $checkSisterKeysByKey, false );
1185
1186 $now = $this->getCurrentTime();
1187 $times = [];
1188 foreach ( $checkSisterKeysByKey as $key => $checkSisterKey ) {
1189 $purge = $this->parsePurgeValue( $wrappedBySisterKey[$checkSisterKey] );
1190 if ( $purge === null ) {
1191 $wrapped = $this->makeCheckPurgeValue( $now, self::HOLDOFF_TTL_NONE, $purge );
1192 $this->cache->add(
1193 $checkSisterKey,
1194 $wrapped,
1195 self::CHECK_KEY_TTL,
1196 $this->cache::WRITE_BACKGROUND
1197 );
1198 }
1199
1200 $times[$key] = $purge[self::PURGE_TIME];
1201 }
1202
1203 return $times;
1204 }
1205
1239 public function touchCheckKey( $key, $holdoff = self::HOLDOFF_TTL ) {
1241 $span = $this->startOperationSpan( __FUNCTION__, $key );
1242
1243 $checkSisterKey = $this->makeSisterKey( $key, self::TYPE_TIMESTAMP );
1244
1245 $now = $this->getCurrentTime();
1246 $purge = $this->makeCheckPurgeValue( $now, $holdoff );
1247 $ok = $this->cache->set(
1248 $this->getRouteKey( $checkSisterKey ),
1249 $purge,
1250 self::CHECK_KEY_TTL,
1251 $this->cache::WRITE_BACKGROUND
1252 );
1253
1254 $keygroup = $this->determineKeyGroupForStats( $key );
1255
1256 $this->stats->getCounter( 'wanobjectcache_check_total' )
1257 ->setLabel( 'keygroup', $keygroup )
1258 ->setLabel( 'result', ( $ok ? 'ok' : 'error' ) )
1259 ->increment();
1260
1261 return $ok;
1262 }
1263
1291 public function resetCheckKey( $key ) {
1293 $span = $this->startOperationSpan( __FUNCTION__, $key );
1294
1295 $checkSisterKey = $this->makeSisterKey( $key, self::TYPE_TIMESTAMP );
1296 $ok = $this->cache->delete( $this->getRouteKey( $checkSisterKey ), $this->cache::WRITE_BACKGROUND );
1297
1298 $keygroup = $this->determineKeyGroupForStats( $key );
1299
1300 $this->stats->getCounter( 'wanobjectcache_reset_total' )
1301 ->setLabel( 'keygroup', $keygroup )
1302 ->setLabel( 'result', ( $ok ? 'ok' : 'error' ) )
1303 ->increment();
1304
1305 return $ok;
1306 }
1307
1618 final public function getWithSetCallback(
1619 $key, $ttl, $callback, array $opts = [], array $cbParams = []
1620 ) {
1622 $span = $this->startOperationSpan( __FUNCTION__, $key );
1623
1624 $version = $opts['version'] ?? null;
1625 $pcTTL = $opts['pcTTL'] ?? self::TTL_UNCACHEABLE;
1626 $pCache = ( $pcTTL >= 0 )
1627 ? $this->getProcessCache( $opts['pcGroup'] ?? self::PC_PRIMARY )
1628 : null;
1629
1630 // Use the process cache if requested as long as no outer cache callback is running.
1631 // Nested callback process cache use is not lag-safe with regard to HOLDOFF_TTL since
1632 // process cached values are more lagged than persistent ones as they are not purged.
1633 if ( $pCache && $this->callbackDepth == 0 ) {
1634 $cached = $pCache->get( $key, $pcTTL, false );
1635 if ( $cached !== false ) {
1636 $this->logger->debug( "getWithSetCallback($key): process cache hit" );
1637 return $cached;
1638 }
1639 }
1640
1641 [ $value, $valueVersion, $curAsOf ] = $this->fetchOrRegenerate( $key, $ttl, $callback, $opts, $cbParams );
1642 if ( $valueVersion !== $version ) {
1643 // Current value has a different version; use the variant key for this version.
1644 // Regenerate the variant value if it is not newer than the main value at $key
1645 // so that purges to the main key propagate to the variant value.
1646 $this->logger->debug( "getWithSetCallback($key): using variant key" );
1647 [ $value ] = $this->fetchOrRegenerate(
1648 $this->makeGlobalKey( 'WANCache-key-variant', md5( $key ), (string)$version ),
1649 $ttl,
1650 $callback,
1651 [ 'version' => null, 'minAsOf' => $curAsOf ] + $opts,
1652 $cbParams
1653 );
1654 }
1655
1656 // Update the process cache if enabled
1657 if ( $pCache && $value !== false ) {
1658 $pCache->set( $key, $value );
1659 }
1660
1661 return $value;
1662 }
1663
1680 private function fetchOrRegenerate( $key, $ttl, $callback, array $opts, array $cbParams ) {
1681 $checkKeys = $opts['checkKeys'] ?? [];
1682 $graceTTL = $opts['graceTTL'] ?? self::GRACE_TTL_NONE;
1683 $minAsOf = $opts['minAsOf'] ?? self::MIN_TIMESTAMP_NONE;
1684 $hotTTR = $opts['hotTTR'] ?? self::HOT_TTR;
1685 $lowTTL = $opts['lowTTL'] ?? min( self::LOW_TTL, $ttl );
1686 $ageNew = $opts['ageNew'] ?? self::AGE_NEW;
1687 $touchedCb = $opts['touchedCallback'] ?? null;
1688 $startTime = $this->getCurrentTime();
1689
1690 $keygroup = $this->determineKeyGroupForStats( $key );
1691
1692 // Get the current key value and its metadata
1693 $curState = $this->fetchKeys( [ $key ], $checkKeys, $startTime, $touchedCb )[$key];
1694 $curValue = $curState[self::RES_VALUE];
1695
1696 // Use the cached value if it exists and is not due for synchronous regeneration
1697 if ( $this->isAcceptablyFreshValue( $curState, $graceTTL, $minAsOf ) ) {
1698 if ( !$this->isLotteryRefreshDue( $curState, $lowTTL, $ageNew, $hotTTR, $startTime ) ) {
1699 $this->stats->getTiming( 'wanobjectcache_getwithset_seconds' )
1700 ->setLabel( 'keygroup', $keygroup )
1701 ->setLabel( 'result', 'hit' )
1702 ->setLabel( 'reason', 'good' )
1703 ->observe( 1e3 * ( $this->getCurrentTime() - $startTime ) );
1704
1705 return [ $curValue, $curState[self::RES_VERSION], $curState[self::RES_AS_OF] ];
1706 } elseif ( $this->scheduleAsyncRefresh( $key, $ttl, $callback, $opts, $cbParams ) ) {
1707 $this->logger->debug( "fetchOrRegenerate($key): hit with async refresh" );
1708
1709 $this->stats->getTiming( 'wanobjectcache_getwithset_seconds' )
1710 ->setLabel( 'keygroup', $keygroup )
1711 ->setLabel( 'result', 'hit' )
1712 ->setLabel( 'reason', 'refresh' )
1713 ->observe( 1e3 * ( $this->getCurrentTime() - $startTime ) );
1714
1715 return [ $curValue, $curState[self::RES_VERSION], $curState[self::RES_AS_OF] ];
1716 } else {
1717 $this->logger->debug( "fetchOrRegenerate($key): hit with sync refresh" );
1718 }
1719 }
1720
1721 $isKeyTombstoned = ( $curState[self::RES_TOMB_AS_OF] !== null );
1722 // Use the interim key as a temporary alternative if the key is tombstoned
1723 if ( $isKeyTombstoned ) {
1724 $volState = $this->getInterimValue( $key, $minAsOf, $startTime, $touchedCb );
1725 $volValue = $volState[self::RES_VALUE];
1726 } else {
1727 $volState = $curState;
1728 $volValue = $curValue;
1729 }
1730
1731 // During the volatile "hold-off" period that follows a purge of the key, the value
1732 // will be regenerated many times if frequently accessed. This is done to mitigate
1733 // the effects of backend replication lag as soon as possible. However, throttle the
1734 // overhead of locking and regeneration by reusing values recently written to cache
1735 // tens of milliseconds ago. Verify the "as of" time against the last purge event.
1736 $lastPurgeTime = max(
1737 // RES_TOUCH_AS_OF depends on the value (possibly from the interim key)
1738 $volState[self::RES_TOUCH_AS_OF],
1739 $curState[self::RES_TOMB_AS_OF],
1740 $curState[self::RES_CHECK_AS_OF]
1741 );
1742 $safeMinAsOf = max( $minAsOf, $lastPurgeTime + self::TINY_POSITIVE );
1743
1744 if ( $volState[self::RES_VALUE] === false || $volState[self::RES_AS_OF] < $safeMinAsOf ) {
1745 $isExtremelyNewValue = false;
1746 } else {
1747 $age = $startTime - $volState[self::RES_AS_OF];
1748 $isExtremelyNewValue = ( $age < mt_rand( self::RECENT_SET_LOW_MS, self::RECENT_SET_HIGH_MS ) / 1e3 );
1749 }
1750 if ( $isExtremelyNewValue ) {
1751 $this->logger->debug( "fetchOrRegenerate($key): volatile hit" );
1752
1753 $this->stats->getTiming( 'wanobjectcache_getwithset_seconds' )
1754 ->setLabel( 'keygroup', $keygroup )
1755 ->setLabel( 'result', 'hit' )
1756 ->setLabel( 'reason', 'volatile' )
1757 ->observe( 1e3 * ( $this->getCurrentTime() - $startTime ) );
1758
1759 return [ $volValue, $volState[self::RES_VERSION], $curState[self::RES_AS_OF] ];
1760 }
1761
1762 $lockTSE = $opts['lockTSE'] ?? self::TSE_NONE;
1763 $busyValue = $opts['busyValue'] ?? null;
1764 $staleTTL = $opts['staleTTL'] ?? self::STALE_TTL_NONE;
1765 $segmentable = $opts['segmentable'] ?? false;
1766 $version = $opts['version'] ?? null;
1767
1768 // Determine whether one thread per datacenter should handle regeneration at a time
1769 $useRegenerationLock =
1770 // Note that since tombstones no-op set(), $lockTSE and $curTTL cannot be used to
1771 // deduce the key hotness because |$curTTL| will always keep increasing until the
1772 // tombstone expires or is overwritten by a new tombstone. Also, even if $lockTSE
1773 // is not set, constant regeneration of a key for the tombstone lifetime might be
1774 // very expensive. Assume tombstoned keys are possibly hot in order to reduce
1775 // the risk of high regeneration load after the delete() method is called.
1776 $isKeyTombstoned ||
1777 // Assume a key is hot if requested soon ($lockTSE seconds) after purge.
1778 // This avoids stampedes when timestamps from $checkKeys/$touchedCb bump.
1779 (
1780 $curState[self::RES_CUR_TTL] !== null &&
1781 $curState[self::RES_CUR_TTL] <= 0 &&
1782 abs( $curState[self::RES_CUR_TTL] ) <= $lockTSE
1783 ) ||
1784 // Assume a key is hot if there is no value and a busy fallback is given.
1785 // This avoids stampedes on eviction or preemptive regeneration taking too long.
1786 ( $busyValue !== null && $volValue === false );
1787
1788 // If a regeneration lock is required, threads that do not get the lock will try to use
1789 // the stale value, the interim value, or the $busyValue placeholder, in that order. If
1790 // none of those are set then all threads will bypass the lock and regenerate the value.
1791 $mutexKey = $this->makeSisterKey( $key, self::TYPE_MUTEX );
1792 // Note that locking is not bypassed due to I/O errors; this avoids stampedes
1793 $hasLock = $useRegenerationLock && $this->cache->add( $mutexKey, 1, self::LOCK_TTL );
1794 if ( $useRegenerationLock && !$hasLock ) {
1795 // Determine if there is stale or volatile cached value that is still usable
1796 // @phan-suppress-next-line PhanTypeMismatchArgumentNullable False positive
1797 if ( $this->isValid( $volValue, $volState[self::RES_AS_OF], $minAsOf ) ) {
1798 $this->logger->debug( "fetchOrRegenerate($key): returning stale value" );
1799
1800 $this->stats->getTiming( 'wanobjectcache_getwithset_seconds' )
1801 ->setLabel( 'keygroup', $keygroup )
1802 ->setLabel( 'result', 'hit' )
1803 ->setLabel( 'reason', 'stale' )
1804 ->observe( 1e3 * ( $this->getCurrentTime() - $startTime ) );
1805
1806 return [ $volValue, $volState[self::RES_VERSION], $curState[self::RES_AS_OF] ];
1807 } elseif ( $busyValue !== null ) {
1808 $miss = is_infinite( $minAsOf ) ? 'renew' : 'miss';
1809 $this->logger->debug( "fetchOrRegenerate($key): busy $miss" );
1810
1811 $this->stats->getTiming( 'wanobjectcache_getwithset_seconds' )
1812 ->setLabel( 'keygroup', $keygroup )
1813 ->setLabel( 'result', $miss )
1814 ->setLabel( 'reason', 'busy' )
1815 ->observe( 1e3 * ( $this->getCurrentTime() - $startTime ) );
1816
1817 $placeholderValue = ( $busyValue instanceof Closure ) ? $busyValue() : $busyValue;
1818
1819 return [ $placeholderValue, $version, $curState[self::RES_AS_OF] ];
1820 }
1821 }
1822
1823 // Generate the new value given any prior value with a matching version
1824 $setOpts = [];
1825 $preCallbackTime = $this->getCurrentTime();
1826 ++$this->callbackDepth;
1827 // https://github.com/phan/phan/issues/4419
1829 $value = null;
1830 try {
1831 $value = $callback(
1832 ( $curState[self::RES_VERSION] === $version ) ? $curValue : false,
1833 $ttl,
1834 $setOpts,
1835 ( $curState[self::RES_VERSION] === $version ) ? $curState[self::RES_AS_OF] : null,
1836 $cbParams
1837 );
1838 } finally {
1839 --$this->callbackDepth;
1840 }
1841 $postCallbackTime = $this->getCurrentTime();
1842
1843 // How long it took to generate the value
1844 $walltime = max( $postCallbackTime - $preCallbackTime, 0.0 );
1845
1846 $this->stats->getTiming( 'wanobjectcache_regen_seconds' )
1847 ->setLabel( 'keygroup', $keygroup )
1848 ->observe( 1e3 * $walltime );
1849
1850 // Attempt to save the newly generated value if applicable
1851 if (
1852 // Callback yielded a cacheable value
1853 ( $value !== false && $ttl >= 0 ) &&
1854 // Current thread was not raced out of a regeneration lock or key is tombstoned
1855 ( !$useRegenerationLock || $hasLock || $isKeyTombstoned )
1856 ) {
1857 // If the key is write-holed then use the (volatile) interim key as an alternative
1858 if ( $isKeyTombstoned ) {
1859 $this->setInterimValue(
1860 $key,
1861 $value,
1862 $lockTSE,
1863 $version,
1864 $segmentable
1865 );
1866 } else {
1867 $this->setMainValue(
1868 $key,
1869 $value,
1870 $ttl,
1871 $version,
1872 $walltime,
1873 // @phan-suppress-next-line PhanCoalescingAlwaysNull
1874 $setOpts['lag'] ?? 0,
1875 // @phan-suppress-next-line PhanCoalescingAlwaysNull
1876 $setOpts['since'] ?? $preCallbackTime,
1877 // @phan-suppress-next-line PhanCoalescingAlwaysNull
1878 $setOpts['pending'] ?? false,
1879 $lockTSE,
1880 $staleTTL,
1881 $segmentable,
1882 ( $curValue === false )
1883 );
1884 }
1885 }
1886
1887 if ( $hasLock ) {
1888 $this->cache->delete( $mutexKey, $this->cache::WRITE_BACKGROUND );
1889 }
1890
1891 $miss = is_infinite( $minAsOf ) ? 'renew' : 'miss';
1892 $this->logger->debug( "fetchOrRegenerate($key): $miss, new value computed" );
1893
1894 $this->stats->getTiming( 'wanobjectcache_getwithset_seconds' )
1895 ->setLabel( 'keygroup', $keygroup )
1896 ->setLabel( 'result', $miss )
1897 ->setLabel( 'reason', 'compute' )
1898 ->observe( 1e3 * ( $this->getCurrentTime() - $startTime ) );
1899
1900 return [ $value, $version, $curState[self::RES_AS_OF] ];
1901 }
1902
1912 private function makeSisterKey( string $baseKey, string $typeChar ) {
1913 if ( $this->coalesceScheme === self::SCHEME_HASH_STOP ) {
1914 // Key style: "WANCache:<base key>|#|<character>"
1915 $sisterKey = 'WANCache:' . $baseKey . '|#|' . $typeChar;
1916 } else {
1917 // Key style: "WANCache:{<base key>}:<character>"
1918 $sisterKey = 'WANCache:{' . $baseKey . '}:' . $typeChar;
1919 }
1920 return $sisterKey;
1921 }
1922
1932 private function getInterimValue( $key, $minAsOf, $now, $touchedCb ) {
1933 if ( $this->useInterimHoldOffCaching ) {
1934 $interimSisterKey = $this->makeSisterKey( $key, self::TYPE_INTERIM );
1935 $wrapped = $this->cache->get( $interimSisterKey );
1936 $res = $this->unwrap( $wrapped, $now );
1937 if ( $res[self::RES_VALUE] !== false && $res[self::RES_AS_OF] >= $minAsOf ) {
1938 if ( $touchedCb !== null ) {
1939 // Update "last purge time" since the $touchedCb timestamp depends on $value
1940 // Get the new "touched timestamp", accounting for callback-checked dependencies
1941 $res[self::RES_TOUCH_AS_OF] = max(
1942 $touchedCb( $res[self::RES_VALUE] ),
1943 $res[self::RES_TOUCH_AS_OF]
1944 );
1945 }
1946
1947 return $res;
1948 }
1949 }
1950
1951 return $this->unwrap( false, $now );
1952 }
1953
1962 private function setInterimValue(
1963 $key,
1964 $value,
1965 $ttl,
1966 ?int $version,
1967 bool $segmentable
1968 ) {
1969 $now = $this->getCurrentTime();
1970 $ttl = max( self::INTERIM_KEY_TTL, (int)$ttl );
1971
1972 // Wrap that value with time/TTL/version metadata
1973 $wrapped = $this->wrap( $value, $ttl, $version, $now );
1974
1975 $flags = $this->cache::WRITE_BACKGROUND;
1976 if ( $segmentable ) {
1977 $flags |= $this->cache::WRITE_ALLOW_SEGMENTS;
1978 }
1979
1980 return $this->cache->set(
1981 $this->makeSisterKey( $key, self::TYPE_INTERIM ),
1982 $wrapped,
1983 $ttl,
1984 $flags
1985 );
1986 }
1987
2053 final public function getMultiWithSetCallback(
2054 ArrayIterator $keyedIds, $ttl, callable $callback, array $opts = []
2055 ) {
2056 $span = $this->startOperationSpan( __FUNCTION__, '' );
2057 if ( $span->getContext()->isSampled() ) {
2058 $span->setAttributes( [
2059 'org.wikimedia.wancache.multi_count' => $keyedIds->count(),
2060 'org.wikimedia.wancache.ttl' => $ttl,
2061 ] );
2062 }
2063 // Batch load required keys into the in-process warmup cache
2064 $this->warmupCache = $this->fetchWrappedValuesForWarmupCache(
2065 $this->getNonProcessCachedMultiKeys( $keyedIds, $opts ),
2066 $opts['checkKeys'] ?? []
2067 );
2068 $this->warmupKeyMisses = 0;
2069
2070 // The required callback signature includes $id as the first argument for convenience
2071 // to distinguish different items. To reuse the code in getWithSetCallback(), wrap the
2072 // callback with a proxy callback that has the standard getWithSetCallback() signature.
2073 // This is defined only once per batch to avoid closure creation overhead.
2074 $proxyCb = static function ( $oldValue, &$ttl, &$setOpts, $oldAsOf, $params )
2075 use ( $callback )
2076 {
2077 return $callback( $params['id'], $oldValue, $ttl, $setOpts, $oldAsOf );
2078 };
2079
2080 // Get the order-preserved result map using the warm-up cache
2081 $values = [];
2082 foreach ( $keyedIds as $key => $id ) {
2083 $values[$key] = $this->getWithSetCallback(
2084 $key,
2085 $ttl,
2086 $proxyCb,
2087 $opts,
2088 [ 'id' => $id ]
2089 );
2090 }
2091
2092 $this->warmupCache = [];
2093
2094 return $values;
2095 }
2096
2163 final public function getMultiWithUnionSetCallback(
2164 ArrayIterator $keyedIds, $ttl, callable $callback, array $opts = []
2165 ) {
2166 $span = $this->startOperationSpan( __FUNCTION__, '' );
2167 if ( $span->getContext()->isSampled() ) {
2168 $span->setAttributes( [
2169 'org.wikimedia.wancache.multi_count' => $keyedIds->count(),
2170 'org.wikimedia.wancache.ttl' => $ttl,
2171 ] );
2172 }
2173 $checkKeys = $opts['checkKeys'] ?? []; // TODO: ???
2174 $minAsOf = $opts['minAsOf'] ?? self::MIN_TIMESTAMP_NONE;
2175
2176 // unset incompatible keys
2177 unset( $opts['lockTSE'] );
2178 unset( $opts['busyValue'] );
2179
2180 // Batch load required keys into the in-process warmup cache
2181 $keysByIdGet = $this->getNonProcessCachedMultiKeys( $keyedIds, $opts );
2182 $this->warmupCache = $this->fetchWrappedValuesForWarmupCache( $keysByIdGet, $checkKeys );
2183 $this->warmupKeyMisses = 0;
2184
2185 // IDs of entities known to be in need of generation
2186 $idsRegen = [];
2187
2188 // Find out which keys are missing/deleted/stale
2189 $now = $this->getCurrentTime();
2190 $resByKey = $this->fetchKeys( $keysByIdGet, $checkKeys, $now );
2191 foreach ( $keysByIdGet as $id => $key ) {
2192 $res = $resByKey[$key];
2193 if (
2194 $res[self::RES_VALUE] === false ||
2195 $res[self::RES_CUR_TTL] < 0 ||
2196 $res[self::RES_AS_OF] < $minAsOf
2197 ) {
2198 $idsRegen[] = $id;
2199 }
2200 }
2201
2202 // Run the callback to populate the generation value map for all required IDs
2203 $newSetOpts = [];
2204 $newTTLsById = array_fill_keys( $idsRegen, $ttl );
2205 $newValsById = $idsRegen ? $callback( $idsRegen, $newTTLsById, $newSetOpts ) : [];
2206
2207 $method = __METHOD__;
2208 // The required callback signature includes $id as the first argument for convenience
2209 // to distinguish different items. To reuse the code in getWithSetCallback(), wrap the
2210 // callback with a proxy callback that has the standard getWithSetCallback() signature.
2211 // This is defined only once per batch to avoid closure creation overhead.
2212 $proxyCb = function ( $oldValue, &$ttl, &$setOpts, $oldAsOf, $params )
2213 use ( $callback, $newValsById, $newTTLsById, $newSetOpts, $method )
2214 {
2215 $id = $params['id'];
2216
2217 if ( array_key_exists( $id, $newValsById ) ) {
2218 // Value was already regenerated as expected, so use the value in $newValsById
2219 $newValue = $newValsById[$id];
2220 $ttl = $newTTLsById[$id];
2221 $setOpts = $newSetOpts;
2222 } else {
2223 // Pre-emptive/popularity refresh and version mismatch cases are not detected
2224 // above and thus $newValsById has no entry. Run $callback on this single entity.
2225 $ttls = [ $id => $ttl ];
2226 $result = $callback( [ $id ], $ttls, $setOpts );
2227 if ( !isset( $result[$id] ) ) {
2228 // T303092
2229 $this->logger->warning(
2230 $method . ' failed due to {id} not set in result {result}', [
2231 'id' => $id,
2232 'result' => json_encode( $result )
2233 ] );
2234 }
2235 $newValue = $result[$id];
2236 $ttl = $ttls[$id];
2237 }
2238
2239 return $newValue;
2240 };
2241
2242 // Get the order-preserved result map using the warm-up cache
2243 $values = [];
2244 foreach ( $keyedIds as $key => $id ) {
2245 $values[$key] = $this->getWithSetCallback(
2246 $key,
2247 $ttl,
2248 $proxyCb,
2249 $opts,
2250 [ 'id' => $id ]
2251 );
2252 }
2253
2254 $this->warmupCache = [];
2255
2256 return $values;
2257 }
2258
2266 public function makeGlobalKey( $keygroup, ...$components ) {
2267 return $this->cache->makeGlobalKey( $keygroup, ...$components );
2268 }
2269
2277 public function makeKey( $keygroup, ...$components ) {
2278 return $this->cache->makeKey( $keygroup, ...$components );
2279 }
2280
2322 final public function makeMultiKeys( array $ids, $keyCallback ) {
2323 $idByKey = [];
2324 foreach ( $ids as $id ) {
2325 $key = $keyCallback( $id, $this );
2326 // Edge case: ignore key collisions due to duplicate $ids like "42" and 42
2327 if ( !isset( $idByKey[$key] ) ) {
2328 $idByKey[$key] = $id;
2329 } elseif ( (string)$id !== (string)$idByKey[$key] ) {
2330 throw new UnexpectedValueException(
2331 "Cache key collision; IDs ('$id','{$idByKey[$key]}') map to '$key'"
2332 );
2333 }
2334 }
2335
2336 return new ArrayIterator( $idByKey );
2337 }
2338
2374 final public function multiRemap( array $ids, array $res ) {
2375 if ( count( $ids ) !== count( $res ) ) {
2376 // If makeMultiKeys() is called on a list of non-unique IDs, then the resulting
2377 // ArrayIterator will have less entries due to "first appearance" de-duplication
2378 $ids = array_keys( array_fill_keys( $ids, true ) );
2379 if ( count( $ids ) !== count( $res ) ) {
2380 throw new UnexpectedValueException( "Multi-key result does not match ID list" );
2381 }
2382 }
2383
2384 return array_combine( $ids, $res );
2385 }
2386
2393 public function watchErrors() {
2394 return $this->cache->watchErrors();
2395 }
2396
2414 final public function getLastError( $watchPoint = 0 ) {
2415 $code = $this->cache->getLastError( $watchPoint );
2416 switch ( $code ) {
2417 case BagOStuff::ERR_NONE:
2418 return BagOStuff::ERR_NONE;
2419 case BagOStuff::ERR_NO_RESPONSE:
2420 return BagOStuff::ERR_NO_RESPONSE;
2421 case BagOStuff::ERR_UNREACHABLE:
2422 return BagOStuff::ERR_UNREACHABLE;
2423 default:
2424 return BagOStuff::ERR_UNEXPECTED;
2425 }
2426 }
2427
2433 public function clearProcessCache() {
2434 $this->processCaches = [];
2435 }
2436
2457 final public function useInterimHoldOffCaching( $enabled ) {
2458 $this->useInterimHoldOffCaching = $enabled;
2459 }
2460
2466 public function getQoS( $flag ) {
2467 return $this->cache->getQoS( $flag );
2468 }
2469
2533 public function adaptiveTTL( $mtime, $maxTTL, $minTTL = 30, $factor = 0.2 ) {
2534 // handle fractional seconds and string integers
2535 $mtime = (int)$mtime;
2536 if ( $mtime <= 0 ) {
2537 // no last-modified time provided
2538 return $minTTL;
2539 }
2540
2541 $age = (int)$this->getCurrentTime() - $mtime;
2542
2543 return (int)min( $maxTTL, max( $minTTL, $factor * $age ) );
2544 }
2545
2551 final public function getWarmupKeyMisses() {
2552 // Number of misses in $this->warmupCache during the last call to certain methods
2553 return $this->warmupKeyMisses;
2554 }
2555
2560 protected function getRouteKey( string $sisterKey ) {
2561 if ( $this->broadcastRoute !== null ) {
2562 if ( $sisterKey[0] === '/' ) {
2563 throw new RuntimeException( "Sister key '$sisterKey' already contains a route." );
2564 }
2565 return $this->broadcastRoute . $sisterKey;
2566 }
2567 return $sisterKey;
2568 }
2569
2581 private function scheduleAsyncRefresh( $key, $ttl, $callback, array $opts, array $cbParams ) {
2582 if ( !$this->asyncHandler ) {
2583 return false;
2584 }
2585 // Update the cache value later, such during post-send of an HTTP request. This forces
2586 // cache regeneration by setting "minAsOf" to infinity, meaning that no existing value
2587 // is considered valid. Furthermore, note that preemptive regeneration is not applicable
2588 // to invalid values, so there is no risk of infinite preemptive regeneration loops.
2589 $func = $this->asyncHandler;
2590 $func( function () use ( $key, $ttl, $callback, $opts, $cbParams ) {
2591 $opts['minAsOf'] = INF;
2592 try {
2593 $this->fetchOrRegenerate( $key, $ttl, $callback, $opts, $cbParams );
2594 } catch ( Exception $e ) {
2595 // Log some context for easier debugging
2596 $this->logger->error( 'Async refresh failed for {key}', [
2597 'key' => $key,
2598 'ttl' => $ttl,
2599 'exception' => $e
2600 ] );
2601 throw $e;
2602 }
2603 } );
2604
2605 return true;
2606 }
2607
2616 private function isAcceptablyFreshValue( $res, $graceTTL, $minAsOf ) {
2617 if ( !$this->isValid( $res[self::RES_VALUE], $res[self::RES_AS_OF], $minAsOf ) ) {
2618 // Value does not exists or is too old
2619 return false;
2620 }
2621
2622 $curTTL = $res[self::RES_CUR_TTL];
2623 if ( $curTTL > 0 ) {
2624 // Value is definitely still fresh
2625 return true;
2626 }
2627
2628 // Remaining seconds during which this stale value can be used
2629 $curGraceTTL = $graceTTL + $curTTL;
2630
2631 return ( $curGraceTTL > 0 )
2632 // Chance of using the value decreases as $curTTL goes from 0 to -$graceTTL
2633 ? !$this->worthRefreshExpiring( $curGraceTTL, $graceTTL, $graceTTL )
2634 // Value is too stale to fall in the grace period
2635 : false;
2636 }
2637
2648 protected function isLotteryRefreshDue( $res, $lowTTL, $ageNew, $hotTTR, $now ) {
2649 $curTTL = $res[self::RES_CUR_TTL];
2650 $logicalTTL = $res[self::RES_TTL];
2651 $asOf = $res[self::RES_AS_OF];
2652
2653 return (
2654 $this->worthRefreshExpiring( $curTTL, $logicalTTL, $lowTTL ) ||
2655 $this->worthRefreshPopular( $asOf, $ageNew, $hotTTR, $now )
2656 );
2657 }
2658
2696 protected function worthRefreshPopular( $asOf, $ageNew, $hotTTR, $now ) {
2697 if ( $ageNew < 0 || $hotTTR <= 0 ) {
2698 return false;
2699 }
2700
2701 $age = $now - $asOf;
2702 $timeOld = $age - $ageNew;
2703 if ( $timeOld <= 0 ) {
2704 return false;
2705 }
2706
2707 $popularHitsPerSec = 1;
2708 // Lifecycle is: new, ramp-up refresh chance, full refresh chance.
2709 // Note that the "expected # of refreshes" for the ramp-up time range is half
2710 // of what it would be if P(refresh) was at its full value during that time range.
2711 $refreshWindowSec = max( $hotTTR - $ageNew - self::RAMPUP_TTL / 2, 1 );
2712 // P(refresh) * (# hits in $refreshWindowSec) = (expected # of refreshes)
2713 // P(refresh) * ($refreshWindowSec * $popularHitsPerSec) = 1 (by definition)
2714 // P(refresh) = 1/($refreshWindowSec * $popularHitsPerSec)
2715 $chance = 1 / ( $popularHitsPerSec * $refreshWindowSec );
2716 // Ramp up $chance from 0 to its nominal value over RAMPUP_TTL seconds to avoid stampedes
2717 $chance *= ( $timeOld <= self::RAMPUP_TTL ) ? $timeOld / self::RAMPUP_TTL : 1;
2718
2719 return ( mt_rand( 1, 1_000_000_000 ) <= 1_000_000_000 * $chance );
2720 }
2721
2758 protected function worthRefreshExpiring( $curTTL, $logicalTTL, $lowTTL ) {
2759 if ( $lowTTL <= 0 ) {
2760 return false;
2761 }
2762 // T264787: avoid having keys start off with a high chance of being refreshed;
2763 // the point where refreshing becomes possible cannot precede the key lifetime.
2764 $effectiveLowTTL = min( $lowTTL, $logicalTTL ?: INF );
2765
2766 // How long the value was in the "low TTL" phase
2767 $timeOld = $effectiveLowTTL - $curTTL;
2768 if ( $timeOld <= 0 || $timeOld >= $effectiveLowTTL ) {
2769 return false;
2770 }
2771
2772 // Ratio of the low TTL phase that has elapsed (r)
2773 $ttrRatio = $timeOld / $effectiveLowTTL;
2774 // Use p(r) as the monotonically increasing "chance of refresh" function,
2775 // having p(0)=0 and p(1)=1. The value expires at the nominal expiry.
2776 $chance = $ttrRatio ** 4;
2777
2778 return ( mt_rand( 1, 1_000_000_000 ) <= 1_000_000_000 * $chance );
2779 }
2780
2789 protected function isValid( $value, $asOf, $minAsOf ) {
2790 return ( $value !== false && $asOf >= $minAsOf );
2791 }
2792
2800 private function wrap( $value, $ttl, $version, $now ) {
2801 // Returns keys in ascending integer order for PHP7 array packing:
2802 // https://nikic.github.io/2014/12/22/PHPs-new-hashtable-implementation.html
2803 $wrapped = [
2804 self::FLD_FORMAT_VERSION => self::VERSION,
2805 self::FLD_VALUE => $value,
2806 self::FLD_TTL => $ttl,
2807 self::FLD_TIME => $now
2808 ];
2809 if ( $version !== null ) {
2810 $wrapped[self::FLD_VALUE_VERSION] = $version;
2811 }
2812
2813 return $wrapped;
2814 }
2815
2830 private function unwrap( $wrapped, $now ) {
2831 // https://nikic.github.io/2014/12/22/PHPs-new-hashtable-implementation.html
2832 $res = [
2833 // Attributes that only depend on the fetched key value
2834 self::RES_VALUE => false,
2835 self::RES_VERSION => null,
2836 self::RES_AS_OF => null,
2837 self::RES_TTL => null,
2838 self::RES_TOMB_AS_OF => null,
2839 // Attributes that depend on caller-specific "check" keys or "touched callbacks"
2840 self::RES_CHECK_AS_OF => null,
2841 self::RES_TOUCH_AS_OF => null,
2842 self::RES_CUR_TTL => null
2843 ];
2844
2845 if ( is_array( $wrapped ) ) {
2846 // Entry expected to be a cached value; validate it
2847 if (
2848 ( $wrapped[self::FLD_FORMAT_VERSION] ?? null ) === self::VERSION &&
2849 $wrapped[self::FLD_TIME] >= $this->epoch
2850 ) {
2851 if ( $wrapped[self::FLD_TTL] > 0 ) {
2852 // Get the approximate time left on the key
2853 $age = $now - $wrapped[self::FLD_TIME];
2854 $curTTL = max( $wrapped[self::FLD_TTL] - $age, 0.0 );
2855 } else {
2856 // Key had no TTL, so the time left is unbounded
2857 $curTTL = INF;
2858 }
2859 $res[self::RES_VALUE] = $wrapped[self::FLD_VALUE];
2860 $res[self::RES_VERSION] = $wrapped[self::FLD_VALUE_VERSION] ?? null;
2861 $res[self::RES_AS_OF] = $wrapped[self::FLD_TIME];
2862 $res[self::RES_CUR_TTL] = $curTTL;
2863 $res[self::RES_TTL] = $wrapped[self::FLD_TTL];
2864 }
2865 } else {
2866 // Entry expected to be a tombstone; parse it
2867 $purge = $this->parsePurgeValue( $wrapped );
2868 if ( $purge !== null ) {
2869 // Tombstoned keys should always have a negative "current TTL"
2870 $curTTL = min( $purge[self::PURGE_TIME] - $now, self::TINY_NEGATIVE );
2871 $res[self::RES_CUR_TTL] = $curTTL;
2872 $res[self::RES_TOMB_AS_OF] = $purge[self::PURGE_TIME];
2873 }
2874 }
2875
2876 return $res;
2877 }
2878
2884 private function determineKeyGroupForStats( $key ) {
2885 $parts = explode( ':', $key, 3 );
2886 // Fallback in case the key was not made by makeKey.
2887 // Replace dots because they are special in StatsD (T232907)
2888 return strtr( $parts[1] ?? $parts[0], '.', '_' );
2889 }
2890
2899 private function parsePurgeValue( $value ) {
2900 if ( !is_string( $value ) ) {
2901 return null;
2902 }
2903
2904 $segments = explode( ':', $value, 3 );
2905 $prefix = $segments[0];
2906 if ( $prefix !== self::PURGE_VAL_PREFIX ) {
2907 // Not a purge value
2908 return null;
2909 }
2910
2911 $timestamp = (float)$segments[1];
2912 // makeTombstonePurgeValue() doesn't store hold-off TTLs
2913 $holdoff = isset( $segments[2] ) ? (int)$segments[2] : self::HOLDOFF_TTL;
2914
2915 if ( $timestamp < $this->epoch ) {
2916 // Purge value is too old
2917 return null;
2918 }
2919
2920 return [ self::PURGE_TIME => $timestamp, self::PURGE_HOLDOFF => $holdoff ];
2921 }
2922
2929 private function makeCheckPurgeValue( float $timestamp, int $holdoff, ?array &$purge = null ) {
2930 $normalizedTime = (int)$timestamp;
2931 // Purge array that matches what parsePurgeValue() would have returned
2932 $purge = [ self::PURGE_TIME => (float)$normalizedTime, self::PURGE_HOLDOFF => $holdoff ];
2933
2934 return self::PURGE_VAL_PREFIX . ":$normalizedTime:$holdoff";
2935 }
2936
2941 private function getProcessCache( $group ) {
2942 if ( !isset( $this->processCaches[$group] ) ) {
2943 [ , $size ] = explode( ':', $group );
2944 $this->processCaches[$group] = new MapCacheLRU( (int)$size );
2945 if ( $this->wallClockOverride !== null ) {
2946 $this->processCaches[$group]->setMockTime( $this->wallClockOverride );
2947 }
2948 }
2949
2950 return $this->processCaches[$group];
2951 }
2952
2958 private function getNonProcessCachedMultiKeys( ArrayIterator $keys, array $opts ) {
2959 $pcTTL = $opts['pcTTL'] ?? self::TTL_UNCACHEABLE;
2960
2961 $keysMissing = [];
2962 if ( $pcTTL > 0 && $this->callbackDepth == 0 ) {
2963 $pCache = $this->getProcessCache( $opts['pcGroup'] ?? self::PC_PRIMARY );
2964 foreach ( $keys as $key => $id ) {
2965 if ( !$pCache->has( $key, $pcTTL ) ) {
2966 $keysMissing[$id] = $key;
2967 }
2968 }
2969 }
2970
2971 return $keysMissing;
2972 }
2973
2980 private function fetchWrappedValuesForWarmupCache( array $keys, array $checkKeys ) {
2981 if ( !$keys ) {
2982 return [];
2983 }
2984
2985 // Get all the value keys to fetch...
2986 $sisterKeys = [];
2987 foreach ( $keys as $baseKey ) {
2988 $sisterKeys[] = $this->makeSisterKey( $baseKey, self::TYPE_VALUE );
2989 }
2990 // Get all the "check" keys to fetch...
2991 foreach ( $checkKeys as $i => $checkKeyOrKeyGroup ) {
2992 // Note: avoid array_merge() inside loop in case there are many keys
2993 if ( is_int( $i ) ) {
2994 // Single "check" key that applies to all value keys
2995 $sisterKeys[] = $this->makeSisterKey( $checkKeyOrKeyGroup, self::TYPE_TIMESTAMP );
2996 } else {
2997 // List of "check" keys that apply to a specific value key
2998 foreach ( (array)$checkKeyOrKeyGroup as $checkKey ) {
2999 $sisterKeys[] = $this->makeSisterKey( $checkKey, self::TYPE_TIMESTAMP );
3000 }
3001 }
3002 }
3003
3004 $wrappedBySisterKey = $this->cache->getMulti( $sisterKeys );
3005 $wrappedBySisterKey += array_fill_keys( $sisterKeys, false );
3006
3007 return $wrappedBySisterKey;
3008 }
3009
3015 private function timeSinceLoggedMiss( $key, $now ) {
3016 // phpcs:ignore Generic.CodeAnalysis.AssignmentInCondition.Found
3017 for ( end( $this->missLog ); $miss = current( $this->missLog ); prev( $this->missLog ) ) {
3018 if ( $miss[0] === $key ) {
3019 return ( $now - $miss[1] );
3020 }
3021 }
3022
3023 return null;
3024 }
3025
3030 protected function getCurrentTime() {
3031 return $this->wallClockOverride ?: microtime( true );
3032 }
3033
3038 public function setMockTime( &$time ) {
3039 $this->wallClockOverride =& $time;
3040 $this->cache->setMockTime( $time );
3041 foreach ( $this->processCaches as $pCache ) {
3042 $pCache->setMockTime( $time );
3043 }
3044 }
3045
3057 private function startOperationSpan( $opName, $keys, $checkKeys = [] ) {
3058 $span = $this->tracer->createSpan( "WANObjectCache::$opName" )
3059 ->setSpanKind( SpanInterface::SPAN_KIND_CLIENT )
3060 ->start();
3061
3062 if ( !$span->getContext()->isSampled() ) {
3063 return $span;
3064 }
3065
3066 $keys = is_array( $keys ) ? implode( ' ', $keys ) : $keys;
3067
3068 if ( count( $checkKeys ) > 0 ) {
3069 $checkKeys = array_map(
3070 static fn ( $checkKeyOrKeyGroup ) =>
3071 is_array( $checkKeyOrKeyGroup )
3072 ? implode( ' ', $checkKeyOrKeyGroup )
3073 : $checkKeyOrKeyGroup,
3074 $checkKeys );
3075
3076 $checkKeys = implode( ' ', $checkKeys );
3077 $span->setAttributes( [ 'org.wikimedia.wancache.check_keys' => $checkKeys ] );
3078 }
3079
3080 $span->setAttributes( [ 'org.wikimedia.wancache.keys' => $keys ] );
3081
3082 $span->activate();
3083 return $span;
3084 }
3085}
3086
3088class_alias( WANObjectCache::class, 'WANObjectCache' );
Store key-value entries in a size-limited in-memory LRU cache.
Abstract class for any ephemeral data store.
Definition BagOStuff.php:73
No-op implementation that stores nothing.
Multi-datacenter aware caching interface.
makeMultiKeys(array $ids, $keyCallback)
Get an iterator of (cache key => entity ID) for a list of entity IDs.
adaptiveTTL( $mtime, $maxTTL, $minTTL=30, $factor=0.2)
Get a TTL that is higher for objects that have not changed recently.
watchErrors()
Get a "watch point" token that can be used to get the "last error" to occur after now.
bool $useInterimHoldOffCaching
Whether to use "interim" caching while keys are tombstoned.
static newEmpty()
Get an instance that wraps EmptyBagOStuff.
const HOLDOFF_TTL_NONE
Idiom for delete()/touchCheckKey() meaning "no hold-off period".
float $epoch
Unix timestamp of the oldest possible valid values.
const KEY_VERSION
Version number attribute for a key; keep value for b/c (< 1.36)
fetchKeys(array $keys, array $checkKeys, float $now, $touchedCb=null)
Fetch the value and key metadata of several keys from cache.
isLotteryRefreshDue( $res, $lowTTL, $ageNew, $hotTTR, $now)
Check if a key is due for randomized regeneration due to near-expiration/popularity.
resetCheckKey( $key)
Clear the last-purge timestamp of a "check" key in all datacenters.
int $coalesceScheme
Scheme to use for key coalescing (Hash Tags or Hash Stops)
worthRefreshExpiring( $curTTL, $logicalTTL, $lowTTL)
Check if a key is nearing expiration and thus due for randomized regeneration.
makeGlobalKey( $keygroup,... $components)
const STALE_TTL_NONE
Idiom for set()/getWithSetCallback() meaning "no post-expiration persistence".
isValid( $value, $asOf, $minAsOf)
Check that a wrapper value exists and has an acceptable age.
const TTL_LAGGED
Max TTL, in seconds, to store keys when a data source has high replication lag.
getMultiCheckKeyTime(array $keys)
Fetch the values of each timestamp "check" key.
getWithSetCallback( $key, $ttl, $callback, array $opts=[], array $cbParams=[])
Method to fetch/regenerate a cache key.
getMultiWithSetCallback(ArrayIterator $keyedIds, $ttl, callable $callback, array $opts=[])
Method to fetch multiple cache keys at once with regeneration.
const KEY_CUR_TTL
Remaining TTL attribute for a key; keep value for b/c (< 1.36)
BagOStuff $cache
The local datacenter cache.
const HOLDOFF_TTL
Seconds to tombstone keys on delete() and to treat keys as volatile after purges.
string null $broadcastRoute
Routing prefix for operations that should be broadcasted to all data centers.
touchCheckKey( $key, $holdoff=self::HOLDOFF_TTL)
Increase the last-purge timestamp of a "check" key in all datacenters.
getLastError( $watchPoint=0)
Get the "last error" registry.
const KEY_TTL
Logical TTL attribute for a key.
const KEY_AS_OF
Generation completion timestamp attribute for a key; keep value for b/c (< 1.36)
const KEY_CHECK_AS_OF
Highest "check" key timestamp for a key; keep value for b/c (< 1.36)
callable null $asyncHandler
Function that takes a WAN cache callback and runs it later.
getCheckKeyTime( $key)
Fetch the value of a timestamp "check" key.
const KEY_TOMB_AS_OF
Tombstone timestamp attribute for a key; keep value for b/c (< 1.36)
MapCacheLRU[] $processCaches
Map of group PHP instance caches.
makeKey( $keygroup,... $components)
getMulti(array $keys, &$curTTLs=[], array $checkKeys=[], &$info=[])
Fetch the value of several keys from cache.
getMultiWithUnionSetCallback(ArrayIterator $keyedIds, $ttl, callable $callback, array $opts=[])
Method to fetch/regenerate multiple cache keys at once.
const PASS_BY_REF
Idiom for get()/getMulti() to return extra information by reference.
useInterimHoldOffCaching( $enabled)
Enable or disable the use of brief caching for tombstoned keys.
clearProcessCache()
Clear the in-process caches; useful for testing.
worthRefreshPopular( $asOf, $ageNew, $hotTTR, $now)
Check if a key is due for randomized regeneration due to its popularity.
multiRemap(array $ids, array $res)
Get an (ID => value) map from (i) a non-unique list of entity IDs, and (ii) the list of corresponding...
const GRACE_TTL_NONE
Idiom for set()/getWithSetCallback() meaning "no post-expiration grace period".
This is the primary interface for validating metrics definitions, caching defined metrics,...
A no-op tracer that creates no-op spans and persists no data.
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, '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'=> '', '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'=>[], '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'=> false, '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 -o $output $input', 'ImagickExt'=>['SvgHandler::rasterizeImagickExt',],], 'SVGConverter'=> 'ImageMagick', 'SVGConverterPath'=> '', 'SVGMaxSize'=> 5120, 'SVGMetadataCutoff'=> 5242880, 'SVGNativeRendering'=> true, 'SVGNativeRenderingSizeLimit'=> 51200, 'MediaInTargetLanguage'=> true, 'MaxImageArea'=> 12500000, 'MaxAnimatedGifArea'=> 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, 250, 300,], 'ThumbnailNamespaces'=>[6,], 'ThumbnailSteps'=> null, 'ThumbnailStepsRatio'=> null, 'ThumbnailBuckets'=> null, 'ThumbnailMinimumBucketDistance'=> 50, 'UploadThumbnailRenderMap'=>[], 'UploadThumbnailRenderMethod'=> 'jobqueue', 'UploadThumbnailRenderHttpCustomHost'=> false, 'UploadThumbnailRenderHttpCustomDomain'=> false, 'UseTinyRGBForJPGThumbnails'=> false, 'GalleryOptions'=>[], 'ThumbUpright'=> 0.75, 'DirectoryMode'=> 511, 'ResponsiveImages'=> true, 'ImagePreconnect'=> 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, 'UserEmailConfirmationUseHTML'=> false, 'PasswordExpirationDays'=> false, 'PasswordExpireGrace'=> 604800, 'SMTP'=> false, 'AdditionalMailParams'=> null, 'AllowHTMLEmail'=> false, 'EnotifFromEditor'=> false, 'EmailAuthentication'=> true, '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'=>[], 'FileSchemaMigrationStage'=> 3, 'ImageLinksSchemaMigrationStage'=> 769, 'ExternalLinksDomainGaps'=>[], 'ContentHandlers'=>['wikitext'=>['class'=> 'MediaWiki\\Content\\WikitextContentHandler', 'services'=>['TitleFactory', 'ParserFactory', 'GlobalIdGenerator', 'LanguageNameUtils', 'LinkRenderer', 'MagicWordFactory', 'ParsoidParserFactory',],], 'javascript'=>['class'=> 'MediaWiki\\Content\\JavaScriptContentHandler', 'services'=>['MainConfig', 'ParserFactory', 'UserOptionsLookup',],], 'json'=>['class'=> 'MediaWiki\\Content\\JsonContentHandler', 'services'=>['ParsoidParserFactory', 'TitleFactory',],], 'css'=>['class'=> 'MediaWiki\\Content\\CssContentHandler', 'services'=>['MainConfig', 'ParserFactory', 'UserOptionsLookup',],], 'vue'=>['class'=> 'MediaWiki\\Content\\VueContentHandler', 'services'=>['MainConfig', 'ParserFactory',],], '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, 'WarmParsoidParserCache'=> false,], 'ParsoidSelectiveUpdateSampleRate'=> 0, 'ParserCacheFilterConfig'=>['pcache'=>['default'=>['minCpuTime'=> 0,],], 'parsoid-pcache'=>['default'=>['minCpuTime'=> 0,],], 'postproc-pcache'=>['default'=>['minCpuTime'=> 9223372036854775807,],], 'postproc-parsoid-pcache'=>['default'=>['minCpuTime'=> 9223372036854775807,],],], 'ChronologyProtectorSecret'=> '', 'ParserCacheExpireTime'=> 86400, 'ParserCacheAsyncExpireTime'=> 60, 'ParserCacheAsyncRefreshJobs'=> true, 'OldRevisionParserCacheExpireTime'=> 3600, 'ObjectCacheSessionExpiry'=> 3600, 'PHPSessionHandling'=> 'warn', 'SuspiciousIpExpiry'=> false, 'SessionPbkdf2Iterations'=> 10001, 'UseSessionCookieJwt'=> false, '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, 'ForcedRawSMaxage'=> 300, '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',],],], '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, ], '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, 'UseLegacyMediaStyles' => 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, ], ], '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, ], 'AllowSecuritySensitiveOperationIfCannotReauthenticate' => [ 'default' => true, ], '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, '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, ], '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, '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' => [ ], '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, 'pagelang' => true, ], 'editprotected' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => true, 'editprotected' => true, ], 'editmycssjs' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => true, 'editmyusercss' => true, 'editmyuserjson' => true, 'editmyuserjs' => true, ], 'editmyoptions' => [ 'editmyoptions' => true, 'editmyuserjson' => true, ], 'editinterface' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => true, 'editinterface' => true, 'edituserjson' => true, 'editsitejson' => true, ], 'editsiteconfig' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => 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, '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, ], 'viewdeleted' => [ 'browsearchive' => true, 'deletedhistory' => true, 'deletedtext' => true, ], 'viewrestrictedlogs' => [ 'suppressionlog' => true, ], 'delete' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => 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, 'editprotected' => true, 'protect' => true, ], 'viewmywatchlist' => [ 'viewmywatchlist' => true, ], 'editmywatchlist' => [ 'editmywatchlist' => true, ], 'sendemail' => [ 'sendemail' => true, ], 'createaccount' => [ 'createaccount' => true, ], 'privateinfo' => [ 'viewmyprivateinfo' => true, ], 'mergehistory' => [ 'mergehistory' => 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', 'editviewmywatchlist' => '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', ], 'GrantRiskGroups' => [ 'basic' => 'low', 'editpage' => 'low', 'createeditmovepage' => 'low', 'editprotected' => 'vandalism', 'patrol' => 'low', 'uploadfile' => 'low', 'uploadeditmovefile' => 'low', 'sendemail' => 'security', 'viewmywatchlist' => 'low', 'editviewmywatchlist' => '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', ], 'EnableBotPasswords' => true, 'BotPasswordsCluster' => false, 'BotPasswordsDatabase' => false, 'SecretKey' => false, 'JwtPrivateKey' => false, 'JwtPublicKey' => false, 'AllowUserJs' => false, 'AllowUserCss' => false, 'AllowUserCssPrefs' => true, 'UseSiteJs' => true, 'UseSiteCss' => true, 'BreakFrames' => false, 'EditPageFrameOptions' => 'DENY', 'ApiFrameOptions' => 'DENY', 'CSPHeader' => false, 'CSPReportOnlyHeader' => 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, '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' => [ ], 'StatsdServer' => false, 'StatsdMetricPrefix' => 'MediaWiki', 'StatsTarget' => null, 'StatsFormat' => null, 'StatsPrefix' => 'mediawiki', 'OpenTelemetryConfig' => null, 'PageInfoTransclusionLimit' => 50, 'EnableJavaScriptTest' => false, 'CachePrefix' => false, 'DebugToolbar' => false, '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: ], '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' => [ ], 'RCEngines' => [ 'redis' => 'MediaWiki\\RCFeed\\RedisPubSubFeedEngine', 'udp' => 'MediaWiki\\RCFeed\\UDPRCFeedEngine', ], '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, ], '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, '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\\JobQueue\\Jobs\\CategoryMembershipChangeJob', 'services' => [ 'RecentChangeFactory', ], ], 'CategoryCountUpdateJob' => [ 'class' => 'MediaWiki\\JobQueue\\Jobs\\CategoryCountUpdateJob', 'services' => [ 'ConnectionProvider', 'NamespaceInfo', ], ], 'clearUserWatchlist' => 'MediaWiki\\Watchlist\\ClearUserWatchlistJob', 'watchlistExpiry' => 'MediaWiki\\Watchlist\\WatchlistExpiryJob', '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', 'parsoidCachePrewarm' => [ 'class' => 'MediaWiki\\JobQueue\\Jobs\\ParsoidCachePrewarmJob', 'services' => [ 'ParserOutputAccess', 'PageStore', 'RevisionLookup', 'ParsoidSiteConfig', ], 'needsPage' => false, ], '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', 'protect', 'rights', 'delete', 'upload', 'move', 'import', 'interwiki', 'patrol', 'merge', 'suppress', 'tag', 'managetags', 'contentmodel', 'renameuser', ], 'LogRestrictions' => [ 'suppress' => 'suppressionlog', ], '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', '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', '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', ], ], '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', ], ], 'upload' => [ 'upload' => [ 'upload', ], 'overwrite' => [ 'overwrite', ], 'revert' => [ 'revert', ], ], ], 'NewUserLog' => 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', 'Access-Control-Max-Age', 'Authorization', ], 'RestAPIAdditionalRouteFiles' => [ ], 'RestSandboxSpecs' => [ ], '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, 'AsyncHTTPTimeout' => 25, 'HTTPProxy' => '', 'LocalVirtualHosts' => [ ], 'LocalHTTPProxy' => false, 'AllowExternalReqID' => false, 'JobRunRate' => 1, 'RunJobsAsync' => false, 'UpdateRowsPerJob' => 300, 'UpdateRowsPerQuery' => 100, 'RedirectOnLogin' => null, 'VirtualRestConfig' => [ 'paths' => [ ], 'modules' => [ ], 'global' => [ 'timeout' => 360, 'forwardCookies' => false, 'HTTPProxy' => 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' => [ ], 'CloneArticleParserOutput' => true, 'UseLeximorph' => false, 'UsePostprocCache' => false, 'UsePostprocCacheLegacy' => false, 'UsePostprocCacheParsoid' => false, 'ParserOptionsLogUnsafeSampleRate' => 0, ], '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', 'CacheSharedUploads' => 'boolean', 'ForeignUploadTargets' => 'array', 'UploadDialog' => 'object', 'FileBackends' => 'object', 'LockManagers' => 'array', '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', ], 'ThumbnailStepsRatio' => [ 'number', 'null', ], 'ThumbnailBuckets' => [ 'array', 'null', ], 'UploadThumbnailRenderMap' => 'object', 'GalleryOptions' => 'object', 'DjvuDump' => [ 'string', 'null', ], 'DjvuRenderer' => [ 'string', 'null', ], 'DjvuTxt' => [ 'string', 'null', ], 'DjvuPostProcessor' => [ 'string', 'null', ], 'UserEmailConfirmationUseHTML' => 'boolean', 'SMTP' => [ 'boolean', 'object', ], 'EnotifFromEditor' => 'boolean', 'EnotifRevealEditorAddress' => 'boolean', 'UsersNotifiedOnAllChanges' => 'object', 'DBmwschema' => [ 'string', 'null', ], 'SharedTables' => 'array', 'DBservers' => [ 'boolean', 'array', ], 'LBFactoryConf' => 'object', 'LocalDatabases' => 'array', 'VirtualDomainsMapping' => 'object', 'FileSchemaMigrationStage' => 'integer', 'ImageLinksSchemaMigrationStage' => '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', 'ParserCacheFilterConfig' => 'object', 'ChronologyProtectorSecret' => 'string', 'PHPSessionHandling' => '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', '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', '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', 'AllowSecuritySensitiveOperationIfCannotReauthenticate' => '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', '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', ], 'CSPHeader' => [ 'boolean', 'object', ], 'CSPReportOnlyHeader' => [ 'boolean', 'object', ], 'CSPFalsePositiveUrls' => 'object', 'AllowCrossOrigin' => 'boolean', 'RestAllowCrossOriginCookieAuth' => 'boolean', 'CookieSameSite' => [ 'string', 'null', ], 'CacheVaryCookies' => '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', 'RCEngines' => 'object', 'OverrideSiteFeed' => 'object', 'FeedClasses' => 'object', 'AdvertisedFeedTypes' => 'array', 'SoftwareTags' => 'object', 'RecentChangesFlags' => 'object', 'WatchlistExpiry' => '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', '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', 'RestSandboxSpecs' => 'object', 'ShellRestrictionMethod' => [ 'string', 'boolean', ], 'ShellboxUrls' => 'object', 'ShellboxSecretKey' => [ 'string', 'null', ], 'ShellboxShell' => [ 'string', 'null', ], 'HTTPTimeout' => 'number', 'HTTPConnectTimeout' => 'number', 'HTTPMaxTimeout' => 'number', 'HTTPMaxConnectTimeout' => 'number', 'LocalVirtualHosts' => 'object', 'LocalHTTPProxy' => [ 'string', 'boolean', ], 'VirtualRestConfig' => 'object', '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', 'CloneArticleParserOutput' => 'boolean', 'UseLeximorph' => 'boolean', 'UsePostprocCache' => 'boolean', 'UsePostprocCacheLegacy' => 'boolean', 'UsePostprocCacheParsoid' => 'boolean', 'ParserOptionsLogUnsafeSampleRate' => 'integer', ], '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', 'VirtualRestConfig' => 'array_plus_2d', ], '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', ], ], ], ], ], 'PHPSessionHandling' => [ 'deprecated' => 'since 1.45 Integration with PHP session handling will be removed in the future', ], 'RawHtmlMessages' => [ 'items' => [ 'type' => 'string', ], ], 'InterwikiLogoOverride' => [ 'items' => [ 'type' => 'string', ], ], 'LegalTitleChars' => [ 'deprecated' => 'since 1.41; use Extension:TitleBlacklist to customize', ], 'ReauthenticateTime' => [ 'additionalProperties' => [ 'type' => 'integer', ], ], 'AllowSecuritySensitiveOperationIfCannotReauthenticate' => [ 'additionalProperties' => [ 'type' => 'boolean', ], ], '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', ], ], ], 'SoftwareTags' => [ 'additionalProperties' => [ 'type' => 'boolean', ], ], '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', ], ], 'RestSandboxSpecs' => [ 'additionalProperties' => [ 'type' => 'object', 'properties' => [ 'url' => [ 'type' => 'string', 'format' => 'url', ], 'name' => [ 'type' => 'string', ], 'msg' => [ 'type' => 'string', 'description' => 'a message key', ], ], 'required' => [ 'url', ], ], ], '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.', ],]
Generic interface providing Time-To-Live constants for expirable object storage.
Key-encoding methods for object caching (BagOStuff and WANObjectCache)
Represents an OpenTelemetry span, i.e.
Base interface for an OpenTelemetry tracer responsible for creating spans.