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;
22
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 array $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 HOLDOFF_TTL_NONE = 0;
220
222 public const MIN_TIMESTAMP_NONE = 0.0;
223
225 private const PC_PRIMARY = 'primary:1000';
226
228 public const PASS_BY_REF = [];
229
231 private const SCHEME_HASH_TAG = 1;
233 private const SCHEME_HASH_STOP = 2;
234
236 private const CHECK_KEY_TTL = self::TTL_YEAR;
238 private const INTERIM_KEY_TTL = 2;
239
241 private const LOCK_TTL = 10;
243 private const RAMPUP_TTL = 30;
244
246 private const TINY_NEGATIVE = -0.000001;
248 private const TINY_POSITIVE = 0.000001;
249
251 private const RECENT_SET_LOW_MS = 50;
253 private const RECENT_SET_HIGH_MS = 100;
254
256 private const GENERATION_HIGH_SEC = 0.2;
257
259 private const PURGE_TIME = 0;
261 private const PURGE_HOLDOFF = 1;
262
264 private const VERSION = 1;
265
267 public const KEY_VERSION = 'version';
269 public const KEY_AS_OF = 'asOf';
271 public const KEY_TTL = 'ttl';
273 public const KEY_CUR_TTL = 'curTTL';
275 public const KEY_TOMB_AS_OF = 'tombAsOf';
277 public const KEY_CHECK_AS_OF = 'lastCKPurge';
278
280 private const RES_VALUE = 0;
282 private const RES_VERSION = 1;
284 private const RES_AS_OF = 2;
286 private const RES_TTL = 3;
288 private const RES_TOMB_AS_OF = 4;
290 private const RES_CHECK_AS_OF = 5;
292 private const RES_TOUCH_AS_OF = 6;
294 private const RES_CUR_TTL = 7;
295
297 private const FLD_FORMAT_VERSION = 0;
299 private const FLD_VALUE = 1;
301 private const FLD_TTL = 2;
303 private const FLD_TIME = 3;
305 private const FLD_FLAGS = 4;
307 private const FLD_VALUE_VERSION = 5;
308 private const FLD_GENERATION_TIME = 6;
309
311 private const TYPE_VALUE = 'v';
313 private const TYPE_TIMESTAMP = 't';
315 private const TYPE_MUTEX = 'm';
317 private const TYPE_INTERIM = 'i';
318
320 private const PURGE_VAL_PREFIX = 'PURGED';
324 private $pendingCallback;
325
357 public function __construct( array $params ) {
358 $this->cache = $params['cache'];
359 $this->broadcastRoute = $params['broadcastRoutingPrefix'] ?? null;
360 $this->epoch = $params['epoch'] ?? 0;
361 if ( ( $params['coalesceScheme'] ?? '' ) === 'hash_tag' ) {
362 // https://redis.io/topics/cluster-spec
363 // https://github.com/twitter/twemproxy/blob/v0.4.1/notes/recommendation.md#hash-tags
364 // https://github.com/Netflix/dynomite/blob/v0.7.0/notes/recommendation.md#hash-tags
365 $this->coalesceScheme = self::SCHEME_HASH_TAG;
366 } else {
367 // https://github.com/facebook/mcrouter/wiki/Key-syntax
368 $this->coalesceScheme = self::SCHEME_HASH_STOP;
369 }
370
371 $this->setLogger( $params['logger'] ?? new NullLogger() );
372 $this->tracer = $params['tracer'] ?? new NoopTracer();
373 $this->stats = $params['stats'] ?? StatsFactory::newNull();
374
375 $this->asyncHandler = $params['asyncHandler'] ?? null;
376 $this->pendingCallback = $params['pendingCallback'] ?? null;
377 }
378
379 public function setLogger( LoggerInterface $logger ): void {
380 $this->logger = $logger;
381 }
382
386 public static function newEmpty(): static {
387 return new static( [ 'cache' => new EmptyBagOStuff() ] );
388 }
389
446 final public function get( $key, &$curTTL = null, array $checkKeys = [], &$info = [] ) {
447 // Note that an undeclared variable passed as $info starts as null (not the default).
448 // Also, if no $info parameter is provided, then it doesn't matter how it changes here.
449 $legacyInfo = ( $info !== self::PASS_BY_REF );
450
451 $cachedValue = $this->getWithInfo( $key, $checkKeys );
452
453 $curTTL = $cachedValue->getRemainingLifetime();
454 $info = $legacyInfo
455 ? $cachedValue->getAsOf()
456 : [
457 self::KEY_VERSION => $cachedValue->getVersion(),
458 self::KEY_AS_OF => $cachedValue->getAsOf(),
459 self::KEY_TTL => $cachedValue->getLifetime(),
460 self::KEY_CUR_TTL => $cachedValue->getRemainingLifetime(),
461 self::KEY_TOMB_AS_OF => $cachedValue->getTombstoneAsOf(),
462 self::KEY_CHECK_AS_OF => $cachedValue->getCheckKeyAsOf()
463 ];
464
465 return $cachedValue->getValue();
466 }
467
481 final public function getWithInfo( string $key, array $checkKeys = [] ): CachedValue {
483 $span = $this->startOperationSpan( 'get', $key, $checkKeys );
484
485 $now = $this->getCurrentTime();
486 $res = $this->fetchKeys( [ $key ], $checkKeys, $now )[$key];
487
488 $curTTL = $res[self::RES_CUR_TTL];
489 if ( $curTTL === null || $curTTL <= 0 ) {
490 // Remove old item so the updated one moves to the end of the array
491 unset( $this->missLog[$key] );
492 if ( count( $this->missLog ) >= 10 ) {
493 // Drop the oldest entry
494 array_shift( $this->missLog );
495 }
496 // Log the timestamp in case a corresponding set() call does not provide "walltime"
497 $this->missLog[$key] = $this->getCurrentTime();
498 }
499
500 return new CachedValue(
501 $res[self::RES_VALUE],
502 $res[self::RES_VERSION],
503 $res[self::RES_AS_OF],
504 $res[self::RES_TTL],
505 $curTTL,
506 $res[self::RES_TOMB_AS_OF],
507 $res[self::RES_CHECK_AS_OF]
508 );
509 }
510
535 final public function getMulti(
536 array $keys,
537 &$curTTLs = [],
538 array $checkKeys = [],
539 &$info = []
540 ) {
541 // Note that an undeclared variable passed as $info starts as null (not the default).
542 // Also, if no $info parameter is provided, then it doesn't matter how it changes here.
543 $legacyInfo = ( $info !== self::PASS_BY_REF );
544
546 $span = $this->startOperationSpan( __FUNCTION__, $keys, $checkKeys );
547
548 $curTTLs = [];
549 $info = [];
550 $valuesByKey = [];
551
552 $now = $this->getCurrentTime();
553 $resByKey = $this->fetchKeys( $keys, $checkKeys, $now );
554 foreach ( $resByKey as $key => $res ) {
555 if ( $res[self::RES_VALUE] !== false ) {
556 $valuesByKey[$key] = $res[self::RES_VALUE];
557 $this->logger->debug( "getMulti($key): hit" );
558 } else {
559 $this->logger->debug( "getMulti($key): miss" );
560 }
561
562 if ( $res[self::RES_CUR_TTL] !== null ) {
563 $curTTLs[$key] = $res[self::RES_CUR_TTL];
564 }
565 $info[$key] = $legacyInfo
566 ? $res[self::RES_AS_OF]
567 : [
568 self::KEY_VERSION => $res[self::RES_VERSION],
569 self::KEY_AS_OF => $res[self::RES_AS_OF],
570 self::KEY_TTL => $res[self::RES_TTL],
571 self::KEY_CUR_TTL => $res[self::RES_CUR_TTL],
572 self::KEY_TOMB_AS_OF => $res[self::RES_TOMB_AS_OF],
573 self::KEY_CHECK_AS_OF => $res[self::RES_CHECK_AS_OF]
574 ];
575 }
576
577 return $valuesByKey;
578 }
579
597 protected function fetchKeys( array $keys, array $checkKeys, float $now, ?array $opts = null ) {
598 $resByKey = [];
599
600 // List of all sister keys that need to be fetched from cache
601 $allSisterKeys = [];
602 // Order-corresponding value sister key list for the base key list ($keys)
603 $valueSisterKeys = [];
604 // List of "check" sister keys to compare all value sister keys against
605 $checkSisterKeysForAll = [];
606 // Map of (base key => additional "check" sister key(s) to compare against)
607 $checkSisterKeysByKey = [];
608
609 foreach ( $keys as $key ) {
610 $sisterKey = $this->makeSisterKey( $key, self::TYPE_VALUE );
611 $allSisterKeys[] = $sisterKey;
612 $valueSisterKeys[] = $sisterKey;
613 }
614
615 foreach ( $checkKeys as $i => $checkKeyOrKeyGroup ) {
616 // Note: avoid array_merge() inside loop in case there are many keys
617 if ( is_int( $i ) ) {
618 // Single "check" key that applies to all base keys
619 $sisterKey = $this->makeSisterKey( $checkKeyOrKeyGroup, self::TYPE_TIMESTAMP );
620 $allSisterKeys[] = $sisterKey;
621 $checkSisterKeysForAll[] = $sisterKey;
622 } else {
623 // List of "check" keys that apply to a specific base key
624 foreach ( (array)$checkKeyOrKeyGroup as $checkKey ) {
625 $sisterKey = $this->makeSisterKey( $checkKey, self::TYPE_TIMESTAMP );
626 $allSisterKeys[] = $sisterKey;
627 $checkSisterKeysByKey[$i][] = $sisterKey;
628 }
629 }
630 }
631
632 if ( $this->warmupCache ) {
633 // Get the wrapped values of the sister keys from the warmup cache
634 $wrappedBySisterKey = $this->warmupCache;
635 $sisterKeysMissing = array_diff( $allSisterKeys, array_keys( $wrappedBySisterKey ) );
636 if ( $sisterKeysMissing ) {
637 $this->warmupKeyMisses += count( $sisterKeysMissing );
638 $wrappedBySisterKey += $this->cache->getMulti( $sisterKeysMissing );
639 }
640 } else {
641 // Fetch the wrapped values of the sister keys from the backend
642 $wrappedBySisterKey = $this->cache->getMulti( $allSisterKeys );
643 }
644
645 // List of "check" sister key purge timestamps to compare all value sister keys against
646 $ckPurgesForAll = $this->processCheckKeys(
647 $checkSisterKeysForAll,
648 $wrappedBySisterKey,
649 $now
650 );
651 // Map of (base key => extra "check" sister key purge timestamp(s) to compare against)
652 $ckPurgesByKey = [];
653 foreach ( $checkSisterKeysByKey as $keyWithCheckKeys => $checkKeysForKey ) {
654 $ckPurgesByKey[$keyWithCheckKeys] = $this->processCheckKeys(
655 $checkKeysForKey,
656 $wrappedBySisterKey,
657 $now
658 );
659 }
660
661 // Unwrap and validate any value found for each base key (under the value sister key)
662 foreach (
663 array_map( null, $valueSisterKeys, $keys )
664 as [ $valueSisterKey, $key ]
665 ) {
666 if ( array_key_exists( $valueSisterKey, $wrappedBySisterKey ) ) {
667 // Key exists as either a live value or tombstone value
668 $wrapped = $wrappedBySisterKey[$valueSisterKey];
669 } else {
670 // Key does not exist
671 $wrapped = false;
672 }
673
674 $res = $this->unwrap( $wrapped, $now );
675 $value = $res[self::RES_VALUE];
676
677 foreach ( array_merge( $ckPurgesForAll, $ckPurgesByKey[$key] ?? [] ) as $ckPurge ) {
678 $res[self::RES_CHECK_AS_OF] = max(
679 $ckPurge[self::PURGE_TIME],
680 $res[self::RES_CHECK_AS_OF]
681 );
682 // Timestamp marking the end of the hold-off period for this purge
683 $holdoffDeadline = $ckPurge[self::PURGE_TIME] + $ckPurge[self::PURGE_HOLDOFF];
684 // Check if the value was generated during the hold-off period
685 if ( $value !== false && $holdoffDeadline >= $res[self::RES_AS_OF] ) {
686 // How long ago this value was purged by *this* "check" key
687 $ago = min( $ckPurge[self::PURGE_TIME] - $now, self::TINY_NEGATIVE );
688 // How long ago this value was purged by *any* known "check" key
689 $res[self::RES_CUR_TTL] = min( $res[self::RES_CUR_TTL], $ago );
690 }
691 }
692
693 $touchedCb = $opts['touchedCallback'] ?? null;
694 $version = $opts['version'] ?? null;
695 // Validate the version first because we must not expose user callbacks to data
696 // from a mismatching runtime version. It would also be a wasteful operation
697 // because getWithSetCallback will reject the value anyway.
698 if ( $touchedCb !== null && $res[self::RES_VERSION] === $version && $value !== false ) {
699 $touched = $touchedCb( $value );
700 if ( $touched !== null && $touched >= $res[self::RES_AS_OF] ) {
701 $res[self::RES_CUR_TTL] = min(
702 $res[self::RES_CUR_TTL],
703 $res[self::RES_AS_OF] - $touched,
704 self::TINY_NEGATIVE
705 );
706 }
707 } else {
708 $touched = null;
709 }
710
711 $res[self::RES_TOUCH_AS_OF] = max( $res[self::RES_TOUCH_AS_OF], $touched );
712
713 $resByKey[$key] = $res;
714 }
715
716 return $resByKey;
717 }
718
725 private function processCheckKeys(
726 array $checkSisterKeys,
727 array $wrappedBySisterKey,
728 float $now
729 ) {
730 $purges = [];
731
732 foreach ( $checkSisterKeys as $timeKey ) {
733 $purge = isset( $wrappedBySisterKey[$timeKey] )
734 ? $this->parsePurgeValue( $wrappedBySisterKey[$timeKey] )
735 : null;
736
737 if ( $purge === null ) {
738 // No holdoff when lazy creating a check key, use cache right away (T344191)
739 $wrapped = $this->makeCheckPurgeValue( $now, self::HOLDOFF_TTL_NONE, $purge );
740 $this->cache->add(
741 $timeKey,
742 $wrapped,
743 self::CHECK_KEY_TTL,
744 $this->cache::WRITE_BACKGROUND
745 );
746 }
747
748 $purges[] = $purge;
749 }
750
751 return $purges;
752 }
753
806 final public function set( $key, $value, $ttl = self::TTL_INDEFINITE, array $opts = [] ) {
808 $span = $this->startOperationSpan( __FUNCTION__, $key );
809
810 $keygroup = $this->determineKeyGroupForStats( $key );
811
812 $this->logger->debug( "set($key): store new value" );
813 $ok = $this->setMainValue(
814 $key,
815 $value,
816 $ttl,
817 $opts['version'] ?? null,
818 $opts['walltime'] ?? null,
819 $opts['staleTTL'] ?? self::STALE_TTL_NONE,
820 $opts['segmentable'] ?? false,
821 $opts['creating'] ?? false
822 );
823
824 $this->stats->getCounter( 'wanobjectcache_set_total' )
825 ->setLabel( 'keygroup', $keygroup )
826 ->setLabel( 'result', ( $ok ? 'ok' : 'error' ) )
827 ->increment();
828
829 return $ok;
830 }
831
843 private function setMainValue(
844 $key,
845 $value,
846 $ttl,
847 ?int $version,
848 ?float $walltime,
849 int $staleTTL,
850 bool $segmentable,
851 bool $creating
852 ) {
853 if ( $ttl < 0 ) {
854 // not cacheable
855 return true;
856 }
857
858 $now = $this->getCurrentTime();
859
860 // T413673: Handle PHP8.5 case where TTL is infinite.
861 if ( is_finite( $ttl ) ) {
862 $ttl = (int)$ttl;
863 } else {
864 $ttl = self::TTL_INDEFINITE;
865 }
866
867 $walltime ??= $this->timeSinceLoggedMiss( $key, $now );
868
869 // Forbid caching data that only exists within an uncommitted transaction. Also, lower
870 // the TTL when the data has a "since" time so far in the past that a delete() tombstone,
871 // made after that time, could have already expired (the key is no longer write-holed).
872 // The mitigation TTL depends on whether this data lag is assumed to systemically effect
873 // regeneration attempts in the near future. The TTL also reflects regeneration wall time.
874 if ( $this->pendingCallback && ( $this->pendingCallback )() ) {
875 $this->logger->warning(
876 "Rejected set() for {cachekey} due to pending writes.",
877 [
878 'cachekey' => $key,
879 'walltime' => $walltime
880 ]
881 );
882
883 // no-op the write for being unsafe
884 return true;
885 }
886
887 // Wrap that value with time/TTL/version metadata
888 $wrapped = $this->wrap( $value, $ttl, $version, $now );
889 $storeTTL = $ttl + $staleTTL;
890
891 $flags = $this->cache::WRITE_BACKGROUND;
892 if ( $segmentable ) {
893 $flags |= $this->cache::WRITE_ALLOW_SEGMENTS;
894 }
895
896 if ( $creating ) {
897 $ok = $this->cache->add(
898 $this->makeSisterKey( $key, self::TYPE_VALUE ),
899 $wrapped,
900 $storeTTL,
901 $flags
902 );
903 } else {
904 $ok = $this->cache->merge(
905 $this->makeSisterKey( $key, self::TYPE_VALUE ),
906 static function ( $cache, $key, $cWrapped ) use ( $wrapped ) {
907 // A string value means that it is a tombstone; do nothing in that case
908 return ( is_string( $cWrapped ) ) ? false : $wrapped;
909 },
910 $storeTTL,
911 $this->cache::MAX_CONFLICTS_ONE,
912 $flags
913 );
914 }
915
916 return $ok;
917 }
918
979 final public function delete( $key, $ttl = self::HOLDOFF_TTL ) {
981 $span = $this->startOperationSpan( __FUNCTION__, $key );
982
983 // Purge values must be stored under the value key so that WANObjectCache::set()
984 // can atomically merge values without accidentally undoing a recent purge and thus
985 // violating the holdoff TTL restriction.
986 $valueSisterKey = $this->makeSisterKey( $key, self::TYPE_VALUE );
987
988 if ( $ttl <= 0 ) {
989 // A client or cache cleanup script is requesting a cache purge, so there is no
990 // volatility period due to replica DB lag. Any recent change to an entity cached
991 // in this key should have triggered an appropriate purge event.
992 $ok = $this->cache->delete( $this->getRouteKey( $valueSisterKey ), $this->cache::WRITE_BACKGROUND );
993 } else {
994 // A cacheable entity recently changed, so there might be a volatility period due
995 // to replica DB lag. Clients usually expect their actions to be reflected in any
996 // of their subsequent web request. This is attainable if (a) purge relay lag is
997 // lower than the time it takes for subsequent request by the client to arrive,
998 // and, (b) DB replica queries have "read-your-writes" consistency due to DB lag
999 // mitigation systems.
1000 $now = $this->getCurrentTime();
1001 // Set the key to the purge value in all datacenters
1002 $purge = self::PURGE_VAL_PREFIX . ':' . (int)$now;
1003 $ok = $this->cache->set(
1004 $this->getRouteKey( $valueSisterKey ),
1005 $purge,
1006 $ttl,
1007 $this->cache::WRITE_BACKGROUND
1008 );
1009 }
1010
1011 $keygroup = $this->determineKeyGroupForStats( $key );
1012
1013 $this->stats->getCounter( 'wanobjectcache_delete_total' )
1014 ->setLabel( 'keygroup', $keygroup )
1015 ->setLabel( 'result', ( $ok ? 'ok' : 'error' ) )
1016 ->increment();
1017
1018 return $ok;
1019 }
1020
1040 final public function getCheckKeyTime( $key ) {
1042 $span = $this->startOperationSpan( __FUNCTION__, $key );
1043
1044 return $this->getMultiCheckKeyTime( [ $key ] )[$key];
1045 }
1046
1108 final public function getMultiCheckKeyTime( array $keys ) {
1110 $span = $this->startOperationSpan( __FUNCTION__, $keys );
1111
1112 $checkSisterKeysByKey = [];
1113 foreach ( $keys as $key ) {
1114 $checkSisterKeysByKey[$key] = $this->makeSisterKey( $key, self::TYPE_TIMESTAMP );
1115 }
1116
1117 $wrappedBySisterKey = $this->cache->getMulti( $checkSisterKeysByKey );
1118 $wrappedBySisterKey += array_fill_keys( $checkSisterKeysByKey, false );
1119
1120 $now = $this->getCurrentTime();
1121 $times = [];
1122 foreach ( $checkSisterKeysByKey as $key => $checkSisterKey ) {
1123 $purge = $this->parsePurgeValue( $wrappedBySisterKey[$checkSisterKey] );
1124 if ( $purge === null ) {
1125 $wrapped = $this->makeCheckPurgeValue( $now, self::HOLDOFF_TTL_NONE, $purge );
1126 $this->cache->add(
1127 $checkSisterKey,
1128 $wrapped,
1129 self::CHECK_KEY_TTL,
1130 $this->cache::WRITE_BACKGROUND
1131 );
1132 }
1133
1134 $times[$key] = $purge[self::PURGE_TIME];
1135 }
1136
1137 return $times;
1138 }
1139
1173 public function touchCheckKey( $key, $holdoff = self::HOLDOFF_TTL ) {
1175 $span = $this->startOperationSpan( __FUNCTION__, $key );
1176
1177 $checkSisterKey = $this->makeSisterKey( $key, self::TYPE_TIMESTAMP );
1178
1179 $now = $this->getCurrentTime();
1180 $purge = $this->makeCheckPurgeValue( $now, $holdoff );
1181 $ok = $this->cache->set(
1182 $this->getRouteKey( $checkSisterKey ),
1183 $purge,
1184 self::CHECK_KEY_TTL,
1185 $this->cache::WRITE_BACKGROUND
1186 );
1187
1188 $keygroup = $this->determineKeyGroupForStats( $key );
1189
1190 $this->stats->getCounter( 'wanobjectcache_check_total' )
1191 ->setLabel( 'keygroup', $keygroup )
1192 ->setLabel( 'result', ( $ok ? 'ok' : 'error' ) )
1193 ->increment();
1194
1195 return $ok;
1196 }
1197
1225 public function resetCheckKey( $key ) {
1227 $span = $this->startOperationSpan( __FUNCTION__, $key );
1228
1229 $checkSisterKey = $this->makeSisterKey( $key, self::TYPE_TIMESTAMP );
1230 $ok = $this->cache->delete( $this->getRouteKey( $checkSisterKey ), $this->cache::WRITE_BACKGROUND );
1231
1232 $keygroup = $this->determineKeyGroupForStats( $key );
1233
1234 $this->stats->getCounter( 'wanobjectcache_reset_total' )
1235 ->setLabel( 'keygroup', $keygroup )
1236 ->setLabel( 'result', ( $ok ? 'ok' : 'error' ) )
1237 ->increment();
1238
1239 return $ok;
1240 }
1241
1267
1549 final public function getWithSetCallback(
1550 $key, $ttl, $callback, array $opts = [], array $cbParams = []
1551 ) {
1553 $span = $this->startOperationSpan( __FUNCTION__, $key );
1554
1555 $version = $opts['version'] ?? null;
1556 $pcTTL = $opts['pcTTL'] ?? self::TTL_UNCACHEABLE;
1557 $pCache = ( $pcTTL >= 0 )
1558 ? $this->getProcessCache( $opts['pcGroup'] ?? self::PC_PRIMARY )
1559 : null;
1560
1561 // Use the process cache if requested as long as no outer cache callback is running.
1562 // Nested callback process cache use is not lag-safe with regard to HOLDOFF_TTL since
1563 // process cached values are more lagged than persistent ones as they are not purged.
1564 if ( $pCache && $this->callbackDepth == 0 ) {
1565 $cached = $pCache->get( $key, $pcTTL, false );
1566 if ( $cached !== false ) {
1567 $this->logger->debug( "getWithSetCallback($key): process cache hit" );
1568 return $cached;
1569 }
1570 }
1571
1572 [ $value, $valueVersion, $curAsOf ] = $this->fetchOrRegenerate( $key, $ttl, $callback, $opts, $cbParams );
1573 if ( $valueVersion !== $version ) {
1574 // Current value has a different version; use the variant key for this version.
1575 // Regenerate the variant value if it is not newer than the main value at $key
1576 // so that purges to the main key propagate to the variant value.
1577 $this->logger->debug( "getWithSetCallback($key): using variant key" );
1578 [ $value ] = $this->fetchOrRegenerate(
1579 $this->makeGlobalKey( 'WANCache-key-variant', md5( $key ), (string)$version ),
1580 $ttl,
1581 $callback,
1582 [ 'version' => null, 'minAsOf' => $curAsOf ] + $opts,
1583 $cbParams
1584 );
1585 }
1586
1587 // Update the process cache if enabled
1588 if ( $pCache && $value !== false ) {
1589 $pCache->set( $key, $value );
1590 }
1591
1592 return $value;
1593 }
1594
1611 private function fetchOrRegenerate( $key, $ttl, $callback, array $opts, array $cbParams ) {
1612 $checkKeys = $opts['checkKeys'] ?? [];
1613 $minAsOf = $opts['minAsOf'] ?? self::MIN_TIMESTAMP_NONE;
1614 $hotTTR = $opts['hotTTR'] ?? self::HOT_TTR;
1615 $lowTTL = $opts['lowTTL'] ?? min( self::LOW_TTL, $ttl );
1616 $ageNew = $opts['ageNew'] ?? self::AGE_NEW;
1617 $touchedCb = $opts['touchedCallback'] ?? null;
1618 $startTime = $this->getCurrentTime();
1619
1620 $keygroup = $this->determineKeyGroupForStats( $key );
1621
1622 // Get the current key value and its metadata
1623 $curState = $this->fetchKeys( [ $key ], $checkKeys, $startTime, $opts )[$key];
1624 $curValue = $curState[self::RES_VALUE];
1625
1626 // Use the cached value if it exists and is not due for synchronous regeneration
1627 if ( $this->isAcceptablyFreshValue( $curState, $minAsOf ) ) {
1628 if ( !$this->isLotteryRefreshDue( $curState, $lowTTL, $ageNew, $hotTTR, $startTime ) ) {
1629 $this->stats->getTiming( 'wanobjectcache_getwithset_seconds' )
1630 ->setLabel( 'keygroup', $keygroup )
1631 ->setLabel( 'result', 'hit' )
1632 ->setLabel( 'reason', 'good' )
1633 ->observe( 1e3 * ( $this->getCurrentTime() - $startTime ) );
1634
1635 return [ $curValue, $curState[self::RES_VERSION], $curState[self::RES_AS_OF] ];
1636 } elseif ( $this->scheduleAsyncRefresh( $key, $ttl, $callback, $opts, $cbParams ) ) {
1637 $this->logger->debug( "fetchOrRegenerate($key): hit with async refresh" );
1638
1639 $this->stats->getTiming( 'wanobjectcache_getwithset_seconds' )
1640 ->setLabel( 'keygroup', $keygroup )
1641 ->setLabel( 'result', 'hit' )
1642 ->setLabel( 'reason', 'refresh' )
1643 ->observe( 1e3 * ( $this->getCurrentTime() - $startTime ) );
1644
1645 return [ $curValue, $curState[self::RES_VERSION], $curState[self::RES_AS_OF] ];
1646 } else {
1647 $this->logger->debug( "fetchOrRegenerate($key): hit with sync refresh" );
1648 }
1649 }
1650
1651 $isKeyTombstoned = ( $curState[self::RES_TOMB_AS_OF] !== null );
1652 // Use the interim key as a temporary alternative if the key is tombstoned
1653 if ( $isKeyTombstoned ) {
1654 $volState = $this->getInterimValue( $key, $minAsOf, $startTime, $touchedCb );
1655 $this->logger->debug( "fetchOrRegenerate($key): fetch interim key" );
1656 $volValue = $volState[self::RES_VALUE];
1657 } else {
1658 $volState = $curState;
1659 $volValue = $curValue;
1660 }
1661
1662 // During the volatile "hold-off" period that follows a purge of the key, the value
1663 // will be regenerated many times if frequently accessed. This is done to mitigate
1664 // the effects of backend replication lag as soon as possible. However, throttle the
1665 // overhead of locking and regeneration by reusing values recently written to cache
1666 // tens of milliseconds ago. Verify the "as of" time against the last purge event.
1667 $lastPurgeTime = max(
1668 // RES_TOUCH_AS_OF depends on the value (possibly from the interim key)
1669 $volState[self::RES_TOUCH_AS_OF],
1670 $curState[self::RES_TOMB_AS_OF],
1671 $curState[self::RES_CHECK_AS_OF]
1672 );
1673 $safeMinAsOf = max( $minAsOf, $lastPurgeTime + self::TINY_POSITIVE );
1674
1675 if ( $volState[self::RES_VALUE] === false || $volState[self::RES_AS_OF] < $safeMinAsOf ) {
1676 $isExtremelyNewValue = false;
1677 } else {
1678 $age = $startTime - $volState[self::RES_AS_OF];
1679 $isExtremelyNewValue = ( $age < mt_rand( self::RECENT_SET_LOW_MS, self::RECENT_SET_HIGH_MS ) / 1e3 );
1680 }
1681 if ( $isExtremelyNewValue ) {
1682 $this->logger->debug( "fetchOrRegenerate($key): volatile hit" );
1683
1684 $this->stats->getTiming( 'wanobjectcache_getwithset_seconds' )
1685 ->setLabel( 'keygroup', $keygroup )
1686 ->setLabel( 'result', 'hit' )
1687 ->setLabel( 'reason', 'volatile' )
1688 ->observe( 1e3 * ( $this->getCurrentTime() - $startTime ) );
1689
1690 return [ $volValue, $volState[self::RES_VERSION], $curState[self::RES_AS_OF] ];
1691 }
1692
1693 $lockTSE = $opts['lockTSE'] ?? self::TSE_NONE;
1694 $busyValue = $opts['busyValue'] ?? null;
1695 $staleTTL = $opts['staleTTL'] ?? self::STALE_TTL_NONE;
1696 $segmentable = $opts['segmentable'] ?? false;
1697 $version = $opts['version'] ?? null;
1698
1699 // Determine whether one thread per datacenter should handle regeneration at a time
1700 $useRegenerationLock =
1701 // Note that since tombstones no-op set(), $lockTSE and $curTTL cannot be used to
1702 // deduce the key hotness because |$curTTL| will always keep increasing until the
1703 // tombstone expires or is overwritten by a new tombstone. Also, even if $lockTSE
1704 // is not set, constant regeneration of a key for the tombstone lifetime might be
1705 // very expensive. Assume tombstoned keys are possibly hot in order to reduce
1706 // the risk of high regeneration load after the delete() method is called.
1707 $isKeyTombstoned ||
1708 // Assume a key is hot if requested soon ($lockTSE seconds) after purge.
1709 // This avoids stampedes when timestamps from $checkKeys/$touchedCb bump.
1710 (
1711 $curState[self::RES_CUR_TTL] !== null &&
1712 $curState[self::RES_CUR_TTL] <= 0 &&
1713 abs( $curState[self::RES_CUR_TTL] ) <= $lockTSE
1714 ) ||
1715 // Assume a key is hot if there is no value and a busy fallback is given.
1716 // This avoids stampedes on eviction or preemptive regeneration taking too long.
1717 ( $busyValue !== null && $volValue === false );
1718
1719 // If a regeneration lock is required, threads that do not get the lock will try to use
1720 // the stale value, the interim value, or the $busyValue placeholder, in that order. If
1721 // none of those are set then all threads will bypass the lock and regenerate the value.
1722 $mutexKey = $this->makeSisterKey( $key, self::TYPE_MUTEX );
1723 // Note that locking is not bypassed due to I/O errors; this avoids stampedes
1724 $hasLock = $useRegenerationLock && $this->cache->add( $mutexKey, 1, self::LOCK_TTL );
1725 if ( $useRegenerationLock && !$hasLock ) {
1726 // Determine if there is stale or volatile cached value that is still usable
1727 // @phan-suppress-next-line PhanTypeMismatchArgumentNullable False positive
1728 if ( $this->isValid( $volValue, $volState[self::RES_AS_OF], $minAsOf ) ) {
1729 $this->logger->debug( "fetchOrRegenerate($key): returning stale value" );
1730
1731 $this->stats->getTiming( 'wanobjectcache_getwithset_seconds' )
1732 ->setLabel( 'keygroup', $keygroup )
1733 ->setLabel( 'result', 'hit' )
1734 ->setLabel( 'reason', 'stale' )
1735 ->observe( 1e3 * ( $this->getCurrentTime() - $startTime ) );
1736
1737 return [ $volValue, $volState[self::RES_VERSION], $curState[self::RES_AS_OF] ];
1738 } elseif ( $busyValue !== null ) {
1739 $miss = is_infinite( $minAsOf ) ? 'renew' : 'miss';
1740 $this->logger->debug( "fetchOrRegenerate($key): busy $miss" );
1741
1742 $this->stats->getTiming( 'wanobjectcache_getwithset_seconds' )
1743 ->setLabel( 'keygroup', $keygroup )
1744 ->setLabel( 'result', $miss )
1745 ->setLabel( 'reason', 'busy' )
1746 ->observe( 1e3 * ( $this->getCurrentTime() - $startTime ) );
1747
1748 $placeholderValue = ( $busyValue instanceof Closure ) ? $busyValue() : $busyValue;
1749
1750 return [ $placeholderValue, $version, $curState[self::RES_AS_OF] ];
1751 }
1752 }
1753
1754 // Generate the new value given any prior value with a matching version
1755 $setOpts = [];
1756 $preCallbackTime = $this->getCurrentTime();
1757 ++$this->callbackDepth;
1758 // https://github.com/phan/phan/issues/4419
1760 $value = null;
1761 try {
1762 $value = $callback(
1763 ( $curState[self::RES_VERSION] === $version ) ? $curValue : false,
1764 $ttl,
1765 $setOpts,
1766 ( $curState[self::RES_VERSION] === $version ) ? $curState[self::RES_AS_OF] : null,
1767 $cbParams
1768 );
1769 } finally {
1770 --$this->callbackDepth;
1771 }
1772 $postCallbackTime = $this->getCurrentTime();
1773
1774 // How long it took to generate the value
1775 $walltime = max( $postCallbackTime - $preCallbackTime, 0.0 );
1776
1777 $this->stats->getTiming( 'wanobjectcache_regen_seconds' )
1778 ->setLabel( 'keygroup', $keygroup )
1779 ->observe( 1e3 * $walltime );
1780
1781 // Attempt to save the newly generated value if applicable
1782 if (
1783 // Callback yielded a cacheable value
1784 ( $value !== false && $ttl >= 0 ) &&
1785 // Current thread was not raced out of a regeneration lock or key is tombstoned
1786 ( !$useRegenerationLock || $hasLock || $isKeyTombstoned )
1787 ) {
1788 // If the key is write-holed then use the (volatile) interim key as an alternative
1789 if ( $isKeyTombstoned ) {
1790 $this->logger->debug( "fetchOrRegenerate($key): set interim key" );
1791 $this->setInterimValue(
1792 $key,
1793 $value,
1794 $lockTSE,
1795 $version,
1796 $segmentable
1797 );
1798 } else {
1799 $this->setMainValue(
1800 $key,
1801 $value,
1802 $ttl,
1803 $version,
1804 $walltime,
1805 $staleTTL,
1806 $segmentable,
1807 ( $curValue === false )
1808 );
1809 }
1810 }
1811
1812 if ( $hasLock ) {
1813 $this->cache->delete( $mutexKey, $this->cache::WRITE_BACKGROUND );
1814 }
1815
1816 $miss = is_infinite( $minAsOf ) ? 'renew' : 'miss';
1817 $this->logger->debug( "fetchOrRegenerate($key): $miss, new value computed" );
1818
1819 $this->stats->getTiming( 'wanobjectcache_getwithset_seconds' )
1820 ->setLabel( 'keygroup', $keygroup )
1821 ->setLabel( 'result', $miss )
1822 ->setLabel( 'reason', 'compute' )
1823 ->observe( 1e3 * ( $this->getCurrentTime() - $startTime ) );
1824
1825 return [ $value, $version, $curState[self::RES_AS_OF] ];
1826 }
1827
1837 private function makeSisterKey( string $baseKey, string $typeChar ) {
1838 if ( $this->coalesceScheme === self::SCHEME_HASH_STOP ) {
1839 // Key style: "WANCache:<base key>|#|<character>"
1840 $sisterKey = 'WANCache:' . $baseKey . '|#|' . $typeChar;
1841 } else {
1842 // Key style: "WANCache:{<base key>}:<character>"
1843 $sisterKey = 'WANCache:{' . $baseKey . '}:' . $typeChar;
1844 }
1845 return $sisterKey;
1846 }
1847
1857 private function getInterimValue( $key, $minAsOf, $now, $touchedCb ) {
1858 if ( $this->useInterimHoldOffCaching ) {
1859 $interimSisterKey = $this->makeSisterKey( $key, self::TYPE_INTERIM );
1860 $wrapped = $this->cache->get( $interimSisterKey );
1861 $res = $this->unwrap( $wrapped, $now );
1862 if ( $res[self::RES_VALUE] !== false && $res[self::RES_AS_OF] >= $minAsOf ) {
1863 // FIXME: This should validate 'version' first and not needlessly invoke
1864 // touchedCallback with data from a mismatching version.
1865 if ( $touchedCb !== null ) {
1866 // Update "last purge time" since the $touchedCb timestamp depends on $value
1867 // Get the new "touched timestamp", accounting for callback-checked dependencies
1868 $res[self::RES_TOUCH_AS_OF] = max(
1869 $touchedCb( $res[self::RES_VALUE] ),
1870 $res[self::RES_TOUCH_AS_OF]
1871 );
1872 }
1873
1874 return $res;
1875 }
1876 }
1877
1878 return $this->unwrap( false, $now );
1879 }
1880
1889 private function setInterimValue(
1890 $key,
1891 $value,
1892 $ttl,
1893 ?int $version,
1894 bool $segmentable
1895 ) {
1896 $now = $this->getCurrentTime();
1897 $ttl = max( self::INTERIM_KEY_TTL, (int)$ttl );
1898
1899 // Wrap that value with time/TTL/version metadata
1900 $wrapped = $this->wrap( $value, $ttl, $version, $now );
1901
1902 $flags = $this->cache::WRITE_BACKGROUND;
1903 if ( $segmentable ) {
1904 $flags |= $this->cache::WRITE_ALLOW_SEGMENTS;
1905 }
1906
1907 return $this->cache->set(
1908 $this->makeSisterKey( $key, self::TYPE_INTERIM ),
1909 $wrapped,
1910 $ttl,
1911 $flags
1912 );
1913 }
1914
1978 final public function getMultiWithSetCallback(
1979 ArrayIterator $keyedIds, $ttl, callable $callback, array $opts = []
1980 ) {
1981 $span = $this->startOperationSpan( __FUNCTION__, '' );
1982 if ( $span->getContext()->isSampled() ) {
1983 $span->setAttributes( [
1984 'org.wikimedia.wancache.multi_count' => $keyedIds->count(),
1985 'org.wikimedia.wancache.ttl' => $ttl,
1986 ] );
1987 }
1988 // Batch load required keys into the in-process warmup cache
1989 $this->warmupCache = $this->fetchWrappedValuesForWarmupCache(
1990 $this->getNonProcessCachedMultiKeys( $keyedIds, $opts ),
1991 $opts['checkKeys'] ?? []
1992 );
1993 $this->warmupKeyMisses = 0;
1994
1995 // The required callback signature includes $id as the first argument for convenience
1996 // to distinguish different items. To reuse the code in getWithSetCallback(), wrap the
1997 // callback with a proxy callback that has the standard getWithSetCallback() signature.
1998 // This is defined only once per batch to avoid closure creation overhead.
1999 $proxyCb = static function ( $oldValue, &$ttl, &$setOpts, $oldAsOf, $params )
2000 use ( $callback )
2001 {
2002 return $callback( $params['id'], $oldValue, $ttl, $setOpts, $oldAsOf );
2003 };
2004
2005 // Get the order-preserved result map using the warm-up cache
2006 $values = [];
2007 foreach ( $keyedIds as $key => $id ) {
2008 $values[$key] = $this->getWithSetCallback(
2009 $key,
2010 $ttl,
2011 $proxyCb,
2012 $opts,
2013 [ 'id' => $id ]
2014 );
2015 }
2016
2017 $this->warmupCache = [];
2018
2019 return $values;
2020 }
2021
2081 final public function getMultiWithUnionSetCallback(
2082 ArrayIterator $keyedIds, $ttl, callable $callback, array $opts = []
2083 ) {
2084 $span = $this->startOperationSpan( __FUNCTION__, '' );
2085 if ( $span->getContext()->isSampled() ) {
2086 $span->setAttributes( [
2087 'org.wikimedia.wancache.multi_count' => $keyedIds->count(),
2088 'org.wikimedia.wancache.ttl' => $ttl,
2089 ] );
2090 }
2091 $checkKeys = $opts['checkKeys'] ?? []; // TODO: ???
2092 $minAsOf = $opts['minAsOf'] ?? self::MIN_TIMESTAMP_NONE;
2093
2094 // unset incompatible keys
2095 unset( $opts['lockTSE'] );
2096 unset( $opts['busyValue'] );
2097
2098 // Batch load required keys into the in-process warmup cache
2099 $keysByIdGet = $this->getNonProcessCachedMultiKeys( $keyedIds, $opts );
2100 $this->warmupCache = $this->fetchWrappedValuesForWarmupCache( $keysByIdGet, $checkKeys );
2101 $this->warmupKeyMisses = 0;
2102
2103 // IDs of entities known to be in need of generation
2104 $idsRegen = [];
2105
2106 // Find out which keys are missing/deleted/stale
2107 $now = $this->getCurrentTime();
2108 $resByKey = $this->fetchKeys( $keysByIdGet, $checkKeys, $now );
2109 foreach ( $keysByIdGet as $id => $key ) {
2110 $res = $resByKey[$key];
2111 if (
2112 $res[self::RES_VALUE] === false ||
2113 $res[self::RES_CUR_TTL] < 0 ||
2114 $res[self::RES_AS_OF] < $minAsOf
2115 ) {
2116 $idsRegen[] = $id;
2117 }
2118 }
2119
2120 // Run the callback to populate the generation value map for all required IDs
2121 $newSetOpts = [];
2122 $newTTLsById = array_fill_keys( $idsRegen, $ttl );
2123 $newValsById = $idsRegen ? $callback( $idsRegen, $newTTLsById, $newSetOpts ) : [];
2124
2125 $method = __METHOD__;
2126 // The required callback signature includes $id as the first argument for convenience
2127 // to distinguish different items. To reuse the code in getWithSetCallback(), wrap the
2128 // callback with a proxy callback that has the standard getWithSetCallback() signature.
2129 // This is defined only once per batch to avoid closure creation overhead.
2130 $proxyCb = function ( $oldValue, &$ttl, &$setOpts, $oldAsOf, $params )
2131 use ( $callback, $newValsById, $newTTLsById, $newSetOpts, $method )
2132 {
2133 $id = $params['id'];
2134
2135 if ( array_key_exists( $id, $newValsById ) ) {
2136 // Value was already regenerated as expected, so use the value in $newValsById
2137 $newValue = $newValsById[$id];
2138 $ttl = $newTTLsById[$id];
2139 $setOpts = $newSetOpts;
2140 } else {
2141 // Pre-emptive/popularity refresh and version mismatch cases are not detected
2142 // above and thus $newValsById has no entry. Run $callback on this single entity.
2143 $ttls = [ $id => $ttl ];
2144 $result = $callback( [ $id ], $ttls, $setOpts );
2145 if ( !isset( $result[$id] ) ) {
2146 // T303092
2147 $this->logger->warning(
2148 $method . ' failed due to {id} not set in result {result}', [
2149 'id' => $id,
2150 'result' => json_encode( $result )
2151 ] );
2152 }
2153 $newValue = $result[$id];
2154 $ttl = $ttls[$id];
2155 }
2156
2157 return $newValue;
2158 };
2159
2160 // Get the order-preserved result map using the warm-up cache
2161 $values = [];
2162 foreach ( $keyedIds as $key => $id ) {
2163 $values[$key] = $this->getWithSetCallback(
2164 $key,
2165 $ttl,
2166 $proxyCb,
2167 $opts,
2168 [ 'id' => $id ]
2169 );
2170 }
2171
2172 $this->warmupCache = [];
2173
2174 return $values;
2175 }
2176
2184 public function makeGlobalKey( $keygroup, ...$components ) {
2185 return $this->cache->makeGlobalKey( $keygroup, ...$components );
2186 }
2187
2195 public function makeKey( $keygroup, ...$components ) {
2196 return $this->cache->makeKey( $keygroup, ...$components );
2197 }
2198
2240 final public function makeMultiKeys( array $ids, $keyCallback ) {
2241 $idByKey = [];
2242 foreach ( $ids as $id ) {
2243 $key = $keyCallback( $id, $this );
2244 // Edge case: ignore key collisions due to duplicate $ids like "42" and 42
2245 if ( !isset( $idByKey[$key] ) ) {
2246 $idByKey[$key] = $id;
2247 } elseif ( (string)$id !== (string)$idByKey[$key] ) {
2248 throw new UnexpectedValueException(
2249 "Cache key collision; IDs ('$id','{$idByKey[$key]}') map to '$key'"
2250 );
2251 }
2252 }
2253
2254 return new ArrayIterator( $idByKey );
2255 }
2256
2292 final public function multiRemap( array $ids, array $res ) {
2293 if ( count( $ids ) !== count( $res ) ) {
2294 // If makeMultiKeys() is called on a list of non-unique IDs, then the resulting
2295 // ArrayIterator will have less entries due to "first appearance" de-duplication
2296 $ids = array_keys( array_fill_keys( $ids, true ) );
2297 if ( count( $ids ) !== count( $res ) ) {
2298 throw new UnexpectedValueException( "Multi-key result does not match ID list" );
2299 }
2300 }
2301
2302 return array_combine( $ids, $res );
2303 }
2304
2311 public function watchErrors() {
2312 return $this->cache->watchErrors();
2313 }
2314
2332 final public function getLastError( $watchPoint = 0 ) {
2333 $code = $this->cache->getLastError( $watchPoint );
2334 switch ( $code ) {
2335 case BagOStuff::ERR_NONE:
2336 return BagOStuff::ERR_NONE;
2337 case BagOStuff::ERR_NO_RESPONSE:
2338 return BagOStuff::ERR_NO_RESPONSE;
2339 case BagOStuff::ERR_UNREACHABLE:
2340 return BagOStuff::ERR_UNREACHABLE;
2341 default:
2342 return BagOStuff::ERR_UNEXPECTED;
2343 }
2344 }
2345
2351 public function clearProcessCache() {
2352 $this->processCaches = [];
2353 }
2354
2375 final public function useInterimHoldOffCaching( $enabled ) {
2376 $this->useInterimHoldOffCaching = $enabled;
2377 }
2378
2384 public function getQoS( $flag ) {
2385 return $this->cache->getQoS( $flag );
2386 }
2387
2450 public function adaptiveTTL( $mtime, $maxTTL, $minTTL = 30, $factor = 0.2 ) {
2451 wfDeprecated( __METHOD__, '1.47' );
2452 // handle fractional seconds and string integers
2453 $mtime = (int)$mtime;
2454 if ( $mtime <= 0 ) {
2455 // no last-modified time provided
2456 return $minTTL;
2457 }
2458
2459 $age = (int)$this->getCurrentTime() - $mtime;
2460
2461 return (int)min( $maxTTL, max( $minTTL, $factor * $age ) );
2462 }
2463
2469 final public function getWarmupKeyMisses() {
2470 // Number of misses in $this->warmupCache during the last call to certain methods
2471 return $this->warmupKeyMisses;
2472 }
2473
2478 protected function getRouteKey( string $sisterKey ) {
2479 if ( $this->broadcastRoute !== null ) {
2480 if ( $sisterKey[0] === '/' ) {
2481 throw new RuntimeException( "Sister key '$sisterKey' already contains a route." );
2482 }
2483 return $this->broadcastRoute . $sisterKey;
2484 }
2485 return $sisterKey;
2486 }
2487
2499 private function scheduleAsyncRefresh( $key, $ttl, $callback, array $opts, array $cbParams ) {
2500 if ( !$this->asyncHandler ) {
2501 return false;
2502 }
2503 // Update the cache value later, such during post-send of an HTTP request. This forces
2504 // cache regeneration by setting "minAsOf" to infinity, meaning that no existing value
2505 // is considered valid. Furthermore, note that preemptive regeneration is not applicable
2506 // to invalid values, so there is no risk of infinite preemptive regeneration loops.
2507 $func = $this->asyncHandler;
2508 $func( function () use ( $key, $ttl, $callback, $opts, $cbParams ) {
2509 $opts['minAsOf'] = INF;
2510 try {
2511 $this->fetchOrRegenerate( $key, $ttl, $callback, $opts, $cbParams );
2512 } catch ( Exception $e ) {
2513 // Log some context for easier debugging
2514 $this->logger->error( 'Async refresh failed for {key}', [
2515 'key' => $key,
2516 'ttl' => $ttl,
2517 'exception' => $e
2518 ] );
2519 throw $e;
2520 }
2521 } );
2522
2523 return true;
2524 }
2525
2533 private function isAcceptablyFreshValue( $res, $minAsOf ) {
2534 return (
2535 // Value exists and is not not too old
2536 $this->isValid( $res[self::RES_VALUE], $res[self::RES_AS_OF], $minAsOf )
2537 // Check remaining seconds during which this value is definitely fresh
2538 && $res[self::RES_CUR_TTL] > 0
2539 );
2540 }
2541
2552 protected function isLotteryRefreshDue( $res, $lowTTL, $ageNew, $hotTTR, $now ) {
2553 $curTTL = $res[self::RES_CUR_TTL];
2554 $logicalTTL = $res[self::RES_TTL];
2555 $asOf = $res[self::RES_AS_OF];
2556
2557 return (
2558 $this->worthRefreshExpiring( $curTTL, $logicalTTL, $lowTTL ) ||
2559 $this->worthRefreshPopular( $asOf, $ageNew, $hotTTR, $now )
2560 );
2561 }
2562
2600 protected function worthRefreshPopular( $asOf, $ageNew, $hotTTR, $now ) {
2601 if ( $ageNew < 0 || $hotTTR <= 0 ) {
2602 return false;
2603 }
2604
2605 $age = $now - $asOf;
2606 $timeOld = $age - $ageNew;
2607 if ( $timeOld <= 0 ) {
2608 return false;
2609 }
2610
2611 $popularHitsPerSec = 1;
2612 // Lifecycle is: new, ramp-up refresh chance, full refresh chance.
2613 // Note that the "expected # of refreshes" for the ramp-up time range is half
2614 // of what it would be if P(refresh) was at its full value during that time range.
2615 $refreshWindowSec = max( $hotTTR - $ageNew - self::RAMPUP_TTL / 2, 1 );
2616 // P(refresh) * (# hits in $refreshWindowSec) = (expected # of refreshes)
2617 // P(refresh) * ($refreshWindowSec * $popularHitsPerSec) = 1 (by definition)
2618 // P(refresh) = 1/($refreshWindowSec * $popularHitsPerSec)
2619 $chance = 1 / ( $popularHitsPerSec * $refreshWindowSec );
2620 // Ramp up $chance from 0 to its nominal value over RAMPUP_TTL seconds to avoid stampedes
2621 $chance *= ( $timeOld <= self::RAMPUP_TTL ) ? $timeOld / self::RAMPUP_TTL : 1;
2622
2623 return ( mt_rand( 1, 1_000_000_000 ) <= 1_000_000_000 * $chance );
2624 }
2625
2662 protected function worthRefreshExpiring( $curTTL, $logicalTTL, $lowTTL ) {
2663 if ( $lowTTL <= 0 ) {
2664 return false;
2665 }
2666 // T264787: avoid having keys start off with a high chance of being refreshed;
2667 // the point where refreshing becomes possible cannot precede the key lifetime.
2668 $effectiveLowTTL = min( $lowTTL, $logicalTTL ?: INF );
2669
2670 // How long the value was in the "low TTL" phase
2671 $timeOld = $effectiveLowTTL - $curTTL;
2672 if ( $timeOld <= 0 || $timeOld >= $effectiveLowTTL ) {
2673 return false;
2674 }
2675
2676 // Ratio of the low TTL phase that has elapsed (r)
2677 $ttrRatio = $timeOld / $effectiveLowTTL;
2678 // Use p(r) as the monotonically increasing "chance of refresh" function,
2679 // having p(0)=0 and p(1)=1. The value expires at the nominal expiry.
2680 $chance = $ttrRatio ** 4;
2681
2682 return ( mt_rand( 1, 1_000_000_000 ) <= 1_000_000_000 * $chance );
2683 }
2684
2693 protected function isValid( $value, $asOf, $minAsOf ) {
2694 return ( $value !== false && $asOf >= $minAsOf );
2695 }
2696
2704 private function wrap( $value, $ttl, $version, $now ) {
2705 // Returns keys in ascending integer order for PHP7 array packing:
2706 // https://nikic.github.io/2014/12/22/PHPs-new-hashtable-implementation.html
2707 $wrapped = [
2708 self::FLD_FORMAT_VERSION => self::VERSION,
2709 self::FLD_VALUE => $value,
2710 self::FLD_TTL => $ttl,
2711 self::FLD_TIME => $now
2712 ];
2713 if ( $version !== null ) {
2714 $wrapped[self::FLD_VALUE_VERSION] = $version;
2715 }
2716
2717 return $wrapped;
2718 }
2719
2734 private function unwrap( $wrapped, $now ) {
2735 // https://nikic.github.io/2014/12/22/PHPs-new-hashtable-implementation.html
2736 $res = [
2737 // Attributes that only depend on the fetched key value
2738 self::RES_VALUE => false,
2739 self::RES_VERSION => null,
2740 self::RES_AS_OF => null,
2741 self::RES_TTL => null,
2742 self::RES_TOMB_AS_OF => null,
2743 // Attributes that depend on caller-specific "check" keys or "touched callbacks"
2744 self::RES_CHECK_AS_OF => null,
2745 self::RES_TOUCH_AS_OF => null,
2746 self::RES_CUR_TTL => null
2747 ];
2748
2749 if ( is_array( $wrapped ) ) {
2750 // Entry expected to be a cached value; validate it
2751 if (
2752 ( $wrapped[self::FLD_FORMAT_VERSION] ?? null ) === self::VERSION &&
2753 $wrapped[self::FLD_TIME] >= $this->epoch
2754 ) {
2755 if ( $wrapped[self::FLD_TTL] > 0 ) {
2756 // Get the approximate time left on the key
2757 $age = $now - $wrapped[self::FLD_TIME];
2758 $curTTL = max( $wrapped[self::FLD_TTL] - $age, 0.0 );
2759 } else {
2760 // Key had no TTL, so the time left is unbounded
2761 $curTTL = INF;
2762 }
2763 $res[self::RES_VALUE] = $wrapped[self::FLD_VALUE];
2764 $res[self::RES_VERSION] = $wrapped[self::FLD_VALUE_VERSION] ?? null;
2765 $res[self::RES_AS_OF] = $wrapped[self::FLD_TIME];
2766 $res[self::RES_CUR_TTL] = $curTTL;
2767 $res[self::RES_TTL] = $wrapped[self::FLD_TTL];
2768 }
2769 } else {
2770 // Entry expected to be a tombstone; parse it
2771 $purge = $this->parsePurgeValue( $wrapped );
2772 if ( $purge !== null ) {
2773 // Tombstoned keys should always have a negative "current TTL"
2774 $curTTL = min( $purge[self::PURGE_TIME] - $now, self::TINY_NEGATIVE );
2775 $res[self::RES_CUR_TTL] = $curTTL;
2776 $res[self::RES_TOMB_AS_OF] = $purge[self::PURGE_TIME];
2777 }
2778 }
2779
2780 return $res;
2781 }
2782
2788 private function determineKeyGroupForStats( $key ) {
2789 $parts = explode( ':', $key, 3 );
2790 // Fallback in case the key was not made by makeKey.
2791 // Replace dots because they are special in StatsD (T232907)
2792 return strtr( $parts[1] ?? $parts[0], '.', '_' );
2793 }
2794
2803 private function parsePurgeValue( $value ) {
2804 if ( !is_string( $value ) ) {
2805 return null;
2806 }
2807
2808 $segments = explode( ':', $value, 3 );
2809 $prefix = $segments[0];
2810 if ( $prefix !== self::PURGE_VAL_PREFIX ) {
2811 // Not a purge value
2812 return null;
2813 }
2814
2815 $timestamp = (float)$segments[1];
2816 // makeTombstonePurgeValue() doesn't store hold-off TTLs
2817 $holdoff = isset( $segments[2] ) ? (int)$segments[2] : self::HOLDOFF_TTL;
2818
2819 if ( $timestamp < $this->epoch ) {
2820 // Purge value is too old
2821 return null;
2822 }
2823
2824 return [ self::PURGE_TIME => $timestamp, self::PURGE_HOLDOFF => $holdoff ];
2825 }
2826
2833 private function makeCheckPurgeValue( float $timestamp, int $holdoff, ?array &$purge = null ) {
2834 $normalizedTime = (int)$timestamp;
2835 // Purge array that matches what parsePurgeValue() would have returned
2836 $purge = [ self::PURGE_TIME => (float)$normalizedTime, self::PURGE_HOLDOFF => $holdoff ];
2837
2838 return self::PURGE_VAL_PREFIX . ":$normalizedTime:$holdoff";
2839 }
2840
2845 private function getProcessCache( $group ) {
2846 if ( !isset( $this->processCaches[$group] ) ) {
2847 [ , $size ] = explode( ':', $group );
2848 $this->processCaches[$group] = new MapCacheLRU( (int)$size );
2849 if ( $this->wallClockOverride !== null ) {
2850 $this->processCaches[$group]->setMockTime( $this->wallClockOverride );
2851 }
2852 }
2853
2854 return $this->processCaches[$group];
2855 }
2856
2862 private function getNonProcessCachedMultiKeys( ArrayIterator $keys, array $opts ) {
2863 $pcTTL = $opts['pcTTL'] ?? self::TTL_UNCACHEABLE;
2864
2865 $keysMissing = [];
2866 if ( $pcTTL > 0 && $this->callbackDepth == 0 ) {
2867 $pCache = $this->getProcessCache( $opts['pcGroup'] ?? self::PC_PRIMARY );
2868 foreach ( $keys as $key => $id ) {
2869 if ( !$pCache->has( $key, $pcTTL ) ) {
2870 $keysMissing[$id] = $key;
2871 }
2872 }
2873 }
2874
2875 return $keysMissing;
2876 }
2877
2884 private function fetchWrappedValuesForWarmupCache( array $keys, array $checkKeys ) {
2885 if ( !$keys ) {
2886 return [];
2887 }
2888
2889 // Get all the value keys to fetch...
2890 $sisterKeys = [];
2891 foreach ( $keys as $baseKey ) {
2892 $sisterKeys[] = $this->makeSisterKey( $baseKey, self::TYPE_VALUE );
2893 }
2894 // Get all the "check" keys to fetch...
2895 foreach ( $checkKeys as $i => $checkKeyOrKeyGroup ) {
2896 // Note: avoid array_merge() inside loop in case there are many keys
2897 if ( is_int( $i ) ) {
2898 // Single "check" key that applies to all value keys
2899 $sisterKeys[] = $this->makeSisterKey( $checkKeyOrKeyGroup, self::TYPE_TIMESTAMP );
2900 } else {
2901 // List of "check" keys that apply to a specific value key
2902 foreach ( (array)$checkKeyOrKeyGroup as $checkKey ) {
2903 $sisterKeys[] = $this->makeSisterKey( $checkKey, self::TYPE_TIMESTAMP );
2904 }
2905 }
2906 }
2907
2908 $wrappedBySisterKey = $this->cache->getMulti( $sisterKeys );
2909 $wrappedBySisterKey += array_fill_keys( $sisterKeys, false );
2910
2911 return $wrappedBySisterKey;
2912 }
2913
2919 private function timeSinceLoggedMiss( $key, $now ) {
2920 return isset( $this->missLog[$key] ) ? ( $now - $this->missLog[$key] ) : null;
2921 }
2922
2927 protected function getCurrentTime() {
2928 return $this->wallClockOverride ?: microtime( true );
2929 }
2930
2935 public function setMockTime( &$time ) {
2936 $this->wallClockOverride =& $time;
2937 $this->cache->setMockTime( $time );
2938 foreach ( $this->processCaches as $pCache ) {
2939 $pCache->setMockTime( $time );
2940 }
2941 }
2942
2954 private function startOperationSpan( $opName, $keys, $checkKeys = [] ) {
2955 $span = $this->tracer->createSpan( "WANObjectCache::$opName" )
2956 ->setSpanKind( SpanInterface::SPAN_KIND_CLIENT )
2957 ->start();
2958
2959 if ( !$span->getContext()->isSampled() ) {
2960 return $span;
2961 }
2962
2963 $keys = is_array( $keys ) ? implode( ' ', $keys ) : $keys;
2964
2965 if ( count( $checkKeys ) > 0 ) {
2966 $checkKeys = array_map(
2967 static fn ( $checkKeyOrKeyGroup ) =>
2968 is_array( $checkKeyOrKeyGroup )
2969 ? implode( ' ', $checkKeyOrKeyGroup )
2970 : $checkKeyOrKeyGroup,
2971 $checkKeys );
2972
2973 $checkKeys = implode( ' ', $checkKeys );
2974 $span->setAttributes( [ 'org.wikimedia.wancache.check_keys' => $checkKeys ] );
2975 }
2976
2977 $span->setAttributes( [ 'org.wikimedia.wancache.keys' => $keys ] );
2978
2979 $span->activate();
2980 return $span;
2981 }
2982}
2983
2985class_alias( WANObjectCache::class, 'WANObjectCache' );
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Logs a warning that a deprecated feature was used.
Abstract class for any ephemeral data store.
Definition BagOStuff.php:73
A value read from WANObjectCache, along with what is known about the key holding it.
No-op implementation that stores nothing.
Store key-value entries in a size-limited in-memory LRU cache.
Fluent builder for a WANObjectCache::getWithSetCallback() call.
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)
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.
buildGetWithSetCallback()
Create a builder for a getWithSetCallback() call.
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)
fetchKeys(array $keys, array $checkKeys, float $now, ?array $opts=null)
Fetch the value and key metadata of several keys from cache.
getWithInfo(string $key, array $checkKeys=[])
Fetch the value of a key from cache, along with what is known about the key.
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...
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, 'EnableChunkedUploads'=> false, 'UploadMaintenance'=> false, 'IllegalFileChars'=> ':\\/\\\\', 'DeletedDirectory'=> false, 'ImgAuthDetails'=> false, 'ImgAuthUrlPathMap'=>[], 'LocalFileRepo'=>['class'=> 'MediaWiki\\FileRepo\\LocalRepo', 'name'=> 'local', 'directory'=> null, 'scriptDirUrl'=> null, 'favicon'=> null, 'url'=> null, 'hashLevels'=> null, 'thumbScriptUrl'=> null, 'transformVia404'=> null, 'deletedDir'=> null, 'deletedHashLevels'=> null, 'updateCompatibleMetadata'=> null, 'reserializeMetadata'=> null,], 'ForeignFileRepos'=>[], 'UseInstantCommons'=> false, 'UseSharedUploads'=> false, 'SharedUploadDirectory'=> null, 'SharedUploadPath'=> null, 'HashedSharedUploadDirectory'=> true, 'RepositoryBaseUrl'=> 'https:'FetchCommonsDescriptions'=> false, 'SharedUploadDBname'=> false, 'SharedUploadDBprefix'=> '', 'CacheSharedUploads'=> true, 'ForeignUploadTargets'=>['local',], 'UploadDialog'=>['fields'=>['description'=> true, 'date'=> false, 'categories'=> false,], 'licensemessages'=>['local'=> 'generic-local', 'foreign'=> 'generic-foreign',], 'comment'=>['local'=> '', 'foreign'=> '',], 'format'=>['filepage'=> ' $DESCRIPTION', 'description'=> ' $TEXT', 'ownwork'=> '', 'license'=> '', 'uncategorized'=> '',],], 'FileBackends'=>[], 'LockManagers'=>[], 'DefaultLockManager'=> null, 'ShowEXIF'=> null, 'UpdateCompatibleMetadata'=> false, 'AllowCopyUploads'=> false, 'CopyUploadsDomains'=>[], 'CopyUploadsFromSpecialUpload'=> false, 'CopyUploadProxy'=> false, 'CopyUploadTimeout'=> false, 'CopyUploadAllowOnWikiDomainConfig'=> false, 'MaxUploadSize'=> 104857600, 'MinUploadChunkSize'=> 1024, 'UploadNavigationUrl'=> false, 'UploadMissingFileUrl'=> false, 'ThumbnailScriptPath'=> false, 'SharedThumbnailScriptPath'=> false, 'HashedUploadDirectory'=> true, 'CSPUploadEntryPoint'=> true, 'FileExtensions'=>['png', 'gif', 'jpg', 'jpeg', 'webp',], 'ProhibitedFileExtensions'=>['html', 'htm', 'js', 'jsb', 'mhtml', 'mht', 'xhtml', 'xht', 'php', 'phtml', 'php3', 'php4', 'php5', 'phps', 'phar', 'shtml', 'jhtml', 'pl', 'py', 'cgi', 'exe', 'scr', 'dll', 'msi', 'vbs', 'bat', 'com', 'pif', 'cmd', 'vxd', 'cpl', 'xml',], 'MimeTypeExclusions'=>['text/html', 'application/javascript', 'text/javascript', 'text/x-javascript', 'application/x-shellscript', 'application/x-php', 'text/x-php', 'text/x-python', 'text/x-perl', 'text/x-bash', 'text/x-sh', 'text/x-csh', 'text/scriptlet', 'application/x-msdownload', 'application/x-msmetafile', 'application/java', 'application/xml', 'text/xml',], 'CheckFileExtensions'=> true, 'StrictFileExtensions'=> true, 'DisableUploadScriptChecks'=> false, 'UploadSizeWarning'=> false, 'TrustedMediaFormats'=>['BITMAP', 'AUDIO', 'VIDEO', 'image/svg+xml', 'application/pdf',], 'MediaHandlers'=>[], 'NativeImageLazyLoading'=> true, 'ParserTestMediaHandlers'=>['image/jpeg'=> 'MockBitmapHandler', 'image/png'=> 'MockBitmapHandler', 'image/gif'=> 'MockBitmapHandler', 'image/tiff'=> 'MockBitmapHandler', 'image/webp'=> 'MockBitmapHandler', 'image/x-ms-bmp'=> 'MockBitmapHandler', 'image/x-bmp'=> 'MockBitmapHandler', 'image/x-xcf'=> 'MockBitmapHandler', 'image/svg+xml'=> 'MockSvgHandler', 'image/vnd.djvu'=> 'MockDjVuHandler',], 'UseImageResize'=> true, 'UseImageMagick'=> false, 'ImageMagickConvertCommand'=> '/usr/bin/convert', 'MaxInterlacingAreas'=>[], 'SharpenParameter'=> '0x0.4', 'SharpenReductionThreshold'=> 0.85, 'ImageMagickTempDir'=> false, 'CustomConvertCommand'=> false, 'JpegTran'=> '/usr/bin/jpegtran', 'JpegPixelFormat'=> 'yuv420', 'JpegQuality'=> 80, 'Exiv2Command'=> '/usr/bin/exiv2', 'Exiftool'=> '/usr/bin/exiftool', 'SVGConverters'=>['ImageMagick'=> ' $path/convert -background "#ffffff00" -thumbnail $widthx$height\\! $input PNG:$output', 'inkscape'=> ' $path/inkscape -w $width -o $output $input', 'batik'=> 'java -Djava.awt.headless=true -jar $path/batik-rasterizer.jar -w $width -d $output $input', 'rsvg'=> ' $path/rsvg-convert -w $width -h $height -l $lang -o $output $input', 'ImagickExt'=>['SvgHandler::rasterizeImagickExt',],], 'SVGConverter'=> 'ImageMagick', 'SVGConverterPath'=> '', 'SVGMaxSize'=> 5120, 'SVGMetadataCutoff'=> 5242880, 'SVGNativeRendering'=> true, 'SVGNativeRenderingSizeLimit'=> 51200, 'MediaInTargetLanguage'=> true, 'MaxImageArea'=> 12500000, 'MaxAnimatedGifArea'=> 12500000, 'MaxAnimatedWebPArea'=> 12500000, 'WebPThumbnailType'=>['webp', 'image/webp',], 'TiffThumbnailType'=>[], 'ThumbnailEpoch'=> '20030516000000', 'AttemptFailureEpoch'=> 1, 'IgnoreImageErrors'=> false, 'GenerateThumbnailOnParse'=> true, 'ShowArchiveThumbnails'=> true, 'EnableAutoRotation'=> null, 'Antivirus'=> null, 'AntivirusSetup'=>['clamav'=>['command'=> 'clamscan --no-summary ', 'codemap'=>[0=> 0, 1=> 1, 52=> -1, ' *'=> false,], 'messagepattern'=> '/.*?:(.*)/sim',],], 'AntivirusRequired'=> true, 'VerifyMimeType'=> true, 'MimeTypeFile'=> 'internal', 'MimeInfoFile'=> 'internal', 'MimeDetectorCommand'=> null, 'TrivialMimeDetection'=> false, 'XMLMimeTypes'=>['http:'svg'=> 'image/svg+xml', 'http:'http:'html'=> 'text/html',], 'ImageLimits'=>[[320, 240,], [640, 480,], [800, 600,], [1024, 768,], [1280, 1024,], [2560, 2048,],], 'ThumbLimits'=>[120, 150, 180, 200, 220, 250, 300, 400,], 'ThumbnailNamespaces'=>[6,], 'ThumbnailSteps'=> null, 'ThumbnailBuckets'=> null, 'ThumbnailMinimumBucketDistance'=> 50, 'UploadThumbnailRenderMap'=>[], 'UploadThumbnailRenderMethod'=> 'jobqueue', 'UploadThumbnailRenderHttpCustomHost'=> false, 'UploadThumbnailRenderHttpCustomDomain'=> false, 'UseTinyRGBForJPGThumbnails'=> false, 'GalleryOptions'=>[], 'ThumbUpright'=> 0.75, 'DirectoryMode'=> 511, 'ResponsiveImages'=> true, 'ImagePreconnect'=> false, 'TrackMediaRequestProvenance'=> false, 'DjvuUseBoxedCommand'=> false, 'DjvuDump'=> null, 'DjvuRenderer'=> null, 'DjvuTxt'=> null, 'DjvuPostProcessor'=> 'pnmtojpeg', 'DjvuOutputExtension'=> 'jpg', 'EmergencyContact'=> false, 'PasswordSender'=> false, 'NoReplyAddress'=> false, 'EnableEmail'=> true, 'EnableUserEmail'=> true, 'UserEmailUseReplyTo'=> true, 'PasswordReminderResendTime'=> 24, 'NewPasswordExpiry'=> 604800, 'UserEmailConfirmationTokenExpiry'=> 604800, 'PasswordExpirationDays'=> false, 'PasswordExpireGrace'=> 604800, 'SMTP'=> false, 'AdditionalMailParams'=> null, 'AllowHTMLEmail'=> false, 'EnotifFromEditor'=> false, 'EmailAuthentication'=> true, 'EmailConfirmationBanner'=> false, 'EnotifWatchlist'=> false, 'EnotifUserTalk'=> false, 'EnotifRevealEditorAddress'=> false, 'EnotifMinorEdits'=> true, 'EnotifUseRealName'=> false, 'UsersNotifiedOnAllChanges'=>[], 'DBname'=> 'my_wiki', 'DBmwschema'=> null, 'DBprefix'=> '', 'DBserver'=> 'localhost', 'DBport'=> 5432, 'DBuser'=> 'wikiuser', 'DBpassword'=> '', 'DBtype'=> 'mysql', 'DBssl'=> false, 'DBcompress'=> false, 'DBStrictWarnings'=> false, 'DBadminuser'=> null, 'DBadminpassword'=> null, 'SearchType'=> null, 'SearchTypeAlternatives'=> null, 'DBTableOptions'=> 'ENGINE=InnoDB, DEFAULT CHARSET=binary', 'SQLMode'=> '', 'SQLiteDataDir'=> '', 'SharedDB'=> null, 'SharedPrefix'=> false, 'SharedTables'=>['user', 'user_properties', 'user_autocreate_serial',], 'SharedSchema'=> false, 'DBservers'=> false, 'LBFactoryConf'=>['class'=> 'Wikimedia\\Rdbms\\LBFactorySimple',], 'DataCenterUpdateStickTTL'=> 10, 'DBerrorLog'=> false, 'DBerrorLogTZ'=> false, 'LocalDatabases'=>[], 'DatabaseReplicaLagWarning'=> 10, 'DatabaseReplicaLagCritical'=> 30, 'MaxExecutionTimeForExpensiveQueries'=> 0, 'VirtualDomainsMapping'=>[], 'RemoteVirtualDomainsMapping'=>[], 'FileSchemaMigrationStage'=> 3, 'ExternalLinksDomainGaps'=>[], 'ContentHandlers'=>['wikitext'=>['class'=> 'MediaWiki\\Content\\WikitextContentHandler', 'services'=>['TitleFactory', 'ParserFactory', 'GlobalIdGenerator', 'LanguageNameUtils', 'LinkRenderer', 'MagicWordFactory', 'ParsoidParserFactory',],], 'javascript'=>['class'=> 'MediaWiki\\Content\\JavaScriptContentHandler', 'services'=>['MainConfig', 'ParserFactory', 'UserOptionsLookup', 'CodeHighlighter',],], 'json'=>['class'=> 'MediaWiki\\Content\\JsonContentHandler', 'services'=>['ParsoidParserFactory', 'TitleFactory',],], 'css'=>['class'=> 'MediaWiki\\Content\\CssContentHandler', 'services'=>['MainConfig', 'ParserFactory', 'UserOptionsLookup', 'CodeHighlighter',],], 'vue'=>['class'=> 'MediaWiki\\Content\\VueContentHandler', 'services'=>['MainConfig', 'ParserFactory', 'CodeHighlighter',],], 'text'=> 'MediaWiki\\Content\\TextContentHandler', 'unknown'=> 'MediaWiki\\Content\\FallbackContentHandler',], 'NamespaceContentModels'=>[], 'TextModelsToParse'=>['wikitext', 'javascript', 'css',], 'CompressRevisions'=> false, 'ExternalStores'=>[], 'ExternalServers'=>[], 'DefaultExternalStore'=> false, 'RevisionCacheExpiry'=> 604800, 'PageLanguageUseDB'=> false, 'DiffEngine'=> null, 'ExternalDiffEngine'=> false, 'Wikidiff2Options'=>[], 'RequestTimeLimit'=> null, 'TransactionalTimeLimit'=> 120, 'CriticalSectionTimeLimit'=> 180.0, 'MiserMode'=> false, 'DisableQueryPages'=> false, 'QueryCacheLimit'=> 1000, 'WantedPagesThreshold'=> 1, 'AllowSlowParserFunctions'=> false, 'AllowSchemaUpdates'=> true, 'MaxArticleSize'=> 2048, 'MemoryLimit'=> '50M', 'PoolCounterConf'=> null, 'PoolCountClientConf'=>['servers'=>['127.0.0.1',], 'timeout'=> 0.1,], 'MaxUserDBWriteDuration'=> false, 'MaxJobDBWriteDuration'=> false, 'LinkHolderBatchSize'=> 1000, 'MaximumMovedPages'=> 100, 'ForceDeferredUpdatesPreSend'=> false, 'MultiShardSiteStats'=> false, 'CacheDirectory'=> false, 'MainCacheType'=> 0, 'MessageCacheType'=> -1, 'ParserCacheType'=> -1, 'SessionCacheType'=> -1, 'AnonSessionCacheType'=> false, 'LanguageConverterCacheType'=> -1, 'ObjectCaches'=>[0=>['class'=> 'Wikimedia\\ObjectCache\\EmptyBagOStuff', 'reportDupes'=> false,], 1=>['class'=> 'MediaWiki\\ObjectCache\\SqlBagOStuff', 'loggroup'=> 'SQLBagOStuff',], 'memcached-php'=>['class'=> 'Wikimedia\\ObjectCache\\MemcachedPhpBagOStuff', 'loggroup'=> 'memcached',], 'memcached-pecl'=>['class'=> 'Wikimedia\\ObjectCache\\MemcachedPeclBagOStuff', 'loggroup'=> 'memcached',], 'hash'=>['class'=> 'Wikimedia\\ObjectCache\\HashBagOStuff', 'reportDupes'=> false,], 'apc'=>['class'=> 'Wikimedia\\ObjectCache\\APCUBagOStuff', 'reportDupes'=> false,], 'apcu'=>['class'=> 'Wikimedia\\ObjectCache\\APCUBagOStuff', 'reportDupes'=> false,],], 'WANObjectCache'=>[], 'MicroStashType'=> -1, 'MainStash'=> 1, 'ParsoidCacheConfig'=>['StashType'=> null, 'StashDuration'=> 86400, 'WarmParsoidParserCache'=> false,], 'ParsoidSelectiveUpdateSampleRate'=> 0, 'SplitParsoidParserCache'=> true, 'ParserCacheFilterConfig'=>['pcache'=>['default'=>['minCpuTime'=> 0,],], 'postproc-pcache'=>['default'=>['minCpuTime'=> 9223372036854775807,],], 'parsoid-pcache'=>['default'=>['minCpuTime'=> 0,],], 'postproc-parsoid-pcache'=>['default'=>['minCpuTime'=> 0,],],], 'ChronologyProtectorSecret'=> '', 'ParserCacheExpireTime'=> 86400, 'ParserCacheAsyncExpireTime'=> 60, 'ParserCacheAsyncRefreshJobs'=> true, 'OldRevisionParserCacheExpireTime'=> 3600, 'ObjectCacheSessionExpiry'=> 3600, 'SuspiciousIpExpiry'=> false, 'SessionPbkdf2Iterations'=> 10001, 'UseSessionCookieJwt'=> false, 'JwtSessionCookieIssuer'=> null, 'MemCachedServers'=>['127.0.0.1:11211',], 'MemCachedPersistent'=> false, 'MemCachedTimeout'=> 500000, 'UseLocalMessageCache'=> false, 'AdaptiveMessageCache'=> false, 'LocalisationCacheConf'=>['class'=> 'MediaWiki\\Language\\LocalisationCache', 'store'=> 'detect', 'storeClass'=> false, 'storeDirectory'=> false, 'storeServer'=>[], 'forceRecache'=> false, 'manualRecache'=> false,], 'CachePages'=> true, 'CacheEpoch'=> '20030516000000', 'GitInfoCacheDirectory'=> false, 'UseFileCache'=> false, 'FileCacheDepth'=> 2, 'RenderHashAppend'=> '', 'EnableSidebarCache'=> false, 'SidebarCacheExpiry'=> 86400, 'UseGzip'=> false, 'InvalidateCacheOnLocalSettingsChange'=> true, 'ExtensionInfoMTime'=> false, 'EnableRemoteBagOStuffTests'=> false, 'UseCdn'=> false, 'VaryOnXFP'=> false, 'InternalServer'=> false, 'CdnMaxAge'=> 18000, 'CdnMaxageLagged'=> 30, 'CdnMaxageStale'=> 10, 'CdnReboundPurgeDelay'=> 0, 'CdnMaxageSubstitute'=> 60, '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',],],], 'EnableSectionShare'=> false, 'UseCombinedLoginLink'=> false, 'Edititis'=> false, 'Send404Code'=> true, 'ShowRollbackEditCount'=> 10, 'EnableCanonicalServerLink'=> false, 'InterwikiLogoOverride'=>[], 'ResourceModules'=>[], 'ResourceModuleSkinStyles'=>[], 'ResourceLoaderSources'=>[], 'ResourceBasePath'=> null, 'ResourceLoaderMaxage'=>[], 'ResourceLoaderDebug'=> false, 'ResourceLoaderMaxQueryLength'=> false, 'ResourceLoaderValidateJS'=> true, 'ResourceLoaderEnableJSProfiler'=> false, 'ResourceLoaderStorageEnabled'=> true, 'ResourceLoaderStorageVersion'=> 1, 'ResourceLoaderEnableSourceMapLinks'=> true, 'AllowSiteCSSOnRestrictedPages'=> false, 'VueDevelopmentMode'=> false, 'CodexDevelopmentDir'=> null, 'MetaNamespace'=> false, 'MetaNamespaceTalk'=> false, 'CanonicalNamespaceNames'=>[-2=> 'Media', -1=> 'Special', 0=> '', 1=> 'Talk', 2=> 'User', 3=> 'User_talk', 4=> 'Project', 5=> 'Project_talk', 6=> 'File', 7=> 'File_talk', 8=> 'MediaWiki', 9=> 'MediaWiki_talk', 10=> 'Template', 11=> 'Template_talk', 12=> 'Help', 13=> 'Help_talk', 14=> 'Category', 15=> 'Category_talk',], 'ExtraNamespaces'=>[], 'ExtraGenderNamespaces'=>[], 'NamespaceAliases'=>[], 'LegalTitleChars'=> ' %!"$&\'()*,\\-.\\/0-9:;=?@A-Z\\\\^_`a-z~\\x80-\\xFF+', 'CapitalLinks' => true, 'CapitalLinkOverrides' => [ ], 'NamespacesWithSubpages' => [ 1 => true, 2 => true, 3 => true, 4 => true, 5 => true, 7 => true, 8 => true, 9 => true, 10 => true, 11 => true, 12 => true, 13 => true, 15 => true, ], 'NamespacesWithoutAutoSummaries' => [ ], 'ContentNamespaces' => [ 0, ], 'ShortPagesNamespaceExclusions' => [ ], 'ExtraSignatureNamespaces' => [ ], 'InvalidRedirectTargets' => [ 'Filepath', 'Mypage', 'Mytalk', 'Redirect', 'Mylog', ], 'DisableHardRedirects' => false, 'FixDoubleRedirects' => false, 'LocalInterwikis' => [ ], 'InterwikiExpiry' => 10800, 'InterwikiCache' => false, 'InterwikiScopes' => 3, 'InterwikiFallbackSite' => 'wiki', 'RedirectSources' => false, 'SiteTypes' => [ 'mediawiki' => 'MediaWiki\\Site\\MediaWikiSite', ], 'MaxTocLevel' => 999, 'MaxPPNodeCount' => 1000000, 'MaxTemplateDepth' => 100, 'MaxPPExpandDepth' => 100, 'UrlProtocols' => [ 'bitcoin:', 'ftp: 'ftps: 'geo:', 'git: 'gopher: 'http: 'https: 'irc: 'ircs: 'magnet:', 'mailto:', 'matrix:', 'mms: 'news:', 'nntp: 'redis: 'sftp: 'sip:', 'sips:', 'sms:', 'ssh: 'svn: 'tel:', 'telnet: 'urn:', 'wikipedia: 'worldwind: 'xmpp:', ' ], 'CleanSignatures' => true, 'AllowExternalImages' => false, 'AllowExternalImagesFrom' => '', 'EnableImageWhitelist' => false, 'TidyConfig' => [ ], 'ParsoidSettings' => [ 'useSelser' => true, ], 'ParsoidExperimentalParserFunctionOutput' => false, 'RawHtml' => false, 'ExternalLinkTarget' => false, 'NoFollowLinks' => true, 'NoFollowNsExceptions' => [ ], 'NoFollowDomainExceptions' => [ 'mediawiki.org', ], 'RegisterInternalExternals' => false, 'ExternalLinksIgnoreDomains' => [ ], 'AllowDisplayTitle' => true, 'RestrictDisplayTitle' => true, 'ExpensiveParserFunctionLimit' => 100, 'PreprocessorCacheThreshold' => 1000, 'EnableScaryTranscluding' => false, 'TranscludeCacheExpiry' => 3600, 'EnableMagicLinks' => [ 'ISBN' => false, 'PMID' => false, 'RFC' => false, ], 'ParserEnableUserLanguage' => false, 'ArticleCountMethod' => 'link', 'ActiveUserDays' => 30, 'LearnerEdits' => 10, 'LearnerMemberSince' => 4, 'ExperiencedUserEdits' => 500, 'ExperiencedUserMemberSince' => 30, 'ManualRevertSearchRadius' => 15, 'RevertedTagMaxDepth' => 15, 'CentralIdLookupProviders' => [ 'local' => [ 'class' => 'MediaWiki\\User\\CentralId\\LocalIdLookup', 'services' => [ 'MainConfig', 'DBLoadBalancerFactory', 'HideUserUtils', ], ], ], 'CentralIdLookupProvider' => 'local', 'UserRegistrationProviders' => [ 'local' => [ 'class' => 'MediaWiki\\User\\Registration\\LocalUserRegistrationProvider', 'services' => [ 'ConnectionProvider', ], ], ], 'PasswordPolicy' => [ 'policies' => [ 'bureaucrat' => [ 'MinimalPasswordLength' => 10, 'MinimumPasswordLengthToLogin' => 1, ], 'sysop' => [ 'MinimalPasswordLength' => 10, 'MinimumPasswordLengthToLogin' => 1, ], 'interface-admin' => [ 'MinimalPasswordLength' => 10, 'MinimumPasswordLengthToLogin' => 1, ], 'bot' => [ 'MinimalPasswordLength' => 10, 'MinimumPasswordLengthToLogin' => 1, ], 'default' => [ 'MinimalPasswordLength' => [ 'value' => 8, 'suggestChangeOnLogin' => true, ], 'PasswordCannotBeSubstringInUsername' => [ 'value' => true, 'suggestChangeOnLogin' => true, ], 'PasswordCannotMatchDefaults' => [ 'value' => true, 'suggestChangeOnLogin' => true, ], 'MaximalPasswordLength' => [ 'value' => 4096, 'suggestChangeOnLogin' => true, ], 'PasswordNotInCommonList' => [ 'value' => true, 'suggestChangeOnLogin' => true, ], ], ], 'checks' => [ 'MinimalPasswordLength' => [ 'MediaWiki\\Password\\PasswordPolicyChecks', 'checkMinimalPasswordLength', ], 'MinimumPasswordLengthToLogin' => [ 'MediaWiki\\Password\\PasswordPolicyChecks', 'checkMinimumPasswordLengthToLogin', ], 'PasswordCannotBeSubstringInUsername' => [ 'MediaWiki\\Password\\PasswordPolicyChecks', 'checkPasswordCannotBeSubstringInUsername', ], 'PasswordCannotMatchDefaults' => [ 'MediaWiki\\Password\\PasswordPolicyChecks', 'checkPasswordCannotMatchDefaults', ], 'MaximalPasswordLength' => [ 'MediaWiki\\Password\\PasswordPolicyChecks', 'checkMaximalPasswordLength', ], 'PasswordNotInCommonList' => [ 'MediaWiki\\Password\\PasswordPolicyChecks', 'checkPasswordNotInCommonList', ], ], ], 'AuthManagerConfig' => null, 'AuthManagerAutoConfig' => [ 'preauth' => [ 'MediaWiki\\Auth\\ThrottlePreAuthenticationProvider' => [ 'class' => 'MediaWiki\\Auth\\ThrottlePreAuthenticationProvider', 'sort' => 0, ], 'MediaWiki\\Auth\\PreviouslyRenamedAccountPreAuthenticationProvider' => [ 'class' => 'MediaWiki\\Auth\\PreviouslyRenamedAccountPreAuthenticationProvider', 'services' => [ 'ConnectionProvider', 'UserFactory', ], 'sort' => 0, ], ], 'primaryauth' => [ 'MediaWiki\\Auth\\TemporaryPasswordPrimaryAuthenticationProvider' => [ 'class' => 'MediaWiki\\Auth\\TemporaryPasswordPrimaryAuthenticationProvider', 'services' => [ 'DBLoadBalancerFactory', 'UserOptionsLookup', ], 'args' => [ [ 'authoritative' => false, ], ], 'sort' => 0, ], 'MediaWiki\\Auth\\LocalPasswordPrimaryAuthenticationProvider' => [ 'class' => 'MediaWiki\\Auth\\LocalPasswordPrimaryAuthenticationProvider', 'services' => [ 'DBLoadBalancerFactory', ], 'args' => [ [ 'authoritative' => true, ], ], 'sort' => 100, ], ], 'secondaryauth' => [ 'MediaWiki\\Auth\\CheckBlocksSecondaryAuthenticationProvider' => [ 'class' => 'MediaWiki\\Auth\\CheckBlocksSecondaryAuthenticationProvider', 'sort' => 0, ], 'MediaWiki\\Auth\\ResetPasswordSecondaryAuthenticationProvider' => [ 'class' => 'MediaWiki\\Auth\\ResetPasswordSecondaryAuthenticationProvider', 'sort' => 100, ], 'MediaWiki\\Auth\\EmailNotificationSecondaryAuthenticationProvider' => [ 'class' => 'MediaWiki\\Auth\\EmailNotificationSecondaryAuthenticationProvider', 'services' => [ 'DBLoadBalancerFactory', ], 'sort' => 200, ], ], ], 'RememberMe' => 'choose', 'ReauthenticateTime' => [ 'default' => 3600, ], 'ChangeCredentialsBlacklist' => [ 'MediaWiki\\Auth\\TemporaryPasswordAuthenticationRequest', ], 'RemoveCredentialsBlacklist' => [ 'MediaWiki\\Auth\\PasswordAuthenticationRequest', ], 'InvalidPasswordReset' => true, 'PasswordDefault' => 'pbkdf2', 'PasswordConfig' => [ 'A' => [ 'class' => 'MediaWiki\\Password\\MWOldPassword', ], 'B' => [ 'class' => 'MediaWiki\\Password\\MWSaltedPassword', ], 'pbkdf2-legacyA' => [ 'class' => 'MediaWiki\\Password\\LayeredParameterizedPassword', 'types' => [ 'A', 'pbkdf2', ], ], 'pbkdf2-legacyB' => [ 'class' => 'MediaWiki\\Password\\LayeredParameterizedPassword', 'types' => [ 'B', 'pbkdf2', ], ], 'bcrypt' => [ 'class' => 'MediaWiki\\Password\\BcryptPassword', 'cost' => 9, ], 'pbkdf2' => [ 'class' => 'MediaWiki\\Password\\Pbkdf2PasswordUsingOpenSSL', 'algo' => 'sha512', 'cost' => '30000', 'length' => '64', ], 'argon2' => [ 'class' => 'MediaWiki\\Password\\Argon2Password', 'algo' => 'auto', ], ], 'PasswordResetRoutes' => [ 'username' => true, 'email' => true, ], 'MaxSigChars' => 255, 'SignatureValidation' => 'warning', 'SignatureAllowedLintErrors' => [ 'obsolete-tag', ], 'MaxNameChars' => 255, 'ReservedUsernames' => [ 'MediaWiki default', 'Conversion script', 'Maintenance script', 'Template namespace initialisation script', 'ScriptImporter', 'Delete page script', 'Move page script', 'Command line script', 'Unknown user', 'msg:double-redirect-fixer', 'msg:usermessage-editor', 'msg:proxyblocker', 'msg:sorbs', 'msg:spambot_username', 'msg:autochange-username', ], 'DefaultUserOptions' => [ 'ccmeonemails' => 0, 'date' => 'default', 'diffonly' => 0, 'diff-type' => 'table', 'disablemail' => 0, 'editfont' => 'monospace', 'editondblclick' => 0, 'editrecovery' => 0, 'editsectiononrightclick' => 0, 'email-allow-new-users' => 1, 'enotifminoredits' => 0, 'enotifrevealaddr' => 0, 'enotifusertalkpages' => 1, 'enotifwatchlistpages' => 1, 'extendwatchlist' => 1, 'fancysig' => 0, 'forceeditsummary' => 0, 'forcesafemode' => 0, 'gender' => 'unknown', 'hidecategorization' => 1, 'hideminor' => 0, 'hidepatrolled' => 0, 'imagesize' => 2, 'minordefault' => 0, 'newpageshidepatrolled' => 0, 'nickname' => '', 'norollbackdiff' => 0, 'prefershttps' => 1, 'previewonfirst' => 0, 'previewontop' => 1, 'pst-cssjs' => 1, 'rcdays' => 7, 'rcenhancedfilters-disable' => 0, 'rclimit' => 50, 'requireemail' => 0, 'search-match-redirect' => true, 'search-special-page' => 'Search', 'search-thumbnail-extra-namespaces' => true, 'searchlimit' => 20, 'showhiddencats' => 0, 'shownumberswatching' => 1, 'showrollbackconfirmation' => 0, 'skin' => false, 'skin-responsive' => 1, 'thumbsize' => 5, 'underline' => 2, 'useeditwarning' => 1, 'uselivepreview' => 0, 'usenewrc' => 1, 'watchcreations' => 1, 'watchcreations-expiry' => 'infinite', 'watchdefault' => 1, 'watchdefault-expiry' => 'infinite', 'watchdeletion' => 0, 'watchlistdays' => 7, 'watchlisthideanons' => 0, 'watchlisthidebots' => 0, 'watchlisthidecategorization' => 1, 'watchlisthideliu' => 0, 'watchlisthideminor' => 0, 'watchlisthideown' => 0, 'watchlisthidepatrolled' => 0, 'watchlistreloadautomatically' => 0, 'watchlistunwatchlinks' => 0, 'watchmoves' => 0, 'watchrollback' => 0, 'watchuploads' => 1, 'watchrollback-expiry' => 'infinite', 'watchstar-expiry' => 'infinite', 'wlenhancedfilters-disable' => 0, 'wllimit' => 250, ], 'ConditionalUserOptions' => [ ], 'HiddenPrefs' => [ ], 'UserJsPrefLimit' => 100, 'InvalidUsernameCharacters' => '@:>=', 'UserrightsInterwikiDelimiter' => '@', 'SecureLogin' => false, 'AuthenticationTokenVersion' => null, 'SessionProviders' => [ 'MediaWiki\\Session\\CookieSessionProvider' => [ 'class' => 'MediaWiki\\Session\\CookieSessionProvider', 'args' => [ [ 'priority' => 30, ], ], 'services' => [ 'JwtCodec', 'UrlUtils', ], ], 'MediaWiki\\Session\\BotPasswordSessionProvider' => [ 'class' => 'MediaWiki\\Session\\BotPasswordSessionProvider', 'args' => [ [ 'priority' => 75, ], ], 'services' => [ 'GrantsInfo', ], ], ], 'AutoCreateTempUser' => [ 'known' => false, 'enabled' => false, 'actions' => [ 'edit', ], 'genPattern' => '~$1', 'matchPattern' => null, 'reservedPattern' => '~$1', 'serialProvider' => [ 'type' => 'local', 'useYear' => true, ], 'serialMapping' => [ 'type' => 'readable-numeric', ], 'expireAfterDays' => 90, 'notifyBeforeExpirationDays' => 10, ], 'AutoblockExemptions' => [ ], 'AutoblockExpiry' => 86400, 'BlockAllowsUTEdit' => true, 'BlockCIDRLimit' => [ 'IPv4' => 16, 'IPv6' => 19, ], 'BlockDisablesLogin' => false, 'EnableMultiBlocks' => false, 'WhitelistRead' => false, 'WhitelistReadRegexp' => false, 'EmailConfirmToEdit' => false, 'HideIdentifiableRedirects' => true, 'GroupPermissions' => [ '*' => [ 'createaccount' => true, 'autocreateaccount' => true, 'read' => true, 'edit' => true, 'createpage' => true, 'createtalk' => true, 'viewmyprivateinfo' => true, 'editmyprivateinfo' => true, 'editmyoptions' => true, ], 'user' => [ 'move' => true, 'move-subpages' => true, 'move-rootuserpages' => true, 'move-categorypages' => true, 'movefile' => true, 'read' => true, 'edit' => true, 'createpage' => true, 'createtalk' => true, 'upload' => true, 'reupload' => true, 'reupload-shared' => true, 'minoredit' => true, 'editmyusercss' => true, 'editmyuserjson' => true, 'editmyuserjs' => true, 'editmyuserjsredirect' => true, 'sendemail' => true, 'applychangetags' => true, 'changetags' => true, 'viewmywatchlist' => true, 'editmywatchlist' => true, 'createwithcontentmodel' => true, 'logout' => true, ], 'autoconfirmed' => [ 'autoconfirmed' => true, 'editsemiprotected' => true, ], 'bot' => [ 'bot' => true, 'autoconfirmed' => true, 'editsemiprotected' => true, 'nominornewtalk' => true, 'autopatrol' => true, 'suppressredirect' => true, 'apihighlimits' => true, ], 'sysop' => [ 'block' => true, 'createaccount' => true, 'createpreviouslyrenamedaccount' => true, 'delete' => true, 'bigdelete' => true, 'deletedhistory' => true, 'deletedtext' => true, 'undelete' => true, 'editcontentmodel' => true, 'editinterface' => true, 'editsitejson' => true, 'edituserjson' => true, 'import' => true, 'importupload' => true, 'move' => true, 'move-subpages' => true, 'move-rootuserpages' => true, 'move-categorypages' => true, 'patrol' => true, 'autopatrol' => true, 'protect' => true, 'editprotected' => true, 'rollback' => true, 'upload' => true, 'reupload' => true, 'reupload-shared' => true, 'unwatchedpages' => true, 'autoconfirmed' => true, 'editsemiprotected' => true, 'ipblock-exempt' => true, 'blockemail' => true, 'markbotedits' => true, 'apihighlimits' => true, 'browsearchive' => true, 'noratelimit' => true, 'movefile' => true, 'unblockself' => true, 'suppressredirect' => true, 'mergehistory' => true, 'managechangetags' => true, 'deletechangetags' => true, ], 'interface-admin' => [ 'editinterface' => true, 'editsitecss' => true, 'editsitejson' => true, 'editsitejs' => true, 'editusercss' => true, 'edituserjson' => true, 'edituserjs' => true, ], 'bureaucrat' => [ 'userrights' => true, 'noratelimit' => true, 'renameuser' => true, ], 'suppress' => [ 'hideuser' => true, 'suppressrevision' => true, 'viewsuppressed' => true, 'suppressionlog' => true, 'deleterevision' => true, 'deletelogentry' => true, ], ], 'PrivilegedGroups' => [ 'bureaucrat', 'interface-admin', 'suppress', 'sysop', ], 'RevokePermissions' => [ ], 'GroupInheritsPermissions' => [ ], 'ImplicitGroups' => [ '*', 'user', 'autoconfirmed', ], 'GroupsAddToSelf' => [ ], 'GroupsRemoveFromSelf' => [ ], 'RestrictedGroups' => [ ], 'UserRequirementsPrivateConditions' => [ ], 'RestrictionTypes' => [ 'create', 'edit', 'move', 'upload', ], 'RestrictionLevels' => [ '', 'autoconfirmed', 'sysop', ], 'CascadingRestrictionLevels' => [ 'sysop', ], 'SemiprotectedRestrictionLevels' => [ 'autoconfirmed', ], 'NamespaceProtection' => [ ], 'RestrictUserPageEditing' => false, 'NonincludableNamespaces' => [ ], 'AutoConfirmAge' => 0, 'AutoConfirmCount' => 0, 'Autopromote' => [ 'autoconfirmed' => [ '&', [ 1, null, ], [ 2, null, ], ], ], 'AutopromoteOnce' => [ 'onEdit' => [ ], ], 'AutopromoteOnceLogInRC' => true, 'AutopromoteOnceRCExcludedGroups' => [ ], 'AddGroups' => [ ], 'RemoveGroups' => [ ], 'AvailableRights' => [ ], 'ImplicitRights' => [ ], 'DeleteRevisionsLimit' => 0, 'DeleteRevisionsBatchSize' => 1000, 'HideUserContribLimit' => 1000, 'AccountCreationThrottle' => [ [ 'count' => 0, 'seconds' => 86400, ], ], 'TempAccountCreationThrottle' => [ [ 'count' => 1, 'seconds' => 600, ], [ 'count' => 6, 'seconds' => 86400, ], ], 'TempAccountNameAcquisitionThrottle' => [ [ 'count' => 60, 'seconds' => 86400, ], ], 'SpamRegex' => [ ], 'SummarySpamRegex' => [ ], 'EnableDnsBlacklist' => false, 'DnsBlacklistUrls' => [ ], 'ProxyList' => [ ], 'ProxyWhitelist' => [ ], 'SoftBlockRanges' => [ ], 'ApplyIpBlocksToXff' => false, 'RateLimits' => [ 'edit' => [ 'ip' => [ 8, 60, ], 'newbie' => [ 8, 60, ], 'user' => [ 90, 60, ], ], 'move' => [ 'newbie' => [ 2, 120, ], 'user' => [ 8, 60, ], ], 'upload' => [ 'ip' => [ 8, 60, ], 'newbie' => [ 8, 60, ], ], 'rollback' => [ 'user' => [ 10, 60, ], 'newbie' => [ 5, 120, ], ], 'mailpassword' => [ 'ip' => [ 5, 3600, ], ], 'sendemail' => [ 'ip' => [ 5, 86400, ], 'newbie' => [ 5, 86400, ], 'user' => [ 20, 86400, ], ], 'changeemail' => [ 'ip-all' => [ 10, 3600, ], 'user' => [ 4, 86400, ], ], 'confirmemail' => [ 'ip-all' => [ 10, 3600, ], 'user' => [ 4, 86400, ], ], 'purge' => [ 'ip' => [ 30, 60, ], 'user' => [ 30, 60, ], ], 'linkpurge' => [ 'ip' => [ 30, 60, ], 'user' => [ 30, 60, ], ], 'renderfile' => [ 'ip' => [ 700, 30, ], 'user' => [ 700, 30, ], ], 'renderfile-nonstandard' => [ 'ip' => [ 70, 30, ], 'user' => [ 70, 30, ], ], 'stashedit' => [ 'ip' => [ 30, 60, ], 'newbie' => [ 30, 60, ], ], 'stashbasehtml' => [ 'ip' => [ 5, 60, ], 'newbie' => [ 5, 60, ], ], 'changetags' => [ 'ip' => [ 8, 60, ], 'newbie' => [ 8, 60, ], ], 'editcontentmodel' => [ 'newbie' => [ 2, 120, ], 'user' => [ 8, 60, ], ], ], 'RateLimitsExcludedIPs' => [ ], 'PutIPinRC' => true, 'QueryPageDefaultLimit' => 50, 'ExternalQuerySources' => [ ], 'PasswordAttemptThrottle' => [ [ 'count' => 5, 'seconds' => 300, ], [ 'count' => 150, 'seconds' => 172800, ], ], 'GrantPermissions' => [ 'basic' => [ 'autocreateaccount' => true, 'autoconfirmed' => true, 'autopatrol' => true, 'editsemiprotected' => true, 'ipblock-exempt' => true, 'nominornewtalk' => true, 'patrolmarks' => true, 'read' => true, 'unwatchedpages' => true, ], 'highvolume' => [ 'bot' => true, 'apihighlimits' => true, 'noratelimit' => true, 'markbotedits' => true, ], 'import' => [ 'import' => true, 'importupload' => true, ], 'editpage' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => true, 'createwithcontentmodel' => true, 'pagelang' => true, ], 'editprotected' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => true, 'createwithcontentmodel' => true, 'editprotected' => true, ], 'editmycssjs' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => true, 'createwithcontentmodel' => true, 'editmyusercss' => true, 'editmyuserjson' => true, 'editmyuserjs' => true, ], 'editmyoptions' => [ 'editmyoptions' => true, 'editmyuserjson' => true, ], 'editinterface' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => true, 'createwithcontentmodel' => true, 'editinterface' => true, 'edituserjson' => true, 'editsitejson' => true, ], 'editsiteconfig' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => true, 'createwithcontentmodel' => true, 'editinterface' => true, 'edituserjson' => true, 'editsitejson' => true, 'editusercss' => true, 'edituserjs' => true, 'editsitecss' => true, 'editsitejs' => true, ], 'createeditmovepage' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => true, 'createwithcontentmodel' => true, 'createpage' => true, 'createtalk' => true, 'delete-redirect' => true, 'move' => true, 'move-rootuserpages' => true, 'move-subpages' => true, 'move-categorypages' => true, 'suppressredirect' => true, ], 'uploadfile' => [ 'upload' => true, 'reupload-own' => true, ], 'uploadeditmovefile' => [ 'upload' => true, 'reupload-own' => true, 'reupload' => true, 'reupload-shared' => true, 'upload_by_url' => true, 'movefile' => true, 'suppressredirect' => true, ], 'patrol' => [ 'patrol' => true, ], 'rollback' => [ 'rollback' => true, ], 'blockusers' => [ 'block' => true, 'blockemail' => true, ], 'viewdeleted' => [ 'browsearchive' => true, 'deletedhistory' => true, 'deletedtext' => true, ], 'viewrestrictedlogs' => [ 'suppressionlog' => true, ], 'delete' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => true, 'createwithcontentmodel' => true, 'browsearchive' => true, 'deletedhistory' => true, 'deletedtext' => true, 'delete' => true, 'bigdelete' => true, 'deletelogentry' => true, 'deleterevision' => true, 'undelete' => true, ], 'oversight' => [ 'suppressrevision' => true, 'viewsuppressed' => true, ], 'protect' => [ 'edit' => true, 'minoredit' => true, 'applychangetags' => true, 'changetags' => true, 'editcontentmodel' => true, 'createwithcontentmodel' => true, 'editprotected' => true, 'protect' => true, ], 'viewmywatchlist' => [ 'viewmywatchlist' => true, ], 'editmywatchlist' => [ 'editmywatchlist' => true, ], 'sendemail' => [ 'sendemail' => true, ], 'createaccount' => [ 'createaccount' => true, ], 'privateinfo' => [ 'viewmyprivateinfo' => true, ], 'mergehistory' => [ 'mergehistory' => true, ], 'managesessions' => [ 'logout' => true, ], ], 'GrantPermissionGroups' => [ 'basic' => 'hidden', 'editpage' => 'page-interaction', 'createeditmovepage' => 'page-interaction', 'editprotected' => 'page-interaction', 'patrol' => 'page-interaction', 'uploadfile' => 'file-interaction', 'uploadeditmovefile' => 'file-interaction', 'sendemail' => 'email', 'viewmywatchlist' => 'watchlist-interaction', 'editmywatchlist' => 'watchlist-interaction', 'editmycssjs' => 'customization', 'editmyoptions' => 'customization', 'editinterface' => 'administration', 'editsiteconfig' => 'administration', 'rollback' => 'administration', 'blockusers' => 'administration', 'delete' => 'administration', 'viewdeleted' => 'administration', 'viewrestrictedlogs' => 'administration', 'protect' => 'administration', 'oversight' => 'administration', 'createaccount' => 'administration', 'mergehistory' => 'administration', 'import' => 'administration', 'highvolume' => 'high-volume', 'privateinfo' => 'private-information', 'managesessions' => 'private-information', ], 'GrantRiskGroups' => [ 'basic' => 'low', 'editpage' => 'low', 'createeditmovepage' => 'low', 'editprotected' => 'vandalism', 'patrol' => 'low', 'uploadfile' => 'low', 'uploadeditmovefile' => 'low', 'sendemail' => 'security', 'viewmywatchlist' => 'low', 'editmywatchlist' => 'low', 'editmycssjs' => 'security', 'editmyoptions' => 'security', 'editinterface' => 'vandalism', 'editsiteconfig' => 'security', 'rollback' => 'low', 'blockusers' => 'vandalism', 'delete' => 'vandalism', 'viewdeleted' => 'vandalism', 'viewrestrictedlogs' => 'security', 'protect' => 'vandalism', 'oversight' => 'security', 'createaccount' => 'low', 'mergehistory' => 'vandalism', 'import' => 'security', 'highvolume' => 'low', 'privateinfo' => 'low', 'managesessions' => 'low', ], 'EnableBotPasswords' => true, 'BotPasswordsCluster' => false, 'BotPasswordsDatabase' => false, 'BotPasswordsLimit' => 100, 'SecretKey' => false, 'JwtPrivateKey' => false, 'JwtPublicKey' => false, 'AllowUserJs' => false, 'ReauthenticateForActions' => [ 'edituserjs' => 'edituserjscss', 'editusercss' => 'edituserjscss', 'editsitejs' => 'editsitejscss', 'editsitecss' => 'editsitejscss', ], 'AllowUserCss' => false, 'AllowUserCssPrefs' => true, 'UseSiteJs' => true, 'UseSiteCss' => true, 'BreakFrames' => false, 'EditPageFrameOptions' => 'DENY', 'ApiFrameOptions' => 'DENY', 'CSPHeader' => false, 'CSPReportOnlyHeader' => false, 'CSPUseReportURIDirective' => false, 'CSPFalsePositiveUrls' => [ 'https: 'https: 'https: 'https: 'https: 'https: 'https: 'https: 'https: 'https: 'https: 'https: 'https: 'https: 'chrome-extension' => true, ], 'AllowCrossOrigin' => false, 'RestAllowCrossOriginCookieAuth' => false, 'SessionSecret' => false, 'CookieExpiration' => 2592000, 'ExtendedLoginCookieExpiration' => 15552000, 'SessionCookieJwtExpiration' => 14400, 'CookieDomain' => '', 'CookiePath' => '/', 'CookieSecure' => 'detect', 'CookiePrefix' => false, 'CookieHttpOnly' => true, 'CookieSameSite' => null, 'CacheVaryCookies' => [ ], 'SessionName' => false, 'CookieSetOnAutoblock' => true, 'CookieSetOnIpBlock' => true, '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, 'DebugToolbar' => false, 'ApiClientErrorSampleRate' => 1.0, 'DisableTextSearch' => false, 'AdvancedSearchHighlighting' => false, 'SearchHighlightBoundaries' => '[\\p{Z}\\p{P}\\p{C}]', 'OpenSearchTemplates' => [ 'application/x-suggestions+json' => false, 'application/x-suggestions+xml' => false, ], 'OpenSearchDefaultLimit' => 10, 'OpenSearchDescriptionLength' => 100, 'SearchSuggestCacheExpiry' => 1200, 'DisableSearchUpdate' => false, 'NamespacesToBeSearchedDefault' => [ true, ], 'DisableInternalSearch' => false, 'SearchForwardUrl' => null, 'SitemapNamespaces' => false, 'SitemapNamespacesPriorities' => false, 'SitemapApiConfig' => [ ], 'SpecialSearchFormOptions' => [ ], 'SearchMatchRedirectPreference' => false, 'SearchRunSuggestedQuery' => true, 'Diff3' => '/usr/bin/diff3', 'Diff' => '/usr/bin/diff', 'PreviewOnOpenNamespaces' => [ 14 => true, ], 'UniversalEditButton' => true, 'UseAutomaticEditSummaries' => true, 'CommandLineDarkBg' => false, 'ReadOnly' => null, 'ReadOnlyWatchedItemStore' => false, 'ReadOnlyFile' => false, 'UpgradeKey' => false, 'GitBin' => '/usr/bin/git', 'GitRepositoryViewers' => [ 'https: 'ssh: 'https: 'git@github\\.com:(.*?)(\\.git)?' => 'https: ], 'InstallerInitialPages' => [ [ 'titlemsg' => 'mainpage', 'text' => '{{subst:int:mainpagetext}}{{subst:int:mainpagedocfooter}}', ], ], 'RCMaxAge' => 7776000, 'WatchersMaxAge' => 15552000, 'UnwatchedPageSecret' => 1, 'RCFilterByAge' => false, 'RCLinkLimits' => [ 50, 100, 250, 500, ], 'RCLinkDays' => [ 1, 3, 7, 14, 30, ], 'RCFeeds' => [ ], 'RCWatchCategoryMembership' => false, 'UseRCPatrol' => true, 'StructuredChangeFiltersLiveUpdatePollingRate' => 3, 'UseNPPatrol' => true, 'UseFilePatrol' => true, 'Feed' => true, 'FeedLimit' => 50, 'FeedCacheTimeout' => 60, 'FeedDiffCutoff' => 32768, 'OverrideSiteFeed' => [ ], 'FeedClasses' => [ 'rss' => 'MediaWiki\\Feed\\RSSFeed', 'atom' => 'MediaWiki\\Feed\\AtomFeed', ], 'AdvertisedFeedTypes' => [ 'atom', ], 'RCShowWatchingUsers' => false, 'RCShowChangedSize' => true, 'RCChangedSizeThreshold' => 500, 'ShowUpdatedMarker' => true, 'DisableAnonTalk' => false, 'UseTagFilter' => true, 'SoftwareTags' => [ 'mw-contentmodelchange' => true, 'mw-new-redirect' => true, 'mw-removed-redirect' => true, 'mw-changed-redirect-target' => true, 'mw-blank' => true, 'mw-replace' => true, 'mw-recreated' => true, 'mw-rollback' => true, 'mw-undo' => true, 'mw-manual-revert' => true, 'mw-reverted' => true, 'mw-server-side-upload' => true, 'mw-ipblock-appeal' => true, 'mw-edited-other-users-js' => true, 'mw-edited-other-users-css' => true, ], 'RestrictedTagViewRights' => [ ], 'UnwatchedPageThreshold' => false, 'RecentChangesFlags' => [ 'newpage' => [ 'letter' => 'newpageletter', 'title' => 'recentchanges-label-newpage', 'legend' => 'recentchanges-legend-newpage', 'grouping' => 'any', ], 'minor' => [ 'letter' => 'minoreditletter', 'title' => 'recentchanges-label-minor', 'legend' => 'recentchanges-legend-minor', 'class' => 'minoredit', 'grouping' => 'all', ], 'bot' => [ 'letter' => 'boteditletter', 'title' => 'recentchanges-label-bot', 'legend' => 'recentchanges-legend-bot', 'class' => 'botedit', 'grouping' => 'all', ], 'unpatrolled' => [ 'letter' => 'unpatrolledletter', 'title' => 'recentchanges-label-unpatrolled', 'legend' => 'recentchanges-legend-unpatrolled', 'grouping' => 'any', ], ], 'WatchlistExpiry' => false, 'EnableWatchstarPopover' => false, 'EnableWatchlistLabels' => false, 'WatchlistLabelsMaxPerUser' => 100, 'WatchlistPurgeRate' => 0.1, 'WatchlistExpiryMaxDuration' => '1 year', 'EnableChangesListQueryPartitioning' => false, 'RightsPage' => null, 'RightsUrl' => null, 'RightsText' => null, 'RightsIcon' => null, 'UseCopyrightUpload' => false, 'MaxCredits' => 0, 'ShowCreditsIfMax' => true, 'ImportSources' => [ ], 'ImportTargetNamespace' => null, 'ExportAllowHistory' => true, 'ExportMaxHistory' => 0, 'ExportAllowListContributors' => false, 'ExportMaxLinkDepth' => 0, 'ExportFromNamespaces' => false, 'ExportAllowAll' => false, 'ExportPagelistLimit' => 5000, 'XmlDumpSchemaVersion' => '0.11', 'WikiFarmSettingsDirectory' => null, 'WikiFarmSettingsExtension' => 'yaml', 'ExtensionFunctions' => [ ], 'ExtensionMessagesFiles' => [ ], 'MessagesDirs' => [ ], 'TranslationAliasesDirs' => [ ], 'ExtensionEntryPointListFiles' => [ ], 'EnableParserLimitReporting' => true, 'ValidSkinNames' => [ ], 'SpecialPages' => [ ], 'ExtensionCredits' => [ ], 'Hooks' => [ ], 'ServiceWiringFiles' => [ ], 'JobClasses' => [ 'deletePage' => 'MediaWiki\\Page\\DeletePageJob', 'refreshLinks' => 'MediaWiki\\JobQueue\\Jobs\\RefreshLinksJob', 'deleteLinks' => 'MediaWiki\\Page\\DeleteLinksJob', 'htmlCacheUpdate' => 'MediaWiki\\JobQueue\\Jobs\\HTMLCacheUpdateJob', 'sendMail' => [ 'class' => 'MediaWiki\\Mail\\EmaillingJob', 'services' => [ 'Emailer', ], ], 'enotifNotify' => [ 'class' => 'MediaWiki\\RecentChanges\\RecentChangeNotifyJob', 'services' => [ 'RecentChangeLookup', ], ], 'fixDoubleRedirect' => [ 'class' => 'MediaWiki\\JobQueue\\Jobs\\DoubleRedirectJob', 'services' => [ 'RevisionLookup', 'MagicWordFactory', 'WikiPageFactory', ], 'needsPage' => true, ], 'AssembleUploadChunks' => 'MediaWiki\\JobQueue\\Jobs\\AssembleUploadChunksJob', 'PublishStashedFile' => 'MediaWiki\\JobQueue\\Jobs\\PublishStashedFileJob', 'ThumbnailRender' => 'MediaWiki\\JobQueue\\Jobs\\ThumbnailRenderJob', 'UploadFromUrl' => 'MediaWiki\\JobQueue\\Jobs\\UploadFromUrlJob', 'recentChangesUpdate' => 'MediaWiki\\RecentChanges\\RecentChangesUpdateJob', 'refreshLinksPrioritized' => 'MediaWiki\\JobQueue\\Jobs\\RefreshLinksJob', 'refreshLinksDynamic' => 'MediaWiki\\JobQueue\\Jobs\\RefreshLinksJob', 'activityUpdateJob' => 'MediaWiki\\Watchlist\\ActivityUpdateJob', 'categoryMembershipChange' => [ 'class' => 'MediaWiki\\RecentChanges\\CategoryMembershipChangeJob', 'services' => [ 'RecentChangeFactory', ], ], 'CategoryCountUpdateJob' => [ 'class' => 'MediaWiki\\JobQueue\\Jobs\\CategoryCountUpdateJob', 'services' => [ 'ConnectionProvider', 'NamespaceInfo', ], ], 'clearUserWatchlist' => 'MediaWiki\\Watchlist\\ClearUserWatchlistJob', 'watchlistExpiry' => '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', 'Promise-Non-Write-API-Action', 'Access-Control-Max-Age', 'Authorization', ], 'RestAPIAdditionalRouteFiles' => [ ], 'RestLocalModuleTestBaseUrl' => null, 'RestModuleOverrides' => [ ], 'RestExternalModules' => [ ], 'RestTermsOfServiceUrl' => null, 'MaxShellMemory' => 307200, 'MaxShellFileSize' => 102400, 'MaxShellTime' => 180, 'MaxShellWallClockTime' => 180, 'ShellCgroup' => false, 'PhpCli' => '/usr/bin/php', 'ShellRestrictionMethod' => 'autodetect', 'ShellboxUrls' => [ 'default' => null, ], 'ShellboxSecretKey' => null, 'ShellboxShell' => '/bin/sh', 'HTTPTimeout' => 25, 'HTTPConnectTimeout' => 5.0, 'HTTPMaxTimeout' => 0, 'HTTPMaxConnectTimeout' => 0, 'HTTPImportTimeout' => 25, 'AsyncHTTPTimeout' => 25, 'HTTPProxy' => '', 'LocalVirtualHosts' => [ ], 'LocalHTTPProxy' => false, 'AllowExternalReqID' => false, 'GenerateReqIDFormat' => 'rand24', 'JobRunRate' => 1, 'RunJobsAsync' => false, 'UpdateRowsPerJob' => 300, 'UpdateRowsPerQuery' => 100, 'RedirectOnLogin' => null, 'EventRelayerConfig' => [ 'default' => [ 'class' => 'Wikimedia\\EventRelayer\\EventRelayerNull', ], ], 'Pingback' => false, 'OriginTrials' => [ ], 'ReportToExpiry' => 86400, 'ReportToEndpoints' => [ ], 'FeaturePolicyReportOnly' => [ ], 'SkinsPreferred' => [ 'vector-2022', 'vector', ], 'SpecialContributeSkinsEnabled' => [ ], 'SpecialContributeNewPageTarget' => null, 'EnableEditRecovery' => false, 'EditRecoveryExpiry' => 2592000, 'UseCodexSpecialBlock' => false, 'ShowLogoutConfirmation' => false, 'EnableProtectionIndicators' => true, 'OutputPipelineStages' => [ ], 'FeatureShutdown' => [ ], 'CloneArticleParserOutput' => true, 'UseLeximorph' => false, 'UsePostprocCacheLegacy' => false, 'UsePostprocCacheParsoid' => true, 'ParserOptionsLogUnsafeSampleRate' => 0, 'ReturnExperimentalPFragmentTypes' => [ ], 'UseParsoidLinksUpdate' => null, 'UseParsoidMessages' => true, ], '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', 'DefaultLockManager' => [ 'string', 'null', ], 'CopyUploadsDomains' => 'array', 'CopyUploadTimeout' => [ 'boolean', 'integer', ], 'SharedThumbnailScriptPath' => [ 'string', 'boolean', ], 'HashedUploadDirectory' => 'boolean', 'CSPUploadEntryPoint' => 'boolean', 'FileExtensions' => 'array', 'ProhibitedFileExtensions' => 'array', 'MimeTypeExclusions' => 'array', 'TrustedMediaFormats' => 'array', 'MediaHandlers' => 'object', 'NativeImageLazyLoading' => 'boolean', 'ParserTestMediaHandlers' => 'object', 'MaxInterlacingAreas' => 'object', 'SVGConverters' => 'object', 'SVGNativeRendering' => [ 'string', 'boolean', ], 'MaxImageArea' => [ 'string', 'integer', 'boolean', ], 'WebPThumbnailType' => 'array', 'TiffThumbnailType' => 'array', 'GenerateThumbnailOnParse' => 'boolean', 'EnableAutoRotation' => [ 'boolean', 'null', ], 'Antivirus' => [ 'string', 'null', ], 'AntivirusSetup' => 'object', 'MimeDetectorCommand' => [ 'string', 'null', ], 'XMLMimeTypes' => 'object', 'ImageLimits' => 'array', 'ThumbLimits' => 'array', 'ThumbnailNamespaces' => 'array', 'ThumbnailSteps' => [ 'array', 'null', ], 'ThumbnailBuckets' => [ 'array', 'null', ], 'UploadThumbnailRenderMap' => 'object', 'GalleryOptions' => 'object', 'DjvuDump' => [ 'string', 'null', ], 'DjvuRenderer' => [ 'string', 'null', ], 'DjvuTxt' => [ 'string', 'null', ], 'DjvuPostProcessor' => [ 'string', 'null', ], 'SMTP' => [ 'boolean', 'object', ], 'EnotifFromEditor' => 'boolean', 'EmailConfirmationBanner' => 'boolean', 'EnotifRevealEditorAddress' => 'boolean', 'UsersNotifiedOnAllChanges' => 'object', 'DBmwschema' => [ 'string', 'null', ], 'SharedTables' => 'array', 'DBservers' => [ 'boolean', 'array', ], 'LBFactoryConf' => 'object', 'LocalDatabases' => 'array', 'VirtualDomainsMapping' => 'object', 'RemoteVirtualDomainsMapping' => 'object', 'FileSchemaMigrationStage' => 'integer', 'ExternalLinksDomainGaps' => 'object', 'ContentHandlers' => 'object', 'NamespaceContentModels' => 'object', 'TextModelsToParse' => 'array', 'ExternalStores' => 'array', 'ExternalServers' => 'object', 'DefaultExternalStore' => [ 'array', 'boolean', ], 'RevisionCacheExpiry' => 'integer', 'PageLanguageUseDB' => 'boolean', 'DiffEngine' => [ 'string', 'null', ], 'ExternalDiffEngine' => [ 'string', 'boolean', ], 'Wikidiff2Options' => 'object', 'RequestTimeLimit' => [ 'integer', 'null', ], 'CriticalSectionTimeLimit' => 'number', 'PoolCounterConf' => [ 'object', 'null', ], 'PoolCountClientConf' => 'object', 'MaxUserDBWriteDuration' => [ 'integer', 'boolean', ], 'MaxJobDBWriteDuration' => [ 'integer', 'boolean', ], 'MultiShardSiteStats' => 'boolean', 'ObjectCaches' => 'object', 'WANObjectCache' => 'object', 'MicroStashType' => [ 'string', 'integer', ], 'ParsoidCacheConfig' => 'object', 'ParsoidSelectiveUpdateSampleRate' => 'integer', 'SplitParsoidParserCache' => 'boolean', 'ParserCacheFilterConfig' => 'object', 'ChronologyProtectorSecret' => 'string', 'SuspiciousIpExpiry' => [ 'integer', 'boolean', ], 'MemCachedServers' => 'array', 'LocalisationCacheConf' => 'object', 'ExtensionInfoMTime' => [ 'integer', 'boolean', ], 'CdnServers' => 'object', 'CdnServersNoPurge' => 'object', 'HTCPRouting' => 'object', 'GrammarForms' => 'object', 'ExtraInterlanguageLinkPrefixes' => 'array', 'InterlanguageLinkCodeMap' => 'object', 'ExtraLanguageNames' => 'object', 'ExtraLanguageCodes' => 'object', 'DummyLanguageCodes' => 'object', 'DisabledVariants' => 'object', 'ForceUIMsgAsContentMsg' => 'object', 'RawHtmlMessages' => 'array', 'OverrideUcfirstCharacters' => 'object', 'XhtmlNamespaces' => 'object', 'BrowserFormatDetection' => 'string', 'SkinMetaTags' => 'object', 'SkipSkins' => 'object', 'FragmentMode' => 'array', 'FooterIcons' => 'object', 'InterwikiLogoOverride' => 'array', 'ResourceModules' => 'object', 'ResourceModuleSkinStyles' => 'object', 'ResourceLoaderSources' => 'object', 'ResourceLoaderMaxage' => 'object', 'ResourceLoaderMaxQueryLength' => [ 'integer', 'boolean', ], 'CanonicalNamespaceNames' => 'object', 'ExtraNamespaces' => 'object', 'ExtraGenderNamespaces' => 'object', 'NamespaceAliases' => 'object', 'CapitalLinkOverrides' => 'object', 'NamespacesWithSubpages' => 'object', 'NamespacesWithoutAutoSummaries' => 'array', 'ContentNamespaces' => 'array', 'ShortPagesNamespaceExclusions' => 'array', 'ExtraSignatureNamespaces' => 'array', 'InvalidRedirectTargets' => 'array', 'LocalInterwikis' => 'array', 'InterwikiCache' => [ 'boolean', 'object', ], 'SiteTypes' => 'object', 'UrlProtocols' => 'array', 'TidyConfig' => 'object', 'ParsoidSettings' => 'object', 'ParsoidExperimentalParserFunctionOutput' => 'boolean', 'NoFollowNsExceptions' => 'array', 'NoFollowDomainExceptions' => 'array', 'ExternalLinksIgnoreDomains' => 'array', 'EnableMagicLinks' => 'object', 'ManualRevertSearchRadius' => 'integer', 'RevertedTagMaxDepth' => 'integer', 'CentralIdLookupProviders' => 'object', 'CentralIdLookupProvider' => 'string', 'UserRegistrationProviders' => 'object', 'PasswordPolicy' => 'object', 'AuthManagerConfig' => [ 'object', 'null', ], 'AuthManagerAutoConfig' => 'object', 'RememberMe' => 'string', 'ReauthenticateTime' => 'object', 'ChangeCredentialsBlacklist' => 'array', 'RemoveCredentialsBlacklist' => 'array', 'PasswordConfig' => 'object', 'PasswordResetRoutes' => 'object', 'SignatureAllowedLintErrors' => 'array', 'ReservedUsernames' => 'array', 'DefaultUserOptions' => 'object', 'ConditionalUserOptions' => 'object', 'HiddenPrefs' => 'array', 'UserJsPrefLimit' => 'integer', 'AuthenticationTokenVersion' => [ 'string', 'null', ], 'SessionProviders' => 'object', 'AutoCreateTempUser' => 'object', 'AutoblockExemptions' => 'array', 'BlockCIDRLimit' => 'object', 'EnableMultiBlocks' => 'boolean', 'GroupPermissions' => 'object', 'PrivilegedGroups' => 'array', 'RevokePermissions' => 'object', 'GroupInheritsPermissions' => 'object', 'ImplicitGroups' => 'array', 'GroupsAddToSelf' => 'object', 'GroupsRemoveFromSelf' => 'object', 'RestrictedGroups' => 'object', 'UserRequirementsPrivateConditions' => 'array', 'RestrictionTypes' => 'array', 'RestrictionLevels' => 'array', 'CascadingRestrictionLevels' => 'array', 'SemiprotectedRestrictionLevels' => 'array', 'NamespaceProtection' => 'object', 'RestrictUserPageEditing' => 'boolean', 'NonincludableNamespaces' => 'object', 'Autopromote' => 'object', 'AutopromoteOnce' => 'object', 'AutopromoteOnceRCExcludedGroups' => 'array', 'AddGroups' => 'object', 'RemoveGroups' => 'object', 'AvailableRights' => 'array', 'ImplicitRights' => 'array', 'AccountCreationThrottle' => [ 'integer', 'array', ], 'TempAccountCreationThrottle' => 'array', 'TempAccountNameAcquisitionThrottle' => 'array', 'SpamRegex' => 'array', 'SummarySpamRegex' => 'array', 'DnsBlacklistUrls' => 'array', 'ProxyList' => [ 'string', 'array', ], 'ProxyWhitelist' => 'array', 'SoftBlockRanges' => 'array', 'RateLimits' => 'object', 'RateLimitsExcludedIPs' => 'array', 'ExternalQuerySources' => 'object', 'PasswordAttemptThrottle' => 'array', 'GrantPermissions' => 'object', 'GrantPermissionGroups' => 'object', 'GrantRiskGroups' => 'object', 'EnableBotPasswords' => 'boolean', 'BotPasswordsCluster' => [ 'string', 'boolean', ], 'BotPasswordsDatabase' => [ 'string', 'boolean', ], 'BotPasswordsLimit' => 'integer', 'ReauthenticateForActions' => 'object', 'CSPHeader' => [ 'boolean', 'object', ], 'CSPReportOnlyHeader' => [ 'boolean', 'object', ], 'CSPUseReportURIDirective' => [ 'boolean', 'object', ], 'CSPFalsePositiveUrls' => 'object', 'AllowCrossOrigin' => 'boolean', 'RestAllowCrossOriginCookieAuth' => 'boolean', 'CookieSameSite' => [ 'string', 'null', ], 'CacheVaryCookies' => 'array', 'TrxProfilerLimits' => 'object', 'DebugLogGroups' => 'object', 'MWLoggerDefaultSpi' => 'object', 'Profiler' => 'object', 'StatsTarget' => [ 'string', 'null', ], 'StatsFormat' => [ 'string', 'null', ], 'StatsPrefix' => 'string', 'OpenTelemetryConfig' => [ 'object', 'null', ], 'OpenSearchTemplates' => 'object', 'NamespacesToBeSearchedDefault' => 'object', 'SitemapNamespaces' => [ 'boolean', 'array', ], 'SitemapNamespacesPriorities' => [ 'boolean', 'object', ], 'SitemapApiConfig' => 'object', 'SpecialSearchFormOptions' => 'object', 'SearchMatchRedirectPreference' => 'boolean', 'SearchRunSuggestedQuery' => 'boolean', 'PreviewOnOpenNamespaces' => 'object', 'ReadOnlyWatchedItemStore' => 'boolean', 'GitRepositoryViewers' => 'object', 'InstallerInitialPages' => 'array', 'RCLinkLimits' => 'array', 'RCLinkDays' => 'array', 'RCFeeds' => 'object', 'OverrideSiteFeed' => 'object', 'FeedClasses' => 'object', 'AdvertisedFeedTypes' => 'array', 'SoftwareTags' => 'object', 'RestrictedTagViewRights' => 'object', 'RecentChangesFlags' => 'object', 'WatchlistExpiry' => 'boolean', 'EnableWatchstarPopover' => 'boolean', 'EnableWatchlistLabels' => 'boolean', 'WatchlistLabelsMaxPerUser' => 'integer', 'WatchlistPurgeRate' => 'number', 'WatchlistExpiryMaxDuration' => [ 'string', 'null', ], 'EnableChangesListQueryPartitioning' => 'boolean', 'ImportSources' => 'object', 'ExtensionFunctions' => 'array', 'ExtensionMessagesFiles' => 'object', 'MessagesDirs' => 'object', 'TranslationAliasesDirs' => 'object', 'ExtensionEntryPointListFiles' => 'object', 'ValidSkinNames' => 'object', 'SpecialPages' => 'object', 'ExtensionCredits' => 'object', 'Hooks' => 'object', 'ServiceWiringFiles' => 'array', 'JobClasses' => 'object', 'JobTypesExcludedFromDefaultQueue' => 'array', 'JobBackoffThrottling' => 'object', 'JobTypeConf' => 'object', 'SpecialPageCacheUpdates' => 'object', 'PagePropLinkInvalidations' => 'object', 'TempCategoryCollations' => 'array', 'SortedCategories' => 'boolean', 'TrackingCategories' => 'array', 'LogTypes' => 'array', 'LogRestrictions' => 'object', 'FilterLogTypes' => 'object', 'LogNames' => 'object', 'LogHeaders' => 'object', 'LogActions' => 'object', 'LogActionsHandlers' => 'object', 'ActionFilteredLogs' => 'object', 'RangeContributionsCIDRLimit' => 'object', 'Actions' => 'object', 'NamespaceRobotPolicies' => 'object', 'ArticleRobotPolicies' => 'object', 'ExemptFromUserRobotsControl' => [ 'array', 'null', ], 'APIModules' => 'object', 'APIFormatModules' => 'object', 'APIMetaModules' => 'object', 'APIPropModules' => 'object', 'APIListModules' => 'object', 'APIUselessQueryPages' => 'array', 'CrossSiteAJAXdomains' => 'object', 'CrossSiteAJAXdomainExceptions' => 'object', 'AllowedCorsHeaders' => 'array', 'RestAPIAdditionalRouteFiles' => 'array', 'RestLocalModuleTestBaseUrl' => [ 'string', 'null', ], 'RestModuleOverrides' => 'object', 'RestExternalModules' => 'object', 'RestTermsOfServiceUrl' => [ 'string', 'null', ], 'ShellRestrictionMethod' => [ 'string', 'boolean', ], 'ShellboxUrls' => 'object', 'ShellboxSecretKey' => [ 'string', 'null', ], 'ShellboxShell' => [ 'string', 'null', ], 'HTTPTimeout' => 'number', 'HTTPConnectTimeout' => 'number', 'HTTPMaxTimeout' => 'number', 'HTTPMaxConnectTimeout' => 'number', 'LocalVirtualHosts' => 'object', 'LocalHTTPProxy' => [ 'string', 'boolean', ], 'GenerateReqIDFormat' => 'string', 'EventRelayerConfig' => 'object', 'Pingback' => 'boolean', 'OriginTrials' => 'array', 'ReportToExpiry' => 'integer', 'ReportToEndpoints' => 'array', 'FeaturePolicyReportOnly' => 'array', 'SkinsPreferred' => 'array', 'SpecialContributeSkinsEnabled' => 'array', 'SpecialContributeNewPageTarget' => [ 'string', 'null', ], 'EnableEditRecovery' => 'boolean', 'EditRecoveryExpiry' => 'integer', 'UseCodexSpecialBlock' => 'boolean', 'ShowLogoutConfirmation' => 'boolean', 'EnableProtectionIndicators' => 'boolean', 'OutputPipelineStages' => 'object', 'FeatureShutdown' => 'array', 'CloneArticleParserOutput' => 'boolean', 'UseLeximorph' => 'boolean', 'UsePostprocCacheLegacy' => 'boolean', 'UsePostprocCacheParsoid' => 'boolean', 'ParserOptionsLogUnsafeSampleRate' => 'integer', 'ReturnExperimentalPFragmentTypes' => 'array', 'UseParsoidLinksUpdate' => [ 'boolean', 'null', ], 'UseParsoidMessages' => [ 'boolean', 'null', ], ], 'mergeStrategy' => [ 'WebPThumbnailType' => 'replace', 'TiffThumbnailType' => 'replace', 'LBFactoryConf' => 'replace', 'InterwikiCache' => 'replace', 'PasswordPolicy' => 'array_replace_recursive', 'AuthManagerAutoConfig' => 'array_plus_2d', 'GroupPermissions' => 'array_plus_2d', 'RevokePermissions' => 'array_plus_2d', 'AddGroups' => 'array_merge_recursive', 'RemoveGroups' => 'array_merge_recursive', 'RateLimits' => 'array_plus_2d', 'GrantPermissions' => 'array_plus_2d', 'MWLoggerDefaultSpi' => 'replace', 'Profiler' => 'replace', 'Hooks' => 'array_merge_recursive', 'RestModuleOverrides' => 'array_replace_recursive', 'RestExternalModules' => 'array_replace_recursive', ], 'dynamicDefault' => [ 'UsePathInfo' => [ 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultUsePathInfo', ], ], 'Script' => [ 'use' => [ 'ScriptPath', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultScript', ], ], 'LoadScript' => [ 'use' => [ 'ScriptPath', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultLoadScript', ], ], 'RestPath' => [ 'use' => [ 'ScriptPath', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultRestPath', ], ], 'StylePath' => [ 'use' => [ 'ResourceBasePath', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultStylePath', ], ], 'LocalStylePath' => [ 'use' => [ 'ScriptPath', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultLocalStylePath', ], ], 'ExtensionAssetsPath' => [ 'use' => [ 'ResourceBasePath', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultExtensionAssetsPath', ], ], 'ArticlePath' => [ 'use' => [ 'Script', 'UsePathInfo', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultArticlePath', ], ], 'UploadPath' => [ 'use' => [ 'ScriptPath', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultUploadPath', ], ], 'FileCacheDirectory' => [ 'use' => [ 'UploadDirectory', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultFileCacheDirectory', ], ], 'Logo' => [ 'use' => [ 'ResourceBasePath', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultLogo', ], ], 'DeletedDirectory' => [ 'use' => [ 'UploadDirectory', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultDeletedDirectory', ], ], 'ShowEXIF' => [ 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultShowEXIF', ], ], 'SharedPrefix' => [ 'use' => [ 'DBprefix', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultSharedPrefix', ], ], 'SharedSchema' => [ 'use' => [ 'DBmwschema', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultSharedSchema', ], ], 'DBerrorLogTZ' => [ 'use' => [ 'Localtimezone', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultDBerrorLogTZ', ], ], 'Localtimezone' => [ 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultLocaltimezone', ], ], 'LocalTZoffset' => [ 'use' => [ 'Localtimezone', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultLocalTZoffset', ], ], 'ResourceBasePath' => [ 'use' => [ 'ScriptPath', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultResourceBasePath', ], ], 'MetaNamespace' => [ 'use' => [ 'Sitename', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultMetaNamespace', ], ], 'CookieSecure' => [ 'use' => [ 'ForceHTTPS', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultCookieSecure', ], ], 'CookiePrefix' => [ 'use' => [ 'SharedDB', 'SharedPrefix', 'SharedTables', 'DBname', 'DBprefix', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultCookiePrefix', ], ], 'ReadOnlyFile' => [ 'use' => [ 'UploadDirectory', ], 'callback' => [ 'MediaWiki\\MainConfigSchema', 'getDefaultReadOnlyFile', ], ], ], ], 'config-schema' => [ 'UploadStashScalerBaseUrl' => [ 'deprecated' => 'since 1.36 Use thumbProxyUrl in $wgLocalFileRepo', ], 'IllegalFileChars' => [ 'deprecated' => 'since 1.41; no longer customizable', ], 'ThumbnailNamespaces' => [ 'items' => [ 'type' => 'integer', ], ], 'LocalDatabases' => [ 'items' => [ 'type' => 'string', ], ], 'ParserCacheFilterConfig' => [ 'additionalProperties' => [ 'type' => 'object', 'description' => 'A map of namespace IDs to filter definitions.', 'additionalProperties' => [ 'type' => 'object', 'description' => 'A map of filter names to values.', 'properties' => [ 'minCpuTime' => [ 'type' => 'number', ], ], ], ], ], 'RawHtmlMessages' => [ 'items' => [ 'type' => 'string', ], ], 'InterwikiLogoOverride' => [ 'items' => [ 'type' => 'string', ], ], 'LegalTitleChars' => [ 'deprecated' => 'since 1.41; use Extension:TitleBlacklist to customize', ], 'ReauthenticateTime' => [ 'additionalProperties' => [ 'type' => 'integer', ], ], 'ChangeCredentialsBlacklist' => [ 'items' => [ 'type' => 'string', ], ], 'RemoveCredentialsBlacklist' => [ 'items' => [ 'type' => 'string', ], ], 'GroupPermissions' => [ 'additionalProperties' => [ 'type' => 'object', 'additionalProperties' => [ 'type' => 'boolean', ], ], ], 'GroupInheritsPermissions' => [ 'additionalProperties' => [ 'type' => 'string', ], ], 'AvailableRights' => [ 'items' => [ 'type' => 'string', ], ], 'ImplicitRights' => [ 'items' => [ 'type' => 'string', ], ], 'SoftBlockRanges' => [ 'items' => [ 'type' => 'string', ], ], 'ExternalQuerySources' => [ 'additionalProperties' => [ 'type' => 'object', 'properties' => [ 'enabled' => [ 'type' => 'boolean', 'default' => false, ], 'url' => [ 'type' => 'string', 'format' => 'uri', ], 'timeout' => [ 'type' => 'integer', 'default' => 10, ], ], 'required' => [ 'enabled', 'url', ], 'additionalProperties' => false, ], ], 'GrantPermissions' => [ 'additionalProperties' => [ 'type' => 'object', 'additionalProperties' => [ 'type' => 'boolean', ], ], ], 'GrantPermissionGroups' => [ 'additionalProperties' => [ 'type' => 'string', ], ], 'SitemapNamespacesPriorities' => [ 'deprecated' => 'since 1.45 and ignored', ], 'SitemapApiConfig' => [ 'additionalProperties' => [ 'enabled' => [ 'type' => 'bool', ], 'sitemapsPerIndex' => [ 'type' => 'int', ], 'pagesPerSitemap' => [ 'type' => 'int', ], 'expiry' => [ 'type' => 'int', ], 'skipRedirects' => [ 'type' => 'bool', ], ], ], 'SoftwareTags' => [ 'additionalProperties' => [ 'type' => 'boolean', ], ], 'UseCopyrightUpload' => [ 'deprecated' => 'since 1.47 This feature is being removed.', ], 'JobBackoffThrottling' => [ 'additionalProperties' => [ 'type' => 'number', ], ], 'JobTypeConf' => [ 'additionalProperties' => [ 'type' => 'object', 'properties' => [ 'class' => [ 'type' => 'string', ], 'order' => [ 'type' => 'string', ], 'claimTTL' => [ 'type' => 'integer', ], ], ], ], 'TrackingCategories' => [ 'deprecated' => 'since 1.25 Extensions should now register tracking categories using the new extension registration system.', ], 'RangeContributionsCIDRLimit' => [ 'additionalProperties' => [ 'type' => 'integer', ], ], 'RestModuleOverrides' => [ 'additionalProperties' => [ 'type' => 'object', 'properties' => [ 'availability' => [ 'type' => 'string', ], ], 'required' => [ 'availability', ], ], ], 'RestExternalModules' => [ 'additionalProperties' => [ 'type' => 'object', 'properties' => [ 'info' => [ 'type' => 'object', 'properties' => [ 'version' => [ 'type' => 'string', ], 'title' => [ 'type' => 'string', ], 'x-i18n-title' => [ 'type' => 'string', ], 'description' => [ 'type' => 'string', ], 'x-i18n-description' => [ 'type' => 'string', ], ], 'required' => [ 'version', ], ], 'base' => [ 'type' => 'string', 'format' => 'uri', ], 'spec' => [ 'type' => 'string', 'format' => 'uri', ], ], 'required' => [ 'info', 'base', 'spec', ], ], ], 'ShellboxUrls' => [ 'additionalProperties' => [ 'type' => [ 'string', 'boolean', 'null', ], ], ], ], 'obsolete-config' => [ 'MangleFlashPolicy' => 'Since 1.39; no longer has any effect.', 'EnableOpenSearchSuggest' => 'Since 1.35, no longer used', 'AutoloadAttemptLowercase' => 'Since 1.40; no longer has any effect.', ],]
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.