Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
23.73% covered (danger)
23.73%
14 / 59
0.00% covered (danger)
0.00%
0 / 25
CRAP
0.00% covered (danger)
0.00%
0 / 1
MainConfigSchema
23.73% covered (danger)
23.73%
14 / 59
0.00% covered (danger)
0.00%
0 / 25
863.39
0.00% covered (danger)
0.00%
0 / 1
 listDefaultValues
81.82% covered (warning)
81.82%
9 / 11
0.00% covered (danger)
0.00%
0 / 1
5.15
 getDefaultValue
71.43% covered (warning)
71.43%
5 / 7
0.00% covered (danger)
0.00%
0 / 1
3.21
 getDefaultUsePathInfo
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
12
 getDefaultScript
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getDefaultLoadScript
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getDefaultRestPath
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getDefaultStylePath
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getDefaultLocalStylePath
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getDefaultExtensionAssetsPath
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getDefaultArticlePath
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
6
 getDefaultUploadPath
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getDefaultFileCacheDirectory
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getDefaultLogo
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getDefaultDeletedDirectory
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getDefaultShowEXIF
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getDefaultSharedPrefix
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getDefaultSharedSchema
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getDefaultDBerrorLogTZ
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
6
 getDefaultLocaltimezone
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
6
 getDefaultLocalTZoffset
0.00% covered (danger)
0.00%
0 / 11
0.00% covered (danger)
0.00%
0 / 1
12
 getDefaultResourceBasePath
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getDefaultMetaNamespace
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getDefaultCookieSecure
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
6
 getDefaultCookiePrefix
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
30
 getDefaultReadOnlyFile
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2/**
3 * This file contains schema declarations for all configuration variables
4 * known to MediaWiki core.
5 *
6 * @file
7 * @ingroup Config
8 */
9
10// phpcs:disable Generic.NamingConventions.UpperCaseConstantName.ClassConstantNotUpperCase
11// phpcs:disable Generic.Files.LineLength.TooLong
12namespace MediaWiki;
13
14use DateTime;
15use DateTimeZone;
16use Generator;
17use InvalidArgumentException;
18use MediaWiki\Auth\CheckBlocksSecondaryAuthenticationProvider;
19use MediaWiki\Auth\EmailNotificationSecondaryAuthenticationProvider;
20use MediaWiki\Auth\LocalPasswordPrimaryAuthenticationProvider;
21use MediaWiki\Auth\PasswordAuthenticationRequest;
22use MediaWiki\Auth\ResetPasswordSecondaryAuthenticationProvider;
23use MediaWiki\Auth\TemporaryPasswordAuthenticationRequest;
24use MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider;
25use MediaWiki\Auth\ThrottlePreAuthenticationProvider;
26use MediaWiki\Config\ConfigException;
27use MediaWiki\Content\CssContentHandler;
28use MediaWiki\Content\FallbackContentHandler;
29use MediaWiki\Content\JavaScriptContentHandler;
30use MediaWiki\Content\JsonContentHandler;
31use MediaWiki\Content\TextContentHandler;
32use MediaWiki\Content\VueContentHandler;
33use MediaWiki\Content\WikitextContentHandler;
34use MediaWiki\Deferred\SiteStatsUpdate;
35use MediaWiki\FileRepo\LocalRepo;
36use MediaWiki\JobQueue\JobQueueDB;
37use MediaWiki\JobQueue\Jobs\AssembleUploadChunksJob;
38use MediaWiki\JobQueue\Jobs\CategoryCountUpdateJob;
39use MediaWiki\JobQueue\Jobs\CategoryMembershipChangeJob;
40use MediaWiki\JobQueue\Jobs\CdnPurgeJob;
41use MediaWiki\JobQueue\Jobs\DoubleRedirectJob;
42use MediaWiki\JobQueue\Jobs\HTMLCacheUpdateJob;
43use MediaWiki\JobQueue\Jobs\NullJob;
44use MediaWiki\JobQueue\Jobs\ParsoidCachePrewarmJob;
45use MediaWiki\JobQueue\Jobs\PublishStashedFileJob;
46use MediaWiki\JobQueue\Jobs\RefreshLinksJob;
47use MediaWiki\JobQueue\Jobs\RevertedTagUpdateJob;
48use MediaWiki\JobQueue\Jobs\ThumbnailRenderJob;
49use MediaWiki\JobQueue\Jobs\UploadFromUrlJob;
50use MediaWiki\Json\RsaJwtCodec;
51use MediaWiki\Language\LocalisationCache;
52use MediaWiki\Logging\BlockLogFormatter;
53use MediaWiki\Logging\ContentModelLogFormatter;
54use MediaWiki\Logging\DeleteLogFormatter;
55use MediaWiki\Logging\ImportLogFormatter;
56use MediaWiki\Logging\InterwikiLogFormatter;
57use MediaWiki\Logging\LogFormatter;
58use MediaWiki\Logging\MergeLogFormatter;
59use MediaWiki\Logging\MoveLogFormatter;
60use MediaWiki\Logging\PatrolLogFormatter;
61use MediaWiki\Logging\ProtectLogFormatter;
62use MediaWiki\Logging\RenameuserLogFormatter;
63use MediaWiki\Logging\RightsLogFormatter;
64use MediaWiki\Logging\TagLogFormatter;
65use MediaWiki\Logging\UploadLogFormatter;
66use MediaWiki\Mail\EmaillingJob;
67use MediaWiki\ObjectCache\SqlBagOStuff;
68use MediaWiki\Page\DeleteLinksJob;
69use MediaWiki\Page\DeletePageJob;
70use MediaWiki\Password\Argon2Password;
71use MediaWiki\Password\BcryptPassword;
72use MediaWiki\Password\LayeredParameterizedPassword;
73use MediaWiki\Password\MWOldPassword;
74use MediaWiki\Password\MWSaltedPassword;
75use MediaWiki\Password\PasswordPolicyChecks;
76use MediaWiki\Password\Pbkdf2PasswordUsingOpenSSL;
77use MediaWiki\Permissions\GrantsInfo;
78use MediaWiki\RCFeed\RedisPubSubFeedEngine;
79use MediaWiki\RCFeed\UDPRCFeedEngine;
80use MediaWiki\RecentChanges\RecentChangeNotifyJob;
81use MediaWiki\RecentChanges\RecentChangesUpdateJob;
82use MediaWiki\RenameUser\Job\RenameUserDerivedJob;
83use MediaWiki\RenameUser\Job\RenameUserTableJob;
84use MediaWiki\Request\WebRequest;
85use MediaWiki\Session\BotPasswordSessionProvider;
86use MediaWiki\Session\SessionManager;
87use MediaWiki\Settings\Source\JsonSchemaTrait;
88use MediaWiki\Site\MediaWikiSite;
89use MediaWiki\Storage\SqlBlobStore;
90use MediaWiki\Title\NamespaceInfo;
91use MediaWiki\User\CentralId\LocalIdLookup;
92use MediaWiki\User\Options\UserOptionsUpdateJob;
93use MediaWiki\User\Registration\LocalUserRegistrationProvider;
94use MediaWiki\User\UserEditCountInitJob;
95use MediaWiki\User\UserGroupExpiryJob;
96use MediaWiki\Watchlist\ActivityUpdateJob;
97use MediaWiki\Watchlist\ClearUserWatchlistJob;
98use MediaWiki\Watchlist\ClearWatchlistNotificationsJob;
99use MediaWiki\Watchlist\WatchlistExpiryJob;
100use ReflectionClass;
101use Wikimedia\EventRelayer\EventRelayerNull;
102use Wikimedia\ObjectCache\APCUBagOStuff;
103use Wikimedia\ObjectCache\EmptyBagOStuff;
104use Wikimedia\ObjectCache\HashBagOStuff;
105use Wikimedia\ObjectCache\MemcachedPeclBagOStuff;
106use Wikimedia\ObjectCache\MemcachedPhpBagOStuff;
107
108/**
109 * This class contains schema declarations for all configuration variables
110 * known to MediaWiki core. The schema definitions follow the JSON Schema
111 * specification.
112 *
113 * @see https://json-schema.org/learn/getting-started-step-by-step.html
114 * @see https://json-schema.org/understanding-json-schema/
115 *
116 * The following JSON schema keys are used by MediaWiki:
117 * - default: the configuration variable's default value.
118 * - type: identifies the allowed value type or types. In addition to JSON Schema types,
119 *         PHPDoc style type definitions are supported for convenience.
120 *         Note that 'array' must not be used for associative arrays.
121 *         To avoid confusion, use 'list' for sequential arrays and 'map' for associative arrays
122 *         with uniform values. The 'object' type should be used for structures that have a known
123 *         set of meaningful properties, especially if each property may have a different kind
124 *         of value.
125 *         See {@link \MediaWiki\Settings\Source\JsonTypeHelper} for details.
126 *
127 * The following additional keys are used by MediaWiki:
128 * - mergeStrategy: see the {@link \MediaWiki\Settings\Config\MergeStrategy}.
129 * - dynamicDefault: Specified a callback that computes the effective default at runtime, based
130 *   on the value of other config variables or on the system environment.
131 *   See {@link \MediaWiki\Settings\Source\ReflectionSchemaSource}
132 *   and {@link \MediaWiki\Settings\DynamicDefaultValues} for details.
133 *
134 * @note After changing this file, run maintenance/generateConfigSchema.php to update
135 *       all the files derived from the information in MainConfigSchema.
136 *
137 * @since 1.39
138 */
139class MainConfigSchema {
140    use JsonSchemaTrait;
141
142    /**
143     * Returns a generator for iterating over all config settings and their default values.
144     * The primary use of this method is to import default values into local scope.
145     * @code
146     *   foreach ( MainConfigSchema::listDefaultValues( 'wg' ) as $var => $value ) {
147     *       $$var = $value;
148     *   }
149     * @endcode
150     *
151     * There should be no reason for application logic to do this.
152     *
153     * @note This method is relatively slow, it should not be used by
154     *       performance critical code. Application logic should generally
155     *       use ConfigSchema instead
156     *
157     * @param string $prefix A prefix to prepend to each setting name.
158     *        Typically, this will be "wg" when constructing global
159     *        variable names.
160     *
161     * @return Generator<string,mixed> $settingName => $defaultValue
162     */
163    public static function listDefaultValues( string $prefix = '' ): Generator {
164        $class = new ReflectionClass( self::class );
165        foreach ( $class->getReflectionConstants() as $const ) {
166            if ( !$const->isPublic() ) {
167                continue;
168            }
169
170            $value = $const->getValue();
171
172            if ( !is_array( $value ) ) {
173                // Just in case we end up having some other kind of constant on this class.
174                continue;
175            }
176
177            if ( isset( $value['obsolete'] ) ) {
178                continue;
179            }
180
181            $name = $const->getName();
182            yield "$prefix$name" => self::getDefaultFromJsonSchema( $value );
183        }
184    }
185
186    /**
187     * Returns the default value of the given config setting.
188     *
189     * @note This method is relatively slow, it should not be used by
190     *       performance critical code. Application logic should generally
191     *       use ConfigSchema instead
192     *
193     * @param string $name The config setting name.
194     *
195     * @return mixed The given config setting's default value, or null
196     *         if no default value is specified in the schema.
197     */
198    public static function getDefaultValue( string $name ) {
199        $class = new ReflectionClass( self::class );
200        if ( !$class->hasConstant( $name ) ) {
201            throw new InvalidArgumentException( "Unknown setting: $name" );
202        }
203        $value = $class->getConstant( $name );
204
205        if ( !is_array( $value ) ) {
206            // Might happen if we end up having other kinds of constants on this class.
207            throw new InvalidArgumentException( "Unknown setting: $name" );
208        }
209
210        return self::getDefaultFromJsonSchema( $value );
211    }
212
213    /***************************************************************************/
214    /**
215     * Registry of factory functions to create config objects:
216     * The 'main' key must be set, and the value should be a valid
217     * callable.
218     *
219     * @since 1.23
220     */
221    public const ConfigRegistry = [
222        'default' => [
223            'main' => 'MediaWiki\\Config\\GlobalVarConfig::newInstance',
224        ],
225        'type' => 'map',
226    ];
227
228    /**
229     * Name of the site. It must be changed in LocalSettings.php
230     */
231    public const Sitename = [
232        'default' => 'MediaWiki',
233    ];
234
235    /***************************************************************************/
236    // region   Server URLs and file paths
237    /** @name   Server URLs and file paths
238     *
239     * In this section, a "path" is usually a host-relative URL, i.e. a URL without
240     * the host part, that starts with a slash. In most cases a full URL is also
241     * acceptable. A "directory" is a local file path.
242     *
243     * In both paths and directories, trailing slashes should not be included.
244     */
245
246    /**
247     * URL of the server.
248     *
249     * **Example:**
250     * ```
251     * $wgServer = 'http://example.com';
252     * ```
253     *
254     * This must be set in LocalSettings.php. The MediaWiki installer does this
255     * automatically since 1.18.
256     *
257     * If you want to use protocol-relative URLs on your wiki, set this to a
258     * protocol-relative URL like '//example.com' and set $wgCanonicalServer
259     * to a fully qualified URL.
260     */
261    public const Server = [
262        'default' => false,
263    ];
264
265    /**
266     * Canonical URL of the server, to use in IRC feeds and notification e-mails.
267     *
268     * Must be fully qualified, even if $wgServer is protocol-relative.
269     *
270     * Defaults to $wgServer, expanded to a fully qualified http:// URL if needed.
271     *
272     * @since 1.18
273     */
274    public const CanonicalServer = [
275        'default' => false,
276    ];
277
278    /**
279     * Server name. This is automatically computed by parsing the bare
280     * hostname out of $wgCanonicalServer. It should not be customized.
281     *
282     * @since 1.24
283     */
284    public const ServerName = [
285        'default' => false,
286    ];
287
288    /**
289     * When the wiki is running behind a proxy and this is set to true, assumes that the proxy
290     * exposes the wiki on the standard ports (443 for https and 80 for http).
291     *
292     * @since 1.26
293     */
294    public const AssumeProxiesUseDefaultProtocolPorts = [
295        'default' => true,
296        'type' => 'boolean',
297    ];
298
299    /**
300     * For installations where the canonical server is HTTP but HTTPS is optionally
301     * supported, you can specify a non-standard HTTPS port here. $wgServer should
302     * be a protocol-relative URL.
303     *
304     * If HTTPS is always used, just specify the port number in $wgServer.
305     *
306     * @see https://phabricator.wikimedia.org/T67184
307     * @since 1.24
308     */
309    public const HttpsPort = [
310        'default' => 443,
311    ];
312
313    /**
314     * If this is true, when an insecure HTTP request is received, always redirect
315     * to HTTPS. This overrides and disables the preferhttps user preference, and it
316     * overrides $wgSecureLogin.
317     *
318     * $wgServer may be either https or protocol-relative. If $wgServer starts with
319     * "http://", an exception will be thrown.
320     *
321     * If a reverse proxy or CDN is used to forward requests from HTTPS to HTTP,
322     * the request header "X-Forwarded-Proto: https" should be sent to suppress
323     * the redirect.
324     *
325     * In addition to setting this to true, for optimal security, the web server
326     * should also be configured to send Strict-Transport-Security response headers.
327     *
328     * @since 1.35
329     */
330    public const ForceHTTPS = [
331        'default' => false,
332        'type' => 'boolean',
333    ];
334
335    /**
336     * The path we should point to.
337     *
338     * It might be a virtual path in case with use apache mod_rewrite for example.
339     *
340     * This *needs* to be set correctly.
341     *
342     * Other paths will be set to defaults based on it unless they are directly
343     * set in LocalSettings.php
344     */
345    public const ScriptPath = [
346        'default' => '/wiki',
347    ];
348
349    /**
350     * Whether to support URLs like index.php/Page_title.
351     * The effective default value is determined at runtime:
352     * it will be enabled in environments where it is expected to be safe.
353     *
354     * Override this to false if $_SERVER['PATH_INFO'] contains unexpectedly
355     * incorrect garbage, or to true if it is really correct.
356     *
357     * The default $wgArticlePath will be set based on this value at runtime, but if
358     * you have customized it, having this incorrectly set to true can cause
359     * redirect loops when "pretty URLs" are used.
360     *
361     * @since 1.2.1
362     */
363    public const UsePathInfo = [
364        'dynamicDefault' => true,
365    ];
366
367    public static function getDefaultUsePathInfo(): bool {
368        // These often break when PHP is set up in CGI mode.
369        // PATH_INFO *may* be correct if cgi.fix_pathinfo is set, but then again it may not;
370        // lighttpd converts incoming path data to lowercase on systems
371        // with case-insensitive filesystems, and there have been reports of
372        // problems on Apache as well.
373        return !str_contains( PHP_SAPI, 'cgi' ) && !str_contains( PHP_SAPI, 'apache2filter' ) &&
374            !str_contains( PHP_SAPI, 'isapi' );
375    }
376
377    /**
378     * The URL path to index.php.
379     *
380     * Defaults to "{$wgScriptPath}/index.php".
381     */
382    public const Script = [
383        'default' => false,
384        'dynamicDefault' => [ 'use' => [ 'ScriptPath' ] ]
385    ];
386
387    /**
388     * @param mixed $scriptPath Value of ScriptPath
389     * @return string
390     */
391    public static function getDefaultScript( $scriptPath ): string {
392        return "$scriptPath/index.php";
393    }
394
395    /**
396     * The URL path to load.php.
397     *
398     * Defaults to "{$wgScriptPath}/load.php".
399     *
400     * @since 1.17
401     */
402    public const LoadScript = [
403        'default' => false,
404        'dynamicDefault' => [ 'use' => [ 'ScriptPath' ] ]
405    ];
406
407    /**
408     * @param mixed $scriptPath Value of ScriptPath
409     * @return string
410     */
411    public static function getDefaultLoadScript( $scriptPath ): string {
412        return "$scriptPath/load.php";
413    }
414
415    /**
416     * The URL path to the REST API.
417     * Defaults to "{$wgScriptPath}/rest.php"
418     *
419     * @since 1.34
420     */
421    public const RestPath = [
422        'default' => false,
423        'dynamicDefault' => [ 'use' => [ 'ScriptPath' ] ]
424    ];
425
426    /**
427     * @param mixed $scriptPath Value of ScriptPath
428     * @return string
429     */
430    public static function getDefaultRestPath( $scriptPath ): string {
431        return "$scriptPath/rest.php";
432    }
433
434    /**
435     * The URL path of the skins directory.
436     *
437     * Defaults to "{$wgResourceBasePath}/skins".
438     *
439     * @since 1.3
440     */
441    public const StylePath = [
442        'default' => false,
443        'dynamicDefault' => [ 'use' => [ 'ResourceBasePath' ] ]
444    ];
445
446    /**
447     * @param mixed $resourceBasePath Value of ResourceBasePath
448     * @return string
449     */
450    public static function getDefaultStylePath( $resourceBasePath ): string {
451        return "$resourceBasePath/skins";
452    }
453
454    /**
455     * The URL path of the skins directory. Should not point to an external domain.
456     *
457     * Defaults to "{$wgScriptPath}/skins".
458     *
459     * @since 1.17
460     */
461    public const LocalStylePath = [
462        'default' => false,
463        'dynamicDefault' => [ 'use' => [ 'ScriptPath' ] ]
464    ];
465
466    /**
467     * @param mixed $scriptPath Value of ScriptPath
468     * @return string
469     */
470    public static function getDefaultLocalStylePath( $scriptPath ): string {
471        // Avoid ResourceBasePath here since that may point to a different domain (e.g. CDN)
472        return "$scriptPath/skins";
473    }
474
475    /**
476     * The URL path of the extensions directory.
477     *
478     * Defaults to "{$wgResourceBasePath}/extensions".
479     *
480     * @since 1.16
481     */
482    public const ExtensionAssetsPath = [
483        'default' => false,
484        'dynamicDefault' => [ 'use' => [ 'ResourceBasePath' ] ]
485    ];
486
487    /**
488     * @param mixed $resourceBasePath Value of ResourceBasePath
489     * @return string
490     */
491    public static function getDefaultExtensionAssetsPath( $resourceBasePath ): string {
492        return "$resourceBasePath/extensions";
493    }
494
495    /**
496     * Extensions directory in the file system.
497     *
498     * Defaults to "{$IP}/extensions" in Setup.php
499     *
500     * @note This configuration variable is used to locate extensions while loading settings.
501     * @since 1.25
502     */
503    public const ExtensionDirectory = [
504        'default' => null,
505        'type' => '?string',
506    ];
507
508    /**
509     * Skins directory in the file system.
510     *
511     * Defaults to "{$IP}/skins" in Setup.php.
512     *
513     * @note This configuration variable is used to locate skins while loading settings.
514     * @since 1.3
515     */
516    public const StyleDirectory = [
517        'default' => null,
518        'type' => '?string',
519    ];
520
521    /**
522     * The URL path for primary article page views. This path should contain $1,
523     * which is replaced by the article title.
524     *
525     * Defaults to "{$wgScript}/$1" or "{$wgScript}?title=$1",
526     * depending on $wgUsePathInfo.
527     */
528    public const ArticlePath = [
529        'default' => false,
530        'dynamicDefault' => [ 'use' => [ 'Script', 'UsePathInfo' ] ]
531    ];
532
533    /**
534     * @param string $script Value of Script
535     * @param mixed $usePathInfo Value of UsePathInfo
536     * @return string
537     */
538    public static function getDefaultArticlePath( string $script, $usePathInfo ): string {
539        if ( $usePathInfo ) {
540            return "$script/$1";
541        }
542        return "$script?title=$1";
543    }
544
545    /**
546     * The URL path to $wgUploadDirectory. Shortcut for $wgLocalFileRepo['url'].
547     *
548     * Defaults to "{$wgScriptPath}/images".
549     */
550    public const UploadPath = [
551        'default' => false,
552        'dynamicDefault' => [ 'use' => [ 'ScriptPath' ] ]
553    ];
554
555    /**
556     * @param mixed $scriptPath Value of ScriptPath
557     * @return string
558     */
559    public static function getDefaultUploadPath( $scriptPath ): string {
560        return "$scriptPath/images";
561    }
562
563    /**
564     * The base path for img_auth.php. This is used to interpret the request URL
565     * for requests to img_auth.php that do not match the base upload path. If
566     * false, "{$wgScriptPath}/img_auth.php" is used.
567     *
568     * Normally, requests to img_auth.php have a REQUEST_URI which matches
569     * $wgUploadPath, and in that case, setting this should not be necessary.
570     * This variable is used in case img_auth.php is accessed via a different path
571     * than $wgUploadPath.
572     *
573     * @since 1.35
574     */
575    public const ImgAuthPath = [
576        'default' => false,
577    ];
578
579    /**
580     * The base path for thumb_handler.php. This is used to interpret the request URL
581     * for requests to thumb_handler.php that do not match the base upload path.
582     *
583     * @since 1.36
584     */
585    public const ThumbPath = [
586        'default' => false,
587    ];
588
589    /**
590     * The filesystem path of the images directory.
591     *
592     * Defaults to "{$IP}/images" in Setup.php.
593     */
594    public const UploadDirectory = [
595        'default' => false,
596        'type' => '?string|false',
597    ];
598
599    /**
600     * Directory where the cached page will be saved.
601     *
602     * Defaults to "{$wgUploadDirectory}/cache".
603     */
604    public const FileCacheDirectory = [
605        'default' => false,
606        'dynamicDefault' => [ 'use' => [ 'UploadDirectory' ] ]
607    ];
608
609    /**
610     * @param mixed $uploadDirectory Value of UploadDirectory
611     * @return string
612     */
613    public static function getDefaultFileCacheDirectory( $uploadDirectory ): string {
614        return "$uploadDirectory/cache";
615    }
616
617    /**
618     * The URL path of the wiki logo. The logo size should be 135x135 pixels.
619     *
620     * Defaults to "$wgResourceBasePath/resources/assets/change-your-logo.svg".
621     * Developers should retrieve this logo (and other variants) using
622     * the static function MediaWiki\ResourceLoader\SkinModule::getAvailableLogos
623     * Ignored if $wgLogos is set.
624     */
625    public const Logo = [
626        'default' => false,
627        'dynamicDefault' => [ 'use' => [ 'ResourceBasePath' ] ]
628    ];
629
630    /**
631     * @param mixed $resourceBasePath Value of ResourceBasePath
632     * @return string
633     */
634    public static function getDefaultLogo( $resourceBasePath ): string {
635        return "$resourceBasePath/resources/assets/change-your-logo.svg";
636    }
637
638    /**
639     * Specification for different versions of the wiki logo.
640     *
641     * This is an array which should have the following k/v pairs:
642     * All path values can be either absolute or relative URIs
643     *
644     * The `1x` key is a path to the 1x version of square logo (should be 135x135 pixels)
645     * The `2x` key is a path to the 2x version of square logo
646     * The `svg` key is a path to the svg version of square logo
647     * The `icon` key is a path to the version of the logo without wordmark and tagline
648     * The `wordmark` key may be null or an array with the following fields
649     *  - `src` path to wordmark version
650     *  - `1x` path to svg wordmark version (if you want to
651     *     support browsers with SVG support with an SVG logo)
652     *  - `width` width of the logo in pixels
653     *  - `height` height of the logo in pixels
654     * The `tagline` key may be null or array with the following fields
655     *  - `src` path to tagline image
656     *  - `width` width of the tagline in pixels
657     *  - `height` height of the tagline in pixels
658     *
659     *
660     * @par Example:
661     * @code
662     * $wgLogos = [
663     *    '1x' => 'path/to/1x_version.png',
664     *    '2x' => 'path/to/2x_version.png',
665     *    'svg' => 'path/to/svg_version.svg',
666     *    'icon' => 'path/to/icon.png',
667     *    'wordmark' => [
668     *      'src' => 'path/to/wordmark_version.png',
669     *      '1x' => 'path/to/wordmark_version.svg',
670     *      'width' => 135,
671     *      'height' => 20,
672     *    ],
673     *    'tagline' => [
674     *      'src' => 'path/to/tagline_version.png',
675     *      'width' => 135,
676     *      'height' => 15,
677     *    ]
678     * ];
679     * @endcode
680     *
681     * Defaults to [ "1x" => $wgLogo ],
682     *   or [ "1x" => "$wgResourceBasePath/resources/assets/change-your-logo.svg" ] if $wgLogo is not set.
683     * @since 1.35
684     */
685    public const Logos = [
686        'default' => false,
687        'type' => 'map|false',
688    ];
689
690    /**
691     * The URL path of the icon.
692     *
693     * @since 1.6
694     */
695    public const Favicon = [
696        'default' => '/favicon.ico',
697    ];
698
699    /**
700     * The URL path of the icon for iPhone and iPod Touch web app bookmarks.
701     *
702     * Defaults to no icon.
703     *
704     * @since 1.12
705     */
706    public const AppleTouchIcon = [
707        'default' => false,
708    ];
709
710    /**
711     * Value for the referrer policy meta tag.
712     *
713     * One or more of the values defined in the Referrer Policy specification:
714     * https://w3c.github.io/webappsec-referrer-policy/
715     * ('no-referrer', 'no-referrer-when-downgrade', 'same-origin',
716     * 'origin', 'strict-origin', 'origin-when-cross-origin',
717     * 'strict-origin-when-cross-origin', or 'unsafe-url')
718     * Setting it to false prevents the meta tag from being output
719     * (which results in falling back to the Referrer-Policy header,
720     * or 'no-referrer-when-downgrade' if that's not set either.)
721     * Setting it to an array (supported since 1.31) will create a meta tag for
722     * each value, in the reverse of the order (meaning that the first array element
723     * will be the default and the others used as fallbacks for browsers which do not
724     * understand it).
725     *
726     * @since 1.25
727     */
728    public const ReferrerPolicy = [
729        'default' => false,
730        'type' => 'list|string|false',
731    ];
732
733    /**
734     * The local filesystem path to a temporary directory. This must not be web-accessible.
735     *
736     * When this setting is set to false, its value will automatically be decided
737     * through the first call to wfTempDir(). See that method's implementation for
738     * the actual detection logic.
739     *
740     * To find the temporary path for the current wiki, developers must not use
741     * this variable directly. Use the global function wfTempDir() instead.
742     *
743     * The temporary directory is expected to be shared with other applications,
744     * including other MediaWiki instances (which might not run the same version
745     * or configuration). When storing files here, take care to avoid conflicts
746     * with other instances of MediaWiki. For example, when caching the result
747     * of a computation, the file name should incorporate the input of the
748     * computation so that it cannot be confused for the result of a similar
749     * computation by another MediaWiki instance.
750     *
751     * @see \wfTempDir()
752     * @note Default changed to false in MediaWiki 1.20.
753     */
754    public const TmpDirectory = [
755        'default' => false,
756    ];
757
758    /**
759     * If set, this server URL is prepended to $wgUploadPath in the default
760     * value of $wgLocalFileRepo['url'].
761     *
762     * It is meant for controlling web access to $wgUploadPath via an alternative
763     * domain name, instead of $wgServer, such as may be needed if your images
764     * are uploaded to a third-party file storage service.
765     *
766     * For other customizations, set $wgLocalFileRepo['url'] directly instead.
767     *
768     * @since 1.4
769     */
770    public const UploadBaseUrl = [
771        'default' => '',
772    ];
773
774    /**
775     * To enable remote on-demand scaling, set this to the thumbnail base URL.
776     *
777     * Full thumbnail URL will be like $wgUploadStashScalerBaseUrl/e/e6/Foo.jpg/123px-Foo.jpg
778     * where 'e6' are the first two characters of the MD5 hash of the file name.
779     *
780     * @deprecated since 1.36 Use thumbProxyUrl in $wgLocalFileRepo
781     *
782     * If $wgUploadStashScalerBaseUrl and thumbProxyUrl are both false, thumbs are
783     * rendered locally as needed.
784     * @since 1.17
785     */
786    public const UploadStashScalerBaseUrl = [
787        'default' => false,
788        'deprecated' => 'since 1.36 Use thumbProxyUrl in $wgLocalFileRepo',
789    ];
790
791    /**
792     * To set 'pretty' URL paths for actions other than
793     * plain page views, add to this array.
794     *
795     * **Example:**
796     * Set pretty URL for the edit action:
797     *
798     * ```
799     *   'edit' => "$wgScriptPath/edit/$1"
800     * ```
801     * There must be an appropriate script or rewrite rule in place to handle these URLs.
802     *
803     * @since 1.5
804     */
805    public const ActionPaths = [
806        'default' => [],
807        'type' => 'map',
808    ];
809
810    /**
811     * When enabled, the domain root will show the wiki's main page,
812     * instead of redirecting to the main page.
813     *
814     * @since 1.34
815     */
816    public const MainPageIsDomainRoot = [
817        'default' => false,
818        'type' => 'boolean',
819    ];
820
821    // endregion -- end of server URLs and file paths
822
823    /***************************************************************************/
824    // region   Files and file uploads
825    /** @name   Files and file uploads */
826
827    /**
828     * Allow users to upload files.
829     *
830     * Use $wgLocalFileRepo to control how and where uploads are stored.
831     * Disabled by default as for security reasons.
832     * See <https://www.mediawiki.org/wiki/Manual:Configuring_file_uploads>.
833     *
834     * @since 1.5
835     */
836    public const EnableUploads = [
837        'default' => false,
838    ];
839
840    /**
841     * The maximum age of temporary (incomplete) uploaded files
842     */
843    public const UploadStashMaxAge = [
844        'default' => 6 * 3600, // 6 hours
845    ];
846
847    /**
848     * Enable deferred upload tasks that use the job queue.
849     *
850     * Only enable this if job runners are set up for both the
851     * 'AssembleUploadChunks','PublishStashedFile' and 'UploadFromUrl' job types.
852     */
853    public const EnableAsyncUploads = [
854        'default' => false,
855    ];
856
857    /**
858     * Enable the async processing of upload by url in Special:Upload.
859     *
860     * Only works if EnableAsyncUploads is also enabled
861     */
862    public const EnableAsyncUploadsByURL = [
863        'default' => false,
864    ];
865
866    /**
867     * To disable file delete/restore temporarily
868     */
869    public const UploadMaintenance = [
870        'default' => false,
871    ];
872
873    /**
874     * Additional characters that are not allowed in filenames. They are replaced with '-' when
875     * uploading. Like $wgLegalTitleChars, this is a regexp character class.
876     *
877     * Slashes and backslashes are disallowed regardless of this setting, but included here for
878     * completeness.
879     *
880     * @deprecated since 1.41; no longer customizable
881     */
882    public const IllegalFileChars = [
883        'default' => ':\\/\\\\',
884        'deprecated' => 'since 1.41; no longer customizable',
885    ];
886
887    /**
888     * Where to move deleted files to. Shortcut for $wgLocalFileRepo['deletedDir'].
889     *
890     * Defaults to "{$wgUploadDirectory}/deleted".
891     */
892    public const DeletedDirectory = [
893        'default' => false,
894        'dynamicDefault' => [ 'use' => [ 'UploadDirectory' ] ]
895    ];
896
897    /**
898     * @param mixed $uploadDirectory Value of UploadDirectory
899     * @return string
900     */
901    public static function getDefaultDeletedDirectory( $uploadDirectory ): string {
902        return "$uploadDirectory/deleted";
903    }
904
905    /**
906     * Set this to true if you use img_auth and want the user to see details on why access failed.
907     */
908    public const ImgAuthDetails = [
909        'default' => false,
910    ];
911
912    /**
913     * Map of relative URL directories to match to internal mwstore:// base storage paths.
914     *
915     * For img_auth.php requests, everything after "img_auth.php/" is checked to see
916     * if starts with any of the prefixes defined here. The prefixes should not overlap.
917     * The prefix that matches has a corresponding storage path, which the rest of the URL
918     * is assumed to be relative to. The file at that path (or a 404) is send to the client.
919     *
920     * Example:
921     * $wgImgAuthUrlPathMap['/timeline/'] = 'mwstore://local-fs/timeline-render/';
922     * The above maps ".../img_auth.php/timeline/X" to "mwstore://local-fs/timeline-render/".
923     * The name "local-fs" should correspond by name to an entry in $wgFileBackends.
924     *
925     * @see self::FileBackends
926     */
927    public const ImgAuthUrlPathMap = [
928        'default' => [],
929        'type' => 'map',
930    ];
931
932    /**
933     * File repository structures
934     *
935     * $wgLocalFileRepo is a single repository structure, and $wgForeignFileRepos is
936     * an array of such structures. Each repository structure is an associative
937     * array of properties configuring the repository.
938     *
939     * Properties required for all repos:
940     *   - class            The class name for the repository. May come from the core or an extension.
941     *                      The core repository classes are FileRepo, LocalRepo, ForeignDBRepo.
942     *
943     *   - name             A unique name for the repository (but $wgLocalFileRepo should be 'local').
944     *                      The name should consist of alpha-numeric characters.
945     *
946     * Optional common properties:
947     *   - backend          A file backend name (see $wgFileBackends). If not specified, or
948     *                      if the name is not present in $wgFileBackends, an FSFileBackend
949     *                      will automatically be configured.
950     *   - lockManager      If a file backend is automatically configured, this will be lock
951     *                      manager name used. A lock manager named in $wgLockManagers, or one of
952     *                      the default lock managers "fsLockManager" or "nullLockManager". Default
953     *                      "fsLockManager".
954     *   - favicon          URL to a favicon. This is exposed via FileRepo::getInfo and
955     *                      ApiQueryFileRepoInfo. Originally for use by MediaViewer (T77093).
956     *
957     * For most core repos:
958     *   - zones            Associative array of zone names that each map to an array with:
959     *                          container  : backend container name the zone is in
960     *                          directory  : root path within container for the zone
961     *                          url        : base URL to the root of the zone
962     *                          urlsByExt  : map of file extension types to base URLs
963     *                                       (useful for using a different cache for videos)
964     *                      Zones default to using "<repo name>-<zone name>" as the container name
965     *                      and default to using the container root as the zone's root directory.
966     *                      Nesting of zone locations within other zones should be avoided.
967     *   - url              Public zone URL. The 'zones' settings take precedence.
968     *   - hashLevels       The number of directory levels for hash-based division of files.
969     *
970     *                      Set this to 0 if you do not want MediaWiki to divide your images
971     *                      directory into many subdirectories.
972     *
973     *                      It is recommended to leave this enabled. In previous versions of
974     *                      MediaWiki, some users set this to false to allow images to be added to
975     *                      the wiki by copying them into $wgUploadDirectory and then running
976     *                      maintenance/rebuildImages.php to register them in the database.
977     *                      This is no longer supported, use maintenance/importImages.php instead.
978     *
979     *                      Default: 2.
980     *   - deletedHashLevels
981     *                      Optional 'hashLevels' override for the 'deleted' zone.
982     *   - thumbScriptUrl   The URL for thumb.php (optional, not recommended)
983     *   - transformVia404  Whether to skip media file transformation on parse and rely on a 404
984     *                      handler instead.
985     *   - thumbProxyUrl    Optional. URL of where to proxy thumb.php requests to. This is
986     *                      also used internally for remote thumbnailing of upload stash files.
987     *                      Example: http://127.0.0.1:8888/wiki/dev/thumb/
988     *   - thumbProxySecret Optional value of the X-Swift-Secret header to use in requests to
989     *                      thumbProxyUrl
990     *   - disableLocalTransform
991     *                      If present and true, local image scaling will be disabled. If attempted,
992     *                      it will show an error to the user and log an error message. To avoid an
993     *                      error, thumbProxyUrl must be set, as well as either transformVia404
994     *                      (preferred) or thumbScriptUrl.
995     *   - initialCapital   Equivalent to $wgCapitalLinks (or $wgCapitalLinkOverrides[NS_FILE],
996     *                      determines whether filenames implicitly start with a capital letter.
997     *                      The current implementation may give incorrect description page links
998     *                      when the local $wgCapitalLinks and initialCapital are mismatched.
999     *   - pathDisclosureProtection
1000     *                      May be 'paranoid' to remove all parameters from error messages, 'none' to
1001     *                      leave the paths in unchanged, or 'simple' to replace paths with
1002     *                      placeholders. Default for LocalRepo is 'simple'.
1003     *   - fileMode         This allows wikis to set the file mode when uploading/moving files. Default
1004     *                      is 0644.
1005     *   - directory        The local filesystem directory where public files are stored. Not used for
1006     *                      some remote repos.
1007     *   - deletedDir       The local filesystem directory where public files are moved to (from
1008     *                      'directory') when they are deleted, at which points they become private.
1009     *                      Defaults to false, which disables the file deletion feature.
1010     *   - thumbDir         The base thumbnail directory. Defaults to "<directory>/thumb".
1011     *   - thumbUrl         The base thumbnail URL. Defaults to "<url>/thumb".
1012     *   - isPrivate        Set this if measures should always be taken to keep the files private.
1013     *                      One should not trust this to assure that the files are not web readable;
1014     *                      the server configuration should be done manually depending on the backend.
1015     *   - useJsonMetadata  Whether handler metadata should be stored in JSON format. Default: true.
1016     *   - useSplitMetadata Whether handler metadata should be split up and stored in the text table.
1017     *                      Default: false.
1018     *   - splitMetadataThreshold
1019     *                      If the media handler opts in, large metadata items will be split into a
1020     *                      separate blob in the database if the item is larger than this threshold.
1021     *                      Default: 1000
1022     *   - updateCompatibleMetadata
1023     *                      When true, image metadata will be upgraded by reloading it from the original
1024     *                      file, if the handler indicates that it is out of date.
1025     *
1026     *                      By default, when purging a file or otherwise refreshing file metadata, it
1027     *                      is only reloaded when the metadata is invalid. Valid data originally loaded
1028     *                      by a current or older compatible version is left unchanged. Enable this
1029     *                      to also reload and upgrade metadata that was stored by an older compatible
1030     *                      version. See also MediaHandler::isMetadataValid, and RefreshImageMetadata.
1031     *
1032     *                      Default: false.
1033     *
1034     *   - reserializeMetadata
1035     *                      If true, image metadata will be automatically rewritten to the database
1036     *                      if its serialization format is out of date. Default: false
1037     *
1038     * These settings describe a foreign MediaWiki installation. They are optional, and will be ignored
1039     * for local repositories:
1040     *   - descBaseUrl       URL of image description pages, e.g. https://en.wikipedia.org/wiki/File:
1041     *   - scriptDirUrl      URL of the MediaWiki installation, equivalent to $wgScriptPath, e.g.
1042     *                       https://en.wikipedia.org/w
1043     *   - articleUrl        Equivalent to $wgArticlePath, e.g. https://en.wikipedia.org/wiki/$1
1044     *   - fetchDescription  Fetch the text of the remote file description page and display them
1045     *                       on the local wiki.
1046     *   - abbrvThreshold    File names over this size will use the short form of thumbnail names.
1047     *                       Short thumbnail names only have the width, parameters, and the extension.
1048     *
1049     * ForeignDBRepo:
1050     *   - dbType, dbServer, dbUser, dbPassword, dbName, dbFlags
1051     *                       equivalent to the corresponding member of $wgDBservers
1052     *   - tablePrefix       Table prefix, the foreign wiki's $wgDBprefix
1053     *   - hasSharedCache    Set to true if the foreign wiki's $wgMainCacheType is identical to,
1054     *                       and accessible from, this wiki.
1055     *
1056     * ForeignAPIRepo:
1057     *   - apibase              Use for the foreign API's URL
1058     *   - apiThumbCacheExpiry  How long to locally cache thumbs for
1059     *
1060     * If you set $wgForeignFileRepos to an array of repository structures, those will
1061     * be searched after the local file repo.
1062     * Otherwise, you will only have access to local media files.
1063     *
1064     * @see SetupDynamicConfig.php for expansion of below initial values.
1065     */
1066    public const LocalFileRepo = [
1067        'default' => [
1068            'class' => LocalRepo::class,
1069            'name' => 'local',
1070            'directory' => null, // $wgUploadDirectory
1071            'scriptDirUrl' => null, // $wgScriptPath
1072            'favicon' => null, // $wgFavicon
1073            'url' => null, // $wgUploadBaseUrl . $wgUploadPath
1074            'hashLevels' => null, // $wgHashedUploadDirectory
1075            'thumbScriptUrl' => null, // $wgThumbnailScriptPath
1076            'transformVia404' => null, // $wgGenerateThumbnailOnParse
1077            'deletedDir' => null, // $wgDeletedDirectory
1078            'deletedHashLevels' => null, // $wgHashedUploadDirectory
1079            'updateCompatibleMetadata' => null, // $wgUpdateCompatibleMetadata
1080            'reserializeMetadata' => null, // $wgUpdateCompatibleMetadata
1081        ],
1082        'type' => 'map',
1083    ];
1084
1085    /**
1086     * Enable the use of files from one or more other wikis.
1087     *
1088     * If you operate multiple wikis, you can declare a shared upload path here.
1089     * Uploads to the local wiki will NOT be stored here - See $wgLocalFileRepo
1090     * and $wgUploadDirectory for that.
1091     *
1092     * When performing file lookups (e.g. via `[[File:..]]` syntax), the wiki will
1093     * only consider the foreign repository if no file of the given name is found
1094     * in the local repository ($wgLocalFileRepo).
1095     *
1096     * If you set $wgUseInstantCommons to true, this automatically includes
1097     * an entry for Wikimedia Commons.
1098     *
1099     * @since 1.11
1100     * @see self::LocalFileRepo
1101     */
1102    public const ForeignFileRepos = [
1103        'default' => [],
1104        'type' => 'list',
1105    ];
1106
1107    /**
1108     * Use Wikimedia Commons as a foreign file repository.
1109     *
1110     * This is a shortcut for adding an entry to $wgForeignFileRepos
1111     * for https://commons.wikimedia.org, using ForeignAPIRepo with the
1112     * default settings.
1113     *
1114     * @since 1.16
1115     */
1116    public const UseInstantCommons = [
1117        'default' => false,
1118    ];
1119
1120    /**
1121     * Shortcut for adding an entry to $wgForeignFileRepos.
1122     *
1123     * Uses the following variables:
1124     *
1125     * - directory: $wgSharedUploadDirectory.
1126     * - url: $wgSharedUploadPath.
1127     * - hashLevels: Based on $wgHashedSharedUploadDirectory.
1128     * - thumbScriptUrl: $wgSharedThumbnailScriptPath.
1129     * - transformVia404: Based on $wgGenerateThumbnailOnParse.
1130     * - descBaseUrl: $wgRepositoryBaseUrl.
1131     * - fetchDescription: $wgFetchCommonsDescriptions.
1132     *
1133     * If $wgSharedUploadDBname is set, it uses the ForeignDBRepo
1134     * class, with also the following variables:
1135     *
1136     * - dbName: $wgSharedUploadDBname.
1137     * - dbType: $wgDBtype.
1138     * - dbServer: $wgDBserver.
1139     * - dbUser: $wgDBuser.
1140     * - dbPassword: $wgDBpassword.
1141     * - dbFlags: Based on $wgDebugDumpSql.
1142     * - tablePrefix: $wgSharedUploadDBprefix,
1143     * - hasSharedCache: $wgCacheSharedUploads.
1144     *
1145     * @since 1.3
1146     */
1147    public const UseSharedUploads = [
1148        'default' => false,
1149        'type' => 'boolean',
1150    ];
1151
1152    /**
1153     * Shortcut for the 'directory' setting of $wgForeignFileRepos.
1154     *
1155     * Only used if $wgUseSharedUploads is enabled.
1156     *
1157     * @since 1.3
1158     */
1159    public const SharedUploadDirectory = [
1160        'default' => null,
1161        'type' => '?string',
1162    ];
1163
1164    /**
1165     * Shortcut for the 'url' setting of $wgForeignFileRepos.
1166     *
1167     * Only used if $wgUseSharedUploads is enabled.
1168     *
1169     * @since 1.3
1170     */
1171    public const SharedUploadPath = [
1172        'default' => null,
1173        'type' => '?string',
1174    ];
1175
1176    /**
1177     * Shortcut for the 'hashLevels' setting of $wgForeignFileRepos.
1178     *
1179     * Only used if $wgUseSharedUploads is enabled.
1180     *
1181     * @since 1.3
1182     */
1183    public const HashedSharedUploadDirectory = [
1184        'default' => true,
1185        'type' => 'boolean',
1186    ];
1187
1188    /**
1189     * Shortcut for the 'descBaseUrl' setting of $wgForeignFileRepos.
1190     *
1191     * Only used if $wgUseSharedUploads is enabled.
1192     *
1193     * @since 1.5
1194     */
1195    public const RepositoryBaseUrl = [
1196        'default' => 'https://commons.wikimedia.org/wiki/File:',
1197    ];
1198
1199    /**
1200     * Shortcut for the 'fetchDescription' setting of $wgForeignFileRepos.
1201     *
1202     * Only used if $wgUseSharedUploads is enabled.
1203     *
1204     * @since 1.5
1205     */
1206    public const FetchCommonsDescriptions = [
1207        'default' => false,
1208        'type' => 'boolean',
1209    ];
1210
1211    /**
1212     * Shortcut for the ForeignDBRepo 'dbName' setting in $wgForeignFileRepos.
1213     *
1214     * Set this to false if the uploads do not come from a wiki.
1215     * Only used if $wgUseSharedUploads is enabled.
1216     *
1217     * @since 1.4
1218     */
1219    public const SharedUploadDBname = [
1220        'default' => false,
1221        'type' => 'false|string',
1222    ];
1223
1224    /**
1225     * Shortcut for the ForeignDBRepo 'tablePrefix' setting in $wgForeignFileRepos.
1226     *
1227     * Only used if $wgUseSharedUploads is enabled.
1228     *
1229     * @since 1.5
1230     */
1231    public const SharedUploadDBprefix = [
1232        'default' => '',
1233        'type' => 'string',
1234    ];
1235
1236    /**
1237     * Shortcut for the ForeignDBRepo 'hasSharedCache' setting in $wgForeignFileRepos.
1238     *
1239     * Only used if $wgUseSharedUploads is enabled.
1240     *
1241     * @since 1.5
1242     */
1243    public const CacheSharedUploads = [
1244        'default' => true,
1245        'type' => 'boolean',
1246    ];
1247
1248    /**
1249     * Array of foreign file repo names (set in $wgForeignFileRepos above) that
1250     * are allowable upload targets. These wikis must have some method of
1251     * authentication (i.e. CentralAuth), and be CORS-enabled for this wiki.
1252     *
1253     * The string 'local' signifies the default local file repository.
1254     *
1255     * Example:
1256     * $wgForeignUploadTargets = [ 'shared' ];
1257     */
1258    public const ForeignUploadTargets = [
1259        'default' => [ 'local', ],
1260        'type' => 'list',
1261    ];
1262
1263    /**
1264     * Configuration for file uploads using the embeddable upload dialog
1265     * (https://www.mediawiki.org/wiki/Upload_dialog).
1266     *
1267     * This applies also to foreign uploads to this wiki (the configuration is loaded by remote
1268     * wikis using the action=query&meta=siteinfo API).
1269     *
1270     * See below for documentation of each property. None of the properties may be omitted.
1271     */
1272    public const UploadDialog = [
1273        'default' =>
1274            [
1275                'fields' =>
1276                    [
1277                        'description' => true,
1278                        'date' => false,
1279                        'categories' => false,
1280                    ],
1281                'licensemessages' =>
1282                    [
1283                        'local' => 'generic-local',
1284                        'foreign' => 'generic-foreign',
1285                    ],
1286                'comment' =>
1287                    [
1288                        'local' => '',
1289                        'foreign' => '',
1290                    ],
1291                'format' =>
1292                    [
1293                        'filepage' => '$DESCRIPTION',
1294                        'description' => '$TEXT',
1295                        'ownwork' => '',
1296                        'license' => '',
1297                        'uncategorized' => '',
1298                    ],
1299            ],
1300        'type' => 'map',
1301    ];
1302
1303    /**
1304     * File backend structure configuration.
1305     *
1306     * This is an array of file backend configuration arrays.
1307     * Each backend configuration has the following parameters:
1308     *  - name        : A unique name for the backend
1309     *  - class       : The file backend class to use
1310     *  - wikiId      : A unique string that identifies the wiki (container prefix)
1311     *  - lockManager : The name of a lock manager (see $wgLockManagers) [optional]
1312     *
1313     * See FileBackend::__construct() for more details.
1314     * Additional parameters are specific to the file backend class used.
1315     * These settings should be global to all wikis when possible.
1316     *
1317     * FileBackendMultiWrite::__construct() is augmented with a 'template' option that
1318     * can be used in any of the values of the 'backends' array. Its value is the name of
1319     * another backend in $wgFileBackends. When set, it pre-fills the array with all of the
1320     * configuration of the named backend. Explicitly set values in the array take precedence.
1321     *
1322     * There are two particularly important aspects about each backend:
1323     *   - a) Whether it is fully qualified or wiki-relative.
1324     *        By default, the paths of files are relative to the current wiki,
1325     *        which works via prefixing them with the current wiki ID when accessed.
1326     *        Setting 'domainId' forces the backend to be fully qualified by prefixing
1327     *        all paths with the specified value instead. This can be useful if
1328     *        multiple wikis need to share the same data. Note that 'name' is *not*
1329     *        part of any prefix and thus should not be relied upon for namespacing.
1330     *   - b) Whether it is only defined for some wikis or is defined on all
1331     *        wikis in the wiki farm. Defining a backend globally is useful
1332     *        if multiple wikis need to share the same data.
1333     *
1334     * One should be aware of these aspects when configuring a backend for use with
1335     * any basic feature or plugin. For example, suppose an extension stores data for
1336     * different wikis in different directories and sometimes needs to access data from
1337     * a foreign wiki's directory in order to render a page on given wiki. The extension
1338     * would need a fully qualified backend that is defined on all wikis in the wiki farm.
1339     */
1340    public const FileBackends = [
1341        'default' => [],
1342        'type' => 'map',
1343    ];
1344
1345    /**
1346     * List of lock manager backend configurations.
1347     *
1348     * Each backend configuration has the following parameters:
1349     *  - name  : A unique name for the lock manager
1350     *  - class : The lock manager class to use
1351     *
1352     * See LockManager::__construct() for more details.
1353     * Additional parameters are specific to the lock manager class used.
1354     * These settings should be global to all wikis.
1355     *
1356     * Minimal example:
1357     *
1358     * ```
1359     * $wgLockManagers[] = [
1360     *   'name' => 'locky-mc-lock-face',
1361     *   'class' => 'MemcLockManager',
1362     *   'lockServers' => [
1363     *     '127.0.0.1:11211',
1364     *   ],
1365     * ];
1366     * ```
1367     */
1368    public const LockManagers = [
1369        'default' => [],
1370        'type' => 'list',
1371    ];
1372
1373    /**
1374     * Whether to show Exif data.
1375     * The effective default value is determined at runtime:
1376     * enabled if PHP's EXIF extension module is loaded.
1377     *
1378     * Requires PHP's Exif extension: https://www.php.net/manual/en/ref.exif.php
1379     *
1380     * @note FOR WINDOWS USERS:
1381     * To enable Exif functions, add the following line to the "Windows
1382     * extensions" section of php.ini:
1383     *
1384     * ```{.ini}
1385     * extension=extensions/php_exif.dll
1386     * ```
1387     */
1388    public const ShowEXIF = [
1389        'dynamicDefault' => [ 'callback' => [ self::class, 'getDefaultShowEXIF' ] ],
1390    ];
1391
1392    public static function getDefaultShowEXIF(): bool {
1393        return function_exists( 'exif_read_data' );
1394    }
1395
1396    /**
1397     * Shortcut for the 'updateCompatibleMetadata' setting of $wgLocalFileRepo.
1398     */
1399    public const UpdateCompatibleMetadata = [
1400        'default' => false,
1401    ];
1402
1403    /**
1404     * Allow for upload to be copied from an URL.
1405     *
1406     * The timeout for copy uploads is set by $wgCopyUploadTimeout.
1407     * You have to assign the user right 'upload_by_url' to a user group, to use this.
1408     */
1409    public const AllowCopyUploads = [
1410        'default' => false,
1411    ];
1412
1413    /**
1414     * A list of domains copy uploads can come from
1415     *
1416     * @since 1.20
1417     */
1418    public const CopyUploadsDomains = [
1419        'default' => [],
1420        'type' => 'list',
1421    ];
1422
1423    /**
1424     * Enable copy uploads from Special:Upload. $wgAllowCopyUploads must also be
1425     * true. If $wgAllowCopyUploads is true, but this is false, you will only be
1426     * able to perform copy uploads from the API or extensions (e.g. UploadWizard).
1427     */
1428    public const CopyUploadsFromSpecialUpload = [
1429        'default' => false,
1430    ];
1431
1432    /**
1433     * Proxy to use for copy upload requests.
1434     *
1435     * @since 1.20
1436     */
1437    public const CopyUploadProxy = [
1438        'default' => false,
1439    ];
1440
1441    /**
1442     * Different timeout for upload by url
1443     * This could be useful since when fetching large files, you may want a
1444     * timeout longer than the default $wgHTTPTimeout. False means fallback
1445     * to default.
1446     *
1447     * @since 1.22
1448     */
1449    public const CopyUploadTimeout = [
1450        'default' => false,
1451        'type' => 'false|integer',
1452    ];
1453
1454    /**
1455     * If true, the value of $wgCopyUploadsDomains will be merged with the
1456     * contents of MediaWiki:Copyupload-allowed-domains.
1457     *
1458     * @since 1.39
1459     */
1460    public const CopyUploadAllowOnWikiDomainConfig = [
1461        'default' => false,
1462    ];
1463
1464    /**
1465     * Max size for uploads, in bytes.
1466     *
1467     * If not set to an array, applies to all uploads. If set to an array, per upload
1468     * type maximums can be set, using the file and url keys. If the `*` key is set
1469     * this value will be used as maximum for non-specified types.
1470     *
1471     * The below example would set the maximum for all uploads to 250 KiB except,
1472     * for upload-by-url, which would have a maximum of 500 KiB.
1473     *
1474     * **Example:**
1475     *
1476     * ```
1477     * $wgMaxUploadSize = [
1478     *     '*' => 250 * 1024,
1479     *     'url' => 500 * 1024,
1480     * ];
1481     * ```
1482     * Default: 100 MiB.
1483     */
1484    public const MaxUploadSize = [
1485        'default' => 1024 * 1024 * 100,
1486    ];
1487
1488    /**
1489     * Minimum upload chunk size, in bytes.
1490     *
1491     * When using chunked upload, non-final chunks smaller than this will be rejected.
1492     *
1493     * Note that this may be further reduced by the `upload_max_filesize` and
1494     * `post_max_size` PHP settings. Use ApiUpload::getMinUploadChunkSize to
1495     * get the effective minimum chunk size used by MediaWiki.
1496     *
1497     * Default: 1 KiB.
1498     *
1499     * @since 1.26
1500     * @see \ApiUpload::getMinUploadChunkSize
1501     */
1502    public const MinUploadChunkSize = [
1503        'default' => 1024,
1504    ];
1505
1506    /**
1507     * Point the upload navigation link to an external URL
1508     * Useful if you want to use a shared repository by default
1509     * without disabling local uploads (use $wgEnableUploads = false for that).
1510     *
1511     * **Example:**
1512     *
1513     * ```
1514     * $wgUploadNavigationUrl = 'https://commons.wikimedia.org/wiki/Special:Upload';
1515     * ```
1516     */
1517    public const UploadNavigationUrl = [
1518        'default' => false,
1519    ];
1520
1521    /**
1522     * Point the upload link for missing files to an external URL, as with
1523     * $wgUploadNavigationUrl. The URL will get "(?|&)wpDestFile=<filename>"
1524     * appended to it as appropriate.
1525     */
1526    public const UploadMissingFileUrl = [
1527        'default' => false,
1528    ];
1529
1530    /**
1531     * Give a path here to use thumb.php for thumbnail generation on client
1532     * request, instead of generating them on render and outputting a static URL.
1533     *
1534     * This is necessary if some of your apache servers don't have read/write
1535     * access to the thumbnail path.
1536     *
1537     * **Example:**
1538     *
1539     * ```
1540     * $wgThumbnailScriptPath = "{$wgScriptPath}/thumb.php";
1541     * ```
1542     */
1543    public const ThumbnailScriptPath = [
1544        'default' => false,
1545    ];
1546
1547    /**
1548     * Shortcut for the 'thumbScriptUrl' setting of $wgForeignFileRepos.
1549     *
1550     * Only used if $wgUseSharedUploads is enabled.
1551     *
1552     * @since 1.3
1553     */
1554    public const SharedThumbnailScriptPath = [
1555        'default' => false,
1556        'type' => 'string|false',
1557    ];
1558
1559    /**
1560     * Shortcut for setting `hashLevels=2` and `deletedHashLevels=3` in $wgLocalFileRepo.
1561     *
1562     * @note Only used if $wgLocalFileRepo is not set.
1563     */
1564    public const HashedUploadDirectory = [
1565        'default' => true,
1566        'type' => 'boolean',
1567    ];
1568
1569    /**
1570     * Controls whether thumb.php and img_auth.php send CSP headers
1571     *
1572     * Note: This does not control general uploads. There is a .htaccess
1573     * in the images directory which will add a CSP header in some web server
1574     * configurations
1575     *
1576     * @since 1.45
1577     */
1578    public const CSPUploadEntryPoint = [
1579        'default' => true,
1580        'type' => 'boolean',
1581    ];
1582
1583    /**
1584     * This is the list of preferred extensions for uploading files. Uploading files
1585     * with extensions not in this list will trigger a warning.
1586     *
1587     * @warning If you add any OpenOffice or Microsoft Office file formats here,
1588     * such as odt or doc, and untrusted users are allowed to upload files, then
1589     * your wiki will be vulnerable to cross-site request forgery (CSRF).
1590     */
1591    public const FileExtensions = [
1592        'default' => [ 'png', 'gif', 'jpg', 'jpeg', 'webp', ],
1593        'type' => 'list',
1594    ];
1595
1596    /**
1597     * Files with these extensions will never be allowed as uploads.
1598     *
1599     * An array of file extensions to prevent being uploaded. You should
1600     * append to this array if you want to prevent additional file extensions.
1601     *
1602     * @since 1.37; previously $wgFileBlacklist
1603     */
1604    public const ProhibitedFileExtensions = [
1605        'default' => [
1606            # HTML may contain cookie-stealing JavaScript and web bugs
1607            'html', 'htm', 'js', 'jsb', 'mhtml', 'mht', 'xhtml', 'xht',
1608            # PHP scripts may execute arbitrary code on the server
1609            'php', 'phtml', 'php3', 'php4', 'php5', 'phps', 'phar',
1610            # Other types that may be interpreted by some servers
1611            'shtml', 'jhtml', 'pl', 'py', 'cgi',
1612            # May contain harmful executables for Windows victims
1613            'exe', 'scr', 'dll', 'msi', 'vbs', 'bat', 'com', 'pif', 'cmd', 'vxd', 'cpl',
1614            # T341565
1615            'xml',
1616        ],
1617        'type' => 'list',
1618    ];
1619
1620    /**
1621     * Files with these MIME types will never be allowed as uploads
1622     * if $wgVerifyMimeType is enabled.
1623     *
1624     * @since 1.37; previously $wgMimeTypeBlacklist
1625     */
1626    public const MimeTypeExclusions = [
1627        'default' => [
1628            # HTML may contain cookie-stealing JavaScript and web bugs
1629            'text/html',
1630            # Similarly with JavaScript itself
1631            'application/javascript', 'text/javascript', 'text/x-javascript', 'application/x-shellscript',
1632            # PHP scripts may execute arbitrary code on the server
1633            'application/x-php', 'text/x-php',
1634            # Other types that may be interpreted by some servers
1635            'text/x-python', 'text/x-perl', 'text/x-bash', 'text/x-sh', 'text/x-csh',
1636            # Client-side hazards on Internet Explorer
1637            'text/scriptlet', 'application/x-msdownload',
1638            # Windows metafile, client-side vulnerability on some systems
1639            'application/x-msmetafile',
1640            # Files that look like java files
1641            'application/java',
1642            # XML files generally - T341565
1643            'application/xml', 'text/xml',
1644        ],
1645        'type' => 'list',
1646    ];
1647
1648    /**
1649     * This is a flag to determine whether or not to check file extensions on upload.
1650     *
1651     * @warning Setting this to false is insecure for public wikis.
1652     */
1653    public const CheckFileExtensions = [
1654        'default' => true,
1655    ];
1656
1657    /**
1658     * If this is turned off, users may override the warning for files not covered
1659     * by $wgFileExtensions.
1660     *
1661     * @warning Setting this to false is insecure for public wikis.
1662     */
1663    public const StrictFileExtensions = [
1664        'default' => true,
1665    ];
1666
1667    /**
1668     * Setting this to true will disable the upload system's checks for HTML/JavaScript.
1669     *
1670     * @warning THIS IS VERY DANGEROUS on a publicly editable site, so USE
1671     * $wgGroupPermissions TO RESTRICT UPLOADING to only those that you trust
1672     */
1673    public const DisableUploadScriptChecks = [
1674        'default' => false,
1675    ];
1676
1677    /**
1678     * Warn if uploaded files are larger than this (in bytes), or false to disable
1679     */
1680    public const UploadSizeWarning = [
1681        'default' => false,
1682    ];
1683
1684    /**
1685     * list of trusted media-types and MIME types.
1686     *
1687     * Use the MEDIATYPE_xxx constants to represent media types.
1688     * This list is used by File::isSafeFile
1689     *
1690     * Types not listed here will have a warning about unsafe content
1691     * displayed on the images description page. It would also be possible
1692     * to use this for further restrictions, like disabling direct
1693     * [[media:...]] links for non-trusted formats.
1694     */
1695    public const TrustedMediaFormats = [
1696        'default' => [
1697            MEDIATYPE_BITMAP, // all bitmap formats
1698            MEDIATYPE_AUDIO, // all audio formats
1699            MEDIATYPE_VIDEO, // all plain video formats
1700            "image/svg+xml", // svg (only needed if inline rendering of svg is not supported)
1701            "application/pdf", // PDF files
1702            # "application/x-shockwave-flash", //flash/shockwave movie
1703        ],
1704        'type' => 'list',
1705    ];
1706
1707    /**
1708     * Plugins for media file type handling.
1709     *
1710     * Each entry in the array maps a MIME type to a class name
1711     *
1712     * Core media handlers are listed in MediaHandlerFactory,
1713     * and extensions should use extension.json.
1714     */
1715    public const MediaHandlers = [
1716        'default' => [],
1717        'type' => 'map',
1718    ];
1719
1720    /**
1721     * Toggles native image lazy loading, via the "loading" attribute.
1722     *
1723     * @unstable EXPERIMENTAL
1724     * @since 1.34
1725     */
1726    public const NativeImageLazyLoading = [
1727        'default' => false,
1728        'type' => 'boolean',
1729    ];
1730
1731    /**
1732     * Media handler overrides for parser tests (they don't need to generate actual
1733     * thumbnails, so a mock will do)
1734     */
1735    public const ParserTestMediaHandlers = [
1736        'default' => [
1737            'image/jpeg' => 'MockBitmapHandler',
1738            'image/png' => 'MockBitmapHandler',
1739            'image/gif' => 'MockBitmapHandler',
1740            'image/tiff' => 'MockBitmapHandler',
1741            'image/webp' => 'MockBitmapHandler',
1742            'image/x-ms-bmp' => 'MockBitmapHandler',
1743            'image/x-bmp' => 'MockBitmapHandler',
1744            'image/x-xcf' => 'MockBitmapHandler',
1745            'image/svg+xml' => 'MockSvgHandler',
1746            'image/vnd.djvu' => 'MockDjVuHandler',
1747        ],
1748        'type' => 'map',
1749    ];
1750
1751    /**
1752     * Whether to enable server-side image thumbnailing. If false, images will
1753     * always be sent to the client in full resolution, with appropriate width= and
1754     * height= attributes on the <img> tag for the client to do its own scaling.
1755     */
1756    public const UseImageResize = [
1757        'default' => true,
1758    ];
1759
1760    /**
1761     * Resizing can be done using PHP's internal image libraries or using
1762     * ImageMagick or another third-party converter, e.g. GraphicMagick.
1763     *
1764     * These support more file formats than PHP, which only supports PNG,
1765     * GIF, JPG, XBM and WBMP.
1766     *
1767     * Use Image Magick instead of PHP builtin functions.
1768     */
1769    public const UseImageMagick = [
1770        'default' => false,
1771    ];
1772
1773    /**
1774     * The convert command shipped with ImageMagick
1775     */
1776    public const ImageMagickConvertCommand = [
1777        'default' => '/usr/bin/convert',
1778    ];
1779
1780    /**
1781     * Array of max pixel areas for interlacing per MIME type
1782     *
1783     * @since 1.27
1784     */
1785    public const MaxInterlacingAreas = [
1786        'default' => [],
1787        'type' => 'map',
1788    ];
1789
1790    /**
1791     * Sharpening parameter to ImageMagick
1792     */
1793    public const SharpenParameter = [
1794        'default' => '0x0.4',
1795    ];
1796
1797    /**
1798     * Reduction in linear dimensions below which sharpening will be enabled
1799     */
1800    public const SharpenReductionThreshold = [
1801        'default' => 0.85,
1802    ];
1803
1804    /**
1805     * Temporary directory used for ImageMagick. The directory must exist. Leave
1806     * this set to false to let ImageMagick decide for itself.
1807     */
1808    public const ImageMagickTempDir = [
1809        'default' => false,
1810    ];
1811
1812    /**
1813     * Use another resizing converter, e.g. GraphicMagick
1814     * %s will be replaced with the source path, %d with the destination
1815     * %w and %h will be replaced with the width and height.
1816     *
1817     * **Example for GraphicMagick:**
1818     *
1819     * ```
1820     * $wgCustomConvertCommand = "gm convert %s -resize %wx%h %d"
1821     * ```
1822     * Leave as false to skip this.
1823     */
1824    public const CustomConvertCommand = [
1825        'default' => false,
1826    ];
1827
1828    /**
1829     * used for lossless jpeg rotation
1830     *
1831     * @since 1.21
1832     */
1833    public const JpegTran = [
1834        'default' => '/usr/bin/jpegtran',
1835    ];
1836
1837    /**
1838     * At default setting of 'yuv420', JPEG thumbnails will use 4:2:0 chroma
1839     * subsampling to reduce file size, at the cost of possible color fringing
1840     * at sharp edges.
1841     *
1842     * See https://en.wikipedia.org/wiki/Chroma_subsampling
1843     *
1844     * Supported values:
1845     *   false - use scaling system's default (same as pre-1.27 behavior)
1846     *   'yuv444' - luma and chroma at same resolution
1847     *   'yuv422' - chroma at 1/2 resolution horizontally, full vertically
1848     *   'yuv420' - chroma at 1/2 resolution in both dimensions
1849     *
1850     * This setting is currently supported only for the ImageMagick backend;
1851     * others may default to 4:2:0 or 4:4:4 or maintaining the source file's
1852     * sampling in the thumbnail.
1853     *
1854     * @since 1.27
1855     */
1856    public const JpegPixelFormat = [
1857        'default' => 'yuv420',
1858    ];
1859
1860    /**
1861     * When scaling a JPEG thumbnail, this is the quality we request
1862     * from the backend. It should be an integer between 1 and 100,
1863     * with 100 indicating 100% quality.
1864     *
1865     * @since 1.32
1866     */
1867    public const JpegQuality = [
1868        'default' => 80,
1869    ];
1870
1871    /**
1872     * Some tests and extensions use exiv2 to manipulate the Exif metadata in some
1873     * image formats.
1874     */
1875    public const Exiv2Command = [
1876        'default' => '/usr/bin/exiv2',
1877    ];
1878
1879    /**
1880     * Path to exiftool binary. Used for lossless ICC profile swapping.
1881     *
1882     * @since 1.26
1883     */
1884    public const Exiftool = [
1885        'default' => '/usr/bin/exiftool',
1886    ];
1887
1888    /**
1889     * Scalable Vector Graphics (SVG) may be uploaded as images.
1890     *
1891     * Since SVG support is not yet standard in browsers, it is
1892     * necessary to rasterize SVGs to PNG as a fallback format.
1893     *
1894     * An external program is required to perform this conversion.
1895     * If set to an array, the first item is a PHP callable and any further items
1896     * are passed as parameters after $srcPath, $dstPath, $width, $height
1897     */
1898    public const SVGConverters = [
1899        'default' => [
1900            'ImageMagick' => '$path/convert -background "#ffffff00" -thumbnail $widthx$height\\! $input PNG:$output',
1901            'inkscape' => '$path/inkscape -w $width -o $output $input',
1902            'batik' => 'java -Djava.awt.headless=true -jar $path/batik-rasterizer.jar -w $width -d $output $input',
1903            'rsvg' => '$path/rsvg-convert -w $width -h $height -o $output $input',
1904            'ImagickExt' => [ 'SvgHandler::rasterizeImagickExt', ],
1905        ],
1906        'type' => 'map',
1907    ];
1908
1909    /**
1910     * Pick a converter defined in $wgSVGConverters
1911     */
1912    public const SVGConverter = [
1913        'default' => 'ImageMagick',
1914    ];
1915
1916    /**
1917     * If not in the executable PATH, specify the SVG converter path.
1918     */
1919    public const SVGConverterPath = [
1920        'default' => '',
1921    ];
1922
1923    /**
1924     * Don't scale a SVG larger than this
1925     */
1926    public const SVGMaxSize = [
1927        'default' => 5120,
1928    ];
1929
1930    /**
1931     * Don't read SVG metadata beyond this point.
1932     *
1933     * Default is 5 MiB
1934     */
1935    public const SVGMetadataCutoff = [
1936        'default' => 1024 * 1024 * 5,
1937    ];
1938
1939    /**
1940     * Whether native rendering by the browser agent is allowed
1941     *
1942     * Default is true, which disables all SVG conversion.
1943     * Setting it to the string 'partial' will only allow native rendering
1944     * when the filesize is below SVGNativeRenderingSizeLimit and if the
1945     * file contains at most 1 language.
1946     *
1947     * @since 1.41
1948     */
1949    public const SVGNativeRendering = [
1950        'default' => true,
1951        'type' => 'string|boolean',
1952    ];
1953
1954    /**
1955     * Filesize limit for allowing SVGs to render natively by the browser agent
1956     *
1957     * Default is 50kB.
1958     *
1959     * @since 1.41
1960     */
1961    public const SVGNativeRenderingSizeLimit = [
1962        'default' => 50 * 1024,
1963    ];
1964
1965    /**
1966     * Whether thumbnails should be generated in target language (usually, same as
1967     * page language), if available.
1968     *
1969     * Currently, applies only to SVG images that use the systemLanguage attribute
1970     * to specify text language.
1971     *
1972     * @since 1.33
1973     */
1974    public const MediaInTargetLanguage = [
1975        'default' => true,
1976    ];
1977
1978    /**
1979     * The maximum number of pixels a source image can have if it is to be scaled
1980     * down by a scaler that requires the full source image to be decompressed
1981     * and stored in decompressed form, before the thumbnail is generated.
1982     *
1983     * This provides a limit on memory usage for the decompression side of the
1984     * image scaler. The limit is used when scaling PNGs with any of the
1985     * built-in image scalers, such as ImageMagick or GD. It is ignored for
1986     * JPEGs with ImageMagick, and when using the VipsScaler extension.
1987     *
1988     * If set to false, MediaWiki will not check the size of the image before
1989     * attempting to scale it. Extensions may still override this setting by
1990     * using the BitmapHandlerCheckImageArea hook.
1991     *
1992     * The default is 50 MB if decompressed to RGBA form, which corresponds to
1993     * 12.5 million pixels or 3500x3500.
1994     */
1995    public const MaxImageArea = [
1996        'default' => 12_500_000,
1997        'type' => 'string|integer|false',
1998    ];
1999
2000    /**
2001     * Force thumbnailing of animated GIFs above this size to a single
2002     * frame instead of an animated thumbnail.  As of MW 1.17 this limit
2003     * is checked against the total size of all frames in the animation.
2004     *
2005     *
2006     * It probably makes sense to keep this equal to $wgMaxImageArea.
2007     */
2008    public const MaxAnimatedGifArea = [
2009        'default' => 12_500_000,
2010    ];
2011
2012    /**
2013     * Browsers don't support TIFF inline generally...
2014     * For inline display, we need to convert to PNG or JPEG.
2015     *
2016     * Note scaling should work with ImageMagick, but may not with GD scaling.
2017     *
2018     * **Example:**
2019     *
2020     * ```
2021     * // PNG is lossless, but inefficient for photos
2022     * $wgTiffThumbnailType = [ 'png', 'image/png' ];
2023     * // JPEG is good for photos, but has no transparency support. Bad for diagrams.
2024     * $wgTiffThumbnailType = [ 'jpg', 'image/jpeg' ];
2025     * ```
2026     */
2027    public const TiffThumbnailType = [
2028        'default' => [],
2029        'type' => 'list',
2030        'mergeStrategy' => 'replace',
2031    ];
2032
2033    /**
2034     * If rendered thumbnail files are older than this timestamp, they
2035     * will be rerendered on demand as if the file didn't already exist.
2036     *
2037     * Update if there is some need to force thumbs and SVG rasterizations
2038     * to rerender, such as fixes to rendering bugs.
2039     */
2040    public const ThumbnailEpoch = [
2041        'default' => '20030516000000',
2042    ];
2043
2044    /**
2045     * Certain operations are avoided if there were too many recent failures,
2046     * for example, thumbnail generation. Bump this value to invalidate all
2047     * memory of failed operations and thus allow further attempts to resume.
2048     *
2049     * This is useful when a cause for the failures has been found and fixed.
2050     */
2051    public const AttemptFailureEpoch = [
2052        'default' => 1,
2053    ];
2054
2055    /**
2056     * If set, inline scaled images will still produce "<img>" tags ready for
2057     * output instead of showing an error message.
2058     *
2059     * This may be useful if errors are transitory, especially if the site
2060     * is configured to automatically render thumbnails on request.
2061     *
2062     * On the other hand, it may obscure error conditions from debugging.
2063     * Enable the debug log or the 'thumbnail' log group to make sure errors
2064     * are logged to a file for review.
2065     */
2066    public const IgnoreImageErrors = [
2067        'default' => false,
2068    ];
2069
2070    /**
2071     * Render thumbnails while parsing wikitext.
2072     *
2073     * If set to false, then the Parser will output valid thumbnail URLs without
2074     * generating or storing the thumbnail files. This can significantly speed up
2075     * processing on the web server. The site admin needs to configure a 404 handler
2076     * in order for the URLs in question to regenerate the thumbnails in question
2077     * on-demand. This can enable concurrency and also save computing resources
2078     * as not every resolution of every image on every page is accessed between
2079     * re-parses of the article. For example, re-parses triggered by bot edits,
2080     * or cascading updates from template edits.
2081     *
2082     * If you use $wgLocalFileRepo, then you will also need to set the following:
2083     *
2084     * ```
2085     * $wgLocalFileRepo['transformVia404'] = true;
2086     * ```
2087     *
2088     * @since 1.7.0
2089     */
2090    public const GenerateThumbnailOnParse = [
2091        'default' => true,
2092        'type' => 'boolean',
2093    ];
2094
2095    /**
2096     * Show thumbnails for old images on the image description page
2097     */
2098    public const ShowArchiveThumbnails = [
2099        'default' => true,
2100    ];
2101
2102    /**
2103     * If set to true, images that contain certain the exif orientation tag will
2104     * be rotated accordingly. If set to null, try to auto-detect whether a scaler
2105     * is available that can rotate.
2106     */
2107    public const EnableAutoRotation = [
2108        'default' => null,
2109        'type' => '?boolean',
2110    ];
2111
2112    /**
2113     * Internal name of virus scanner. This serves as a key to the
2114     * $wgAntivirusSetup array. Set this to NULL to disable virus scanning. If not
2115     * null, every file uploaded will be scanned for viruses.
2116     */
2117    public const Antivirus = [
2118        'default' => null,
2119        'type' => '?string',
2120    ];
2121
2122    /**
2123     * Configuration for different virus scanners. This an associative array of
2124     * associative arrays. It contains one setup array per known scanner type.
2125     *
2126     * The entry is selected by $wgAntivirus, i.e.
2127     * valid values for $wgAntivirus are the keys defined in this array.
2128     *
2129     * The configuration array for each scanner contains the following keys:
2130     * "command", "codemap", "messagepattern":
2131     *
2132     * "command" is the full command to call the virus scanner - %f will be
2133     * replaced with the name of the file to scan. If not present, the filename
2134     * will be appended to the command. Note that this must be overwritten if the
2135     * scanner is not in the system path; in that case, please set
2136     * $wgAntivirusSetup[$wgAntivirus]['command'] to the desired command with full
2137     * path.
2138     *
2139     * "codemap" is a mapping of exit code to return codes of the detectVirus
2140     * function in SpecialUpload.
2141     *   - An exit code mapped to AV_SCAN_FAILED causes the function to consider
2142     *     the scan to be failed. This will pass the file if $wgAntivirusRequired
2143     *     is not set.
2144     *   - An exit code mapped to AV_SCAN_ABORTED causes the function to consider
2145     *     the file to have an unsupported format, which is probably immune to
2146     *     viruses. This causes the file to pass.
2147     *   - An exit code mapped to AV_NO_VIRUS will cause the file to pass, meaning
2148     *     no virus was found.
2149     *   - All other codes (like AV_VIRUS_FOUND) will cause the function to report
2150     *     a virus.
2151     *   - You may use "*" as a key in the array to catch all exit codes not mapped otherwise.
2152     *
2153     * "messagepattern" is a perl regular expression to extract the meaningful part of the scanners
2154     * output. The relevant part should be matched as group one (\1).
2155     * If not defined or the pattern does not match, the full message is shown to the user.
2156     */
2157    public const AntivirusSetup = [
2158        'default' => [
2159            # setup for clamav
2160            'clamav' => [
2161                'command' => 'clamscan --no-summary ',
2162                'codemap' => [
2163                    "0" => AV_NO_VIRUS, # no virus
2164                    "1" => AV_VIRUS_FOUND, # virus found
2165                    "52" => AV_SCAN_ABORTED, # unsupported file format (probably immune)
2166                    "*" => AV_SCAN_FAILED, # else scan failed
2167                ],
2168                'messagepattern' => '/.*?:(.*)/sim',
2169            ],
2170        ],
2171        'type' => 'map',
2172    ];
2173
2174    /**
2175     * Determines if a failed virus scan (AV_SCAN_FAILED) will cause the file to be rejected.
2176     */
2177    public const AntivirusRequired = [
2178        'default' => true,
2179    ];
2180
2181    /**
2182     * Determines if the MIME type of uploaded files should be checked
2183     */
2184    public const VerifyMimeType = [
2185        'default' => true,
2186    ];
2187
2188    /**
2189     * Sets the MIME type definition file to use by includes/libs/mime/MimeAnalyzer.php.
2190     *
2191     * When this is set to the path of a mime.types file, MediaWiki will use this
2192     * file to map MIME types to file extensions and vice versa, in lieu of its
2193     * internal MIME map. Note that some MIME mappings are considered "baked in"
2194     * and cannot be overridden. See includes/libs/mime/MimeMapMinimal.php for a
2195     * full list.
2196     * example: $wgMimeTypeFile = '/etc/mime.types';
2197     */
2198    public const MimeTypeFile = [
2199        'default' => 'internal',
2200    ];
2201
2202    /**
2203     * Sets the MIME type info file to use by includes/libs/mime/MimeAnalyzer.php.
2204     *
2205     * Set to null to use the minimum set of built-in defaults only.
2206     */
2207    public const MimeInfoFile = [
2208        'default' => 'internal',
2209    ];
2210
2211    /**
2212     * Sets an external MIME detector program. The command must print only
2213     * the MIME type to standard output.
2214     *
2215     * The name of the file to process will be appended to the command given here.
2216     * If not set or NULL, PHP's mime_content_type function will be used.
2217     *
2218     * **Example:**
2219     *
2220     * ```
2221     * #$wgMimeDetectorCommand = "file -bi"; // use external MIME detector (Linux)
2222     * ```
2223     */
2224    public const MimeDetectorCommand = [
2225        'default' => null,
2226        'type' => '?string',
2227    ];
2228
2229    /**
2230     * Switch for trivial MIME detection. Used by thumb.php to disable all fancy
2231     * things, because only a few types of images are needed and file extensions
2232     * can be trusted.
2233     */
2234    public const TrivialMimeDetection = [
2235        'default' => false,
2236    ];
2237
2238    /**
2239     * Additional XML types we can allow via MIME-detection.
2240     *
2241     * array = [ 'rootElement' => 'associatedMimeType' ]
2242     */
2243    public const XMLMimeTypes = [
2244        'default' => [
2245            'http://www.w3.org/2000/svg:svg' => 'image/svg+xml',
2246            'svg' => 'image/svg+xml',
2247            'http://www.lysator.liu.se/~alla/dia/:diagram' => 'application/x-dia-diagram',
2248            'http://www.w3.org/1999/xhtml:html' => 'text/html',
2249            'html' => 'text/html',
2250        ],
2251        'type' => 'map',
2252    ];
2253
2254    /**
2255     * Limit images on image description pages to a user-selectable limit.
2256     *
2257     * In order to reduce disk usage, limits can only be selected from this list.
2258     * The user preference is saved as an array offset in the database, by default
2259     * the offset is set with $wgDefaultUserOptions['imagesize']. Make sure you
2260     * change it if you alter the array (see T10858).
2261     *
2262     * This list is also used by ImagePage for alternate size links.
2263     */
2264    public const ImageLimits = [
2265        'default' => [
2266            [ 320, 240 ],
2267            [ 640, 480 ],
2268            [ 800, 600 ],
2269            [ 1024, 768 ],
2270            [ 1280, 1024 ],
2271            [ 2560, 2048 ],
2272        ],
2273        'type' => 'list',
2274    ];
2275
2276    /**
2277     * Adjust thumbnails on image pages according to a user setting. In order to
2278     * reduce disk usage, the values can only be selected from a list. This is the
2279     * list of settings the user can choose from:
2280     */
2281    public const ThumbLimits = [
2282        'default' => [
2283            120,
2284            150,
2285            180,
2286            200,
2287            220,
2288            250,
2289            300,
2290            400,
2291        ],
2292        'type' => 'list',
2293    ];
2294
2295    /**
2296     * Defines what namespaces thumbnails will be displayed for in Special:Search.
2297     * This is the list of namespaces for which thumbnails (or a placeholder in
2298     * the absence of a thumbnail) will be shown:
2299     */
2300    public const ThumbnailNamespaces = [
2301        'default' => [ NS_FILE ],
2302        'type' => 'list',
2303        'items' => [ 'type' => 'integer', ],
2304    ];
2305
2306    /**
2307     * When defined, is an array of image widths used as steps for thumbnail sizes.
2308     *
2309     * The thumbnail with smallest step that has larger value than requested will be shown
2310     * but it will be downsized via HTML values.
2311     *
2312     * It increases the bandwidth to the users by serving slightly large thumbnail sizes they
2313     * have requested but it will save resources by de-duplicating thumbnail generation and storage.
2314     *
2315     * Note that these steps are "best effort" and MediaWiki might decide to use the requested size
2316     * for any reason.
2317     */
2318    public const ThumbnailSteps = [
2319        'default' => null,
2320        'type' => '?list',
2321    ];
2322
2323    /**
2324     * Ratio of images that will use the thumbnail steps
2325     *
2326     * This is to allow for gradual roll out of thumbnail steps. It should be a number between 0 and 1.
2327     *
2328     * The precision of this value is up to 0.001, anything below that will be ignored.
2329     */
2330    public const ThumbnailStepsRatio = [
2331        'default' => null,
2332        'type' => '?float',
2333    ];
2334
2335    /**
2336     * When defined, is an array of image widths used as buckets for thumbnail generation.
2337     *
2338     * The goal is to save resources by generating thumbnails based on reference buckets instead of
2339     * always using the original. This will incur a speed gain but cause a quality loss.
2340     *
2341     * The buckets generation is chained, with each bucket generated based on the above bucket
2342     * when possible. File handlers have to opt into using that feature. For now only BitmapHandler
2343     * supports it.
2344     */
2345    public const ThumbnailBuckets = [
2346        'default' => null,
2347        'type' => '?list',
2348    ];
2349
2350    /**
2351     * When using thumbnail buckets as defined above, this sets the minimum distance to the bucket
2352     * above the requested size. The distance represents how many extra pixels of width the bucket
2353     * needs in order to be used as the reference for a given thumbnail. For example, with the
2354     * following buckets:
2355     *
2356     * $wgThumbnailBuckets = [ 128, 256, 512 ];
2357     *
2358     * and a distance of 50:
2359     *
2360     * $wgThumbnailMinimumBucketDistance = 50;
2361     *
2362     * If we want to render a thumbnail of width 220px, the 512px bucket will be used,
2363     * because 220 + 50 = 270 and the closest bucket bigger than 270px is 512.
2364     */
2365    public const ThumbnailMinimumBucketDistance = [
2366        'default' => 50,
2367    ];
2368
2369    /**
2370     * When defined, is an array of thumbnail widths to be rendered at upload time. The idea is to
2371     * prerender common thumbnail sizes, in order to avoid the necessity to render them on demand,
2372     * which has a performance impact for the first client to view a certain size.
2373     *
2374     * This obviously means that more disk space is needed per upload upfront.
2375     *
2376     * @since 1.25
2377     */
2378    public const UploadThumbnailRenderMap = [
2379        'default' => [],
2380        'type' => 'map',
2381    ];
2382
2383    /**
2384     * The method through which the thumbnails will be prerendered for the entries in
2385     * $wgUploadThumbnailRenderMap
2386     *
2387     * The method can be either "http" or "jobqueue". The former uses an http request to hit the
2388     * thumbnail's URL.
2389     * This method only works if thumbnails are configured to be rendered by a 404 handler. The
2390     * latter option uses the job queue to render the thumbnail.
2391     *
2392     * @since 1.25
2393     */
2394    public const UploadThumbnailRenderMethod = [
2395        'default' => 'jobqueue',
2396    ];
2397
2398    /**
2399     * When using the "http" $wgUploadThumbnailRenderMethod, lets one specify a custom Host HTTP
2400     * header.
2401     *
2402     * @since 1.25
2403     */
2404    public const UploadThumbnailRenderHttpCustomHost = [
2405        'default' => false,
2406    ];
2407
2408    /**
2409     * When using the "http" $wgUploadThumbnailRenderMethod, lets one specify a custom domain to
2410     * send the HTTP request to.
2411     *
2412     * @since 1.25
2413     */
2414    public const UploadThumbnailRenderHttpCustomDomain = [
2415        'default' => false,
2416    ];
2417
2418    /**
2419     * When this variable is true and JPGs use the sRGB ICC profile, swaps it for the more
2420     * lightweight
2421     * (and free) TinyRGB profile when generating thumbnails.
2422     *
2423     * @since 1.26
2424     */
2425    public const UseTinyRGBForJPGThumbnails = [
2426        'default' => false,
2427    ];
2428
2429    /**
2430     * Parameters for the "<gallery>" tag.
2431     *
2432     * Fields are:
2433     * - imagesPerRow:   Default number of images per-row in the gallery. 0 -> Adapt to screensize
2434     * - imageWidth:     Width of the cells containing images in galleries (in "px")
2435     * - imageHeight:    Height of the cells containing images in galleries (in "px")
2436     * - captionLength:  Length to truncate filename to in caption when using "showfilename".
2437     *                   A value of 'true' will truncate the filename to one line using CSS
2438     *                   and will be the behaviour after deprecation.
2439     *                   @deprecated since 1.28
2440     * - showBytes:      Show the filesize in bytes in categories
2441     * - showDimensions: Show the dimensions (width x height) in categories
2442     * - mode:           Gallery mode
2443     */
2444    public const GalleryOptions = [
2445        'default' => [],
2446        'type' => 'map',
2447    ];
2448
2449    /**
2450     * Adjust width of upright images when parameter 'upright' is used
2451     * This allows a nicer look for upright images without the need to fix the width
2452     * by hardcoded px in wiki sourcecode.
2453     */
2454    public const ThumbUpright = [
2455        'default' => 0.75,
2456    ];
2457
2458    /**
2459     * Default value for chmod-ing of new directories.
2460     */
2461    public const DirectoryMode = [
2462        'default' => 0o777,
2463    ];
2464
2465    /**
2466     * Generate and use thumbnails suitable for screens with 1.5 and 2.0 pixel densities.
2467     *
2468     * This means a 320x240 use of an image on the wiki will also generate 480x360 and 640x480
2469     * thumbnails, output via the srcset attribute.
2470     */
2471    public const ResponsiveImages = [
2472        'default' => true,
2473    ];
2474
2475    /**
2476     * Add a preconnect link for browsers to a remote FileRepo host.
2477     *
2478     * This is an optional performance enhancement designed for wiki farm where
2479     * $wgForeignFileRepos or $wgLocalFileRepo is set to serve thumbnails from a
2480     * separate hostname (e.g. not local `/w/images`). The feature expects at most
2481     * a single remote hostname to be used.
2482     *
2483     * If multiple foreign repos are registered that serve images from different hostnames,
2484     * only the first will be preconnected.
2485     *
2486     * This may cause unneeded HTTP connections in browsers on wikis where a foreign repo is
2487     * enabled but where a local repo is more commonly used.
2488     *
2489     * @since 1.35
2490     */
2491    public const ImagePreconnect = [
2492        'default' => false,
2493    ];
2494
2495    /**
2496     * Add tracking query parameters to URLs for media thumbnails and originals.
2497     *
2498     * The values include the site requesting the image (e.g. 'www.mediawiki.org'),
2499     * the software component involved (e.g. 'parser' or 'imageinfo') and the
2500     * format of the requested image ('original', 'thumbnail' or 'thumbnail_unscaled').
2501     *
2502     * These values are not used by MediaWiki, but they may be used by the server
2503     * hosting the files. The intended use case is applying different rate limits
2504     * depending on how and where the file is used.
2505     *
2506     * @since 1.46
2507     */
2508    public const TrackMediaRequestProvenance = [
2509        'default' => false,
2510    ];
2511
2512    /***************************************************************************/
2513    // region   DJVU settings
2514    /** @name   DJVU settings */
2515
2516    /**
2517     * Whether to use BoxedCommand or not.
2518     *
2519     * @unstable Temporary feature flag for T352515
2520     * @since 1.42
2521     */
2522    public const DjvuUseBoxedCommand = [
2523        'default' => false,
2524    ];
2525
2526    /**
2527     * Path of the djvudump executable
2528     * Enable this and $wgDjvuRenderer to enable djvu rendering
2529     * example: $wgDjvuDump = 'djvudump';
2530     *
2531     * If this is set, {@link self::ShellboxShell} must be set to the correct
2532     * shell path.
2533     */
2534    public const DjvuDump = [
2535        'default' => null,
2536        'type' => '?string',
2537    ];
2538
2539    /**
2540     * Path of the ddjvu DJVU renderer
2541     * Enable this and $wgDjvuDump to enable djvu rendering
2542     * example: $wgDjvuRenderer = 'ddjvu';
2543     */
2544    public const DjvuRenderer = [
2545        'default' => null,
2546        'type' => '?string',
2547    ];
2548
2549    /**
2550     * Path of the djvutxt DJVU text extraction utility
2551     * Enable this and $wgDjvuDump to enable text layer extraction from djvu files
2552     * example: $wgDjvuTxt = 'djvutxt';
2553     *
2554     * If this is set, {@link self::ShellboxShell} must be set to the correct
2555     *  shell path.
2556     */
2557    public const DjvuTxt = [
2558        'default' => null,
2559        'type' => '?string',
2560    ];
2561
2562    /**
2563     * Shell command for the DJVU post processor
2564     * Default: pnmtojpeg, since ddjvu generates ppm output
2565     * Set this to false to output the ppm file directly.
2566     */
2567    public const DjvuPostProcessor = [
2568        'default' => 'pnmtojpeg',
2569        'type' => '?string',
2570    ];
2571
2572    /**
2573     * File extension for the DJVU post processor output
2574     */
2575    public const DjvuOutputExtension = [
2576        'default' => 'jpg',
2577    ];
2578
2579    // endregion -- end of DJvu
2580
2581    // endregion -- end of file uploads
2582
2583    /***************************************************************************/
2584    // region   Email settings
2585    /** @name   Email settings */
2586
2587    /**
2588     * Site admin email address.
2589     *
2590     * Defaults to "wikiadmin@$wgServerName" (in Setup.php).
2591     */
2592    public const EmergencyContact = [
2593        'default' => false,
2594    ];
2595
2596    /**
2597     * Sender email address for e-mail notifications.
2598     *
2599     * The address we use as sender when a user requests a password reminder,
2600     * as well as other e-mail notifications.
2601     *
2602     * Defaults to "apache@$wgServerName" (in Setup.php).
2603     */
2604    public const PasswordSender = [
2605        'default' => false,
2606    ];
2607
2608    /**
2609     * Reply-To address for e-mail notifications.
2610     *
2611     * Defaults to $wgPasswordSender (in Setup.php).
2612     */
2613    public const NoReplyAddress = [
2614        'default' => false,
2615    ];
2616
2617    /**
2618     * Set to true to enable the e-mail basic features:
2619     * Password reminders, etc. If sending e-mail on your
2620     * server doesn't work, you might want to disable this.
2621     */
2622    public const EnableEmail = [
2623        'default' => true,
2624    ];
2625
2626    /**
2627     * Set to true to enable user-to-user e-mail.
2628     *
2629     * This can potentially be abused, as it's hard to track.
2630     */
2631    public const EnableUserEmail = [
2632        'default' => true,
2633    ];
2634
2635    /**
2636     * If true put the sending user's email in a Reply-To header
2637     * instead of From (false). ($wgPasswordSender will be used as From.)
2638     *
2639     * Some mailers (eg SMTP) set the SMTP envelope sender to the From value,
2640     * which can cause problems with SPF validation and leak recipient addresses
2641     * when bounces are sent to the sender. In addition, DMARC restrictions
2642     * can cause emails to fail to be received when false.
2643     */
2644    public const UserEmailUseReplyTo = [
2645        'default' => true,
2646    ];
2647
2648    /**
2649     * Minimum time, in hours, which must elapse between password reminder
2650     * emails for a given account. This is to prevent abuse by mail flooding.
2651     */
2652    public const PasswordReminderResendTime = [
2653        'default' => 24,
2654    ];
2655
2656    /**
2657     * The time, in seconds, when an emailed temporary password expires.
2658     */
2659    public const NewPasswordExpiry = [
2660        'default' => 3600 * 24 * 7,
2661    ];
2662
2663    /**
2664     * The time, in seconds, when an email confirmation email expires
2665     */
2666    public const UserEmailConfirmationTokenExpiry = [
2667        'default' => 7 * 24 * 60 * 60,
2668    ];
2669
2670    /**
2671     * Whether the modern email confirmation message is used
2672     *
2673     * @since 1.46
2674     */
2675    public const UserEmailConfirmationUseHTML = [
2676        'default' => false,
2677        'type' => 'boolean',
2678    ];
2679
2680    /**
2681     * The number of days that a user's password is good for. After this number of days, the
2682     * user will be asked to reset their password. Set to false to disable password expiration.
2683     */
2684    public const PasswordExpirationDays = [
2685        'default' => false,
2686    ];
2687
2688    /**
2689     * If a user's password is expired, the number of seconds when they can still login,
2690     * and cancel their password change, but are sent to the password change form on each login.
2691     */
2692    public const PasswordExpireGrace = [
2693        'default' => 3600 * 24 * 7,
2694    ];
2695
2696    /**
2697     * SMTP Mode.
2698     *
2699     * For using a direct (authenticated) SMTP server connection.
2700     * Default to false or fill an array :
2701     *
2702     * ```
2703     * $wgSMTP = [
2704     *     'host'     => 'SMTP domain',
2705     *     'IDHost'   => 'domain for MessageID',
2706     *     'port'     => '25',
2707     *     'auth'     => [true|false],
2708     *     'username' => [SMTP username],
2709     *     'password' => [SMTP password],
2710     * ];
2711     * ```
2712     */
2713    public const SMTP = [
2714        'default' => false,
2715        'type' => 'false|map',
2716    ];
2717
2718    /**
2719     * Additional email parameters, will be passed as the last argument to mail() call.
2720     */
2721    public const AdditionalMailParams = [
2722        'default' => null,
2723    ];
2724
2725    /**
2726     * For parts of the system that have been updated to provide HTML email content, send
2727     * both text and HTML parts as the body of the email
2728     */
2729    public const AllowHTMLEmail = [
2730        'default' => false,
2731    ];
2732
2733    /**
2734     * Allow sending of e-mail notifications with the editor's address as sender.
2735     *
2736     * This setting depends on $wgEnotifRevealEditorAddress also being enabled.
2737     * If both are enabled, notifications for actions from users that have opted-in,
2738     * will be sent to other users with their address as "From" instead of "Reply-To".
2739     *
2740     * If disabled, or not opted-in, notifications come from $wgPasswordSender.
2741     */
2742    public const EnotifFromEditor = [
2743        'default' => false,
2744        'type' => 'boolean',
2745    ];
2746
2747    /**
2748     * Require email authentication before sending mail to an email address.
2749     *
2750     * This is highly recommended. It prevents MediaWiki from being used as an open
2751     * spam relay.
2752     */
2753    public const EmailAuthentication = [
2754        'default' => true,
2755    ];
2756
2757    /**
2758     * Allow users to enable email notification ("enotif") on watchlist changes.
2759     */
2760    public const EnotifWatchlist = [
2761        'default' => false,
2762    ];
2763
2764    /**
2765     * Allow users to enable email notification ("enotif") when someone edits their
2766     * user talk page.
2767     *
2768     * The owner of the user talk page must also have the 'enotifusertalkpages' user
2769     * preference set to true.
2770     */
2771    public const EnotifUserTalk = [
2772        'default' => false,
2773    ];
2774
2775    /**
2776     * Allow sending of e-mail notifications with the editor's address in "Reply-To".
2777     *
2778     * Note, enabling this only actually uses it in notification e-mails if the user
2779     * opted-in to this feature. This feature flag also controls visibility of the
2780     * 'enotifrevealaddr' preference, which, if users opt into, will make e-mail
2781     * notifications about their actions use their address as "Reply-To".
2782     *
2783     * To set the address as "From" instead of "Reply-To", also enable $wgEnotifFromEditor.
2784     *
2785     * If disabled, or not opted-in, notifications come from $wgPasswordSender.
2786     */
2787    public const EnotifRevealEditorAddress = [
2788        'default' => false,
2789        'type' => 'boolean',
2790    ];
2791
2792    /**
2793     * Potentially send notification mails on minor edits to pages. This is enabled
2794     * by default.  If this is false, users will never be notified on minor edits.
2795     *
2796     * If it is true, editors with the 'nominornewtalk' right (typically bots) will still not
2797     * trigger notifications for minor edits they make (to any page, not just user talk).
2798     *
2799     * Finally, if the watcher/recipient has the 'enotifminoredits' user preference set to
2800     * false, they will not receive notifications for minor edits.
2801     *
2802     * User talk notifications are also affected by $wgEnotifMinorEdits, the above settings,
2803     * $wgEnotifUserTalk, and the preference described there.
2804     */
2805    public const EnotifMinorEdits = [
2806        'default' => true,
2807    ];
2808
2809    /**
2810     * Use real name instead of username in e-mail "from" field.
2811     */
2812    public const EnotifUseRealName = [
2813        'default' => false,
2814    ];
2815
2816    /**
2817     * Array of usernames who will be sent a notification email for every change
2818     * which occurs on a wiki. Users will not be notified of their own changes.
2819     */
2820    public const UsersNotifiedOnAllChanges = [
2821        'default' => [],
2822        'type' => 'map',
2823    ];
2824
2825    // endregion -- end of email settings
2826
2827    /***************************************************************************/
2828    // region  Database settings
2829    /** @name   Database settings */
2830
2831    /**
2832     * Current wiki database name
2833     *
2834     * This should only contain alphanumeric and underscore characters ([A-Za-z0-9_]+).
2835     * Spaces, quotes, backticks, dots, and hyphens are likely to be problematic.
2836     *
2837     * This is used to determine the current/local wiki ID (WikiMap::getCurrentWikiDbDomain).
2838     *
2839     * This should still be set even if $wgLBFactoryConf is configured.
2840     */
2841    public const DBname = [
2842        'default' => 'my_wiki',
2843    ];
2844
2845    /**
2846     * Current wiki database schema name
2847     *
2848     * This should only contain alphanumeric and underscore characters ([A-Za-z0-9_]+).
2849     * Spaces, quotes, backticks, dots, and hyphens are likely to be problematic.
2850     *
2851     * This is used to determine the current/local wiki ID (WikiMap::getCurrentWikiDbDomain).
2852     *
2853     * This should still be set even if $wgLBFactoryConf is configured.
2854     */
2855    public const DBmwschema = [
2856        'default' => null,
2857        'type' => '?string',
2858    ];
2859
2860    /**
2861     * Current wiki database table name prefix
2862     *
2863     * This should only contain alphanumeric and underscore characters ([A-Za-z0-9_]+).
2864     * If it's a non-empty string, then it preferably should end with an underscore.
2865     * Spaces, quotes, backticks, dots, and hyphens are especially likely to be problematic.
2866     *
2867     * This is used to determine the current/local wiki ID (WikiMap::getCurrentWikiDbDomain).
2868     *
2869     * This should still be set even if $wgLBFactoryConf is configured.
2870     */
2871    public const DBprefix = [
2872        'default' => '',
2873    ];
2874
2875    /**
2876     * Database host name or IP address
2877     */
2878    public const DBserver = [
2879        'default' => 'localhost',
2880    ];
2881
2882    /**
2883     * Database port number
2884     */
2885    public const DBport = [
2886        'default' => 5432,
2887    ];
2888
2889    /**
2890     * Database username
2891     */
2892    public const DBuser = [
2893        'default' => 'wikiuser',
2894    ];
2895
2896    /**
2897     * Database user's password
2898     */
2899    public const DBpassword = [
2900        'default' => '',
2901    ];
2902
2903    /**
2904     * Database type
2905     */
2906    public const DBtype = [
2907        'default' => 'mysql',
2908    ];
2909
2910    /**
2911     * Whether to use SSL in DB connection.
2912     *
2913     * This setting is only used if $wgLBFactoryConf['class'] is set to
2914     * '\Wikimedia\Rdbms\LBFactorySimple' and $wgDBservers is an empty array; otherwise
2915     * the 'ssl' parameter of the server array must be set to achieve the same functionality.
2916     */
2917    public const DBssl = [
2918        'default' => false,
2919    ];
2920
2921    /**
2922     * Whether to use compression in DB connection.
2923     *
2924     * This setting is only used $wgLBFactoryConf['class'] is set to
2925     * '\Wikimedia\Rdbms\LBFactorySimple' and $wgDBservers is an empty array; otherwise
2926     * the DBO_COMPRESS flag must be set in the 'flags' option of the database
2927     * connection to achieve the same functionality.
2928     */
2929    public const DBcompress = [
2930        'default' => false,
2931    ];
2932
2933    /**
2934     * Check for warnings after DB queries and throw an exception if an
2935     * unacceptable warning is detected.
2936     *
2937     * This setting is only used if $wgLBFactoryConf['class'] is set to
2938     * '\Wikimedia\Rdbms\LBFactorySimple' and $wgDBservers is an empty array.
2939     * Otherwise, the 'strictWarnings' parameter of the server array must be set
2940     * to achieve the same functionality.
2941     *
2942     * @since 1.42
2943     */
2944    public const DBStrictWarnings = [
2945        'default' => false,
2946    ];
2947
2948    /**
2949     * Separate username for maintenance tasks. Leave as null to use the default.
2950     */
2951    public const DBadminuser = [
2952        'default' => null,
2953    ];
2954
2955    /**
2956     * Separate password for maintenance tasks. Leave as null to use the default.
2957     */
2958    public const DBadminpassword = [
2959        'default' => null,
2960    ];
2961
2962    /**
2963     * Search type.
2964     *
2965     * Leave as null to select the default search engine for the
2966     * selected database type (eg SearchMySQL), or set to a class
2967     * name to override to a custom search engine.
2968     *
2969     * If the canonical name for the search engine doesn't match the class name
2970     * (because it's namespaced for example), you can add a mapping for this in
2971     * SearchMappings in extension.json.
2972     */
2973    public const SearchType = [
2974        'default' => null,
2975    ];
2976
2977    /**
2978     * Alternative search types
2979     *
2980     * Sometimes you want to support multiple search engines for testing. This
2981     * allows users to select their search engine of choice via url parameters
2982     * to Special:Search and the action=search API. If using this, there's no
2983     * need to add $wgSearchType to it, that is handled automatically.
2984     *
2985     * If the canonical name for the search engine doesn't match the class name
2986     * (because it's namespaced for example), you can add a mapping for this in
2987     * SearchMappings in extension.json.
2988     */
2989    public const SearchTypeAlternatives = [
2990        'default' => null,
2991    ];
2992
2993    /**
2994     * MySQL table options to use during installation or update
2995     */
2996    public const DBTableOptions = [
2997        'default' => 'ENGINE=InnoDB, DEFAULT CHARSET=binary',
2998    ];
2999
3000    /**
3001     * SQL Mode - default is turning off all modes, including strict, if set.
3002     *
3003     * null can be used to skip the setting for performance reasons and assume
3004     * the DBA has done their best job.
3005     * String override can be used for some additional fun :-)
3006     */
3007    public const SQLMode = [
3008        'default' => '',
3009    ];
3010
3011    /**
3012     * To override default SQLite data directory ($docroot/../data)
3013     */
3014    public const SQLiteDataDir = [
3015        'default' => '',
3016    ];
3017
3018    /**
3019     * Shared database for multiple wikis. Commonly used for storing a user table
3020     * for single sign-on. The server for this database must be the same as for the
3021     * main database.
3022     *
3023     * For backwards compatibility the shared prefix is set to the same as the local
3024     * prefix, and the user table is listed in the default list of shared tables.
3025     * The user_properties table is also added so that users will continue to have their
3026     * preferences shared (preferences were stored in the user table prior to 1.16)
3027     *
3028     * $wgSharedTables may be customized with a list of tables to share in the shared
3029     * database. However it is advised to limit what tables you do share as many of
3030     * MediaWiki's tables may have side effects if you try to share them.
3031     *
3032     * $wgSharedPrefix is the table prefix for the shared database. It defaults to
3033     * $wgDBprefix.
3034     *
3035     * $wgSharedSchema is the table schema for the shared database. It defaults to
3036     * $wgDBmwschema.
3037     */
3038    public const SharedDB = [
3039        'default' => null,
3040    ];
3041
3042    /**
3043     * @see self::SharedDB
3044     */
3045    public const SharedPrefix = [
3046        'default' => false,
3047        'dynamicDefault' => [ 'use' => [ 'DBprefix' ] ]
3048    ];
3049
3050    /**
3051     * @param mixed $dbPrefix Value of DBprefix
3052     * @return mixed
3053     */
3054    public static function getDefaultSharedPrefix( $dbPrefix ) {
3055        return $dbPrefix;
3056    }
3057
3058    /**
3059     * @see self::SharedDB
3060     * The installer will add 'actor' to this list for all new wikis.
3061     */
3062    public const SharedTables = [
3063        'default' => [
3064            'user',
3065            'user_properties',
3066            'user_autocreate_serial',
3067        ],
3068        'type' => 'list',
3069    ];
3070
3071    /**
3072     * @see self::SharedDB
3073     * @since 1.23
3074     */
3075    public const SharedSchema = [
3076        'default' => false,
3077        'dynamicDefault' => [ 'use' => [ 'DBmwschema' ] ]
3078    ];
3079
3080    /**
3081     * @param mixed $dbMwschema Value of DBmwschema
3082     * @return mixed
3083     */
3084    public static function getDefaultSharedSchema( $dbMwschema ) {
3085        return $dbMwschema;
3086    }
3087
3088    /**
3089     * Database load balancer
3090     * This is a two-dimensional array, a list of server info structures
3091     * Fields are:
3092     *   - host:        Host name
3093     *   - dbname:      Default database name
3094     *   - user:        DB user
3095     *   - password:    DB password
3096     *   - type:        DB type
3097     *   - driver:      DB driver (when there are multiple drivers)
3098     *
3099     *   - load:        Ratio of DB_REPLICA load, must be >=0, the sum of all loads must be >0.
3100     *                  If this is zero for any given server, no normal query traffic will be
3101     *                  sent to it. It will be excluded from lag checks in maintenance scripts.
3102     *                  The only way it can receive traffic is if groupLoads is used.
3103     *
3104     *   - flags:       (optional) Bit field of properties:
3105     *                  - DBO_DEFAULT:    Transactional-ize web requests and use autocommit otherwise
3106     *                  - DBO_DEBUG:      Equivalent of $wgDebugDumpSql
3107     *                  - DBO_SSL:        Use TLS connection encryption if available (deprecated)
3108     *                  - DBO_COMPRESS:   Use protocol compression with database connections
3109     *                  - DBO_PERSISTENT: Enables persistent database connections
3110     *
3111     *   - ssl:         (optional) Boolean, whether to use TLS encryption. Overrides DBO_SSL.
3112     *   - max lag:     (optional) Maximum replication lag before a replica DB goes out of rotation
3113     *   - is static:   (optional) Set to true if the dataset is static and no replication is used.
3114     *   - cliMode:     (optional) Connection handles will not assume that requests are short-lived
3115     *                  nor that INSERT..SELECT can be rewritten into a buffered SELECT and INSERT.
3116     *                  This is what DBO_DEFAULT uses to determine when a web request is present.
3117     *                  [Default: true if MW_ENTRY_POINT is 'cli', otherwise false]
3118     *
3119     *   These and any other user-defined properties will be assigned to the mLBInfo member
3120     *   variable of the Database object.
3121     *
3122     * Leave at false to use the single-server variables above. If you set this
3123     * variable, the single-server variables will generally be ignored (except
3124     * perhaps in some command-line scripts).
3125     *
3126     * The first server listed in this array (with key 0) will be the primary. The
3127     * rest of the servers will be replica DBs. To prevent writes to your replica DBs due to
3128     * accidental misconfiguration or MediaWiki bugs, set read_only=1 on all your
3129     * replica DBs in my.cnf. You can set read_only mode at runtime using:
3130     *
3131     * ```
3132     *     SET @@read_only=1;
3133     * ```
3134     *
3135     * Since the effect of writing to a replica DB is so damaging and difficult to clean
3136     * up, we at Wikimedia set read_only=1 in my.cnf on all our DB servers, even
3137     * our primaries, and then set read_only=0 on primaries at runtime.
3138     */
3139    public const DBservers = [
3140        'default' => false,
3141        'type' => 'false|list',
3142    ];
3143
3144    /**
3145     * Configuration for the ILBFactory service
3146     *
3147     * The "class" setting must point to a LBFactory subclass, which is also responsible
3148     * for reading $wgDBservers, $wgDBserver, etc.
3149     *
3150     * To set up a wiki farm with multiple database clusters, set the "class" to
3151     * LBFactoryMulti. See {@link Wikimedia::Rdbms::LBFactoryMulti LBFactoryMulti} docs for
3152     * information on how to configure the rest of the $wgLBFactoryConf array.
3153     */
3154    public const LBFactoryConf = [
3155        'default' => [
3156            'class' => 'Wikimedia\\Rdbms\\LBFactorySimple',
3157        ],
3158        'type' => 'map',
3159        'mergeStrategy' => 'replace',
3160    ];
3161
3162    /**
3163     * After a state-changing request is done by a client, this determines
3164     * how many seconds that client should keep using the primary datacenter.
3165     *
3166     * This avoids unexpected stale or 404 responses due to replication lag.
3167     *
3168     * This must be greater than or equal to
3169     * Wikimedia\Rdbms\ChronologyProtector::POSITION_COOKIE_TTL.
3170     *
3171     * @since 1.27
3172     */
3173    public const DataCenterUpdateStickTTL = [
3174        'default' => 10,
3175    ];
3176
3177    /**
3178     * File to log database errors to
3179     */
3180    public const DBerrorLog = [
3181        'default' => false,
3182    ];
3183
3184    /**
3185     * Timezone to use in the error log.
3186     *
3187     * Defaults to the wiki timezone ($wgLocaltimezone).
3188     *
3189     * A list of usable timezones can found at:
3190     * https://www.php.net/manual/en/timezones.php
3191     *
3192     * **Examples:**
3193     *
3194     * ```
3195     * $wgDBerrorLogTZ = 'UTC';
3196     * $wgDBerrorLogTZ = 'GMT';
3197     * $wgDBerrorLogTZ = 'PST8PDT';
3198     * $wgDBerrorLogTZ = 'Europe/Sweden';
3199     * $wgDBerrorLogTZ = 'CET';
3200     * ```
3201     *
3202     * @since 1.20
3203     */
3204    public const DBerrorLogTZ = [
3205        'default' => false,
3206        'dynamicDefault' => [ 'use' => [ 'Localtimezone' ] ]
3207    ];
3208
3209    public static function getDefaultDBerrorLogTZ( ?string $localtimezone ): string {
3210        // NOTE: Extra fallback, in case $localtimezone is ''.
3211        //       Many extsing LocalSettings files have $wgLocaltimezone = ''
3212        //       in them, erroneously generated by the installer.
3213        return $localtimezone ?: self::getDefaultLocaltimezone();
3214    }
3215
3216    /**
3217     * List of all wiki IDs that reside on the current wiki farm.
3218     *
3219     * The wikis listed here must meet the following requirements in order to
3220     * be be considered part of the same wiki farm:
3221     *
3222     * - reachable for cross-wiki database queries, via \Wikimedia\Rdbms\IConnectionProvider,
3223     *   as configured by $wgLBFactoryConf
3224     * - share the same $wgMainCacheType backend (e.g. the same Memcached cluster),
3225     *   so that cache updates and purges via BagOStuff::makeGlobalKey and
3226     *   WANObjectCache work correctly.
3227     *
3228     * Examples of cross-wiki features enabled through this setting:
3229     *
3230     * - SpecialUserRights, to assign a local user group from a central wiki.
3231     * - JobQueueGroup::push, to queue a job for another wiki
3232     *   (e.g. GlobalUsage, MassMessage, and Wikibase extensions).
3233     * - RenameUser (when using $wgSharedDB), to globally apply the rename to revisions
3234     *   logging tables on all wikis.
3235     *
3236     * Each wiki ID must consist of 1-3 hyphen-delimited alphanumeric components (each with no
3237     * hyphens nor spaces) of any of the forms:
3238     *
3239     * - "<DB NAME>"
3240     * - "<DB NAME>-<TABLE PREFIX>"
3241     * - "<DB NAME>-<DB SCHEMA>-<TABLE PREFIX>"
3242     *
3243     * If hyphens appear in any of the components, then the domain ID parsing may not work
3244     * and site functionality might be affected. If the schema ($wgDBmwschema) is set to the
3245     * default of "mediawiki" on all wikis, then the schema should be omitted from wiki IDs.
3246     *
3247     * @see WikiMap::getWikiIdFromDbDomain
3248     * @see SiteConfiguration::getLocalDatabases
3249     * @see self::LocalVirtualHosts
3250     */
3251    public const LocalDatabases = [
3252        'default' => [],
3253        'type' => 'list',
3254        'items' => [ 'type' => 'string', ],
3255    ];
3256
3257    /**
3258     * If lag is higher than $wgDatabaseReplicaLagWarning, show a warning in some special
3259     * pages (like watchlist). If the lag is higher than $wgDatabaseReplicaLagCritical,
3260     * show a more obvious warning.
3261     *
3262     * @since 1.36
3263     */
3264    public const DatabaseReplicaLagWarning = [
3265        'default' => 10,
3266    ];
3267
3268    /**
3269     * @see self::DatabaseReplicaLagWarning
3270     * @since 1.36
3271     */
3272    public const DatabaseReplicaLagCritical = [
3273        'default' => 30,
3274    ];
3275
3276    /**
3277     * Max execution time for queries of several expensive special pages such as RecentChanges
3278     * in milliseconds.
3279     *
3280     * @since 1.38
3281     */
3282    public const MaxExecutionTimeForExpensiveQueries = [
3283        'default' => 0,
3284    ];
3285
3286    /**
3287     * Mapping of virtual domain to external cluster db.
3288     *
3289     * If no entry is set, the code assumes local database.
3290     * For example, for routing queries of virtual domain 'vdomain'
3291     * to 'wikishared' database in 'extension1' cluster. The config should be like this:
3292     *  [ 'vdomain' => [ 'cluster' => 'extension1', 'db' => 'wikishared' ] ]
3293     *
3294     * If the database needs to be the local domain, just set the 'db' to false.
3295     *
3296     * If you want to get another db in the main cluster, just omit 'cluster'. For example:
3297     *  [ 'centralauth' => [ 'db' => 'centralauth' ] ]
3298     *
3299     * @since 1.41
3300     */
3301    public const VirtualDomainsMapping = [
3302        'default' => [],
3303        'type' => 'map',
3304    ];
3305
3306    /**
3307     * Migration stage for file tables
3308     *
3309     * Use the SCHEMA_COMPAT_XXX flags. Supported values:
3310     *
3311     *   - SCHEMA_COMPAT_WRITE_OLD | SCHEMA_COMPAT_READ_OLD (SCHEMA_COMPAT_OLD)
3312     *   - SCHEMA_COMPAT_WRITE_BOTH | SCHEMA_COMPAT_READ_OLD
3313     *
3314     * History:
3315     *   - 1.44: Added
3316     */
3317    public const FileSchemaMigrationStage = [
3318        'default' => SCHEMA_COMPAT_OLD,
3319        'type' => 'integer',
3320    ];
3321
3322    /**
3323     * Gaps in the externallinks table for certain domains.
3324     *
3325     * If you have identified certain domains for which externallinks searches are slow,
3326     * you can use this setting to make MediaWiki skip large el_id ranges,
3327     * rather than having the database scan through them fruitlessly.
3328     *
3329     * Each key in the array is a domain name in el_to_domain_index form,
3330     * e.g. 'https://com.example.'.
3331     * The value is an array with integer keys and values,
3332     * where each entry is a range (from => to, both inclusive)
3333     * of el_id values where this domain is known to have no entries.
3334     * (Subdomains are included, i.e., configuring an entry here guarantees to MediaWiki
3335     * that there are no rows where the el_to_domain_index starts with this value.)
3336     *
3337     * History:
3338     *   - 1.41: Added
3339     */
3340    public const ExternalLinksDomainGaps = [
3341        'default' => [],
3342        'type' => 'map',
3343    ];
3344
3345    // endregion -- End of DB settings
3346
3347    /***************************************************************************/
3348    // region   Content handlers and storage
3349    /** @name   Content handlers and storage */
3350
3351    /**
3352     * Plugins for page content model handling.
3353     *
3354     * Each entry in the array maps a model id to an ObjectFactory specification
3355     * that creates an instance of the appropriate ContentHandler subclass.
3356     *
3357     * @since 1.21
3358     */
3359    public const ContentHandlers = [
3360        'default' =>
3361            [
3362                // the usual case
3363                CONTENT_MODEL_WIKITEXT => [
3364                    'class' => WikitextContentHandler::class,
3365                    'services' => [
3366                        'TitleFactory',
3367                        'ParserFactory',
3368                        'GlobalIdGenerator',
3369                        'LanguageNameUtils',
3370                        'LinkRenderer',
3371                        'MagicWordFactory',
3372                        'ParsoidParserFactory',
3373                    ],
3374                ],
3375                // dumb version, no syntax highlighting
3376                CONTENT_MODEL_JAVASCRIPT => [
3377                    'class' => JavaScriptContentHandler::class,
3378                    'services' => [
3379                        'MainConfig',
3380                        'ParserFactory',
3381                        'UserOptionsLookup',
3382                    ],
3383                ],
3384                // simple implementation, for use by extensions, etc.
3385                CONTENT_MODEL_JSON => [
3386                    'class' => JsonContentHandler::class,
3387                    'services' => [
3388                        'ParsoidParserFactory',
3389                        'TitleFactory',
3390                    ],
3391                ],
3392                // dumb version, no syntax highlighting
3393                CONTENT_MODEL_CSS => [
3394                    'class' => CssContentHandler::class,
3395                    'services' => [
3396                        'MainConfig',
3397                        'ParserFactory',
3398                        'UserOptionsLookup',
3399                    ],
3400                ],
3401                CONTENT_MODEL_VUE => [
3402                    'class' => VueContentHandler::class,
3403                    'services' => [
3404                        'MainConfig',
3405                        'ParserFactory',
3406                    ]
3407                ],
3408                // plain text, for use by extensions, etc.
3409                CONTENT_MODEL_TEXT => TextContentHandler::class,
3410                // fallback for unknown models, from imports or extensions that were removed
3411                CONTENT_MODEL_UNKNOWN => FallbackContentHandler::class,
3412            ],
3413        'type' => 'map',
3414    ];
3415
3416    /**
3417     * Associative array mapping namespace IDs to the name of the content model pages in that
3418     * namespace should have by default (use the CONTENT_MODEL_XXX constants). If no special
3419     * content type is defined for a given namespace, pages in that namespace will use the
3420     * CONTENT_MODEL_WIKITEXT
3421     * (except for the special case of JS and CS pages).
3422     *
3423     * @note To determine the default model for a new page's main slot, or any slot in general,
3424     * use SlotRoleHandler::getDefaultModel() together with SlotRoleRegistry::getRoleHandler().
3425     * @since 1.21
3426     */
3427    public const NamespaceContentModels = [
3428        'default' => [],
3429        'type' => 'map',
3430    ];
3431
3432    /**
3433     * Determines which types of text are parsed as wikitext. This does not imply that these kinds
3434     * of texts are also rendered as wikitext, it only means that links, magic words, etc will have
3435     * the effect on the database they would have on a wikitext page.
3436     *
3437     * Note that table of contents information will be *suppressed* for all
3438     * text models in this list other than wikitext.
3439     *
3440     * @todo Make the ToC suppression configurable by the content model
3441     * (T313455), not a side effect of inclusion here.
3442     *
3443     * @todo On the long run, it would be nice to put categories etc into a separate structure,
3444     * or at least parse only the contents of comments in the scripts.
3445     * @since 1.21
3446     */
3447    public const TextModelsToParse = [
3448        'default' => [
3449            CONTENT_MODEL_WIKITEXT, // Just for completeness, wikitext will always be parsed.
3450            CONTENT_MODEL_JAVASCRIPT, // Make categories etc work, people put them into comments.
3451            CONTENT_MODEL_CSS, // Make categories etc work, people put them into comments.
3452        ],
3453        'type' => 'list',
3454    ];
3455
3456    /**
3457     * We can also compress text stored in the 'text' table. If this is set on, new
3458     * revisions will be compressed on page save if zlib support is available. Any
3459     * compressed revisions will be decompressed on load regardless of this setting,
3460     * but will not be readable at all if zlib support is not available.
3461     */
3462    public const CompressRevisions = [
3463        'default' => false,
3464    ];
3465
3466    /**
3467     * List of enabled ExternalStore protocols.
3468     *
3469     * @see \ExternalStoreAccess
3470     *
3471     * ```
3472     * $wgExternalStores = [ "DB" ];
3473     * ```
3474     */
3475    public const ExternalStores = [
3476        'default' => [],
3477        'type' => 'list',
3478    ];
3479
3480    /**
3481     * Shortcut for setting `$wgLBFactoryConf["externalClusters"]`.
3482     *
3483     * This is only applicable when using the default LBFactory
3484     * of {@link Wikimedia::Rdbms::LBFactorySimple LBFactorySimple}.
3485     * It is ignored if a different LBFactory is set, or if `externalClusters`
3486     * is already set explicitly.
3487     *
3488     * @see \ExternalStoreAccess
3489     *
3490     * **Example:**
3491     * Create a cluster named 'blobs_cluster1':
3492     *
3493     * ```
3494     * $wgExternalServers = [
3495     *     'blobs_cluster1' => <array in the same format as $wgDBservers>
3496     * ];
3497     * ```
3498     */
3499    public const ExternalServers = [
3500        'default' => [],
3501        'type' => 'map',
3502    ];
3503
3504    /**
3505     * The place to put new text blobs or false to put them in the text table
3506     * of the local wiki database.
3507     *
3508     * @see \ExternalStoreAccess
3509     *
3510     * **Example:**
3511     *
3512     * ```
3513     * $wgDefaultExternalStore = [ 'DB://cluster1', 'DB://cluster2' ];
3514     * ```
3515     */
3516    public const DefaultExternalStore = [
3517        'default' => false,
3518        'type' => 'list|false',
3519    ];
3520
3521    /**
3522     * Revision text may be cached in the main WAN cache to reduce load on external
3523     * storage servers and object extraction overhead for frequently-loaded revisions.
3524     *
3525     * Set to 0 to disable, or number of seconds before cache expiry.
3526     */
3527    public const RevisionCacheExpiry = [
3528        'default' => SqlBlobStore::DEFAULT_TTL,
3529        'type' => 'integer',
3530    ];
3531
3532    /**
3533     * Enable page language feature
3534     * Allows setting page language in database
3535     *
3536     * @since 1.24
3537     */
3538    public const PageLanguageUseDB = [
3539        'default' => false,
3540        'type' => 'boolean',
3541    ];
3542
3543    /**
3544     * Specify the difference engine to use.
3545     *
3546     * Supported values:
3547     * - 'external': Use an external diff engine, which must be specified via $wgExternalDiffEngine
3548     * - 'wikidiff2': Use the wikidiff2 PHP extension
3549     * - 'php': PHP implementations included in MediaWiki
3550     *
3551     * The default (null) is to use the first engine that's available.
3552     *
3553     * @since 1.35
3554     */
3555    public const DiffEngine = [
3556        'default' => null,
3557        'type' => '?string',
3558    ];
3559
3560    /**
3561     * Name of the external diff engine to use.
3562     */
3563    public const ExternalDiffEngine = [
3564        'default' => false,
3565        'type' => 'string|false',
3566    ];
3567
3568    /**
3569     * Options for wikidiff2:
3570     *   - useMultiFormat: (bool) Whether to use wikidiff2_multi_format_diff()
3571     *     if it is available. This temporarily defaults to false, during
3572     *     migration to the new code. It is available in wikidiff2 1.14.0+.
3573     *
3574     * The following options are only effective if wikidiff2_multi_format_diff()
3575     * is enabled. See README.md in wikidiff2 for details:
3576     *
3577     *   - numContextLines
3578     *   - changeThreshold
3579     *   - movedLineThreshold
3580     *   - maxMovedLines
3581     *   - maxWordLevelDiffComplexity
3582     *   - maxSplitSize
3583     *   - initialSplitThreshold
3584     *   - finalSplitThreshold
3585     *
3586     * Also:
3587     *   - formatOptions: An array of format-specific overrides. The key may
3588     *     be "inline" or "table" and the value is an array with keys
3589     *     numContextLines, changeThreshold, etc.
3590     * @since 1.41
3591     */
3592    public const Wikidiff2Options = [
3593        'default' => [],
3594        'type' => 'map'
3595    ];
3596
3597    // endregion -- end of Content handlers and storage
3598
3599    /***************************************************************************/
3600    // region   Performance hacks and limits
3601    /** @name   Performance hacks and limits */
3602
3603    /**
3604     * Set a limit on server request wall clock time.
3605     *
3606     * If the Excimer extension is enabled, setting this will cause an exception
3607     * to be thrown after the specified number of seconds. If the extension is
3608     * not available, set_time_limit() will be called instead.
3609     *
3610     * @since 1.36
3611     */
3612    public const RequestTimeLimit = [
3613        'default' => null,
3614        'type' => '?integer',
3615    ];
3616
3617    /**
3618     * The request time limit for "slow" write requests that should not be
3619     * interrupted due to the risk of data corruption.
3620     *
3621     * The limit will only be raised. If the pre-existing time limit is larger,
3622     * then this will have no effect.
3623     *
3624     * @since 1.26
3625     */
3626    public const TransactionalTimeLimit = [
3627        'default' => 120,
3628    ];
3629
3630    /**
3631     * The maximum time critical sections are allowed to stay open. Critical
3632     * sections are used to defer Excimer request timeouts. If Excimer is available
3633     * and this time limit is exceeded, an exception will be thrown at the next
3634     * opportunity, typically after a long-running function like a DB query returns.
3635     *
3636     * Critical sections may wrap long-running queries, and it's generally better
3637     * for the timeout to be handled a few milliseconds later when the critical
3638     * section exits, so this should be a large number.
3639     *
3640     * This limit is ignored in command-line mode.
3641     *
3642     * @since 1.36
3643     */
3644    public const CriticalSectionTimeLimit = [
3645        'default' => 180.0,
3646        'type' => 'float',
3647    ];
3648
3649    /**
3650     * Disable database-intensive features
3651     */
3652    public const MiserMode = [
3653        'default' => false,
3654    ];
3655
3656    /**
3657     * Disable all query pages if miser mode is on, not just some
3658     */
3659    public const DisableQueryPages = [
3660        'default' => false,
3661    ];
3662
3663    /**
3664     * Number of rows to cache in 'querycache' table when miser mode is on
3665     */
3666    public const QueryCacheLimit = [
3667        'default' => 1000,
3668    ];
3669
3670    /**
3671     * Number of links to a page required before it is deemed "wanted"
3672     */
3673    public const WantedPagesThreshold = [
3674        'default' => 1,
3675    ];
3676
3677    /**
3678     * Enable slow parser functions
3679     */
3680    public const AllowSlowParserFunctions = [
3681        'default' => false,
3682    ];
3683
3684    /**
3685     * Allow schema updates
3686     */
3687    public const AllowSchemaUpdates = [
3688        'default' => true,
3689    ];
3690
3691    /**
3692     * Maximum article size in kibibytes
3693     */
3694    public const MaxArticleSize = [
3695        'default' => 2048,
3696    ];
3697
3698    /**
3699     * The minimum amount of memory that MediaWiki "needs"; MediaWiki will try to
3700     * raise PHP's memory limit if it's below this amount.
3701     */
3702    public const MemoryLimit = [
3703        'default' => '50M',
3704    ];
3705
3706    /**
3707     * Configuration for processing pool control, for use in high-traffic wikis.
3708     *
3709     * An implementation is provided in the PoolCounter extension.
3710     *
3711     * This configuration array maps pool types to an associative array. The only
3712     * defined key in the associative array is "class", which gives the class name.
3713     * The remaining elements are passed through to the class as constructor
3714     * parameters.
3715     *
3716     * **Processing pools used in MediaWiki core:**
3717     * - ArticleView: parsing caused by users viewing a wiki page (per page and revision)
3718     * - HtmlRestApi: parsing caused by requests to the REST API (per page and revision)
3719     * - ApiParser: parsing caused by action=parse (per requesting user)
3720     * - FileRender: thumbnail generation (per file name)
3721     * - FileRenderExpensive: expensive thumbnail generation (per file name)
3722     * - GetLocalFileCopy: expensive thumbnail generation (per file name)
3723     * - diff: revision diff (per content hash)
3724     * - SpecialContributions: list user contributions (per requesting user)
3725     *
3726     * **Example using local redis instance:**
3727     *
3728     * ```
3729     * $wgPoolCounterConf = [ 'ArticleView' => [
3730     *   'class' => PoolCounterRedis::class,
3731     *   'timeout' => 15, // wait timeout in seconds
3732     *   'workers' => 1, // maximum number of active threads in each pool
3733     *   'maxqueue' => 5, // maximum number of total threads in each pool
3734     *   'servers' => [ '127.0.0.1' ],
3735     *   'redisConfig' => []
3736     * ] ];
3737     * ```
3738     *
3739     * **Example using C daemon from <https://gerrit.wikimedia.org/g/mediawiki/services/poolcounter>**
3740     *
3741     * ```
3742     * $wgPoolCountClientConf = [
3743     *   'servers' => [ '127.0.0.1' ],
3744     *   'timeout' => 0.5,
3745     *   'connect_timeout' => 0.01,
3746     * ];
3747     *
3748     * $wgPoolCounterConf = [ 'ArticleView' => [
3749     *   'class' => 'PoolCounter_Client',
3750     *   'timeout' => 15, // wait timeout in seconds
3751     *   'workers' => 5, // maximum number of active threads in each pool
3752     *   'maxqueue' => 50, // maximum number of total threads in each pool
3753     *   ... any extension-specific options...
3754     * ] ];
3755     * ```
3756     *
3757     * @since 1.16
3758     */
3759    public const PoolCounterConf = [
3760        'default' => null,
3761        'type' => '?map',
3762    ];
3763
3764    /**
3765     * Configuration array for the PoolCounter client.
3766     *
3767     * - servers: Array of hostnames, or hostname:port. The default port is 7531.
3768     * - timeout: Connection timeout.
3769     * - connect_timeout: [Since 1.28] Alternative connection timeout. If set, it is used
3770     *   instead of `timeout` and will be retried once if a connection fails
3771     *   to be established. Background: https://phabricator.wikimedia.org/T105378.
3772     *
3773     * @see \MediaWiki\PoolCounter\PoolCounterClient
3774     * @since 1.16
3775     */
3776    public const PoolCountClientConf = [
3777        'default' => [
3778            'servers' => [
3779                '127.0.0.1'
3780            ],
3781            'timeout' => 0.1,
3782        ],
3783        'type' => 'map',
3784    ];
3785
3786    /**
3787     * Max time (in seconds) a user-generated transaction can spend in writes.
3788     *
3789     * If exceeded, the transaction is rolled back with an error instead of being committed.
3790     *
3791     * @since 1.27
3792     */
3793    public const MaxUserDBWriteDuration = [
3794        'default' => false,
3795        'type' => 'integer|false',
3796    ];
3797
3798    /**
3799     * Max time (in seconds) a job-generated transaction can spend in writes.
3800     *
3801     * If exceeded, the transaction is rolled back with an error instead of being committed.
3802     *
3803     * @since 1.30
3804     */
3805    public const MaxJobDBWriteDuration = [
3806        'default' => false,
3807        'type' => 'integer|false',
3808    ];
3809
3810    /**
3811     * LinkHolderArray batch size
3812     * For debugging
3813     */
3814    public const LinkHolderBatchSize = [
3815        'default' => 1000,
3816    ];
3817
3818    /**
3819     * Maximum number of pages to move at once when moving subpages with a page.
3820     */
3821    public const MaximumMovedPages = [
3822        'default' => 100,
3823    ];
3824
3825    /**
3826     * Force deferred updates to be run before sending a response to the client,
3827     * instead of attempting to run them after sending the response. Setting this
3828     * to true is useful for end-to-end testing, to ensure that the effects of a
3829     * request are visible to any subsequent requests, even if they are made
3830     * immediately after the first one. Note however that this does not ensure
3831     * that database replication is complete, nor does it execute any jobs
3832     * enqueued for later.
3833     * There should be no reason to set this in a normal production environment.
3834     *
3835     * @since 1.38
3836     */
3837    public const ForceDeferredUpdatesPreSend = [
3838        'default' => false,
3839    ];
3840
3841    /**
3842     * Whether site_stats table should have multiple rows. If set to true, in each update,
3843     * one of ten rows gets updated at random to reduce lock wait time in wikis
3844     * that have lots of concurrent edits.
3845     * It should be set to true in really large wikis with big flow of edits,
3846     * Otherwise it can cause inaccuracy in data.
3847     *
3848     * @since 1.39
3849     */
3850    public const MultiShardSiteStats = [
3851        'default' => false,
3852        'type' => 'boolean',
3853    ];
3854
3855    // endregion -- end performance hacks
3856
3857    /***************************************************************************/
3858    // region   Cache settings
3859    /** @name   Cache settings */
3860
3861    /**
3862     * Directory for caching data in the local filesystem. Should not be accessible
3863     * from the web.
3864     *
3865     * Note: if multiple wikis share the same localisation cache directory, they
3866     * must all have the same set of extensions. You can set a directory just for
3867     * the localisation cache using $wgLocalisationCacheConf['storeDirectory'].
3868     */
3869    public const CacheDirectory = [
3870        'default' => false,
3871    ];
3872
3873    /**
3874     * Main cache type. This should be a cache with fast access, but it may have
3875     * limited space. By default, it is disabled, since the stock database cache
3876     * is not fast enough to make it worthwhile.
3877     *
3878     * The options are:
3879     *
3880     * - CACHE_ANYTHING:   Use anything, as long as it works
3881     * - CACHE_NONE:       Do not cache
3882     * - CACHE_DB:         Store cache objects in the DB
3883     * - CACHE_MEMCACHED:  MemCached, must specify servers in $wgMemCachedServers
3884     * - CACHE_ACCEL:      APC or APCu
3885     * - (other):          A string may be used which identifies a cache
3886     *                     configuration in $wgObjectCaches.
3887     *
3888     * For a multi-datacenter setup, the underlying service should be configured
3889     * to broadcast operations by WANObjectCache using Mcrouter or Dynomite.
3890     * See @ref wanobjectcache-deployment "Deploying WANObjectCache".
3891     * To configure the `broadcastRoutingPrefix` WANObjectCache parameter,
3892     * use $wgWANObjectCache.
3893     *
3894     * @see self::MessageCacheType
3895     * @see self::ParserCacheType
3896     */
3897    public const MainCacheType = [
3898        'default' => CACHE_NONE,
3899    ];
3900
3901    /**
3902     * The cache type for storing the contents of the MediaWiki namespace. This
3903     * cache is used for a small amount of data which is expensive to regenerate.
3904     *
3905     * For available types see $wgMainCacheType.
3906     */
3907    public const MessageCacheType = [
3908        'default' => CACHE_ANYTHING,
3909    ];
3910
3911    /**
3912     * The cache type for storing page content HTML (e.g. parsed from wikitext).
3913     *
3914     * Parsing wikitext is considered an expensive operation. It is recommended
3915     * to give your parser cache plenty of storage space, such that long tail cache
3916     * hits are possible.
3917     *
3918     * The default parser cache backend (when MainCacheType is left to CACHE_NONE)
3919     * is effectively CACHE_DB (SqlBagOStuff). If you set up a main cache type
3920     * such as memcached, it is recommended to set this explicitly to CACHE_DB.
3921     *
3922     * Advice for large wiki farms:
3923     * - Consider allocating a dedicated database to ParserCache.
3924     *   Register it in $wgObjectCaches and point $wgParserCacheType to it.
3925     * - Consider using MultiWriteBagOStuff to add a higher tier with Memcached
3926     *   in front of the lower database tier.
3927     * - Consider setting `'purgePeriod' => 0` in the dedicated SqlBagOStuff
3928     *   entry in $wgObjectCaches. This disables the automatic purging of
3929     *   expired rows (which would normally happen in the background of
3930     *   write requests). You can then schedule the purgeParserCache.php script
3931     *   to e.g. once a day prune expired rows from the a dedicated maintenance
3932     *   server.
3933     *
3934     * For available types see $wgMainCacheType.
3935     */
3936    public const ParserCacheType = [
3937        'default' => CACHE_ANYTHING,
3938    ];
3939
3940    /**
3941     * The cache backend for storing authenticated session data when $wgAnonSessionCacheType
3942     * is set. Otherwise, when $wgAnonSessionCacheType is unset, this will be used for all types
3943     * of sessions.
3944     *
3945     * Used by MediaWiki\Session\SessionStore. See $wgMainCacheType for available types.
3946     *
3947     * See [SessionStore Storage expectations](@ref SessionStore-storage-expectations).
3948     */
3949    public const SessionCacheType = [
3950        'default' => CACHE_ANYTHING,
3951    ];
3952
3953    /**
3954     * The cache backend for storing anonymous session data. When false, $wgSessionCacheType
3955     * will be used.
3956     *
3957     * Used by MediaWiki\Session\SessionCache. See $wgSessionCacheType for available types.
3958     *
3959     * @since 1.45
3960     */
3961    public const AnonSessionCacheType = [
3962        'default' => false
3963    ];
3964
3965    /**
3966     * The cache type for storing language conversion tables,
3967     * which are used when parsing certain text and interface messages.
3968     *
3969     * For available types see $wgMainCacheType.
3970     *
3971     * @since 1.20
3972     */
3973    public const LanguageConverterCacheType = [
3974        'default' => CACHE_ANYTHING,
3975    ];
3976
3977    /**
3978     * Advanced object cache configuration.
3979     *
3980     * Use this to define the class names and constructor parameters which are used
3981     * for the various cache types. Custom cache types may be defined here and
3982     * referenced from $wgMainCacheType, $wgMessageCacheType, $wgParserCacheType,
3983     * or $wgLanguageConverterCacheType.
3984     *
3985     * The format is an associative array where the key is a cache identifier, and
3986     * the value is an associative array of parameters. One of the following
3987     * parameters specifying the class must be given:
3988     *
3989     *   - class: The class name which will be used.
3990     *   - factory: A callable function which will generate a suitable cache object.
3991     *
3992     * The following parameters are shared and understood by most classes:
3993     *
3994     *   - loggroup: The log channel to use.
3995     *
3996     * For SqlBagOStuff, the main configured database will be used, unless one of the following
3997     * three parameters is given:
3998     *
3999     *   - server: Server config map for Database::factory() that describes the database to
4000     *      use for all key operations in the current region. This is overridden by "servers".
4001     *   - servers: Map of tag strings to server config maps, each for Database::factory(),
4002     *      describing the set of database servers on which to distribute key operations in the
4003     *      current region. Data is distributed among the servers via key hashing based on the
4004     *      server tags. Therefore, each tag represents a shard of the dataset. Tags are useful
4005     *      for failover using cold-standby servers and for managing shards with replica servers
4006     *      in multiple regions (each having different hostnames).
4007     *   - cluster: The ExternalStore cluster name to use.
4008     *
4009     * SqlBagOStuff also accepts the following optional parameters:
4010     *
4011     *   - dbDomain: The database name to pass to the LoadBalancer.
4012     *   - purgePeriod: The average number of object cache writes in between garbage collection
4013     *      operations, where expired entries are removed from the database. Or in other words,
4014     *      the probability of performing a purge is one in every this number. If set to zero,
4015     *      purging will never be done at runtime (for use with PurgeParserCache).
4016     *   - purgeLimit: Maximum number of rows to purge at once.
4017     *   - tableName: The table name to use, default is "objectcache".
4018     *   - shards: The number of tables to use for data storage on each server. If greater than
4019     *      1, table names are formed in the style objectcacheNNN where NNN is the shard index,
4020     *      between 0 and shards-1. The number of digits used in the suffix is the minimum number
4021     *      required to hold the largest shard index. Data is distributed among the tables via
4022     *      key hashing. This helps mitigate MySQL bugs 61735 and 61736.
4023     *   - writeBatchSize: Default maximum number of rows to change in each query for write
4024     *      operations that can be chunked into a set of smaller writes.
4025     *   - dataRedundancy: When set to a number higher than one, instead of sharding values,
4026     *     it writes to that many servers (out of all servers) and reads from all of them too.
4027     *     In case of inconsistency between servers, it picks the value with the highest exptime.
4028     *     Mostly useful for stronger consistency such as mainstash.
4029     *     This option has many limitations (for example when TTL is set to indef or changes)
4030     *     and it shouldn't be used to handle race conditions nor canonical data.
4031     *     The main point of data redundancy is to allow depool of a cluster for maintenance
4032     *     without displacing too many keys.
4033     *
4034     * For MemcachedPhpBagOStuff parameters see {@link MemcachedPhpBagOStuff::__construct}
4035     *
4036     * For MemcachedPeclBagOStuff parameters see {@link MemcachedPeclBagOStuff::__construct}
4037     *
4038     * For RedisBagOStuff parameters see {@link Wikimedia\ObjectCache\RedisBagOStuff::__construct}
4039     */
4040    public const ObjectCaches = [
4041        'default' => [
4042            CACHE_NONE => [ 'class' => EmptyBagOStuff::class, 'reportDupes' => false ],
4043            CACHE_DB => [ 'class' => SqlBagOStuff::class, 'loggroup' => 'SQLBagOStuff' ],
4044
4045            'memcached-php' => [ 'class' => MemcachedPhpBagOStuff::class, 'loggroup' => 'memcached' ],
4046            'memcached-pecl' => [ 'class' => MemcachedPeclBagOStuff::class, 'loggroup' => 'memcached' ],
4047            'hash' => [ 'class' => HashBagOStuff::class, 'reportDupes' => false ],
4048
4049            // Deprecated since 1.35.
4050            // - To configure a wg*CacheType variable to use the local server cache,
4051            //   use CACHE_ACCEL instead, which will select these automatically.
4052            // - To access the object for the local server cache at run-time,
4053            //   use MediaWikiServices::getLocalServerObjectCache()
4054            //   instead of e.g. ObjectCache::getInstance( 'apcu' ).
4055            // - To instantiate a new one of these explicitly, do so directly
4056            //   by using `new APCUBagOStuff( [ … ] )`
4057            // - To instantiate a new one of these including auto-detection and fallback,
4058            //   use ObjectCache::makeLocalServerCache().
4059            'apc' => [ 'class' => APCUBagOStuff::class, 'reportDupes' => false ],
4060            'apcu' => [ 'class' => APCUBagOStuff::class, 'reportDupes' => false ],
4061        ],
4062        'type' => 'map',
4063    ];
4064
4065    /**
4066     * Extra parameters to the WANObjectCache constructor.
4067     *
4068     * See @ref wanobjectcache-deployment "Deploying WANObjectCache".
4069     *
4070     * @since 1.40
4071     */
4072    public const WANObjectCache = [
4073        'default' => [],
4074        'type' => 'map',
4075    ];
4076
4077    /**
4078     * The stash store backend for MicroStash.
4079     *
4080     * This store should be optimized for ephemeral data, and should be able to handle
4081     * a high volume of writes and reads. The dataset access scope should be across
4082     * all servers that serve the application.
4083     *
4084     * Note that the TTL of the data written to this store must be respected completely
4085     * before the data gets evicted from the store (whether the data is used or not).
4086     * The store must not evict data based on LRU or popularity before the TTL expires.
4087     *
4088     * Expectations for sysadmins:
4089     *
4090     * 1. The data written to this store is generally short-lived (seconds/minutes),
4091     * 2. This store must reliably persist and should not evict data until the TTL expires,
4092     * 3. The same store must be accessed by all application servers (i.e. no visible lag or
4093     *    split reality),
4094     * 4. This store should handle a high volume of both writes and reads,
4095     *    with reads completing with consistently low latencies.
4096     *
4097     * Examples users:
4098     *
4099     * - {@link MediaWiki::Permissions::RateLimiter RateLimiter} (via RStatsFactory)
4100     * - {@link Wikimedia::Rdbms::ChronologyProtector ChronologyProtector}
4101     *    See also [ChronologyProtector requirements](@ref ChronologyProtector-storage-requirements),
4102     *    for more detailed system administrator requirements for multi-DC operations.
4103     *
4104     * Valid options are the keys of {@link $wgObjectCaches}, e.g. CACHE_* constants.
4105     *
4106     * @see \Wikimedia\ObjectCache\BagOStuff
4107     * @since 1.42
4108     */
4109    public const MicroStashType = [
4110        'default' => CACHE_ANYTHING,
4111        'type' => 'string|int',
4112    ];
4113
4114    /**
4115     * The object store type of the main stash.
4116     *
4117     * This should be a fast storage system optimized for lightweight data, both ephemeral and
4118     * permanent, for things like counters, tokens, and blobs. The dataset access scope should
4119     * include all the application servers in all datacenters. Thus, the data must be replicated
4120     * among all datacenters. The store should have "Last Write Wins" eventual consistency. Per
4121     * https://en.wikipedia.org/wiki/PACELC_theorem, the store should act as a PA/EL distributed
4122     * system for these operations.
4123     *
4124     * The multi-datacenter strategy for MediaWiki is to have CDN route HTTP POST requests to the
4125     * primary datacenter and HTTP GET/HEAD/OPTIONS requests to the closest datacenter to the
4126     * client. The stash accepts write operations from any datacenter, but cross-datacenter
4127     * replication is asynchronous.
4128     *
4129     * Modules that use the main stash can expect race conditions to occur if a key can receive
4130     * write operations originating from multiple datacenters. To improve consistency, callers
4131     * should avoid main stash updates during non-POST requests. In any case, callers should
4132     * gracefully tolerate occasional key evictions, temporary inconsistencies among datacenters,
4133     * and violations of linearizability (e.g. during timeouts). Modules that can never handle
4134     * these kinds of anomalies should use other storage mediums.
4135     *
4136     * Valid options are the keys of {@link $wgObjectCaches}, e.g. CACHE_* constants.
4137     *
4138     * @see \Wikimedia\ObjectCache\BagOStuff
4139     * @since 1.26
4140     */
4141    public const MainStash = [
4142        'default' => CACHE_DB,
4143    ];
4144
4145    /**
4146     * Configuration for the caching related to parsoid output. The configuration contains the
4147     * following keys:
4148     *
4149     * - StashType: The type of object store to be used by the ParsoidOutputStash service,
4150     *       which stores the base state of HTML based edits.
4151     *       Valid options are the keys of {@link $wgObjectCaches}, e.g. CACHE_* constants.
4152     *       By default, the value of the MainStash setting will be used.
4153     *       This should be an object store that provides fairly solid persistence guarantees,
4154     *       since losing an entry from the stash may mean that the user can't save their edit.
4155     *       If null, the value of the MainStash configuration setting will be used.
4156     *
4157     * - StashDuration: The number of seconds for which an entry in the stash should be kept.
4158     *       Should be long enough for users to finish editing,
4159     *       since losing an entry from the stash may mean that the user can't save their edit.
4160     *       This is set to one day by default.
4161     *
4162     * - WarmParsoidParserCache: Setting this to true will pre-populate the parsoid parser cache
4163     *       with parsoid outputs on page edits. This speeds up loading HTML into Visual Editor.
4164     *
4165     * @since 1.39
4166     * @unstable Per MediaWiki 1.39, the structure of this configuration is still subject to
4167     *           change.
4168     */
4169    public const ParsoidCacheConfig = [
4170        'type' => 'object',
4171        'properties' => [
4172            'StashType' => [ 'type' => 'int|string|null', 'default' => null ],
4173            'StashDuration' => [ 'type' => 'int', 'default' => 24 * 60 * 60 ],
4174            'WarmParsoidParserCache' => [ 'type' => 'bool', 'default' => false ],
4175        ]
4176    ];
4177
4178    /**
4179     * Sample rate for collecting statistics on Parsoid selective update.
4180     *
4181     * Zero disables collection; 1000 means "1 in every 1000 parses will
4182     * be sampled".
4183     *
4184     * @warning This is EXPERIMENTAL and will disappear once analysis is
4185     * complete.
4186     */
4187    public const ParsoidSelectiveUpdateSampleRate = [
4188        'type' => 'integer',
4189        'default' => 0,
4190    ];
4191
4192    /**
4193     * Per-namespace configuration for the ParserCache filter.
4194     *
4195     * There is one top level key for each cache name supported in ParserCacheFactory.
4196     * The per-namespace configuration is given separately for each cache.
4197     *
4198     * For each namespace, this defines a set of filter options, which are represented
4199     * as an associative array. The following keys are supported in this array:
4200     *
4201     * - minCpuTime: causes the parser cache to not save any output that took fewer
4202     *   than the given number of seconds of CPU time to generate, according to
4203     *   ParserOutput::getTimeProfile(). Set to 0 to always cache, or to
4204     *   PHP_INT_MAX to disable caching for this namespace.
4205     *
4206     * If no filter options are defined for a given namespace, the filter options
4207     * under the "default" key will be used for pages in that namespace.
4208     *
4209     * @since 1.42
4210     */
4211    public const ParserCacheFilterConfig = [
4212        'type' => 'map',
4213        'default' => [ // default value
4214            'pcache' => [ // old parser cache
4215                'default' => [ // all namespaces
4216                    // 0 means no threshold.
4217                    // Use PHP_INT_MAX to disable cache.
4218                    'minCpuTime' => 0
4219                ],
4220            ],
4221            'parsoid-pcache' => [ // parsoid output cache
4222                'default' => [ // all namespaces
4223                    // 0 means no threshold.
4224                    // Use PHP_INT_MAX to disable cache.
4225                    'minCpuTime' => 0
4226                ],
4227            ],
4228            'postproc-pcache' => [ // postprocessing output cache
4229                'default' => [ // all namespaces
4230                    // 0 means no threshold.
4231                    // Use PHP_INT_MAX to disable cache.
4232                    'minCpuTime' => PHP_INT_MAX
4233                ],
4234            ],
4235            'postproc-parsoid-pcache' => [ // parsoid postprocessing output cache
4236                'default' => [ // all namespaces
4237                    // 0 means no threshold.
4238                    // Use PHP_INT_MAX to disable cache.
4239                    'minCpuTime' => PHP_INT_MAX
4240                ],
4241            ],
4242        ],
4243        'additionalProperties' => [ // caches
4244            'type' => 'map',
4245            'description' => 'A map of namespace IDs to filter definitions.',
4246            'additionalProperties' => [ // namespaces
4247                'type' => 'map',
4248                'description' => 'A map of filter names to values.',
4249                'properties' => [ // filters
4250                    'minCpuTime' => [ 'type' => 'float' ]
4251                ]
4252            ],
4253        ],
4254    ];
4255
4256    /**
4257     * Secret string for HMAC hashing in ChronologyProtector [optional]
4258     *
4259     * @since 1.41
4260     */
4261    public const ChronologyProtectorSecret = [
4262        'default' => '',
4263        'type' => 'string',
4264    ];
4265
4266    /**
4267     * The expiry time for the parser cache, in seconds.
4268     *
4269     * The default is 86400 (one day).
4270     */
4271    public const ParserCacheExpireTime = [
4272        'default' => 60 * 60 * 24,
4273    ];
4274
4275    /**
4276     * The expiry time for "not ready" asynchronous content in the parser
4277     * cache, in seconds.  This should be rather short, to allow the
4278     * "not ready" content to be replaced by "ready" content.
4279     *
4280     * The default is 60 (one minute).
4281     *
4282     * @since 1.44
4283     */
4284    public const ParserCacheAsyncExpireTime = [
4285        'default' => 60,
4286    ];
4287
4288    /**
4289     * Whether to re-run the refresh links jobs when asynchronous content
4290     * becomes ready.  This is needed if the asynchronous content can affect
4291     * categories or other page metadata.
4292     *
4293     * @since 1.44
4294     */
4295    public const ParserCacheAsyncRefreshJobs = [
4296        'default' => true,
4297    ];
4298
4299    /**
4300     * The expiry time for the parser cache for old revisions, in seconds.
4301     *
4302     * The default is 3600 (cache disabled).
4303     */
4304    public const OldRevisionParserCacheExpireTime = [
4305        'default' => 60 * 60,
4306    ];
4307
4308    /**
4309     * The expiry time to use for session storage, in seconds.
4310     */
4311    public const ObjectCacheSessionExpiry = [
4312        'default' => 60 * 60,
4313    ];
4314
4315    /**
4316     * Whether to use PHP session handling ($_SESSION and session_*() functions)
4317     *
4318     * If the constant MW_NO_SESSION is defined, this is forced to 'disable'.
4319     *
4320     * If the constant MW_NO_SESSION_HANDLER is defined, this is ignored and PHP
4321     * session handling will function independently of SessionHandler.
4322     * SessionHandler and PHP's session handling may attempt to override each
4323     * others' cookies.
4324     *
4325     * @since 1.27
4326     * @deprecated since 1.45 Integration with PHP session handling will be removed in the future
4327     */
4328    public const PHPSessionHandling = [
4329        'default' => 'warn',
4330        'type' => 'string',
4331        'deprecated' => 'since 1.45 Integration with PHP session handling will be removed in the future',
4332    ];
4333
4334    /**
4335     * Time in seconds to remember IPs for, for the purposes of logging IP changes within the
4336     * same session. This is meant more for debugging errors in the authentication system than
4337     * for detecting abuse.
4338     *
4339     * @since 1.36
4340     */
4341    public const SuspiciousIpExpiry = [
4342        'default' => false,
4343        'type' => 'integer|false',
4344    ];
4345
4346    /**
4347     * Number of internal PBKDF2 iterations to use when deriving session secrets.
4348     *
4349     * @since 1.28
4350     */
4351    public const SessionPbkdf2Iterations = [
4352        'default' => 10001,
4353    ];
4354
4355    /**
4356     * Include a JWT alongside the session cookie when using cookie-based sessions.
4357     *
4358     * @note The JWT cookie intentionally has the same name on all wikis, to make it easier for
4359     *   edge infrastructure to handle it. If multiple wikis use the same domain, without
4360     *   appropriate $wgCookieDomain settings, enabling this will break session handling.
4361     *
4362     * @since 1.45
4363     * @see SessionManager::getJwtData()
4364     */
4365    public const UseSessionCookieJwt = [
4366        'default' => false,
4367    ];
4368
4369    /**
4370     * TEMPORARY feature flag.
4371     *
4372     * Used in conjunction with `UseSessionCookieJwt` above to enable JWT session
4373     * cookie for bot passwords. Will be removed once it's enabled everywhere in
4374     * production.
4375     *
4376     * @since 1.46
4377     * @see BotPasswordSessionProvider::provideSessionInfo()
4378     */
4379    public const UseSessionCookieForBotPasswords = [
4380        'default' => false,
4381    ];
4382
4383    /**
4384     * The wiki's URL that would create, sign and issue JWTs using the configured
4385     * private key. The entity is identified by the `iss` claim in the JWT payload.
4386     *
4387     * @since 1.46
4388     */
4389    public const JwtSessionCookieIssuer = [
4390        'default' => null,
4391    ];
4392
4393    /**
4394     * The list of MemCached servers and port numbers
4395     */
4396    public const MemCachedServers = [
4397        'default' => [ '127.0.0.1:11211', ],
4398        'type' => 'list',
4399    ];
4400
4401    /**
4402     * Use persistent connections to MemCached, which are shared across multiple
4403     * requests.
4404     */
4405    public const MemCachedPersistent = [
4406        'default' => false,
4407    ];
4408
4409    /**
4410     * Read/write timeout for MemCached server communication, in microseconds.
4411     */
4412    public const MemCachedTimeout = [
4413        'default' => 500_000,
4414    ];
4415
4416    /**
4417     * Set this to true to maintain a copy of the message cache on the local server.
4418     *
4419     * This layer of message cache is in addition to the one configured by $wgMessageCacheType.
4420     *
4421     * The local copy is put in APC. If APC is not installed, this setting does nothing.
4422     *
4423     * Note that this is about the message cache, which stores interface messages
4424     * maintained as wiki pages. This is separate from the localisation cache for interface
4425     * messages provided by the software, which is configured by $wgLocalisationCacheConf.
4426     */
4427    public const UseLocalMessageCache = [
4428        'default' => false,
4429    ];
4430
4431    /**
4432     * Instead of caching everything, only cache those messages which have
4433     * been customised in the site content language. This means that
4434     * MediaWiki:Foo/ja is ignored if MediaWiki:Foo doesn't exist.
4435     *
4436     * This option is probably only useful for translatewiki.net.
4437     */
4438    public const AdaptiveMessageCache = [
4439        'default' => false,
4440    ];
4441
4442    /**
4443     * Localisation cache configuration.
4444     *
4445     * Used by service wiring to decide how to construct the
4446     * LocalisationCache instance. Associative array with keys:
4447     *
4448     * class:       The class to use for constructing the LocalisationCache object.
4449     *              This may be overridden by extensions to a subclass of LocalisationCache.
4450     *              Sub classes are expected to still honor the 'storeClass', 'storeDirectory'
4451     *              and 'manualRecache' options where applicable.
4452     *
4453     * storeClass:  Which LCStore class implementation to use. This is optional.
4454     *              The default LocalisationCache class offers the 'store' option
4455     *              as abstraction for this.
4456     *
4457     * store:       How and where to store localisation cache data.
4458     *              This option is ignored if 'storeClass' is explicitly set to a class name.
4459     *              Must be one of:
4460     *              - 'detect' (default): Automatically select 'files' if 'storeDirectory'
4461     *                 or $wgCacheDirectory is set, and fall back to 'db' otherwise.
4462     *              - 'files': Store in $wgCacheDirectory as CDB files.
4463     *              - 'array': Store in $wgCacheDirectory as PHP static array files.
4464     *              - 'db': Store in the l10n_cache database table.
4465     *
4466     * storeDirectory: If the selected LCStore class puts its data in files, then it
4467     *                 will use this directory. If set to false (default), then
4468     *                 $wgCacheDirectory is used instead.
4469     *
4470     * manualRecache: Set this to true to disable cache updates on web requests.
4471     *                Use maintenance/rebuildLocalisationCache.php instead.
4472     */
4473    public const LocalisationCacheConf = [
4474        'properties' => [
4475            'class' => [ 'type' => 'string', 'default' => LocalisationCache::class ],
4476            'store' => [ 'type' => 'string', 'default' => 'detect' ],
4477            'storeClass' => [ 'type' => 'false|string', 'default' => false ],
4478            'storeDirectory' => [ 'type' => 'false|string', 'default' => false ],
4479            'storeServer' => [ 'type' => 'object', 'default' => [] ],
4480            'forceRecache' => [ 'type' => 'bool', 'default' => false ],
4481            'manualRecache' => [ 'type' => 'bool', 'default' => false ],
4482        ],
4483        'type' => 'object',
4484    ];
4485
4486    /**
4487     * Allow client-side caching of pages
4488     */
4489    public const CachePages = [
4490        'default' => true,
4491    ];
4492
4493    /**
4494     * Set this to current time to invalidate all prior cached pages. Affects both
4495     * client-side and server-side caching.
4496     *
4497     * You can get the current date on your server by using the command:
4498     *
4499     * @verbatim date +%Y%m%d%H%M%S
4500     * @endverbatim
4501     */
4502    public const CacheEpoch = [
4503        'default' => '20030516000000',
4504    ];
4505
4506    /**
4507     * Directory where GitInfo will look for pre-computed cache files. If false,
4508     * $wgCacheDirectory/gitinfo will be used.
4509     */
4510    public const GitInfoCacheDirectory = [
4511        'default' => false,
4512    ];
4513
4514    /**
4515     * This will cache static pages for non-logged-in users to reduce
4516     * database traffic on public sites. ResourceLoader requests to default
4517     * language and skins are cached as well as single module requests.
4518     */
4519    public const UseFileCache = [
4520        'default' => false,
4521    ];
4522
4523    /**
4524     * Depth of the subdirectory hierarchy to be created under
4525     * $wgFileCacheDirectory.  The subdirectories will be named based on
4526     * the MD5 hash of the title.  A value of 0 means all cache files will
4527     * be put directly into the main file cache directory.
4528     */
4529    public const FileCacheDepth = [
4530        'default' => 2,
4531    ];
4532
4533    /**
4534     * Append a configured value to the parser cache and the sitenotice key so
4535     * that they can be kept separate for some class of activity.
4536     */
4537    public const RenderHashAppend = [
4538        'default' => '',
4539    ];
4540
4541    /**
4542     * If on, the sidebar navigation links are cached for users with the
4543     * current language set. This can save a touch of load on a busy site
4544     * by shaving off extra message lookups.
4545     *
4546     * However it is also fragile: changing the site configuration, or
4547     * having a variable $wgArticlePath, can produce broken links that
4548     * don't update as expected.
4549     */
4550    public const EnableSidebarCache = [
4551        'default' => false,
4552    ];
4553
4554    /**
4555     * Expiry time for the sidebar cache, in seconds
4556     */
4557    public const SidebarCacheExpiry = [
4558        'default' => 86400,
4559    ];
4560
4561    /**
4562     * When using the file cache, we can store the cached HTML gzipped to save disk
4563     * space. Pages will then also be served compressed to clients that support it.
4564     *
4565     * Requires zlib support enabled in PHP.
4566     */
4567    public const UseGzip = [
4568        'default' => false,
4569    ];
4570
4571    /**
4572     * Invalidate various caches when LocalSettings.php changes. This is equivalent
4573     * to setting $wgCacheEpoch to the modification time of LocalSettings.php, as
4574     * was previously done in the default LocalSettings.php file.
4575     *
4576     * On high-traffic wikis, this should be set to false, to avoid the need to
4577     * check the file modification time, and to avoid the performance impact of
4578     * unnecessary cache invalidations.
4579     */
4580    public const InvalidateCacheOnLocalSettingsChange = [
4581        'default' => true,
4582    ];
4583
4584    /**
4585     * When loading extensions through the extension registration system, this
4586     * can be used to invalidate the cache. A good idea would be to set this to
4587     * one file, you can just `touch` that one to invalidate the cache
4588     *
4589     * **Example:**
4590     *
4591     * ```
4592     * $wgExtensionInfoMTime = filemtime( "$IP/LocalSettings.php" );
4593     * ```
4594     *
4595     * If set to false, the mtime for each individual JSON file will be checked,
4596     * which can be slow if a large number of extensions are being loaded.
4597     */
4598    public const ExtensionInfoMTime = [
4599        'default' => false,
4600        'type' => 'integer|false',
4601    ];
4602
4603    /**
4604     * If this is set to true, phpunit will run integration tests against remote
4605     * caches defined in $wgObjectCaches.
4606     *
4607     * @since 1.38
4608     */
4609    public const EnableRemoteBagOStuffTests = [
4610        'default' => false,
4611    ];
4612
4613    // endregion -- end of cache settings
4614
4615    /***************************************************************************/
4616    // region   HTTP proxy (CDN) settings
4617    /** @name   HTTP proxy (CDN) settings
4618     *
4619     * Many of these settings apply to any HTTP proxy used in front of MediaWiki,
4620     * although they are sometimes still referred to as Squid settings for
4621     * historical reasons.
4622     *
4623     * Achieving a high hit ratio with an HTTP proxy requires special configuration.
4624     * See https://www.mediawiki.org/wiki/Manual:Performance_tuning#Page_view_caching
4625     * for more details.
4626     */
4627
4628    /**
4629     * Enable/disable CDN.
4630     *
4631     * See https://www.mediawiki.org/wiki/Manual:Performance_tuning#Page_view_caching
4632     *
4633     * @since 1.34 Renamed from $wgUseSquid.
4634     */
4635    public const UseCdn = [
4636        'default' => false,
4637    ];
4638
4639    /**
4640     * Add X-Forwarded-Proto to the Vary and Key headers for API requests and
4641     * RSS/Atom feeds. Use this if you have an SSL termination setup
4642     * and need to split the cache between HTTP and HTTPS for API requests,
4643     * feed requests and HTTP redirect responses in order to prevent cache
4644     * pollution. This does not affect 'normal' requests to index.php other than
4645     * HTTP redirects.
4646     */
4647    public const VaryOnXFP = [
4648        'default' => false,
4649    ];
4650
4651    /**
4652     * Internal server name as known to CDN, if different.
4653     *
4654     * **Example:**
4655     *
4656     * ```
4657     * $wgInternalServer = 'http://yourinternal.tld:8000';
4658     * ```
4659     */
4660    public const InternalServer = [
4661        'default' => false,
4662    ];
4663
4664    /**
4665     * Cache TTL for the CDN sent as s-maxage (without ESI) or
4666     * Surrogate-Control (with ESI). Without ESI, you should strip
4667     * out s-maxage in the CDN config.
4668     *
4669     * 18000 seconds = 5 hours, more cache hits with 2678400 = 31 days.
4670     *
4671     * @since 1.34 Renamed from $wgSquidMaxage
4672     */
4673    public const CdnMaxAge = [
4674        'default' => 18000,
4675    ];
4676
4677    /**
4678     * Cache timeout for the CDN when DB replica DB lag is high
4679     *
4680     * @see self::CdnMaxAge
4681     * @since 1.27
4682     */
4683    public const CdnMaxageLagged = [
4684        'default' => 30,
4685    ];
4686
4687    /**
4688     * Cache timeout when delivering a stale ParserCache response due to PoolCounter
4689     * contention.
4690     *
4691     * @since 1.35
4692     */
4693    public const CdnMaxageStale = [
4694        'default' => 10,
4695    ];
4696
4697    /**
4698     * If set, any SquidPurge call on a URL or URLs will send a second purge no less than
4699     * this many seconds later via the job queue. This requires delayed job support.
4700     *
4701     * This should be safely higher than the 'max lag' value in $wgLBFactoryConf, so that
4702     * replica DB lag does not cause page to be stuck in stales states in CDN.
4703     *
4704     * This also fixes race conditions in two-tiered CDN setups (e.g. cdn2 => cdn1 => MediaWiki).
4705     * If a purge for a URL reaches cdn2 before cdn1 and a request reaches cdn2 for that URL,
4706     * it will populate the response from the stale cdn1 value. When cdn1 gets the purge, cdn2
4707     * will still be stale. If the rebound purge delay is safely higher than the time to relay
4708     * a purge to all nodes, then the rebound purge will clear cdn2 after cdn1 was cleared.
4709     *
4710     * @since 1.27
4711     */
4712    public const CdnReboundPurgeDelay = [
4713        'default' => 0,
4714    ];
4715
4716    /**
4717     * Cache timeout for the CDN when a response is known to be wrong or incomplete (due to load)
4718     *
4719     * @see self::CdnMaxAge
4720     * @since 1.27
4721     */
4722    public const CdnMaxageSubstitute = [
4723        'default' => 60,
4724    ];
4725
4726    /**
4727     * Default maximum age for raw CSS/JS accesses
4728     *
4729     * 300 seconds = 5 minutes.
4730     */
4731    public const ForcedRawSMaxage = [
4732        'default' => 300,
4733    ];
4734
4735    /**
4736     * List of proxy servers to purge on changes; default port is 80. Use IP addresses.
4737     *
4738     * When MediaWiki is running behind a proxy, it will trust X-Forwarded-For
4739     * headers sent/modified from these proxies when obtaining the remote IP address
4740     *
4741     * For a list of trusted servers which *aren't* purged, see $wgSquidServersNoPurge.
4742     *
4743     * @since 1.34 Renamed from $wgSquidServers.
4744     */
4745    public const CdnServers = [
4746        'default' => [],
4747        'type' => 'map',
4748    ];
4749
4750    /**
4751     * As with $wgCdnServers, except these servers aren't purged on page changes;
4752     * use to set a list of trusted proxies, etc. Supports both individual IP
4753     * addresses and CIDR blocks.
4754     *
4755     * @since 1.23 Supports CIDR ranges
4756     * @since 1.34 Renamed from $wgSquidServersNoPurge
4757     */
4758    public const CdnServersNoPurge = [
4759        'default' => [],
4760        'type' => 'map',
4761    ];
4762
4763    /**
4764     * Routing configuration for HTCP multicast purging. Add elements here to
4765     * enable HTCP and determine which purges are sent where. If set to an empty
4766     * array, HTCP is disabled.
4767     *
4768     * Each key in this array is a regular expression to match against the purged
4769     * URL, or an empty string to match all URLs. The purged URL is matched against
4770     * the regexes in the order specified, and the first rule whose regex matches
4771     * is used, all remaining rules will thus be ignored.
4772     *
4773     * **Example configuration to send purges for upload.wikimedia.org to one**
4774     * multicast group and all other purges to another:
4775     *
4776     * ```
4777     * $wgHTCPRouting = [
4778     *         '|^https?://upload\.wikimedia\.org|' => [
4779     *                 'host' => '239.128.0.113',
4780     *                 'port' => 4827,
4781     *         ],
4782     *         '' => [
4783     *                 'host' => '239.128.0.112',
4784     *                 'port' => 4827,
4785     *         ],
4786     * ];
4787     * ```
4788     *
4789     * You can also pass an array of hosts to send purges too. This is useful when
4790     * you have several multicast groups or unicast address that should receive a
4791     * given purge.  Multiple hosts support was introduced in MediaWiki 1.22.
4792     *
4793     * **Example of sending purges to multiple hosts:**
4794     *
4795     * ```
4796     * $wgHTCPRouting = [
4797     *     '' => [
4798     *         // Purges to text caches using multicast
4799     *         [ 'host' => '239.128.0.114', 'port' => '4827' ],
4800     *         // Purges to a hardcoded list of caches
4801     *         [ 'host' => '10.88.66.1', 'port' => '4827' ],
4802     *         [ 'host' => '10.88.66.2', 'port' => '4827' ],
4803     *         [ 'host' => '10.88.66.3', 'port' => '4827' ],
4804     *     ],
4805     * ];
4806     * ```
4807     *
4808     * @since 1.22
4809     * @see self::HTCPMulticastTTL
4810     */
4811    public const HTCPRouting = [
4812        'default' => [],
4813        'type' => 'map',
4814    ];
4815
4816    /**
4817     * HTCP multicast TTL.
4818     *
4819     * @see self::HTCPRouting
4820     */
4821    public const HTCPMulticastTTL = [
4822        'default' => 1,
4823    ];
4824
4825    /**
4826     * Should forwarded Private IPs be accepted?
4827     */
4828    public const UsePrivateIPs = [
4829        'default' => false,
4830    ];
4831
4832    /**
4833     * Set this to false if MediaWiki is behind a CDN that re-orders query
4834     * parameters on incoming requests.
4835     *
4836     * MediaWiki sets a large 'Cache-Control: s-maxage=' directive on page
4837     * views only if the request URL matches one of the normal CDN URL forms.
4838     * When 'CdnMatchParameterOrder' is false, the matching algorithm ignores
4839     * the order of URL parameters.
4840     *
4841     * @since 1.39
4842     */
4843    public const CdnMatchParameterOrder = [
4844        'default' => true,
4845    ];
4846
4847    // endregion -- end of HTTP proxy settings
4848
4849    /***************************************************************************/
4850    // region   Language, regional and character encoding settings
4851    /** @name   Language, regional and character encoding settings */
4852
4853    /**
4854     * Site language code. See includes/Languages/Data/Names.php for languages
4855     * supported by MediaWiki out of the box. Not all languages listed there have
4856     * translations, see languages/messages/ for the list of languages with some
4857     * localisation.
4858     *
4859     * Warning: Don't use any of MediaWiki's deprecated language codes listed in
4860     * LanguageCode::getDeprecatedCodeMapping or $wgDummyLanguageCodes, like "no"
4861     * for Norwegian (use "nb" instead). If you do, things will break unexpectedly.
4862     *
4863     * This defines the default interface language for all users, but users can
4864     * change it in their preferences.
4865     *
4866     * This also defines the language of pages in the wiki. The content is wrapped
4867     * in a html element with lang=XX attribute. This behavior can be overridden
4868     * via hooks, see Title::getPageLanguage.
4869     */
4870    public const LanguageCode = [
4871        'default' => 'en',
4872    ];
4873
4874    /**
4875     * Some languages need different word forms, usually for different cases.
4876     *
4877     * Used in Language::convertGrammar().
4878     *
4879     * **Example:**
4880     *
4881     * ```
4882     * $wgGrammarForms['en']['genitive']['car'] = 'car\'s';
4883     * ```
4884     */
4885    public const GrammarForms = [
4886        'default' => [],
4887        'type' => 'map',
4888    ];
4889
4890    /**
4891     * Treat language links as magic connectors, not inline links
4892     */
4893    public const InterwikiMagic = [
4894        'default' => true,
4895    ];
4896
4897    /**
4898     * Hide interlanguage links from the sidebar
4899     */
4900    public const HideInterlanguageLinks = [
4901        'default' => false,
4902    ];
4903
4904    /**
4905     * List of additional interwiki prefixes that should be treated as
4906     * interlanguage links (i.e. placed in the sidebar).
4907     *
4908     * Notes:
4909     * - This will not do anything unless the prefixes are defined in the interwiki
4910     *   map.
4911     * - The display text for these custom interlanguage links will be fetched from
4912     *   the system message "interlanguage-link-xyz" where xyz is the prefix in
4913     *   this array.
4914     * - A friendly name for each site, used for tooltip text, may optionally be
4915     *   placed in the system message "interlanguage-link-sitename-xyz" where xyz is
4916     *   the prefix in this array.
4917     * - This should be a list of "interwiki prefixes" (ie, what appears in
4918     *   wikitext), and you probably want to add an entry to
4919     *   InterlanguageLinkCodeMap as well to specify which mediawiki internal
4920     *   (or custom) language code this prefix corresponds to, and perhaps
4921     *   then map that custom language code to a language name in
4922     *   ExtraLanguageNames.
4923     */
4924    public const ExtraInterlanguageLinkPrefixes = [
4925        'default' => [],
4926        'type' => 'list',
4927    ];
4928
4929    /**
4930     * Map of interlanguage link codes to language codes. This is useful to override
4931     * what is shown as the language name when the interwiki code does not match it
4932     * exactly
4933     *
4934     * @since 1.35
4935     */
4936    public const InterlanguageLinkCodeMap = [
4937        'default' => [],
4938        'type' => 'map',
4939    ];
4940
4941    /**
4942     * List of language names or overrides for default names in Names.php
4943     */
4944    public const ExtraLanguageNames = [
4945        'default' => [],
4946        'type' => 'map',
4947    ];
4948
4949    /**
4950     * List of mappings from one language code to another.
4951     *
4952     * This array makes the codes not appear as a selectable language on the
4953     * installer.
4954     *
4955     * In Setup.php, the variable $wgDummyLanguageCodes is created by combining
4956     * these codes with a list of "deprecated" codes, which are mostly leftovers
4957     * from renames or other legacy things, and the internal codes 'qqq' and 'qqx'.
4958     * If a mapping in $wgExtraLanguageCodes collide with a built-in mapping, the
4959     * value in $wgExtraLanguageCodes will be used.
4960     *
4961     * @since 1.29
4962     */
4963    public const ExtraLanguageCodes = [
4964        'default' => [
4965            'bh' => 'bho',
4966            'no' => 'nb',
4967            'simple' => 'en',
4968        ],
4969        'type' => 'map',
4970    ];
4971
4972    /**
4973     * Functionally the same as $wgExtraLanguageCodes, but deprecated. Instead of
4974     * appending values to this array, append them to $wgExtraLanguageCodes.
4975     *
4976     * @note Since 1.29, this should not be set directly in LocalSettings,
4977     *       ExtraLanguageCodes should be set instead. However, DummyLanguageCodes
4978     *       will be initialized and can be read internally.
4979     */
4980    public const DummyLanguageCodes = [
4981        'default' => [],
4982        'type' => 'map',
4983    ];
4984
4985    /**
4986     * Set this to always convert certain Unicode sequences to modern ones
4987     * regardless of the content language. This has a small performance
4988     * impact.
4989     *
4990     * @since 1.17
4991     */
4992    public const AllUnicodeFixes = [
4993        'default' => false,
4994    ];
4995
4996    /**
4997     * Set this to eg 'ISO-8859-1' to perform character set conversion when
4998     * loading old revisions not marked with "utf-8" flag. Use this when
4999     * converting a wiki from MediaWiki 1.4 or earlier to UTF-8 without the
5000     * burdensome mass conversion of old text data.
5001     *
5002     * @note This DOES NOT touch any fields other than old_text. Titles, comments,
5003     * user names, etc still must be converted en masse in the database before
5004     * continuing as a UTF-8 wiki.
5005     */
5006    public const LegacyEncoding = [
5007        'default' => false,
5008    ];
5009
5010    /**
5011     * Enable dates like 'May 12' instead of '12 May', if the default date format
5012     * is 'dmy or mdy'.
5013     */
5014    public const AmericanDates = [
5015        'default' => false,
5016    ];
5017
5018    /**
5019     * For Hindi and Arabic use local numerals instead of Western style (0-9)
5020     * numerals in interface.
5021     */
5022    public const TranslateNumerals = [
5023        'default' => true,
5024    ];
5025
5026    /**
5027     * Translation using MediaWiki: namespace.
5028     *
5029     * Interface messages will be loaded from the database.
5030     */
5031    public const UseDatabaseMessages = [
5032        'default' => true,
5033    ];
5034
5035    /**
5036     * Maximum entry size in the message cache, in bytes
5037     */
5038    public const MaxMsgCacheEntrySize = [
5039        'default' => 10000,
5040    ];
5041
5042    /**
5043     * Whether to enable language variant conversion.
5044     */
5045    public const DisableLangConversion = [
5046        'default' => false,
5047    ];
5048
5049    /**
5050     * Whether to enable language variant conversion for links.
5051     * Note that this option is slightly misnamed.
5052     */
5053    public const DisableTitleConversion = [
5054        'default' => false,
5055    ];
5056
5057    /**
5058     * Default variant code. If false, the default will be the static default
5059     * variant of the language.
5060     */
5061    public const DefaultLanguageVariant = [
5062        'default' => false,
5063    ];
5064
5065    /**
5066     * Whether to enable the pig Latin variant of English (en-x-piglatin),
5067     * used to ease variant development work.
5068     */
5069    public const UsePigLatinVariant = [
5070        'default' => false,
5071    ];
5072
5073    /**
5074     * Disabled variants array of language variant conversion.
5075     *
5076     * **Example:**
5077     *
5078     * ```
5079     * $wgDisabledVariants[] = 'zh-mo';
5080     * $wgDisabledVariants[] = 'zh-my';
5081     * ```
5082     */
5083    public const DisabledVariants = [
5084        'default' => [],
5085        'type' => 'map',
5086    ];
5087
5088    /**
5089     * Like $wgArticlePath, but on multi-variant wikis, this provides a
5090     * path format that describes which parts of the URL contain the
5091     * language variant.
5092     *
5093     * **Example:**
5094     *
5095     * ```
5096     * $wgLanguageCode = 'sr';
5097     * $wgVariantArticlePath = '/$2/$1';
5098     * $wgArticlePath = '/wiki/$1';
5099     * ```
5100     *
5101     * A link to /wiki/ would be redirected to /sr/Главна_страна
5102     *
5103     * It is important that $wgArticlePath not overlap with possible values
5104     * of $wgVariantArticlePath.
5105     */
5106    public const VariantArticlePath = [
5107        'default' => false,
5108    ];
5109
5110    /**
5111     * Whether to enable the 'x-xss' language code, used for development.
5112     *
5113     * When enabled, the language code 'x-xss' (e.g. via ?uselang=x-xss) can
5114     * be used to test correct message escaping at scale, to prevent
5115     * cross-site scripting. In this "language", every message becomes an HTML
5116     * snippet which attempts to alert the message key. Well-written code will
5117     * correctly escape all of these messages. If any alerts are actually
5118     * fired in the browser, the message is not being escaped correctly;
5119     * either the offending code should be fixed, or the message should be
5120     * added to {@link self::RawHtmlMessages}.
5121     *
5122     * @see https://www.mediawiki.org/wiki/Special:MyLanguage/Cross-site_scripting
5123     * @since 1.41
5124     */
5125    public const UseXssLanguage = [
5126        'default' => false,
5127    ];
5128
5129    /**
5130     * Show a bar of language selection links in the user login and user
5131     * registration forms; edit the "loginlanguagelinks" message to
5132     * customise these.
5133     */
5134    public const LoginLanguageSelector = [
5135        'default' => false,
5136    ];
5137
5138    /**
5139     * When translating messages with wfMessage(), it is not always clear what
5140     * should be considered UI messages and what should be content messages.
5141     *
5142     * For example, for the English Wikipedia, there should be only one 'mainpage',
5143     * so when getting the link for 'mainpage', we should treat it as site content
5144     * and call ->inContentLanguage()->text(), but for rendering the text of the
5145     * link, we call ->text(). The code behaves this way by default. However,
5146     * sites like the Wikimedia Commons do offer different versions of 'mainpage'
5147     * and the like for different languages. This array provides a way to override
5148     * the default behavior.
5149     *
5150     * **Example:**
5151     * To allow language-specific main page and community
5152     * portal:
5153     *
5154     * ```
5155     * $wgForceUIMsgAsContentMsg = [ 'mainpage', 'portal-url' ];
5156     * ```
5157     */
5158    public const ForceUIMsgAsContentMsg = [
5159        'default' => [],
5160        'type' => 'map',
5161    ];
5162
5163    /**
5164     * List of messages which might contain raw HTML.
5165     *
5166     * Extensions should add their insecure raw HTML messages to extension.json.
5167     * The list is used for access control:
5168     * changing messages listed here will require editsitecss and editsitejs rights.
5169     *
5170     * Message names must be given with underscores rather than spaces and with lowercase first
5171     * letter.
5172     *
5173     * @since 1.32
5174     */
5175    public const RawHtmlMessages = [
5176        'default' => [],
5177        'type' => 'list',
5178        'items' => [ 'type' => 'string', ],
5179    ];
5180
5181    /**
5182     * Fake out the timezone that the server thinks it's in. This will be used for
5183     * date display and not for what's stored in the DB. Leave to null to retain
5184     * your server's OS-based timezone value.
5185     *
5186     * This variable is currently used only for signature formatting and for local
5187     * time/date parser variables ({{LOCALTIME}} etc.)
5188     *
5189     * Timezones can be translated by editing MediaWiki messages of type
5190     * timezone-nameinlowercase like timezone-utc.
5191     *
5192     * A list of usable timezones can found at:
5193     * https://www.php.net/manual/en/timezones.php
5194     *
5195     * **Examples:**
5196     *
5197     * ```
5198     * $wgLocaltimezone = 'UTC';
5199     * $wgLocaltimezone = 'GMT';
5200     * $wgLocaltimezone = 'PST8PDT';
5201     * $wgLocaltimezone = 'Europe/Sweden';
5202     * $wgLocaltimezone = 'CET';
5203     * ```
5204     */
5205    public const Localtimezone = [
5206        'dynamicDefault' => true,
5207    ];
5208
5209    public static function getDefaultLocaltimezone(): string {
5210        // This defaults to the `date.timezone` value of the PHP INI option. If this option is not set,
5211        // it falls back to UTC.
5212        $localtimezone = date_default_timezone_get();
5213        if ( !$localtimezone ) {
5214            // Make doubly sure we have a valid time zone, even if date_default_timezone_get()
5215            // returned garbage.
5216            $localtimezone = 'UTC';
5217        }
5218
5219        return $localtimezone;
5220    }
5221
5222    /**
5223     * Set an offset from UTC in minutes to use for the default timezone setting
5224     * for anonymous users and new user accounts.
5225     *
5226     * This setting is used for most date/time displays in the software, and is
5227     * overridable in user preferences. It is *not* used for signature timestamps.
5228     *
5229     * By default, this will be set to match $wgLocaltimezone.
5230     */
5231    public const LocalTZoffset = [
5232        'dynamicDefault' => [ 'use' => [ 'Localtimezone' ] ]
5233    ];
5234
5235    public static function getDefaultLocalTZoffset( ?string $localtimezone ): int {
5236        // NOTE: Extra fallback, in case $localtimezone is ''.
5237        //       Many extsing LocalSettings files have $wgLocaltimezone = ''
5238        //       in them, erroneously generated by the installer.
5239        $localtimezone = $localtimezone ?: self::getDefaultLocaltimezone();
5240
5241        try {
5242            $timezone = new DateTimeZone( $localtimezone );
5243        } catch ( \Exception $e ) {
5244            throw new ConfigException(
5245                sprintf( "Invalid timezone '%s'. Please set a valid timezone in '$%s' in LocalSettings.php. Refer to the list of valid timezones at https://www.php.net/timezones. Error: %s",
5246                    $localtimezone,
5247                    "wgLocaltimezone",
5248                    $e->getMessage() ),
5249            );
5250        }
5251
5252        $offset = $timezone->getOffset( new DateTime() );
5253
5254        return (int)( $offset / 60 );
5255    }
5256
5257    /**
5258     * Map of Unicode characters for which capitalization is overridden in
5259     * Language::ucfirst. The characters should be
5260     * represented as char_to_convert => conversion_override. See T219279 for details
5261     * on why this is useful during php version transitions.
5262     *
5263     * @since 1.34
5264     */
5265    public const OverrideUcfirstCharacters = [
5266        'default' => [],
5267        'type' => 'map',
5268    ];
5269
5270    // endregion -- End of language/charset settings
5271
5272    /***************************************************************************/
5273    // region   Output format and skin settings
5274    /** @name   Output format and skin settings */
5275
5276    /**
5277     * The default Content-Type header.
5278     */
5279    public const MimeType = [
5280        'default' => 'text/html',
5281    ];
5282
5283    /**
5284     * Defines the value of the version attribute in the &lt;html&gt; tag, if any.
5285     *
5286     * If your wiki uses RDFa, set it to the correct value for RDFa+HTML5.
5287     * Correct current values are 'HTML+RDFa 1.0' or 'XHTML+RDFa 1.0'.
5288     * See also https://www.w3.org/TR/rdfa-in-html/#document-conformance
5289     *
5290     * @since 1.16
5291     */
5292    public const Html5Version = [
5293        'default' => null,
5294    ];
5295
5296    /**
5297     * Whether to label the store-to-database-and-show-to-others button in the editor
5298     * as "Save page"/"Save changes" if false (the default) or, if true, instead as
5299     * "Publish page"/"Publish changes".
5300     *
5301     * @since 1.28
5302     */
5303    public const EditSubmitButtonLabelPublish = [
5304        'default' => false,
5305    ];
5306
5307    /**
5308     * Permit other namespaces in addition to the w3.org default.
5309     *
5310     * Use the prefix for the key and the namespace for the value.
5311     *
5312     * **Example:**
5313     *
5314     * ```
5315     * $wgXhtmlNamespaces['svg'] = 'http://www.w3.org/2000/svg';
5316     * ```
5317     *
5318     * Normally we wouldn't have to define this in the root "<html>"
5319     * element, but IE needs it there in some circumstances.
5320     *
5321     * This is ignored if $wgMimeType is set to a non-XML MIME type.
5322     */
5323    public const XhtmlNamespaces = [
5324        'default' => [],
5325        'type' => 'map',
5326    ];
5327
5328    /**
5329     * Site notice shown at the top of each page
5330     *
5331     * MediaWiki:Sitenotice page, which will override this. You can also
5332     * provide a separate message for logged-out users using the
5333     * MediaWiki:Anonnotice page.
5334     */
5335    public const SiteNotice = [
5336        'default' => '',
5337    ];
5338
5339    /**
5340     * Override the ability of certain browsers to attempt to autodetect dataformats in pages.
5341     *
5342     * This is a default feature of many mobile browsers, but can have a lot of false positives,
5343     * where for instance, year ranges are confused with phone numbers.
5344     * The default of this setting is to disable telephone number data detection.
5345     * Set BrowserFormatDetection to false to fallback to the browser defaults.
5346     *
5347     * @since 1.37
5348     * @see https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html
5349     */
5350    public const BrowserFormatDetection = [
5351        'default' => 'telephone=no',
5352        'type' => 'string',
5353    ];
5354
5355    /**
5356     * An array of open graph tags which should be added by all skins.
5357     *
5358     * Accepted values are "og:site_name", "og:title", "og:type" and "twitter:card".
5359     * Since some of these fields can be provided by extensions it defaults to an empty array.
5360     *
5361     * @since 1.36
5362     */
5363    public const SkinMetaTags = [
5364        'default' => [],
5365        'type' => 'map',
5366    ];
5367
5368    /**
5369     * Default skin, for new users and anonymous visitors. Registered users may
5370     * change this to any one of the other available skins in their preferences.
5371     */
5372    public const DefaultSkin = [
5373        'default' => 'vector-2022',
5374    ];
5375
5376    /**
5377     * Fallback skin used when the skin defined by $wgDefaultSkin can't be found.
5378     *
5379     * @since 1.24
5380     */
5381    public const FallbackSkin = [
5382        'default' => 'fallback',
5383    ];
5384
5385    /**
5386     * Specify the names of skins that should not be presented in the list of
5387     * available skins in user preferences.
5388     *
5389     * NOTE: This does not uninstall the skin, and it will still be accessible
5390     * via the `useskin` query parameter. To uninstall a skin, remove its inclusion
5391     * from LocalSettings.php.
5392     *
5393     * @see \SkinFactory::getAllowedSkins
5394     */
5395    public const SkipSkins = [
5396        'default' => [],
5397        'type' => 'map',
5398    ];
5399
5400    /**
5401     * Disable output compression (enabled by default if zlib is available)
5402     */
5403    public const DisableOutputCompression = [
5404        'default' => false,
5405    ];
5406
5407    /**
5408     * How should section IDs be encoded?
5409     * This array can contain 1 or 2 elements, each of them can be one of:
5410     * - 'html5'  is modern HTML5 style encoding with minimal escaping. Displays Unicode
5411     *            characters in most browsers' address bars.
5412     *
5413     * - 'legacy' is old MediaWiki-style encoding, e.g. 啤酒 turns into .E5.95.A4.E9.85.92
5414     *
5415     * The first element of this array specifies the primary mode of escaping IDs. This
5416     * is what users will see when they e.g. follow an [[#internal link]] to a section of
5417     * a page.
5418     *
5419     * The optional second element defines a fallback mode, useful for migrations.
5420     * If present, it will direct MediaWiki to add empty <span>s to every section with its
5421     * id attribute set to fallback encoded title so that links using the previous encoding
5422     * would still work.
5423     *
5424     * Example: you want to migrate your wiki from 'legacy' to 'html5'
5425     *
5426     * On the first step, set this variable to [ 'legacy', 'html5' ]. After a while, when
5427     * all caches (parser, HTTP, etc.) contain only pages generated with this setting,
5428     * flip the value to [ 'html5', 'legacy' ]. This will result in all internal links being
5429     * generated in the new encoding while old links (both external and cached internal) will
5430     * still work. After a long time, you might want to ditch backwards compatibility and
5431     * set it to [ 'html5' ]. After all, pages get edited, breaking incoming links no matter which
5432     * fragment mode is used.
5433     *
5434     * @since 1.30
5435     */
5436    public const FragmentMode = [
5437        'default' => [ 'html5', 'legacy', ],
5438        'type' => 'list',
5439    ];
5440
5441    /**
5442     * Which ID escaping mode should be used for external interwiki links? See documentation
5443     * for $wgFragmentMode above for details of each mode. Because you can't control external sites,
5444     * this setting should probably always be 'legacy', unless every wiki you link to has converted
5445     * to 'html5'.
5446     *
5447     * @since 1.30
5448     */
5449    public const ExternalInterwikiFragmentMode = [
5450        'default' => 'legacy',
5451    ];
5452
5453    /**
5454     * Abstract list of footer icons for skins in place of old copyrightico and poweredbyico code
5455     * You can add new icons to the built in copyright or poweredby, or you can create
5456     * a new block. Though note that you may need to add some custom css to get good styling
5457     * of new blocks in monobook. vector and modern should work without any special css.
5458     *
5459     * $wgFooterIcons itself is a key/value array.
5460     * The key is the name of a block that the icons will be wrapped in. The final id varies
5461     * by skin; Monobook and Vector will turn poweredby into f-poweredbyico while Modern
5462     * turns it into mw_poweredby.
5463     * The value is either key/value array of icons or a string.
5464     * In the key/value array the key may or may not be used by the skin but it can
5465     * be used to find the icon and unset it or change the icon if needed.
5466     * This is useful for disabling icons that are set by extensions.
5467     * The value should be either a string or an array. If it is a string it will be output
5468     * directly as html, however some skins may choose to ignore it. An array is the preferred
5469     * format for the icon, the following keys are used:
5470     * - src: An absolute url to the image to use for the icon, this is recommended
5471     *        but not required, however some skins will ignore icons without an image
5472     * - srcset: optional additional-resolution images; see HTML5 specs
5473     * - url: The url to use in the a element around the text or icon, if not set an a element will
5474     *        not be outputted
5475     * - alt: This is the text form of the icon, it will be displayed without an image in
5476     *        skins like Modern or if src is not set, and will otherwise be used as
5477     *        the alt="" for the image. This key is required.
5478     * - width and height: If the icon specified by src is not of the standard size
5479     *                     you can specify the size of image to use with these keys.
5480     *                     Otherwise they will default to the standard 88x31.
5481     *
5482     * @todo Reformat documentation.
5483     */
5484    public const FooterIcons = [
5485        'default' => [
5486            "copyright" => [
5487                "copyright" => [], // placeholder for the built in copyright icon
5488            ],
5489            "poweredby" => [
5490                "mediawiki" => [
5491                    // Defaults to point at
5492                    // "$wgResourceBasePath/resources/assets/poweredby_mediawiki_88x31.png"
5493                    // plus srcset for 2x resolution variant.
5494                    "src" => null,
5495                    "url" => "https://www.mediawiki.org/",
5496                    "alt" => "Powered by MediaWiki",
5497                    "lang" => "en",
5498                ]
5499            ],
5500        ],
5501        'type' => 'map',
5502    ];
5503
5504    /**
5505     * Login / create account link behavior when it's possible for anonymous users
5506     * to create an account.
5507     *
5508     * - true = use a combined login / create account link
5509     * - false = split login and create account into two separate links
5510     */
5511    public const UseCombinedLoginLink = [
5512        'default' => false,
5513    ];
5514
5515    /**
5516     * Display user edit counts in various prominent places.
5517     */
5518    public const Edititis = [
5519        'default' => false,
5520    ];
5521
5522    /**
5523     * Some web hosts attempt to rewrite all responses with a 404 (not found)
5524     * status code, mangling or hiding MediaWiki's output. If you are using such a
5525     * host, you should start looking for a better one. While you're doing that,
5526     * set this to false to convert some of MediaWiki's 404 responses to 200 so
5527     * that the generated error pages can be seen.
5528     *
5529     * In cases where for technical reasons it is more important for MediaWiki to
5530     * send the correct status code than for the body to be transmitted intact,
5531     * this configuration variable is ignored.
5532     */
5533    public const Send404Code = [
5534        'default' => true,
5535    ];
5536
5537    /**
5538     * The $wgShowRollbackEditCount variable is used to show how many edits can be rolled back.
5539     *
5540     * The numeric value of the variable controls how many edits MediaWiki will look back to
5541     * determine whether a rollback is allowed (by checking that they are all from the same author).
5542     * If the value is false or 0, the edits are not counted. Disabling this will prevent MediaWiki
5543     * from hiding some useless rollback links.
5544     *
5545     * @since 1.20
5546     */
5547    public const ShowRollbackEditCount = [
5548        'default' => 10,
5549    ];
5550
5551    /**
5552     * Output a <link rel="canonical"> tag on every page indicating the canonical
5553     * server which should be used, i.e. $wgServer or $wgCanonicalServer. Since
5554     * detection of the current server is unreliable, the link is sent
5555     * unconditionally.
5556     */
5557    public const EnableCanonicalServerLink = [
5558        'default' => false,
5559    ];
5560
5561    /**
5562     * List of interwiki logos overrides.
5563     * This is used by the sister project sidebar. This list accept a key equal to the
5564     * interwiki ID (as defined in the interwiki links), and accept a Codex icon name
5565     * (https://doc.wikimedia.org/codex/latest/icons/all-icons.html) or a base URL for
5566     * the given interwiki.
5567     *
5568     * Example :
5569     * $wgInterwikiLogoOverride = [
5570     *     'c' => 'logoWikimediaCommons',
5571     *     'wikit' => 'https://mySpecialWiki.com'
5572     * ];
5573     */
5574    public const InterwikiLogoOverride = [
5575        'default' => [],
5576        'type' => 'list',
5577        'items' => [ 'type' => 'string', ],
5578    ];
5579
5580    // endregion -- End of output format settings
5581
5582    /***************************************************************************/
5583    // region   ResourceLoader settings
5584    /** @name   ResourceLoader settings */
5585
5586    /**
5587     * Formerly a workaround for a security vulnerability caused by installation
5588     * of Flash as a browser extension.
5589     *
5590     * @since 1.25
5591     * @deprecated since 1.39
5592     */
5593    public const MangleFlashPolicy = [
5594        'default' => true,
5595        'obsolete' => 'Since 1.39; no longer has any effect.',
5596        'description' => 'Has been emitting warnings since 1.39 (LTS). ' .
5597            'Can be removed completely in 1.44, assuming 1.43 is an LTS release.'
5598    ];
5599
5600    /**
5601     * Define extra client-side modules to be registered with ResourceLoader.
5602     *
5603     * @note It is recommended to define modules using the `ResourceModule` attribute
5604     * in `extension.json` or `skin.json` when possible (instead of via PHP global variables).
5605     *
5606     * Registration is internally handled by ResourceLoader::register.
5607     *
5608     * ## Available modules
5609     *
5610     * Modules that ship with %MediaWiki core are registered via
5611     * resources/Resources.php. For a full list with documentation, see:
5612     * [ResourceLoader/Core_modules](https://www.mediawiki.org/wiki/ResourceLoader/Core_modules).
5613     *
5614     * ## Options
5615     *
5616     * - class `{string}`:
5617     *   By default a module is assumed to bundle file resources
5618     *   as handled by the MediaWiki\ResourceLoader\FileModule class. Use this option
5619     *   to use a different implementation of MediaWiki\ResourceLoader\Module instead.
5620     *
5621     *   Default: `\MediaWiki\ResourceLoader\FileModule`
5622     *
5623     * - factory `{string}`:
5624     *   Override the instantiation of the MediaWiki\ResourceLoader\Module
5625     *   class using a PHP callback. This allows dependency injection to be used.
5626     *   This option cannot be combined with the `class` option.
5627     *
5628     *   Since: MW 1.30
5629     *
5630     * - dependencies `{string[]|string}`:
5631     *   Modules that must be executed before this module.
5632     *   Module name string or list of module name strings.
5633     *
5634     *   Default: `[]`
5635     *
5636     * - deprecated `{boolean|string}`:
5637     *   Whether the module is deprecated and usage is discouraged.
5638     *   Set to boolean true, or a string to include in the warning message.
5639     *
5640     *   Default: `false`
5641     *
5642     * - group `{string}`:
5643     *   Optional request group to override which modules may be downloaded
5644     *   together in an HTTP batch request. By default, any two modules may be
5645     *   loaded together in the same batch request. Set this option to a
5646     *   descriptive string to give the module its own HTTP request. To allow
5647     *   other modules to join this new request, give those the same request group.
5648     *
5649     *   Use this option with caution. The default behaviour is well-tuned already,
5650     *   and setting this often does more harm than good. For more about request
5651     *   balancing optimisations, see
5652     *   [ResourceLoader/Architecture#Balance](https://www.mediawiki.org/wiki/ResourceLoader/Architecture#Balance).
5653     *
5654     * - skipFunction `{string}`:
5655     *   Allow this module to be satisfied as dependency without actually loading
5656     *   or executing scripts from the server, if the specified JavaScript function
5657     *   returns true.
5658     *
5659     *   Use this to provide polyfills that are natively available in newer browsers.
5660     *   Specify the relative path to a JavaScript file containing a top-level return
5661     *   statement. The contents of the file should not contain any wrapping function,
5662     *   it will be wrapped by %ResourceLoader in an anonymous function and invoked
5663     *   when the module is considered for loading.
5664     *
5665     * ## FileModule options
5666     *
5667     * - localBasePath `{string}`:
5668     *   Base file path to prepend to relative file paths specified in other options.
5669     *
5670     *   Default: `$IP`
5671     *
5672     * - remoteBasePath `{string}`:
5673     *   Base URL path to prepend to relative file paths specified in other options.
5674     *   This is used to form URLs for files, such as when referencing images in
5675     *   stylesheets, or in debug mode to serve JavaScript files directly.
5676     *
5677     *   Default: @ref $wgResourceBasePath (which defaults to @ref $wgScriptPath)
5678     *
5679     * - remoteExtPath `{string}`:
5680     *   Shortcut for `remoteBasePath` that is relative to $wgExtensionAssetsPath.
5681     *   Use this when defining modules from an extension, so as to avoid hardcoding
5682     *   the script path of the %MediaWiki install or the location of the extensions
5683     *   directory.
5684     *
5685     *   This option is mutually exclusive with `remoteBasePath`.
5686     *
5687     * - remoteSkinPath `{string}`: Like `remoteExtPath`, but relative to $wgStylePath.
5688     *
5689     * - styles `{string[]|string|array<string,array>}`:
5690     *   Styles to always include in the module.
5691     *   %File path or list of file paths, relative to `localBasePath`.
5692     *   The stylesheet can be automatically wrapped in a `@media` query by specifying
5693     *   the file path as the key in an object (instead of the value), with the value
5694     *   specifying a `media` query.
5695     *
5696     *   See @ref wgResourceModules-example-stylesheet "Stylesheet examples" below.
5697     *
5698     *   See also @ref $wgResourceModuleSkinStyles.
5699     *
5700     *   Extended options:
5701     *
5702     *   - skinStyles `{string[]|string}`: Styles to include in specific skin contexts.
5703     *     Array keyed is by skin name with file path or list of file paths as value,
5704     *     relative to `localBasePath`.
5705     *
5706     *   Default: `[]`
5707     *
5708     * - noflip `{boolean}`:
5709     *   By default, CSSJanus will be used automatically to perform LTR-to-RTL flipping
5710     *   when loaded in a right-to-left (RTL) interface language context.
5711     *   Use this option to skip CSSJanus LTR-to-RTL flipping for this module, for example
5712     *   when registering an external library that already handles RTL styles.
5713     *
5714     *   Default: `false`
5715     *
5716     * - packageFiles `{string[]|array[]}`
5717     *   Specify script files and (virtual) data files to include in the module.
5718     *   Each internal JavaScript file retains its own local module scope and its
5719     *   private exports can be accessed separately by other client-side code in the
5720     *   same module, via the local `require()` function.
5721     *
5722     *   Modules that use package files should export any public API methods using
5723     *   `module.exports`.
5724     *
5725     *   See examples at
5726     *     [ResourceLoader/Package_files](https://www.mediawiki.org/wiki/ResourceLoader/Package_files)
5727     *     on mediawiki.org.
5728     *
5729     *   The `packageFiles` feature cannot be combined with legacy scripts that use
5730     *   the `scripts` option, including its extended variants `languageScripts`,
5731     *   `skinScripts`, and `debugScripts`.
5732     *
5733     *   Since: MW 1.33
5734     *
5735     *   Default: `[]`
5736     *
5737     * - scripts `{string[]|string|array[]}`:
5738     *   Scripts to always include in the module.
5739     *   %File path or list of file paths, relative to `localBasePath`.
5740     *
5741     *   These files are concatenated blindly and executed as a single client-side script.
5742     *   Modules using this option are sometimes referred to as "legacy scripts" to
5743     *   distinguish them from those that use the `packageFiles` option.
5744     *
5745     *   Modules that use legacy scripts usually attach any public APIs they have
5746     *   to the `mw` global variable. If a module contains just one file, it is also
5747     *   supported to use the newer `module.exports` mechanism, though if the module
5748     *   contains more than one legacy script, it is considered unsafe and unsupported
5749     *   to use this mechanism (use `packageFiles` instead). See also
5750     *   [Coding
5751     *     conventions/JavaScript](https://www.mediawiki.org/wiki/Manual:Coding_conventions/JavaScript#Exporting).
5752     *
5753     *   Since MW 1.41, an element of `scripts` may be an array in the same format as
5754     *   packageFiles, giving a callback to call for content generation.
5755     *
5756     *   Default: `[]`
5757     *
5758     *   Extended options, concatenated in this order:
5759     *
5760     *   - languageScripts `{string[]|string|array[]}`: Scripts to include in specific
5761     *     language contexts. Array is keyed by language code with file path or list of
5762     *     file path.
5763     *   - skinScripts `{string[]|string|array[]}`: Scripts to include in specific skin contexts.
5764     *     Array keyed is by skin name with file path or list of file paths.
5765     *   - debugScripts `{string[]|string|array[]}`: Scripts to include in debug contexts.
5766     *     %File path or list of file paths.
5767     *
5768     * - messages `{string[]}`
5769     *   Localisation messages to bundle with this module, for client-side use
5770     *   via `mw.msg()` and `mw.message()`. List of message keys.
5771     *
5772     *   Default: `[]`
5773     *
5774     * - templates `{string[]}`
5775     *   List of template files to be loaded for client-side usage via `mw.templates`.
5776     *
5777     *   Default: `[]`
5778     *
5779     * - es6 `{boolean}`:
5780     *   Since: MW 1.36; ignored since MW 1.41.
5781     *
5782     *   Default: `true`
5783     *
5784     *  - skipStructureTest `{boolean}`:
5785     *   Whether to skip ResourcesTest::testRespond(). Since MW 1.42.
5786     *
5787     *   Default: `false`.
5788     *
5789     * ## Examples
5790     *
5791     * **Example: Using an alternate subclass**
5792     *
5793     * ```
5794     * $wgResourceModules['ext.myExtension'] = [
5795     *   'class' => \MediaWiki\ResourceLoader\WikiModule::class,
5796     * ];
5797     * ```
5798     *
5799     * **Example: Deprecated module**
5800     *
5801     * ```
5802     * $wgResourceModules['ext.myExtension'] = [
5803     *   'deprecated' => 'You should use ext.myExtension2 instead',
5804     * ];
5805     * ```
5806     *
5807     * **Example: Base paths in extension.json**
5808     *
5809     * ```
5810     * "ext.myExtension": {
5811     *   "localBasePath": "modules/ext.MyExtension",
5812     *   "remoteExtPath": "MyExtension/modules/ext.MyExtension"
5813     * }
5814     * ```
5815     *
5816     * **Example: Base paths in core with PHP**
5817     *
5818     * ```
5819     * $wgResourceModules['mediawiki.example'] = [
5820     *   'localBasePath' => "$IP/resources/src/mediawiki.example",
5821     *   'remoteBasePath' => "$wgResourceBasePath/resources/src/mediawiki.example",
5822     * ];
5823     * ```
5824     *
5825     * **Example: Define a skip function**
5826     *
5827     * ```
5828     * $wgResourceModules['ext.myExtension.SomeWebAPI'] = [
5829     *   'skipFunction' => 'skip-SomeWebAPI.js',
5830     * ];
5831     * ```
5832     *
5833     * **Example: Contents of skip function file**
5834     *
5835     * ```
5836     * return typeof SomeWebAPI === 'function' && SomeWebAPI.prototype.duckMethod;
5837     * ```
5838     * @anchor wgResourceModules-example-stylesheet
5839     *
5840     * **Example: Stylesheets**
5841     *
5842     * ```
5843     * $wgResourceModules['example'] = [
5844     *   'styles' => [
5845     *     'foo.css',
5846     *     'bar.css',
5847     *   ],
5848     * ];
5849     * $wgResourceModules['example.media'] = [
5850     *   'styles' => [
5851     *     'foo.css' => [ 'media' => 'print' ],
5852     * ];
5853     * $wgResourceModules['example.mixed'] = [
5854     *   'styles' => [
5855     *     'foo.css',
5856     *     'bar.css' => [ 'media' => 'print' ],
5857     *   ],
5858     * ];
5859     * ```
5860     *
5861     * **Example: Package files**
5862     *
5863     * ```
5864     * "ext.myExtension": {
5865     *     "localBasePath": "modules/ext.MyExtension",
5866     *     "remoteExtPath": "MyExtension/modules/ext.MyExtension",
5867     *     "packageFiles": [
5868     *       "index.js",
5869     *       "utils.js",
5870     *       "data.json"
5871     *     ]
5872     *   }
5873     * }
5874     * ```
5875     *
5876     * **Example: Legacy scripts**
5877     *
5878     * ```
5879     * $wgResourceModules['ext.myExtension'] = [
5880     *   'scripts' => [
5881     *     'modules/ext.myExtension/utils.js',
5882     *     'modules/ext.myExtension/myExtension.js',
5883     *   ],
5884     *   'languageScripts' => [
5885     *     'bs' => 'modules/ext.myExtension/languages/bs.js',
5886     *     'fi' => 'modules/ext.myExtension/languages/fi.js',
5887     *   ],
5888     *   'skinScripts' => [
5889     *     'default' => 'modules/ext.myExtension/skin-default.js',
5890     *   ],
5891     *   'debugScripts' => [
5892     *     'modules/ext.myExtension/debug.js',
5893     *   ],
5894     * ];
5895     * ```
5896     *
5897     * **Example: Template files**
5898     *
5899     * ```
5900     * $wgResourceModules['ext.myExtension'] = [
5901     *   'templates' => [
5902     *     'templates/template.html',
5903     *     'templates/template2.html',
5904     *   ],
5905     * ];
5906     * ```
5907     * @since 1.17
5908     */
5909    public const ResourceModules = [
5910        'default' => [],
5911        'type' => 'map',
5912    ];
5913
5914    /**
5915     * Add extra skin-specific styles to a resource module.
5916     *
5917     * These are automatically added by ResourceLoader to the 'skinStyles' list of
5918     * the existing module. The 'styles' list cannot be modified or disabled.
5919     *
5920     * For example, below a module "bar" is defined and skin Foo provides additional
5921     * styles for it:
5922     *
5923     * **Example:**
5924     *
5925     * ```
5926     * $wgResourceModules['bar'] = [
5927     *   'scripts' => 'resources/bar/bar.js',
5928     *   'styles' => 'resources/bar/main.css',
5929     * ];
5930     *
5931     * $wgResourceModuleSkinStyles['foo'] = [
5932     *   'bar' => 'skins/Foo/styles/bar.css',
5933     * ];
5934     * ```
5935     *
5936     * This is effectively equivalent to:
5937     *
5938     * **Equivalent:**
5939     *
5940     * ```
5941     * $wgResourceModules['bar'] = [
5942     *   'scripts' => 'resources/bar/bar.js',
5943     *   'styles' => 'resources/bar/main.css',
5944     *   'skinStyles' => [
5945     *     'foo' => skins/Foo/styles/bar.css',
5946     *   ],
5947     * ];
5948     * ```
5949     *
5950     * If the module already defines its own entry in `skinStyles` for a given skin, then
5951     * $wgResourceModuleSkinStyles is ignored.
5952     *
5953     * If a module defines a `skinStyles['default']` the skin may want to extend that instead
5954     * of replacing it. This can be done using the `+` prefix.
5955     *
5956     * **Example:**
5957     *
5958     * ```
5959     * $wgResourceModules['bar'] = [
5960     *   'scripts' => 'resources/bar/bar.js',
5961     *   'styles' => 'resources/bar/basic.css',
5962     *   'skinStyles' => [
5963     *    'default' => 'resources/bar/additional.css',
5964     *   ],
5965     * ];
5966     * // Note the '+' character:
5967     * $wgResourceModuleSkinStyles['foo'] = [
5968     *   '+bar' => 'skins/Foo/styles/bar.css',
5969     * ];
5970     * ```
5971     *
5972     * This is effectively equivalent to:
5973     *
5974     * **Equivalent:**
5975     *
5976     * ```
5977     * $wgResourceModules['bar'] = [
5978     *   'scripts' => 'resources/bar/bar.js',
5979     *   'styles' => 'resources/bar/basic.css',
5980     *   'skinStyles' => [
5981     *     'default' => 'resources/bar/additional.css',
5982     *     'foo' => [
5983     *       'resources/bar/additional.css',
5984     *       'skins/Foo/styles/bar.css',
5985     *     ],
5986     *   ],
5987     * ];
5988     * ```
5989     *
5990     * In other words, as a module author, use the `styles` list for stylesheets that may not be
5991     * disabled by a skin. To provide default styles that may be extended or replaced,
5992     * use `skinStyles['default']`.
5993     *
5994     * As with $wgResourceModules, always set the localBasePath and remoteBasePath
5995     * keys (or one of remoteExtPath/remoteSkinPath).
5996     *
5997     * **Example:**
5998     *
5999     * ```
6000     * $wgResourceModuleSkinStyles['foo'] = [
6001     *   'bar' => 'bar.css',
6002     *   'quux' => 'quux.css',
6003     *   'remoteSkinPath' => 'Foo/styles',
6004     *   'localBasePath' => __DIR__ . '/styles',
6005     * ];
6006     * ```
6007     */
6008    public const ResourceModuleSkinStyles = [
6009        'default' => [],
6010        'type' => 'map',
6011    ];
6012
6013    /**
6014     * Extensions should register foreign module sources here. 'local' is a
6015     * built-in source that is not in this array, but defined by
6016     * ResourceLoader::__construct() so that it cannot be unset.
6017     *
6018     * **Example:**
6019     *
6020     * ```
6021     * $wgResourceLoaderSources['foo'] = 'http://example.org/w/load.php';
6022     * ```
6023     */
6024    public const ResourceLoaderSources = [
6025        'default' => [],
6026        'type' => 'map',
6027    ];
6028
6029    /**
6030     * The default 'remoteBasePath' value for instances of MediaWiki\ResourceLoader\FileModule.
6031     *
6032     * Defaults to $wgScriptPath.
6033     */
6034    public const ResourceBasePath = [
6035        'default' => null,
6036        'dynamicDefault' => [ 'use' => [ 'ScriptPath' ] ]
6037    ];
6038
6039    /**
6040     * @param mixed $scriptPath Value of ScriptPath
6041     * @return string
6042     */
6043    public static function getDefaultResourceBasePath( $scriptPath ): string {
6044        return $scriptPath;
6045    }
6046
6047    /**
6048     * Override how long a CDN or browser may cache a ResourceLoader HTTP response.
6049     *
6050     * Maximum time in seconds. Used for the `max-age` and `s-maxage` Cache-Control headers.
6051     *
6052     * Valid keys:
6053     *   - versioned
6054     *   - unversioned
6055     *
6056     * @see \MediaWiki\ResourceLoader\ResourceLoader::__construct
6057     * @since 1.35
6058     */
6059    public const ResourceLoaderMaxage = [
6060        'default' => [],
6061        'type' => 'map',
6062    ];
6063
6064    /**
6065     * The default debug mode (on/off) for of ResourceLoader requests.
6066     *
6067     * This will still be overridden when the debug URL parameter is used.
6068     */
6069    public const ResourceLoaderDebug = [
6070        'default' => false,
6071    ];
6072
6073    /**
6074     * ResourceLoader will not generate URLs whose query string is more than
6075     * this many characters long, and will instead use multiple requests with
6076     * shorter query strings. Using multiple requests may degrade performance,
6077     * but may be needed based on the query string limit supported by your web
6078     * server and/or your user's web browsers.
6079     *
6080     * Default: `2000`.
6081     *
6082     * @see \MediaWiki\ResourceLoader\StartUpModule::getMaxQueryLength
6083     * @since 1.17
6084     */
6085    public const ResourceLoaderMaxQueryLength = [
6086        'default' => false,
6087        'type' => 'integer|false',
6088    ];
6089
6090    /**
6091     * Validate JavaScript code loaded from wiki pages.
6092     *
6093     * If a syntax error is found, the script is replaced with a warning
6094     * logged to the browser console. This ensures errors are found early and
6095     * consistently (independent of the editor's own browser), and prevents
6096     * breaking other modules loaded in the same batch from load.php.
6097     *
6098     * @see \MediaWiki\ResourceLoader\Module::validateScriptFile
6099     */
6100    public const ResourceLoaderValidateJS = [
6101        'default' => true,
6102    ];
6103
6104    /**
6105     * When enabled, execution of JavaScript modules is profiled client-side.
6106     *
6107     * Instrumentation happens in mw.loader.profiler.
6108     * Use `mw.inspect('time')` from the browser console to display the data.
6109     *
6110     * @since 1.32
6111     */
6112    public const ResourceLoaderEnableJSProfiler = [
6113        'default' => false,
6114    ];
6115
6116    /**
6117     * Whether ResourceLoader should attempt to persist modules in localStorage on
6118     * browsers that support the Web Storage API.
6119     */
6120    public const ResourceLoaderStorageEnabled = [
6121        'default' => true,
6122    ];
6123
6124    /**
6125     * Cache version for client-side ResourceLoader module storage. You can trigger
6126     * invalidation of the contents of the module store by incrementing this value.
6127     *
6128     * @since 1.23
6129     */
6130    public const ResourceLoaderStorageVersion = [
6131        'default' => 1,
6132    ];
6133
6134    /**
6135     * Whether to include a SourceMap header in ResourceLoader responses
6136     * for JavaScript modules.
6137     *
6138     * @since 1.41
6139     */
6140    public const ResourceLoaderEnableSourceMapLinks = [
6141        'default' => true,
6142    ];
6143
6144    /**
6145     * Whether to allow site-wide CSS (MediaWiki:Common.css and friends) on
6146     * restricted pages like Special:UserLogin or Special:Preferences where
6147     * JavaScript is disabled for security reasons. As it is possible to
6148     * execute JavaScript through CSS, setting this to true opens up a
6149     * potential security hole. Some sites may "skin" their wiki by using
6150     * site-wide CSS, causing restricted pages to look unstyled and different
6151     * from the rest of the site.
6152     *
6153     * @since 1.25
6154     */
6155    public const AllowSiteCSSOnRestrictedPages = [
6156        'default' => false,
6157    ];
6158
6159    /**
6160     * Whether to use the development version of Vue.js. This should be disabled
6161     * for production installations. For development installations, enabling this
6162     * provides useful additional warnings and checks.
6163     *
6164     * Even when this is disabled, using ResourceLoader's debug mode (?debug=true)
6165     * will cause the development version to be loaded.
6166     *
6167     * @since 1.35
6168     */
6169    public const VueDevelopmentMode = [
6170        'default' => false,
6171    ];
6172
6173    /**
6174     * If this is set, MediaWiki will look for Codex files in this directory
6175     * instead of in resources/lib/codex/ and friends.
6176     *
6177     * To use a local development version of Codex, set this to the full file
6178     * path of the root directory of a local clone of the Codex repository, and
6179     * run `npm run build-all` in the Codex root directory. Rerun this command
6180     * after making any changes.
6181     *
6182     * This should be disabled for production installations.
6183     *
6184     * @since 1.43
6185     */
6186    public const CodexDevelopmentDir = [
6187        'default' => null,
6188    ];
6189
6190    // endregion -- End of ResourceLoader settings
6191
6192    /***************************************************************************/
6193    // region   Page titles and redirects
6194    /** @name   Page titles and redirects */
6195
6196    /**
6197     * Name of the project namespace. If left set to false, $wgSitename will be
6198     * used instead.
6199     */
6200    public const MetaNamespace = [
6201        'default' => false,
6202        'dynamicDefault' => [ 'use' => [ 'Sitename' ] ]
6203    ];
6204
6205    /**
6206     * @param mixed $sitename Value of Sitename
6207     * @return string
6208     */
6209    public static function getDefaultMetaNamespace( $sitename ): string {
6210        return str_replace( ' ', '_', $sitename );
6211    }
6212
6213    /**
6214     * Name of the project talk namespace.
6215     *
6216     * Normally you can ignore this and it will be something like
6217     * $wgMetaNamespace . "_talk". In some languages, you may want to set this
6218     * manually for grammatical reasons.
6219     */
6220    public const MetaNamespaceTalk = [
6221        'default' => false,
6222    ];
6223
6224    /**
6225     * Canonical namespace names.
6226     *
6227     * Must not be changed directly in configuration or by extensions, use $wgExtraNamespaces
6228     * instead.
6229     */
6230    public const CanonicalNamespaceNames = [
6231        'default' => NamespaceInfo::CANONICAL_NAMES,
6232        'type' => 'map',
6233    ];
6234
6235    /**
6236     * Additional namespaces. If the namespaces defined in Language.php and
6237     * Namespace.php are insufficient, you can create new ones here, for example,
6238     * to import Help files in other languages. You can also override the namespace
6239     * names of existing namespaces. Extensions should use the CanonicalNamespaces
6240     * hook or extension.json.
6241     *
6242     * @warning Once you delete a namespace, the pages in that namespace will
6243     * no longer be accessible. If you rename it, then you can access them through
6244     * the new namespace name.
6245     *
6246     * Custom namespaces should start at 100 to avoid conflicting with standard
6247     * namespaces, and should always follow the even/odd main/talk pattern.
6248     *
6249     * **Example:**
6250     *
6251     * ```
6252     * $wgExtraNamespaces = [
6253     *    100 => "Hilfe",
6254     *    101 => "Hilfe_Diskussion",
6255     *    102 => "Aide",
6256     *    103 => "Discussion_Aide"
6257     * ];
6258     * ```
6259     * @todo Add a note about maintenance/namespaceDupes.php
6260     */
6261    public const ExtraNamespaces = [
6262        'default' => [],
6263        'type' => 'map',
6264    ];
6265
6266    /**
6267     * Same as above, but for namespaces with gender distinction.
6268     *
6269     * Note: the default form for the namespace should also be set
6270     * using $wgExtraNamespaces for the same index.
6271     *
6272     * @since 1.18
6273     */
6274    public const ExtraGenderNamespaces = [
6275        'default' => [],
6276        'type' => 'map',
6277    ];
6278
6279    /**
6280     * Define extra namespace aliases.
6281     *
6282     * These are alternate names for the primary localised namespace names, which
6283     * are defined by $wgExtraNamespaces and the language file. If a page is
6284     * requested with such a prefix, the request will be redirected to the primary
6285     * name.
6286     *
6287     * Set this to a map from namespace names to IDs.
6288     *
6289     * **Example:**
6290     *
6291     * ```
6292     * $wgNamespaceAliases = [
6293     *     'Wikipedian' => NS_USER,
6294     *     'Help' => 100,
6295     * ];
6296     * ```
6297     *
6298     * @see \MediaWiki\Language\Language::getNamespaceAliases for accessing the full list of aliases,
6299     * including those defined by other means.
6300     */
6301    public const NamespaceAliases = [
6302        'default' => [],
6303        'type' => 'map',
6304    ];
6305
6306    /**
6307     * Allowed title characters -- regex character class
6308     * Don't change this unless you know what you're doing
6309     *
6310     * Problematic punctuation:
6311     *   -  []}|#     Are needed for link syntax, never enable these
6312     *   -  <>        Causes problems with HTML escaping, don't use
6313     *   -  %         Enabled by default, minor problems with path to query rewrite rules, see below
6314     *   -  +         Enabled by default, but doesn't work with path to query rewrite rules,
6315     *                corrupted by apache
6316     *   -  ?         Enabled by default, but doesn't work with path to PATH_INFO rewrites
6317     *
6318     * All three of these punctuation problems can be avoided by using an alias,
6319     * instead of a rewrite rule of either variety.
6320     *
6321     * The problem with % is that when using a path to query rewrite rule, URLs are
6322     * double-unescaped: once by Apache's path conversion code, and again by PHP. So
6323     * %253F, for example, becomes "?". Our code does not double-escape to compensate
6324     * for this, indeed double escaping would break if the double-escaped title was
6325     * passed in the query string rather than the path. This is a minor security issue
6326     * because articles can be created such that they are hard to view or edit.
6327     *
6328     * In some rare cases you may wish to remove + for compatibility with old links.
6329     * @deprecated since 1.41; use Extension:TitleBlacklist or (soon)
6330     * Extension:AbuseFilter to customize this set.
6331     */
6332    public const LegalTitleChars = [
6333        'default' => ' %!"$&\'()*,\\-.\\/0-9:;=?@A-Z\\\\^_`a-z~\\x80-\\xFF+',
6334        'deprecated' => 'since 1.41; use Extension:TitleBlacklist to customize',
6335    ];
6336
6337    /**
6338     * Set this to false to avoid forcing the first letter of links to capitals.
6339     *
6340     * @warning may break links! This makes links COMPLETELY case-sensitive. Links
6341     * appearing with a capital at the beginning of a sentence will *not* go to the
6342     * same place as links in the middle of a sentence using a lowercase initial.
6343     */
6344    public const CapitalLinks = [
6345        'default' => true,
6346    ];
6347
6348    /**
6349     * @since 1.16 - This can now be set per-namespace. Some special namespaces (such as Special,
6350     *     see NamespaceInfo::ALWAYS_CAPITALIZED_NAMESPACES for the full list) must be true by
6351     *     default (and setting them has no effect), due to various things that require them to be
6352     *     so. Also, since Talk namespaces need to directly mirror their associated content
6353     *     namespaces, the values for those are ignored in favor of the subject namespace's
6354     *     setting. Setting for NS_MEDIA is taken automatically from NS_FILE.
6355     *
6356     * **Example:**
6357     *
6358     * ```
6359     * $wgCapitalLinkOverrides[ NS_FILE ] = false;
6360     * ```
6361     */
6362    public const CapitalLinkOverrides = [
6363        'default' => [],
6364        'type' => 'map',
6365    ];
6366
6367    /**
6368     * Which namespaces should support subpages?
6369     * See Language.php for a list of namespaces.
6370     */
6371    public const NamespacesWithSubpages = [
6372        'default' => [
6373            NS_TALK => true,
6374            NS_USER => true,
6375            NS_USER_TALK => true,
6376            NS_PROJECT => true,
6377            NS_PROJECT_TALK => true,
6378            NS_FILE_TALK => true,
6379            NS_MEDIAWIKI => true,
6380            NS_MEDIAWIKI_TALK => true,
6381            NS_TEMPLATE => true,
6382            NS_TEMPLATE_TALK => true,
6383            NS_HELP => true,
6384            NS_HELP_TALK => true,
6385            NS_CATEGORY_TALK => true
6386        ],
6387        'type' => 'map',
6388    ];
6389
6390    /**
6391     * Array of namespaces which can be deemed to contain valid "content", as far
6392     * as the site statistics are concerned. Useful if additional namespaces also
6393     * contain "content" which should be considered when generating a count of the
6394     * number of articles in the wiki.
6395     */
6396    public const ContentNamespaces = [
6397        'default' => [ NS_MAIN ],
6398        'type' => 'list',
6399    ];
6400
6401    /**
6402     * Optional array of namespaces which should be excluded from Special:ShortPages.
6403     *
6404     * Only pages inside $wgContentNamespaces but not $wgShortPagesNamespaceExclusions will
6405     * be shown on that page.
6406     *
6407     * @since 1.37; previously $wgShortPagesNamespaceBlacklist
6408     */
6409    public const ShortPagesNamespaceExclusions = [
6410        'default' => [],
6411        'type' => 'list',
6412    ];
6413
6414    /**
6415     * Array of namespaces, in addition to the talk namespaces, where signatures
6416     * (~~~~) are likely to be used. This determines whether to display the
6417     * Signature button on the edit toolbar, and may also be used by extensions.
6418     *
6419     * For example, "traditional" style wikis, where content and discussion are
6420     * intermixed, could place NS_MAIN and NS_PROJECT namespaces in this array.
6421     */
6422    public const ExtraSignatureNamespaces = [
6423        'default' => [],
6424        'type' => 'list',
6425    ];
6426
6427    /**
6428     * Array of invalid page redirect targets.
6429     *
6430     * Attempting to create a redirect to any of the pages in this array
6431     * will make the redirect fail.
6432     * Userlogout is hard-coded, so it does not need to be listed here.
6433     * (T12569) Disallow Mypage and Mytalk as well.
6434     *
6435     * As of now, this only checks special pages. Redirects to pages in
6436     * other namespaces cannot be invalidated by this variable.
6437     */
6438    public const InvalidRedirectTargets = [
6439        'default' => [ 'Filepath', 'Mypage', 'Mytalk', 'Redirect', 'Mylog' ],
6440        'type' => 'list',
6441    ];
6442
6443    /**
6444     * Disable redirects to special pages and interwiki redirects, which use a 302
6445     * and have no "redirected from" link.
6446     *
6447     * @note This is only for articles with #REDIRECT in them. URL's containing a
6448     * local interwiki prefix (or a non-canonical special page name) are still hard
6449     * redirected regardless of this setting.
6450     */
6451    public const DisableHardRedirects = [
6452        'default' => false,
6453    ];
6454
6455    /**
6456     * Fix double redirects after a page move.
6457     *
6458     * Tends to conflict with page move vandalism, use only on a private wiki.
6459     */
6460    public const FixDoubleRedirects = [
6461        'default' => false,
6462    ];
6463
6464    // endregion -- End of title and interwiki settings
6465
6466    /***************************************************************************/
6467    // region   Interwiki links and sites
6468    /** @name   Interwiki links and sites */
6469
6470    /**
6471     * Array for local interwiki values, for each of the interwiki prefixes that point to
6472     * the current wiki.
6473     *
6474     * Note, recent changes feeds use only the first entry in this array. See $wgRCFeeds.
6475     */
6476    public const LocalInterwikis = [
6477        'default' => [],
6478        'type' => 'list',
6479    ];
6480
6481    /**
6482     * Expiry time for cache of interwiki table
6483     */
6484    public const InterwikiExpiry = [
6485        'default' => 10800,
6486    ];
6487
6488    /**
6489     * Interwiki cache as an associative array.
6490     *
6491     * When set, the InterwikiLookup service will not use the built-in `interwiki` database table,
6492     * but instead use this static array as its source.
6493     *
6494     * This cache data structure can be generated by the `dumpInterwiki.php` maintenance
6495     * script (which lives in the WikimediaMaintenance repository) and has key
6496     * formats such as the following:
6497     *
6498     *  - dbname:key - a simple key (e.g. enwiki:meta)
6499     *  - _sitename:key - site-scope key (e.g. wiktionary:meta)
6500     *  - __global:key - global-scope key (e.g. __global:meta)
6501     *  - __sites:dbname - site mapping (e.g. __sites:enwiki)
6502     *
6503     * Sites mapping just specifies site name, other keys provide "local url"
6504     * data layout.
6505     *
6506     * @see \MediaWiki\Interwiki\ClassicInterwikiLookup
6507     */
6508    public const InterwikiCache = [
6509        'default' => false,
6510        'type' => 'false|map',
6511        'mergeStrategy' => 'replace',
6512    ];
6513
6514    /**
6515     * Specify number of domains to check for messages.
6516     *
6517     * - 1: Just wiki(db)-level
6518     * - 2: wiki and global levels
6519     * - 3: site levels
6520     */
6521    public const InterwikiScopes = [
6522        'default' => 3,
6523    ];
6524
6525    /**
6526     * Fallback site, if unable to resolve from cache
6527     */
6528    public const InterwikiFallbackSite = [
6529        'default' => 'wiki',
6530    ];
6531
6532    /**
6533     * If local interwikis are set up which allow redirects,
6534     * set this regexp to restrict URLs which will be displayed
6535     * as 'redirected from' links.
6536     *
6537     * **Example:**
6538     * It might look something like this:
6539     *
6540     * ```
6541     * $wgRedirectSources = '!^https?://[a-z-]+\.wikipedia\.org/!';
6542     * ```
6543     *
6544     * Leave at false to avoid displaying any incoming redirect markers.
6545     * This does not affect intra-wiki redirects, which don't change
6546     * the URL.
6547     */
6548    public const RedirectSources = [
6549        'default' => false,
6550    ];
6551
6552    /**
6553     * Register handlers for specific types of sites.
6554     *
6555     * @since 1.21
6556     */
6557    public const SiteTypes = [
6558        'default' => [ 'mediawiki' => MediaWikiSite::class, ],
6559        'type' => 'map',
6560    ];
6561
6562    // endregion -- Interwiki links and sites
6563
6564    /***************************************************************************/
6565    // region   Parser settings
6566    /** @name   Parser settings
6567     *  These settings configure the transformation from wikitext to HTML.
6568     */
6569
6570    /**
6571     * Maximum indent level of toc.
6572     */
6573    public const MaxTocLevel = [
6574        'default' => 999,
6575    ];
6576
6577    /**
6578     * A complexity limit on template expansion: the maximum number of nodes visited
6579     * by PPFrame::expand()
6580     */
6581    public const MaxPPNodeCount = [
6582        'default' => 1_000_000,
6583    ];
6584
6585    /**
6586     * Maximum recursion depth for templates within templates.
6587     *
6588     * The current parser adds two levels to the PHP call stack for each template,
6589     * and xdebug limits the call stack to 256 by default. So this should hopefully
6590     * stop the parser before it hits the xdebug limit.
6591     */
6592    public const MaxTemplateDepth = [
6593        'default' => 100,
6594    ];
6595
6596    /**
6597     * @see self::MaxTemplateDepth
6598     */
6599    public const MaxPPExpandDepth = [
6600        'default' => 100,
6601    ];
6602
6603    /**
6604     * URL schemes that should be recognized as valid by UrlUtils::parse().
6605     *
6606     * WARNING: Do not add 'file:' to this or internal file links will be broken.
6607     * Instead, if you want to support file links, add 'file://'. The same applies
6608     * to any other protocols with the same name as a namespace. See task T46011 for
6609     * more information.
6610     *
6611     * @see \MediaWiki\Utils\UrlUtils::parse()
6612     */
6613    public const UrlProtocols = [
6614        'default' => [
6615            'bitcoin:', 'ftp://', 'ftps://', 'geo:', 'git://', 'gopher://', 'http://',
6616            'https://', 'irc://', 'ircs://', 'magnet:', 'mailto:', 'matrix:', 'mms://',
6617            'news:', 'nntp://', 'redis://', 'sftp://', 'sip:', 'sips:', 'sms:',
6618            'ssh://', 'svn://', 'tel:', 'telnet://', 'urn:', 'wikipedia://', 'worldwind://',
6619            'xmpp:', '//',
6620        ],
6621        'type' => 'list',
6622    ];
6623
6624    /**
6625     * If true, removes (by substituting) templates in signatures.
6626     */
6627    public const CleanSignatures = [
6628        'default' => true,
6629    ];
6630
6631    /**
6632     * Whether to allow inline image pointing to other websites
6633     */
6634    public const AllowExternalImages = [
6635        'default' => false,
6636    ];
6637
6638    /**
6639     * If the above is false, you can specify an exception here. Image URLs
6640     * that start with this string are then rendered, while all others are not.
6641     *
6642     * You can use this to set up a trusted, simple repository of images.
6643     * You may also specify an array of strings to allow multiple sites
6644     *
6645     * **Examples:**
6646     *
6647     * ```
6648     * $wgAllowExternalImagesFrom = 'http://127.0.0.1/';
6649     * $wgAllowExternalImagesFrom = [ 'http://127.0.0.1/', 'http://example.com' ];
6650     * ```
6651     */
6652    public const AllowExternalImagesFrom = [
6653        'default' => '',
6654    ];
6655
6656    /**
6657     * If $wgAllowExternalImages is false, you can allow an on-wiki
6658     * allow list of regular expression fragments to match the image URL
6659     * against. If the image matches one of the regular expression fragments,
6660     * the image will be displayed.
6661     *
6662     * Set this to true to enable the on-wiki allow list (MediaWiki:External image whitelist)
6663     * Or false to disable it
6664     *
6665     * @since 1.14
6666     */
6667    public const EnableImageWhitelist = [
6668        'default' => false,
6669    ];
6670
6671    /**
6672     * Configuration for HTML postprocessing tool. Set this to a configuration
6673     * array to enable an external tool. By default, we now use the RemexHtml
6674     * library; historically, other postprocessors were used.
6675     *
6676     * Setting this to null will use default settings.
6677     *
6678     * Keys include:
6679     *  - treeMutationTrace: a boolean to turn on Remex tracing
6680     *  - serializerTrace: a boolean to turn on Remex tracing
6681     *  - mungerTrace: a boolean to turn on Remex tracing
6682     *  - pwrap: whether <p> wrapping should be done (default true)
6683     *
6684     * See includes/tidy/RemexDriver.php for detail on configuration.
6685     *
6686     * Overriding the default configuration is strongly discouraged in
6687     * production.
6688     */
6689    public const TidyConfig = [
6690        'default' => [],
6691        'type' => 'map',
6692    ];
6693
6694    /**
6695     * Default Parsoid configuration.
6696     *
6697     * Overriding the default configuration is strongly discouraged in
6698     * production.
6699     *
6700     * @since 1.39
6701     */
6702    public const ParsoidSettings = [
6703        'default' => [
6704            'useSelser' => true,
6705        ],
6706        'type' => 'map',
6707    ];
6708
6709    /**
6710     * If set, Parsoid's HTML output for parser functions will be different
6711     * from Parsoid HTML spec 2.x.x and lets us experiment with a better
6712     * output that might be rolled out in a future 3.x Parsoid HTML version.
6713     * Parsoid will start generating this output for wikifunctions parser function
6714     * whenever that code is rolled out to production and will let us experiment
6715     * with this new format and tweak it now. This also lets Parsoid developers
6716     * experiment with it locally.
6717     *
6718     * This is an experimental flag and might be removed without notice.
6719     *
6720     * @unstable EXPERIMENTAL
6721     */
6722    public const ParsoidExperimentalParserFunctionOutput = [
6723        'default' => false,
6724        'type' => 'boolean',
6725    ];
6726
6727    /**
6728     * Disable shipping the styles for the legacy media HTML structure.
6729     * This is to give time for templates and extensions that mimic the
6730     * legacy output to be migrated away.
6731     *
6732     * @internal Temporary feature flag for T318433.
6733     * @since 1.41
6734     */
6735    public const UseLegacyMediaStyles = [
6736        'default' => false,
6737    ];
6738
6739    /**
6740     * Allow raw, unchecked HTML in "<html>...</html>" sections.
6741     *
6742     * THIS IS VERY DANGEROUS on a publicly editable site, so USE $wgGroupPermissions
6743     * TO RESTRICT EDITING to only those that you trust
6744     */
6745    public const RawHtml = [
6746        'default' => false,
6747    ];
6748
6749    /**
6750     * Set a default target for external links, e.g. _blank to pop up a new window.
6751     *
6752     * This will also set the "noreferrer" and "noopener" link rel to prevent the
6753     * attack described at https://mathiasbynens.github.io/rel-noopener/ .
6754     * Some older browsers may not support these link attributes, hence
6755     * setting $wgExternalLinkTarget to _blank may represent a security risk
6756     * to some of your users.
6757     */
6758    public const ExternalLinkTarget = [
6759        'default' => false,
6760    ];
6761
6762    /**
6763     * If true, external URL links in wiki text will be given the
6764     * rel="nofollow" attribute as a hint to search engines that
6765     * they should not be followed for ranking purposes as they
6766     * are user-supplied and thus subject to spamming.
6767     */
6768    public const NoFollowLinks = [
6769        'default' => true,
6770    ];
6771
6772    /**
6773     * Namespaces in which $wgNoFollowLinks doesn't apply.
6774     *
6775     * See Language.php for a list of namespaces.
6776     */
6777    public const NoFollowNsExceptions = [
6778        'default' => [],
6779        'type' => 'list',
6780    ];
6781
6782    /**
6783     * If this is set to an array of domains, external links to these domain names
6784     * (or any subdomains) will not be set to rel="nofollow" regardless of the
6785     * value of $wgNoFollowLinks.  For instance:
6786     *
6787     * $wgNoFollowDomainExceptions = [ 'en.wikipedia.org', 'wiktionary.org', 'mediawiki.org' ];
6788     *
6789     * This would add rel="nofollow" to links to de.wikipedia.org, but not
6790     * en.wikipedia.org, wiktionary.org, en.wiktionary.org, us.en.wikipedia.org,
6791     * etc.
6792     *
6793     * Defaults to mediawiki.org for the links included in the software by default.
6794     */
6795    public const NoFollowDomainExceptions = [
6796        'default' => [ 'mediawiki.org', ],
6797        'type' => 'list',
6798    ];
6799
6800    /**
6801     * By default MediaWiki does not register links pointing to same server in
6802     * externallinks dataset, use this value to override:
6803     */
6804    public const RegisterInternalExternals = [
6805        'default' => false,
6806    ];
6807
6808    /**
6809     * List of domains that will be ignored in being tracked into externallinks table.
6810     *
6811     * Subdomains will be also ignored. So 'wikipedia.org' means 'fa.wikipedia.org'
6812     * will be also ignored.
6813     */
6814    public const ExternalLinksIgnoreDomains = [
6815        'default' => [],
6816        'type' => 'array',
6817    ];
6818
6819    /**
6820     * Allow DISPLAYTITLE to change title display
6821     */
6822    public const AllowDisplayTitle = [
6823        'default' => true,
6824    ];
6825
6826    /**
6827     * For consistency, restrict DISPLAYTITLE to text that normalizes to the same
6828     * canonical DB key. Also disallow some inline CSS rules like display: none;
6829     * which can cause the text to be hidden or unselectable.
6830     */
6831    public const RestrictDisplayTitle = [
6832        'default' => true,
6833    ];
6834
6835    /**
6836     * Maximum number of calls per parse to expensive parser functions such as
6837     * PAGESINCATEGORY.
6838     */
6839    public const ExpensiveParserFunctionLimit = [
6840        'default' => 100,
6841    ];
6842
6843    /**
6844     * Preprocessor caching threshold
6845     * Setting it to 'false' will disable the preprocessor cache.
6846     */
6847    public const PreprocessorCacheThreshold = [
6848        'default' => 1000,
6849    ];
6850
6851    /**
6852     * Enable interwiki transcluding.  Only when iw_trans=1 in the interwiki table.
6853     */
6854    public const EnableScaryTranscluding = [
6855        'default' => false,
6856    ];
6857
6858    /**
6859     * Expiry time for transcluded templates cached in object cache.
6860     *
6861     * Only used $wgEnableInterwikiTranscluding is set to true.
6862     */
6863    public const TranscludeCacheExpiry = [
6864        'default' => 3600,
6865    ];
6866
6867    /**
6868     * Enable the magic links feature of automatically turning ISBN xxx,
6869     * PMID xxx, RFC xxx into links
6870     *
6871     * @since 1.28
6872     */
6873    public const EnableMagicLinks = [
6874        'default' => [
6875            'ISBN' => false,
6876            'PMID' => false,
6877            'RFC' => false,
6878        ],
6879        'type' => 'map',
6880    ];
6881
6882    /**
6883     * Set this to true to allow the {{USERLANGUAGE}} magic word to return the
6884     * actual user language. If it is false, {{USERLANGUAGE}} will return the
6885     * page language. Setting this to true is discouraged since the page
6886     * language should typically be used in the content area. Accessing the user
6887     * language using this feature reduces the efficiency of the parser cache.
6888     *
6889     * @since 1.43
6890     */
6891    public const ParserEnableUserLanguage = [
6892        'default' => false,
6893    ];
6894
6895    // endregion -- end of parser settings
6896
6897    /***************************************************************************/
6898    // region   Statistics and content analysis
6899    /** @name   Statistics and content analysis */
6900
6901    /**
6902     * Method used to determine if a page in a content namespace should be counted
6903     * as a valid article.
6904     *
6905     * Redirect pages will never be counted as valid articles.
6906     *
6907     * This variable can have the following values:
6908     * - 'any': all pages as considered as valid articles
6909     * - 'link': the page must contain a [[wiki link]] to be considered valid
6910     *
6911     * See also See https://www.mediawiki.org/wiki/Manual:Article_count
6912     *
6913     * Retroactively changing this variable will not affect the existing count,
6914     * to update it, you will need to run the maintenance/updateArticleCount.php
6915     * script.
6916     */
6917    public const ArticleCountMethod = [
6918        'default' => 'link',
6919    ];
6920
6921    /**
6922     * How many days user must be idle before they are considered inactive. Will affect
6923     * the number shown on Special:Statistics, Special:ActiveUsers, and the
6924     * {{NUMBEROFACTIVEUSERS}} magic word in wikitext.
6925     *
6926     * You might want to leave this as the default value, to provide comparable
6927     * numbers between different wikis.
6928     */
6929    public const ActiveUserDays = [
6930        'default' => 30,
6931    ];
6932
6933    /**
6934     * The following variables define 3 user experience levels:
6935     *
6936     * - newcomer: has not yet reached the 'learner' level
6937     *
6938     * - learner: has at least $wgLearnerEdits and has been
6939     *            a member for $wgLearnerMemberSince days
6940     *            but has not yet reached the 'experienced' level.
6941     *
6942     * - experienced: has at least $wgExperiencedUserEdits edits and
6943     *                has been a member for $wgExperiencedUserMemberSince days.
6944     */
6945    public const LearnerEdits = [
6946        'default' => 10,
6947    ];
6948
6949    /**
6950     * Number of days the user must exist before becoming a learner.
6951     *
6952     * @see self::LearnerEdits
6953     */
6954    public const LearnerMemberSince = [
6955        'default' => 4,
6956    ];
6957
6958    /**
6959     * Number of edits the user must have before becoming "experienced".
6960     *
6961     * @see self::LearnerEdits
6962     */
6963    public const ExperiencedUserEdits = [
6964        'default' => 500,
6965    ];
6966
6967    /**
6968     * Number of days the user must exist before becoming "experienced".
6969     *
6970     * @see self::LearnerEdits
6971     */
6972    public const ExperiencedUserMemberSince = [
6973        'default' => 30,
6974    ];
6975
6976    /**
6977     * Maximum number of revisions of a page that will be checked against every new edit
6978     * made to determine whether the edit was a manual revert.
6979     *
6980     * Computational time required increases roughly linearly with this configuration
6981     * variable.
6982     *
6983     * Larger values will let you detect very deep reverts, but at the same time can give
6984     * unexpected results (such as marking large amounts of edits as reverts) and may slow
6985     * down the wiki slightly when saving new edits.
6986     *
6987     * Setting this to 0 will disable the manual revert detection feature entirely.
6988     *
6989     * See this document for a discussion on this topic:
6990     * https://meta.wikimedia.org/wiki/Research:Revert
6991     *
6992     * @since 1.36
6993     */
6994    public const ManualRevertSearchRadius = [
6995        'default' => 15,
6996        'type' => 'integer',
6997    ];
6998
6999    /**
7000     * Maximum depth (revision count) of reverts that will have their reverted edits marked
7001     * with the mw-reverted change tag. Reverts deeper than that will not have any edits
7002     * marked as reverted at all.
7003     *
7004     * Large values can lead to lots of revisions being marked as "reverted", which may appear
7005     * confusing to users.
7006     *
7007     * Setting this to 0 will disable the reverted tag entirely.
7008     *
7009     * @since 1.36
7010     */
7011    public const RevertedTagMaxDepth = [
7012        'default' => 15,
7013        'type' => 'integer',
7014    ];
7015
7016    // endregion -- End of statistics and content analysis
7017
7018    /***************************************************************************/
7019    // region   User accounts, authentication
7020    /** @name   User accounts, authentication */
7021
7022    /**
7023     * Central ID lookup providers
7024     * Key is the provider ID, value is a specification for ObjectFactory
7025     *
7026     * @since 1.27
7027     */
7028    public const CentralIdLookupProviders = [
7029        'default' => [
7030            'local' => [
7031                'class' => LocalIdLookup::class,
7032                'services' => [
7033                    'MainConfig',
7034                    'DBLoadBalancerFactory',
7035                    'HideUserUtils',
7036                ]
7037            ]
7038        ],
7039        'type' => 'map',
7040    ];
7041
7042    /**
7043     * Central ID lookup provider to use by default
7044     */
7045    public const CentralIdLookupProvider = [
7046        'default' => 'local',
7047        'type' => 'string',
7048    ];
7049
7050    /**
7051     * User registration timestamp provider classes
7052     * @since 1.41
7053     */
7054    public const UserRegistrationProviders = [
7055        'default' => [
7056            LocalUserRegistrationProvider::TYPE => [
7057                'class' => LocalUserRegistrationProvider::class,
7058                'services' => [
7059                    'ConnectionProvider',
7060                ],
7061            ],
7062        ],
7063        'type' => 'map',
7064    ];
7065
7066    /**
7067     * Password policy for the wiki.
7068     *
7069     * Structured as
7070     * ```
7071     * [
7072     *     'policies' => [ <group> => [ <policy> => <settings>, ... ], ... ],
7073     *     'checks' => [ <policy> => <callback>, ... ],
7074     * ]
7075     * ```
7076     * where <group> is a user group, <policy> is a password policy name
7077     * (arbitrary string) defined in the 'checks' part, <callback> is the
7078     * PHP callable implementing the policy check, <settings> is an array
7079     * of options with the following keys:
7080     * - value: (number, boolean or null) the value to pass to the callback
7081     * - forceChange: (boolean, default false) if the password is invalid, do
7082     *   not let the user log in without changing the password
7083     * - suggestChangeOnLogin: (boolean, default false) if true and the password is
7084     *   invalid, suggest a password change if logging in. If all the failing policies
7085     *   that apply to the user have this set to false, the password change
7086     *   screen will not be shown. 'forceChange' takes precedence over
7087     *   'suggestChangeOnLogin' if they are both present.
7088     * As a shorthand for [ 'value' => <value> ], simply <value> can be written.
7089     * When multiple password policies are defined for a user, the settings
7090     * arrays are merged, and for fields which are set in both arrays, the
7091     * larger value (as understood by PHP's 'max' method) is taken.
7092     *
7093     * A user's effective policy is the superset of all policy statements
7094     * from the policies for the groups where the user is a member. If more
7095     * than one group policy include the same policy statement, the value is
7096     * the max() of the values. Note true > false. The 'default' policy group
7097     * is required, and serves as the minimum policy for all users.
7098     *
7099     * Callbacks receive three arguments: the policy value, the User object
7100     * and the password; and must return a StatusValue. A non-good status
7101     * means the password will not be accepted for new accounts, and existing
7102     * accounts will be prompted for password change or barred from logging in
7103     * (depending on whether the status is a fatal or merely error/warning).
7104     *
7105     * The checks supported by core are:
7106     * - MinimalPasswordLength - Minimum length a user can set.
7107     * - MinimumPasswordLengthToLogin - Passwords shorter than this will
7108     *    not be allowed to login, or offered a chance to reset their password
7109     *    as part of the login workflow, regardless if it is correct.
7110     * - MaximalPasswordLength - maximum length password a user is allowed
7111     *    to attempt. Prevents DoS attacks with pbkdf2.
7112     * - PasswordCannotBeSubstringInUsername - Password cannot be a substring
7113     *    (contained within) the username.
7114     * - PasswordCannotMatchDefaults - Username/password combination cannot
7115     *    match a list of default passwords used by MediaWiki in the past.
7116     * - PasswordNotInCommonList - Password not in best practices list of
7117     *    100,000 commonly used passwords. Due to the size of the list this
7118     *    is a probabilistic test.
7119     *
7120     * If you add custom checks, for Special:PasswordPolicies to display them correctly,
7121     * every check should have a corresponding passwordpolicies-policy-<check> message,
7122     * and every settings field other than 'value' should have a corresponding
7123     * passwordpolicies-policyflag-<flag> message (<check> and <flag> are in lowercase).
7124     * The check message receives the policy value as a parameter.
7125     *
7126     * @since 1.26
7127     * @see \MediaWiki\Password\PasswordPolicyChecks
7128     * @see \MediaWiki\User\User::checkPasswordValidity()
7129     */
7130    public const PasswordPolicy = [
7131        'default' => [
7132            'policies' => [
7133                'bureaucrat' => [
7134                    'MinimalPasswordLength' => 10,
7135                    'MinimumPasswordLengthToLogin' => 1,
7136                ],
7137                'sysop' => [
7138                    'MinimalPasswordLength' => 10,
7139                    'MinimumPasswordLengthToLogin' => 1,
7140                ],
7141                'interface-admin' => [
7142                    'MinimalPasswordLength' => 10,
7143                    'MinimumPasswordLengthToLogin' => 1,
7144                ],
7145                'bot' => [
7146                    'MinimalPasswordLength' => 10,
7147                    'MinimumPasswordLengthToLogin' => 1,
7148                ],
7149                'default' => [
7150                    'MinimalPasswordLength' => [ 'value' => 8, 'suggestChangeOnLogin' => true ],
7151                    'PasswordCannotBeSubstringInUsername' => [
7152                        'value' => true,
7153                        'suggestChangeOnLogin' => true
7154                    ],
7155                    'PasswordCannotMatchDefaults' => [ 'value' => true, 'suggestChangeOnLogin' => true ],
7156                    'MaximalPasswordLength' => [ 'value' => 4096, 'suggestChangeOnLogin' => true ],
7157                    'PasswordNotInCommonList' => [ 'value' => true, 'suggestChangeOnLogin' => true ],
7158                ],
7159            ],
7160            'checks' => [
7161                'MinimalPasswordLength' => [ PasswordPolicyChecks::class, 'checkMinimalPasswordLength' ],
7162                'MinimumPasswordLengthToLogin' => [ PasswordPolicyChecks::class, 'checkMinimumPasswordLengthToLogin' ],
7163                'PasswordCannotBeSubstringInUsername' => [ PasswordPolicyChecks::class, 'checkPasswordCannotBeSubstringInUsername' ],
7164                'PasswordCannotMatchDefaults' => [ PasswordPolicyChecks::class, 'checkPasswordCannotMatchDefaults' ],
7165                'MaximalPasswordLength' => [ PasswordPolicyChecks::class, 'checkMaximalPasswordLength' ],
7166                'PasswordNotInCommonList' => [ PasswordPolicyChecks::class, 'checkPasswordNotInCommonList' ],
7167            ],
7168        ],
7169        'type' => 'map',
7170        'mergeStrategy' => 'array_replace_recursive',
7171    ];
7172
7173    /**
7174     * Configure AuthManager
7175     *
7176     * All providers are constructed using ObjectFactory, see that for the general
7177     * structure. The array may also contain a key "sort" used to order providers:
7178     * providers are stably sorted by this value, which should be an integer
7179     * (default is 0).
7180     *
7181     * Elements are:
7182     * - preauth: Array (keys ignored) of specifications for PreAuthenticationProviders
7183     * - primaryauth: Array (keys ignored) of specifications for PrimaryAuthenticationProviders
7184     * - secondaryauth: Array (keys ignored) of specifications for SecondaryAuthenticationProviders
7185     *
7186     * @since 1.27
7187     * @note If this is null or empty, the value from $wgAuthManagerAutoConfig is
7188     * used instead. Local customization should generally set this variable from
7189     * scratch to the desired configuration. Extensions that want to
7190     * auto-configure themselves should use $wgAuthManagerAutoConfig instead.
7191     */
7192    public const AuthManagerConfig = [
7193        'default' => null,
7194        'type' => '?map',
7195    ];
7196
7197    /**
7198     * @see self::AuthManagerConfig
7199     * @since 1.27
7200     */
7201    public const AuthManagerAutoConfig = [
7202        'default' => [
7203            'preauth' => [
7204                ThrottlePreAuthenticationProvider::class => [
7205                    'class' => ThrottlePreAuthenticationProvider::class,
7206                    'sort' => 0,
7207                ],
7208            ],
7209            'primaryauth' => [
7210                // TemporaryPasswordPrimaryAuthenticationProvider should come before
7211                // any other PasswordAuthenticationRequest-based
7212                // PrimaryAuthenticationProvider (or at least any that might return
7213                // FAIL rather than ABSTAIN for a wrong password), or password reset
7214                // won't work right. Do not remove this (or change the key) or
7215                // auto-configuration of other such providers in extensions will
7216                // probably auto-insert themselves in the wrong place.
7217                TemporaryPasswordPrimaryAuthenticationProvider::class => [
7218                    'class' => TemporaryPasswordPrimaryAuthenticationProvider::class,
7219                    'services' => [
7220                        'DBLoadBalancerFactory',
7221                        'UserOptionsLookup',
7222                    ],
7223                    'args' => [ [
7224                        // Fall through to LocalPasswordPrimaryAuthenticationProvider
7225                        'authoritative' => false,
7226                    ] ],
7227                    'sort' => 0,
7228                ],
7229                LocalPasswordPrimaryAuthenticationProvider::class => [
7230                    'class' => LocalPasswordPrimaryAuthenticationProvider::class,
7231                    'services' => [
7232                        'DBLoadBalancerFactory',
7233                    ],
7234                    'args' => [ [
7235                        // Last one should be authoritative, or else the user will get
7236                        // a less-than-helpful error message (something like "supplied
7237                        // authentication info not supported" rather than "wrong
7238                        // password") if it too fails.
7239                        'authoritative' => true,
7240                    ] ],
7241                    'sort' => 100,
7242                ],
7243            ],
7244            'secondaryauth' => [
7245                CheckBlocksSecondaryAuthenticationProvider::class => [
7246                    'class' => CheckBlocksSecondaryAuthenticationProvider::class,
7247                    'sort' => 0,
7248                ],
7249                ResetPasswordSecondaryAuthenticationProvider::class => [
7250                    'class' => ResetPasswordSecondaryAuthenticationProvider::class,
7251                    'sort' => 100,
7252                ],
7253                // Linking during login is experimental, enable at your own risk - T134952
7254                // MediaWiki\Auth\ConfirmLinkSecondaryAuthenticationProvider::class => [
7255                //   'class' => MediaWiki\Auth\ConfirmLinkSecondaryAuthenticationProvider::class,
7256                //   'sort' => 100,
7257                // ],
7258                EmailNotificationSecondaryAuthenticationProvider::class => [
7259                    'class' => EmailNotificationSecondaryAuthenticationProvider::class,
7260                    'services' => [
7261                        'DBLoadBalancerFactory',
7262                    ],
7263                    'sort' => 200,
7264                ],
7265            ],
7266        ],
7267        'type' => 'map',
7268        'mergeStrategy' => 'array_plus_2d',
7269    ];
7270
7271    /**
7272     * Configures RememberMe authentication request added by AuthManager. It can show a "remember
7273     * me" checkbox that, when checked, will cause it to take more time for the authenticated
7274     * session to expire. It can also be configured to always or to never extend the authentication
7275     * session.
7276     *
7277     * Valid values are listed in RememberMeAuthenticationRequest::ALLOWED_FLAGS.
7278     *
7279     * @since 1.36
7280     */
7281    public const RememberMe = [
7282        'default' => 'choose',
7283        'type' => 'string',
7284    ];
7285
7286    /**
7287     * Time frame for re-authentication.
7288     *
7289     * With only password-based authentication, you'd just ask the user to re-enter
7290     * their password to verify certain operations like changing the password or
7291     * changing the account's email address. But under AuthManager, the user might
7292     * not have a password (you might even have to redirect the browser to a
7293     * third-party service or something complex like that), you might want to have
7294     * both factors of a two-factor authentication, and so on. So, the options are:
7295     * - Incorporate the whole multi-step authentication flow within everything
7296     *   that needs to do this.
7297     * - Consider it good if they used Special:UserLogin during this session within
7298     *   the last X seconds.
7299     * - Come up with a third option.
7300     *
7301     * MediaWiki currently takes the second option. This setting configures the
7302     * "X seconds".
7303     *
7304     * This allows for configuring different time frames for different
7305     * "operations". The operations used in MediaWiki core include:
7306     * - LinkAccounts
7307     * - UnlinkAccount
7308     * - ChangeCredentials
7309     * - RemoveCredentials
7310     * - ChangeEmail
7311     *
7312     * Additional operations may be used by extensions, either explicitly by
7313     * calling AuthManager::securitySensitiveOperationStatus(),
7314     * ApiAuthManagerHelper::securitySensitiveOperation() or
7315     * SpecialPage::checkLoginSecurityLevel(), or implicitly by overriding
7316     * SpecialPage::getLoginSecurityLevel() or by subclassing
7317     * AuthManagerSpecialPage.
7318     *
7319     * The key 'default' is used if a requested operation isn't defined in the array.
7320     *
7321     * @since 1.27
7322     */
7323    public const ReauthenticateTime = [
7324        'default' => [ 'default' => 3600, ],
7325        'type' => 'map',
7326        'additionalProperties' => [ 'type' => 'integer', ],
7327    ];
7328
7329    /**
7330     * Whether to allow security-sensitive operations when re-authentication is not possible.
7331     *
7332     * If AuthManager::canAuthenticateNow() is false (e.g. the current
7333     * SessionProvider is not able to change users, such as when OAuth is in use),
7334     * AuthManager::securitySensitiveOperationStatus() cannot sensibly return
7335     * SEC_REAUTH. Setting an operation true here will have it return SEC_OK in
7336     * that case, while setting it false will have it return SEC_FAIL.
7337     *
7338     * The key 'default' is used if a requested operation isn't defined in the array.
7339     *
7340     * @since 1.27
7341     * @see self::ReauthenticateTime
7342     */
7343    public const AllowSecuritySensitiveOperationIfCannotReauthenticate = [
7344        'default' => [ 'default' => true, ],
7345        'type' => 'map',
7346        'additionalProperties' => [ 'type' => 'boolean', ],
7347    ];
7348
7349    /**
7350     * List of AuthenticationRequest class names which are not changeable through
7351     * Special:ChangeCredentials and the changeauthenticationdata API.
7352     *
7353     * This is only enforced on the client level; AuthManager itself (e.g.
7354     * AuthManager::allowsAuthenticationDataChange calls) is not affected.
7355     * Class names are checked for exact match (not for subclasses).
7356     *
7357     * @since 1.27
7358     */
7359    public const ChangeCredentialsBlacklist = [
7360        'default' => [
7361            TemporaryPasswordAuthenticationRequest::class,
7362        ],
7363        'type' => 'list',
7364        'items' => [ 'type' => 'string', ],
7365    ];
7366
7367    /**
7368     * List of AuthenticationRequest class names which are not removable through
7369     * Special:RemoveCredentials and the removeauthenticationdata API.
7370     *
7371     * This is only enforced on the client level; AuthManager itself (e.g.
7372     * AuthManager::allowsAuthenticationDataChange calls) is not affected.
7373     * Class names are checked for exact match (not for subclasses).
7374     *
7375     * @since 1.27
7376     */
7377    public const RemoveCredentialsBlacklist = [
7378        'default' => [
7379            PasswordAuthenticationRequest::class,
7380        ],
7381        'type' => 'list',
7382        'items' => [ 'type' => 'string', ],
7383    ];
7384
7385    /**
7386     * Specifies if users should be sent to a password-reset form on login, if their
7387     * password doesn't meet the requirements of User::isValidPassword().
7388     *
7389     * @since 1.23
7390     */
7391    public const InvalidPasswordReset = [
7392        'default' => true,
7393    ];
7394
7395    /**
7396     * Default password type to use when hashing user passwords.
7397     *
7398     * Must be set to a type defined in $wgPasswordConfig, or a type that
7399     * is registered by default in PasswordFactory.php.
7400     *
7401     * @since 1.24
7402     */
7403    public const PasswordDefault = [
7404        'default' => 'pbkdf2',
7405    ];
7406
7407    /**
7408     * Configuration for built-in password types.
7409     *
7410     * Maps the password type to an array of options:
7411     *
7412     * - class: The Password class to use.
7413     * - factory (since 1.40): A function that creates and returns a suitable Password object.
7414     *   This option is intended only for internal use; the function signature is unstable and
7415     *   subject to change in future versions.
7416     *
7417     * All other options are class-dependent.
7418     *
7419     * An advanced example:
7420     *
7421     * ```
7422     * $wgPasswordConfig['bcrypt-peppered'] = [
7423     *     'class' => EncryptedPassword::class,
7424     *     'underlying' => 'bcrypt',
7425     *     'secrets' => [
7426     *         hash( 'sha256', 'secret', true ),
7427     *     ],
7428     *     'cipher' => 'aes-256-cbc',
7429     * ];
7430     * ```
7431     *
7432     * @since 1.24
7433     */
7434    public const PasswordConfig = [
7435        'default' => [
7436            'A' => [
7437                'class' => MWOldPassword::class,
7438            ],
7439            'B' => [
7440                'class' => MWSaltedPassword::class,
7441            ],
7442            'pbkdf2-legacyA' => [
7443                'class' => LayeredParameterizedPassword::class,
7444                'types' => [
7445                    'A',
7446                    'pbkdf2',
7447                ],
7448            ],
7449            'pbkdf2-legacyB' => [
7450                'class' => LayeredParameterizedPassword::class,
7451                'types' => [
7452                    'B',
7453                    'pbkdf2',
7454                ],
7455            ],
7456            'bcrypt' => [
7457                'class' => BcryptPassword::class,
7458                'cost' => 9,
7459            ],
7460            'pbkdf2' => [
7461                'class' => Pbkdf2PasswordUsingOpenSSL::class,
7462                'algo' => 'sha512',
7463                'cost' => '30000',
7464                'length' => '64',
7465            ],
7466            'argon2' => [
7467                'class' => Argon2Password::class,
7468
7469                // Algorithm used:
7470                // * 'argon2i' is optimized against side-channel attacks
7471                // * 'argon2id' is optimized against both side-channel and GPU cracking
7472                // * 'auto' to use the best available algorithm. If you're using more than one server, be
7473                //   careful when you're mixing PHP versions because newer PHP might generate hashes that
7474                //   older versions would not understand.
7475                'algo' => 'auto',
7476
7477                // The parameters below are the same as options accepted by password_hash().
7478                // Set them to override that function's defaults.
7479                //
7480                // 'memory_cost' => PASSWORD_ARGON2_DEFAULT_MEMORY_COST,
7481                // 'time_cost' => PASSWORD_ARGON2_DEFAULT_TIME_COST,
7482                // 'threads' => PASSWORD_ARGON2_DEFAULT_THREADS,
7483            ],
7484        ],
7485        'type' => 'map',
7486    ];
7487
7488    /**
7489     * Whether to allow password resets ("enter some identifying data, and we'll send an email
7490     * with a temporary password you can use to get back into the account") identified by
7491     * various bits of data.  Setting all of these to false (or the whole variable to false)
7492     * has the effect of disabling password resets entirely
7493     */
7494    public const PasswordResetRoutes = [
7495        'default' => [
7496            'username' => true,
7497            'email' => true,
7498        ],
7499        'type' => 'map',
7500    ];
7501
7502    /**
7503     * Maximum number of Unicode characters in signature
7504     */
7505    public const MaxSigChars = [
7506        'default' => 255,
7507    ];
7508
7509    /**
7510     * Behavior of signature validation. Allowed values are:
7511     *  - 'warning' - invalid signatures cause a warning to be displayed on the preferences page,
7512     * but they are still used when signing comments; new invalid signatures can still be saved as
7513     * normal
7514     *  - 'new' - existing invalid signatures behave as above; new invalid signatures can't be
7515     * saved
7516     *  - 'disallow' - existing invalid signatures are no longer used when signing comments; new
7517     * invalid signatures can't be saved
7518     *
7519     * @since 1.35
7520     */
7521    public const SignatureValidation = [
7522        'default' => 'warning',
7523    ];
7524
7525    /**
7526     * List of lint error codes which don't cause signature validation to fail.
7527     *
7528     * @see https://www.mediawiki.org/wiki/Help:Lint_errors
7529     * @since 1.35
7530     */
7531    public const SignatureAllowedLintErrors = [
7532        'default' => [ 'obsolete-tag', ],
7533        'type' => 'list',
7534    ];
7535
7536    /**
7537     * Maximum number of bytes in username. You want to run the maintenance
7538     * script ./maintenance/checkUsernames.php once you have changed this value.
7539     */
7540    public const MaxNameChars = [
7541        'default' => 255,
7542    ];
7543
7544    /**
7545     * Array of usernames which may not be registered or logged in from
7546     * Maintenance scripts can still use these
7547     *
7548     * @see \MediaWiki\User\User::MAINTENANCE_SCRIPT_USER
7549     */
7550    public const ReservedUsernames = [
7551        'default' => [
7552            'MediaWiki default', // Default 'Main Page' and MediaWiki: message pages
7553            'Conversion script', // Used for the old Wikipedia software upgrade
7554            'Maintenance script', // Maintenance scripts which perform editing, image import script
7555            'Template namespace initialisation script', // Used in 1.2->1.3 upgrade
7556            'ScriptImporter', // Default user name used by maintenance/importSiteScripts.php
7557            'Delete page script', // Default user name used by maintenance/deleteBatch.php
7558            'Move page script', // Default user name used by maintenance/deleteBatch.php
7559            'Command line script', // Default user name used by maintenance/undelete.php
7560            'Unknown user', // Used in WikiImporter & RevisionStore for revisions with no author and in User for invalid user id
7561            'msg:double-redirect-fixer', // Automatic double redirect fix
7562            'msg:usermessage-editor', // Default user for leaving user messages
7563            'msg:proxyblocker', // For $wgProxyList and Special:Blockme (removed in 1.22)
7564            'msg:sorbs', // For $wgEnableDnsBlacklist etc.
7565            'msg:spambot_username', // Used by cleanupSpam.php
7566            'msg:autochange-username', // Used by anon category RC entries (removed in 1.44)
7567        ],
7568        'type' => 'list',
7569    ];
7570
7571    /**
7572     * Settings added to this array will override the default globals for the user
7573     * preferences used by anonymous visitors and newly created accounts.
7574     *
7575     * For instance, to disable editing on double clicks:
7576     * $wgDefaultUserOptions ['editondblclick'] = 0;
7577     *
7578     * To save storage space, no user_properties row will be stored for users with the
7579     * default setting for a given option, even if the user manually selects that option.
7580     * This means that a change to the defaults will change the setting for all users who
7581     * have been using the default setting; there is no way for users to opt out of this.
7582     * $wgConditionalUserOptions can be used to change the default value for future users
7583     * only.
7584     *
7585     * @see self::ConditionalUserOptions
7586     */
7587    public const DefaultUserOptions = [
7588        'default' =>
7589            // This array should be sorted by key
7590            [
7591                'ccmeonemails' => 0,
7592                'date' => 'default',
7593                'diffonly' => 0,
7594                'diff-type' => 'table',
7595                'disablemail' => 0,
7596                'editfont' => 'monospace',
7597                'editondblclick' => 0,
7598                'editrecovery' => 0,
7599                'editsectiononrightclick' => 0,
7600                'email-allow-new-users' => 1,
7601                'enotifminoredits' => 0,
7602                'enotifrevealaddr' => 0,
7603                'enotifusertalkpages' => 1,
7604                'enotifwatchlistpages' => 1,
7605                'extendwatchlist' => 1,
7606                'fancysig' => 0,
7607                'forceeditsummary' => 0,
7608                'forcesafemode' => 0,
7609                'gender' => 'unknown',
7610                'hidecategorization' => 1,
7611                'hideminor' => 0,
7612                'hidepatrolled' => 0,
7613                'imagesize' => 2,
7614                'minordefault' => 0,
7615                'newpageshidepatrolled' => 0,
7616                'nickname' => '',
7617                'norollbackdiff' => 0,
7618                'prefershttps' => 1,
7619                'previewonfirst' => 0,
7620                'previewontop' => 1,
7621                'pst-cssjs' => 1,
7622                'rcdays' => 7,
7623                'rcenhancedfilters-disable' => 0,
7624                'rclimit' => 50,
7625                'requireemail' => 0,
7626                'search-match-redirect' => true,
7627                'search-special-page' => 'Search',
7628                'search-thumbnail-extra-namespaces' => true,
7629                'searchlimit' => 20,
7630                'showhiddencats' => 0,
7631                'shownumberswatching' => 1,
7632                'showrollbackconfirmation' => 0,
7633                'skin' => false,
7634                'skin-responsive' => 1,
7635                'thumbsize' => 5,
7636                'underline' => 2,
7637                'useeditwarning' => 1,
7638                'uselivepreview' => 0,
7639                'usenewrc' => 1,
7640                'watchcreations' => 1,
7641                'watchcreations-expiry' => 'infinite',
7642                'watchdefault' => 1,
7643                'watchdefault-expiry' => 'infinite',
7644                'watchdeletion' => 0,
7645                'watchlistdays' => 7,
7646                'watchlisthideanons' => 0,
7647                'watchlisthidebots' => 0,
7648                'watchlisthidecategorization' => 1,
7649                'watchlisthideliu' => 0,
7650                'watchlisthideminor' => 0,
7651                'watchlisthideown' => 0,
7652                'watchlisthidepatrolled' => 0,
7653                'watchlistreloadautomatically' => 0,
7654                'watchlistunwatchlinks' => 0,
7655                'watchmoves' => 0,
7656                'watchrollback' => 0,
7657                'watchuploads' => 1,
7658                'watchrollback-expiry' => 'infinite',
7659                'watchstar-expiry' => 'infinite',
7660                'wlenhancedfilters-disable' => 0,
7661                'wllimit' => 250,
7662            ],
7663        'type' => 'map',
7664    ];
7665
7666    /**
7667     * Conditional defaults for user options
7668     *
7669     * Map of user options to conditional defaults descriptors, which is an array
7670     * of conditional cases [ VALUE, CONDITION1, CONDITION2, ... ], where VALUE is the default value for
7671     * all users that meet ALL conditions, and each CONDITION is either a:
7672     *     (a) a CUDCOND_* constant (when condition does not take any arguments), or
7673     *     (b) an array [ CUDCOND_*, argument1, argument1, ... ] (when chosen condition takes at
7674     *         least one argument).
7675     *
7676     * When `null` is used as the VALUE, it is interpreted as "no conditional default for this
7677     * condition". In other words, `null` and $wgDefaultUserOptions['user-option'] can be used
7678     * interchangeably as the VALUE.
7679     *
7680     * All conditions are evaluated in order. When no condition matches.
7681     * $wgDefaultUserOptions is used instead.
7682     *
7683     * Example of valid configuration:
7684     *   $wgConditionalUserOptions['user-option'] = [
7685     *       [ 'registered in 2024', [ CUDCOND_AFTER, '20240101000000' ] ]
7686     *   ];
7687     *
7688     * List of valid conditions:
7689     *   * CUDCOND_AFTER: user registered after given timestamp (args: string $timestamp)
7690     *   * CUDCOND_ANON: allows specifying a default for anonymous (logged-out, non-temporary) users
7691     *   * CUDCOND_NAMED: allows specifying a default for named (registered, non-temporary) users
7692     *   * CUDCOND_USERGROUP: users with a specific user group
7693     *
7694     * @since 1.42
7695     * @see self::DefaultUserOptions
7696     */
7697    public const ConditionalUserOptions = [
7698        'default' => [],
7699        'type' => 'map',
7700    ];
7701
7702    /**
7703     * An array of preferences to not show for the user
7704     */
7705    public const HiddenPrefs = [
7706        'default' => [],
7707        'type' => 'list',
7708    ];
7709
7710    /**
7711     * Maximum number of userjs preferences allowed for each user
7712     */
7713    public const UserJsPrefLimit = [
7714        'default' => 100,
7715        'type' => 'int',
7716    ];
7717
7718    /**
7719     * Characters to prevent during new account creations.
7720     *
7721     * This is used in a regular expression character class during
7722     * registration (regex metacharacters like / are escaped).
7723     */
7724    public const InvalidUsernameCharacters = [
7725        'default' => '@:>=',
7726    ];
7727
7728    /**
7729     * Character used as a delimiter when testing for interwiki userrights
7730     * (In Special:UserRights, it is possible to modify users on different
7731     * databases if the delimiter is used, e.g. "Someuser@enwiki").
7732     *
7733     * It is recommended that you have this delimiter in
7734     * $wgInvalidUsernameCharacters above, or you will not be able to
7735     * modify the user rights of those users via Special:UserRights
7736     */
7737    public const UserrightsInterwikiDelimiter = [
7738        'default' => '@',
7739    ];
7740
7741    /**
7742     * This is to let user authenticate using https when they come from http.
7743     *
7744     * Based on an idea by George Herbert on wikitech-l:
7745     * https://lists.wikimedia.org/pipermail/wikitech-l/2010-October/050039.html
7746     *
7747     * @since 1.17
7748     */
7749    public const SecureLogin = [
7750        'default' => false,
7751    ];
7752
7753    /**
7754     * Versioning for authentication tokens.
7755     *
7756     * If non-null, this is combined with the user's secret (the user_token field
7757     * in the DB) to generate the token cookie. Changing this will invalidate all
7758     * active sessions (i.e. it will log everyone out).
7759     *
7760     * @since 1.27
7761     */
7762    public const AuthenticationTokenVersion = [
7763        'default' => null,
7764        'type' => '?string',
7765    ];
7766
7767    /**
7768     * MediaWiki\Session\SessionProvider configuration.
7769     *
7770     * Values are ObjectFactory specifications for the SessionProviders to be
7771     * used. Keys in the array are ignored; the class name is conventionally
7772     * used as the key to avoid collisions. Order is not significant.
7773     *
7774     * @since 1.27
7775     */
7776    public const SessionProviders = [
7777        'type' => 'map',
7778        'default' => [
7779            \MediaWiki\Session\CookieSessionProvider::class => [
7780                'class' => \MediaWiki\Session\CookieSessionProvider::class,
7781                'args' => [ [
7782                    'priority' => 30,
7783                ] ],
7784                'services' => [
7785                    'JwtCodec',
7786                    'UrlUtils',
7787                ],
7788            ],
7789            \MediaWiki\Session\BotPasswordSessionProvider::class => [
7790                'class' => \MediaWiki\Session\BotPasswordSessionProvider::class,
7791                'args' => [ [
7792                    'priority' => 75,
7793                ] ],
7794                'services' => [
7795                    'GrantsInfo'
7796                ],
7797            ],
7798        ],
7799    ];
7800
7801    /**
7802     * Configuration for automatic creation of temporary accounts on page save.
7803     * This can be enabled to avoid exposing the IP addresses of casual editors who
7804     * do not explicitly create an account.
7805     *
7806     * @warning This is EXPERIMENTAL, enabling may break extensions.
7807     *
7808     * An associative array with the following keys:
7809     *
7810     *   - known: (bool) Whether auto-creation is known about. Set this to 'true' if
7811     *     temp accounts have been created on this wiki already. This setting allows
7812     *     temp users to be recognized even if auto-creation is currently disabled.
7813     *     If auto-creation is enabled via the 'enabled' property, then 'known' is
7814     *     overriden to true.
7815     *   - enabled: (bool) Whether auto-creation is enabled. If changing this
7816     *     value from 'true' to 'false', you should also set 'known' to true, so
7817     *     that relevant code can continue to identify temporary accounts as
7818     *     visually and conceptually distinct from anonymous accounts and named accounts.
7819     *     Note that temporary account auto-creation is only actually enabled if
7820     *     `*` group has the `createaccount` or `autocreateaccount` right.
7821     *   - actions: (array) A list of actions for which the feature is enabled.
7822     *     Currently only "edit" is supported.
7823     *   - genPattern: (string) The pattern used when generating new usernames.
7824     *     This should have "$1" indicating the place where the serial string will
7825     *     be substituted.
7826     *   - matchPattern: (string|string[]|null) The pattern used when determining whether a
7827     *     username is a temporary user. This affects the rights of the user
7828     *     and also prevents explicit creation of users with matching names.
7829     *     This is ignored if "enabled" is false. If the value is null, the
7830     *     the genPattern value is used as the matchPattern.
7831     *   - reservedPattern: (string) A pattern used to determine whether a
7832     *     username should be denied for explicit creation, in addition to
7833     *     matchPattern. This is used even if "enabled" is false.
7834     *   - serialProvider: (array) Configuration for generation of unique integer
7835     *     indexes which are used to make temporary usernames.
7836     *       - type: (string) May be "local" to allocate indexes using the local
7837     *         database. If the CentralAuth extension is enabled, it may be
7838     *         "centralauth". Extensions may plug in additional types using the
7839     *         TempUserSerialProviders attribute.
7840     *       - numShards (int, default 1): A small integer. This can be set to a
7841     *         value greater than 1 to avoid acquiring a global lock when
7842     *         allocating IDs, at the expense of making the IDs be non-monotonic.
7843     *       - useYear: (bool) Restart at 1 each time the year changes (in UTC).
7844     *         To avoid naming conflicts, the year is included in the name after
7845     *         the prefix, in the form 'YYYY-'.
7846     *   - serialMapping: (array) Configuration for mapping integer indexes to strings
7847     *     to substitute into genPattern.
7848     *       - type: (string) May be
7849     *         - "readable-numeric" to use ASCII decimal numbers broken up with hyphens
7850     *         - "plain-numeric" to use ASCII decimal numbers
7851     *         - "localized-numeric" to use numbers localized using a specific language
7852     *         - "filtered-radix" to use numbers in an arbitrary base between 2 and 36,
7853     *           with an optional list of "bad" IDs to skip over.
7854     *         - "scramble": to use ASCII decimal numbers that are short but
7855     *           non-consecutive.
7856     *       - language: (string) With "localized-numeric", the language code
7857     *       - radix: (int) With "filtered-radix", the base
7858     *       - badIndexes: (array) With "filtered-radix", an array with the bad unmapped
7859     *         indexes in the values. The integers must be sorted and the list
7860     *         must never change after the indexes have been allocated. The keys must
7861     *         be zero-based array indexes.
7862     *       - uppercase: (bool) With "filtered-radix", whether to use uppercase
7863     *         letters, default false.
7864     *       - offset: (int) With "plain-numeric" and "readable-numeric", a constant to add to the
7865     *         stored index.
7866     *    - expireAfterDays: (int|null, default 90) If not null, how many days should the temporary
7867     *      accounts expire? You should run expireTemporaryAccounts.php periodically to expire
7868     *      temporary accounts. Otherwise they are expired when they try to edit.
7869     *    - notifyBeforeExpirationDays: (int|null, default 10) If not null, how many days before the
7870     *      expiration of a temporary account should it be notified that their account is to be expired.
7871     *
7872     * @unstable EXPERIMENTAL
7873     * @since 1.39
7874     */
7875    public const AutoCreateTempUser = [
7876        'properties' => [
7877            'known' => [ 'type' => 'bool', 'default' => false ],
7878            'enabled' => [ 'type' => 'bool', 'default' => false ],
7879            'actions' => [ 'type' => 'list', 'default' => [ 'edit' ] ],
7880            'genPattern' => [ 'type' => 'string', 'default' => '~$1' ],
7881            'matchPattern' => [ 'type' => 'string|array|null', 'default' => null ],
7882            'reservedPattern' => [ 'type' => 'string|null', 'default' => '~$1' ],
7883            'serialProvider' => [ 'type' => 'object', 'default' => [ 'type' => 'local', 'useYear' => true ] ],
7884            'serialMapping' => [ 'type' => 'object', 'default' => [ 'type' => 'readable-numeric' ] ],
7885            'expireAfterDays' => [ 'type' => 'int|null', 'default' => 90 ],
7886            'notifyBeforeExpirationDays' => [ 'type' => 'int|null', 'default' => 10 ],
7887        ],
7888        'type' => 'object',
7889    ];
7890
7891    // endregion -- end user accounts
7892
7893    /***************************************************************************/
7894    // region   User rights, access control and monitoring
7895    /** @name   User rights, access control and monitoring */
7896
7897    /** List of IP addresses or CIDR ranges that are exempt from autoblocks. */
7898    public const AutoblockExemptions = [
7899        'default' => [],
7900        'type' => 'array',
7901    ];
7902
7903    /**
7904     * Number of seconds before autoblock entries expire. Default 86400 = 1 day.
7905     */
7906    public const AutoblockExpiry = [
7907        'default' => 86400,
7908    ];
7909
7910    /**
7911     * Set this to true to allow blocked users to edit their own user talk page.
7912     *
7913     * This only applies to sitewide blocks. Partial blocks always allow users to
7914     * edit their own user talk page unless otherwise specified in the block
7915     * restrictions.
7916     */
7917    public const BlockAllowsUTEdit = [
7918        'default' => true,
7919    ];
7920
7921    /**
7922     * Limits on the possible sizes of range blocks.
7923     *
7924     * CIDR notation is hard to understand, it's easy to mistakenly assume that a
7925     * /1 is a small range and a /31 is a large range. For IPv4, setting a limit of
7926     * half the number of bits avoids such errors, and allows entire ISPs to be
7927     * blocked using a small number of range blocks.
7928     *
7929     * For IPv6, RFC 3177 recommends that a /48 be allocated to every residential
7930     * customer, so range blocks larger than /64 (half the number of bits) will
7931     * plainly be required. RFC 4692 implies that a very large ISP may be
7932     * allocated a /19 if a generous HD-Ratio of 0.8 is used, so we will use that
7933     * as our limit. As of 2012, blocking the whole world would require a /4 range.
7934     */
7935    public const BlockCIDRLimit = [
7936        'default' => [
7937            'IPv4' => 16,
7938            'IPv6' => 19,
7939        ],
7940        'type' => 'map',
7941    ];
7942
7943    /**
7944     * If true, sitewide blocked users will not be allowed to login. (Direct
7945     * blocks only; IP blocks are ignored.) This can be used to remove users'
7946     * read access on a private wiki.
7947     */
7948    public const BlockDisablesLogin = [
7949        'default' => false,
7950    ];
7951
7952    /**
7953     * If this is false, the number of blocks of a given target is limited to only 1.
7954     *
7955     * @since 1.42
7956     */
7957    public const EnableMultiBlocks = [
7958        'default' => false,
7959        'type' => 'boolean',
7960    ];
7961
7962    /**
7963     * Pages anonymous user may see, set as an array of pages titles.
7964     *
7965     * **Example:**
7966     *
7967     * ```
7968     * $wgWhitelistRead = [ "Main Page", "Wikipedia:Help" ];
7969     * ```
7970     *
7971     * Special:Userlogin and Special:ChangePassword are always allowed.
7972     *
7973     * @note This will only work if $wgGroupPermissions['*']['read'] is false --
7974     * see below. Otherwise, ALL pages are accessible, regardless of this setting.
7975     * @note Also that this will only protect _pages in the wiki_. Uploaded files
7976     * will remain readable. You can use img_auth.php to protect uploaded files,
7977     * see https://www.mediawiki.org/wiki/Manual:Image_Authorization
7978     * @note Extensions should not modify this, but use the TitleReadWhitelist
7979     * hook instead.
7980     */
7981    public const WhitelistRead = [
7982        'default' => false,
7983    ];
7984
7985    /**
7986     * Pages anonymous user may see, set as an array of regular expressions.
7987     *
7988     * This function will match the regexp against the title name, which
7989     * is without underscore.
7990     *
7991     * **Example:**
7992     * To whitelist [[Main Page]]:
7993     *
7994     * ```
7995     * $wgWhitelistReadRegexp = [ "/Main Page/" ];
7996     * ```
7997     * @note Unless ^ and/or $ is specified, a regular expression might match
7998     * pages not intended to be allowed.  The above example will also
7999     * allow a page named 'Security Main Page'.
8000     *
8001     * **Example:**
8002     * To allow reading any page starting with 'User' regardless of the case:
8003     *
8004     * ```
8005     * $wgWhitelistReadRegexp = [ "@^UsEr.*@i" ];
8006     * ```
8007     *
8008     * Will allow both [[User is banned]] and [[User:JohnDoe]]
8009     * @note This will only work if $wgGroupPermissions['*']['read'] is false --
8010     * see below. Otherwise, ALL pages are accessible, regardless of this setting.
8011     */
8012    public const WhitelistReadRegexp = [
8013        'default' => false,
8014    ];
8015
8016    /**
8017     * Should editors be required to have a validated e-mail
8018     * address before being allowed to edit?
8019     */
8020    public const EmailConfirmToEdit = [
8021        'default' => false,
8022    ];
8023
8024    /**
8025     * Should MediaWiki attempt to protect user's privacy when doing redirects?
8026     * Keep this true if access counts to articles are made public.
8027     */
8028    public const HideIdentifiableRedirects = [
8029        'default' => true,
8030    ];
8031
8032    /**
8033     * Permission keys given to users in each group.
8034     *
8035     * This is an array where the keys are all groups and each value is an
8036     * array of the format (right => boolean).
8037     *
8038     * The second format is used to support per-namespace permissions.
8039     * Note that this feature does not fully work for all permission types.
8040     *
8041     * All users are implicitly in the '*' group including anonymous visitors;
8042     * logged-in users are all implicitly in the 'user' group. These will be
8043     * combined with the permissions of all groups that a given user is listed
8044     * in the user_groups table.
8045     *
8046     * Note: Don't set $wgGroupPermissions = []; unless you know what you're
8047     * doing! This will wipe all permissions, and may mean that your users are
8048     * unable to perform certain essential tasks or access new functionality
8049     * when new permissions are introduced and default grants established.
8050     *
8051     * Functionality to make pages inaccessible has not been extensively tested
8052     * for security. Use at your own risk!
8053     *
8054     * This replaces $wgWhitelistAccount and $wgWhitelistEdit
8055     */
8056    public const GroupPermissions = [
8057        'type' => 'map',
8058        'additionalProperties' => [
8059            'type' => 'map',
8060            'additionalProperties' => [ 'type' => 'boolean', ],
8061        ],
8062        'mergeStrategy' => 'array_plus_2d',
8063        'default' => [
8064            '*' => [
8065                'createaccount' => true,
8066                'read' => true,
8067                'edit' => true,
8068                'createpage' => true,
8069                'createtalk' => true,
8070                'viewmyprivateinfo' => true,
8071                'editmyprivateinfo' => true,
8072                'editmyoptions' => true,
8073            ],
8074            'user' => [
8075                'move' => true,
8076                'move-subpages' => true,
8077                'move-rootuserpages' => true,
8078                'move-categorypages' => true,
8079                'movefile' => true,
8080                'read' => true,
8081                'edit' => true,
8082                'createpage' => true,
8083                'createtalk' => true,
8084                'upload' => true,
8085                'reupload' => true,
8086                'reupload-shared' => true,
8087                'minoredit' => true,
8088                'editmyusercss' => true,
8089                'editmyuserjson' => true,
8090                'editmyuserjs' => true,
8091                'editmyuserjsredirect' => true,
8092                'sendemail' => true,
8093                'applychangetags' => true,
8094                'changetags' => true,
8095                'viewmywatchlist' => true,
8096                'editmywatchlist' => true,
8097            ],
8098            'autoconfirmed' => [
8099                'autoconfirmed' => true,
8100                'editsemiprotected' => true,
8101            ],
8102            'bot' => [
8103                'bot' => true,
8104                'autoconfirmed' => true,
8105                'editsemiprotected' => true,
8106                'nominornewtalk' => true,
8107                'autopatrol' => true,
8108                'suppressredirect' => true,
8109                'apihighlimits' => true,
8110            ],
8111            'sysop' => [
8112                'block' => true,
8113                'createaccount' => true,
8114                'delete' => true,
8115                'bigdelete' => true,
8116                'deletedhistory' => true,
8117                'deletedtext' => true,
8118                'undelete' => true,
8119                'editcontentmodel' => true,
8120                'editinterface' => true,
8121                'editsitejson' => true,
8122                'edituserjson' => true,
8123                'import' => true,
8124                'importupload' => true,
8125                'move' => true,
8126                'move-subpages' => true,
8127                'move-rootuserpages' => true,
8128                'move-categorypages' => true,
8129                'patrol' => true,
8130                'autopatrol' => true,
8131                'protect' => true,
8132                'editprotected' => true,
8133                'rollback' => true,
8134                'upload' => true,
8135                'reupload' => true,
8136                'reupload-shared' => true,
8137                'unwatchedpages' => true,
8138                'autoconfirmed' => true,
8139                'editsemiprotected' => true,
8140                'ipblock-exempt' => true,
8141                'blockemail' => true,
8142                'markbotedits' => true,
8143                'apihighlimits' => true,
8144                'browsearchive' => true,
8145                'noratelimit' => true,
8146                'movefile' => true,
8147                'unblockself' => true,
8148                'suppressredirect' => true,
8149                'mergehistory' => true,
8150                'managechangetags' => true,
8151                'deletechangetags' => true,
8152            ],
8153            'interface-admin' => [
8154                'editinterface' => true,
8155                'editsitecss' => true,
8156                'editsitejson' => true,
8157                'editsitejs' => true,
8158                'editusercss' => true,
8159                'edituserjson' => true,
8160                'edituserjs' => true,
8161            ],
8162            'bureaucrat' => [
8163                'userrights' => true,
8164                'noratelimit' => true,
8165                'renameuser' => true,
8166            ],
8167            'suppress' => [
8168                'hideuser' => true,
8169                'suppressrevision' => true,
8170                'viewsuppressed' => true,
8171                'suppressionlog' => true,
8172                'deleterevision' => true,
8173                'deletelogentry' => true,
8174            ],
8175        ],
8176    ];
8177
8178    /**
8179     * List of groups which should be considered privileged (user accounts
8180     * belonging in these groups can be abused in dangerous ways).
8181     * This is used for some security checks, mainly logging.
8182     * @since 1.41
8183     * @see \MediaWiki\User\UserGroupManager::getUserPrivilegedGroups()
8184     */
8185    public const PrivilegedGroups = [
8186        'default' => [
8187            'bureaucrat',
8188            'interface-admin',
8189            'suppress',
8190            'sysop',
8191        ],
8192        'type' => 'list',
8193    ];
8194
8195    /**
8196     * Permission keys revoked from users in each group.
8197     *
8198     * This acts the same way as $wgGroupPermissions above, except that
8199     * if the user is in a group here, the permission will be removed from them.
8200     *
8201     * Improperly setting this could mean that your users will be unable to perform
8202     * certain essential tasks, so use at your own risk!
8203     */
8204    public const RevokePermissions = [
8205        'default' => [],
8206        'type' => 'map',
8207        'mergeStrategy' => 'array_plus_2d',
8208    ];
8209
8210    /**
8211     * Groups that should inherit permissions from another group
8212     *
8213     * This allows defining a group that inherits its permissions
8214     * from another group without having to copy all the permission
8215     * grants over. For example, if you wanted a manual "confirmed"
8216     * group that had the same permissions as "autoconfirmed":
8217     *
8218     * ```
8219     * $wgGroupInheritsPermissions['confirmed'] = 'autoconfirmed';
8220     * ```
8221     *
8222     * Recursive inheritance is currently not supported. In the above
8223     * example, confirmed will only gain the permissions explicitly
8224     * granted (or revoked) from autoconfirmed, not any permissions
8225     * that autoconfirmed might inherit.
8226     *
8227     * @since 1.38
8228     */
8229    public const GroupInheritsPermissions = [
8230        'default' => [],
8231        'type' => 'map',
8232        'additionalProperties' => [ 'type' => 'string', ],
8233    ];
8234
8235    /**
8236     * Implicit groups, aren't shown on Special:Listusers or somewhere else
8237     */
8238    public const ImplicitGroups = [
8239        'default' => [ '*', 'user', 'autoconfirmed' ],
8240        'type' => 'list',
8241    ];
8242
8243    /**
8244     * A map of group names that the user is in, to group names that those users
8245     * are allowed to add or revoke.
8246     *
8247     * Setting the list of groups to add or revoke to true is equivalent to "any
8248     * group".
8249     *
8250     * **Example:**
8251     * To allow sysops to add themselves to the "bot" group:
8252     *
8253     * ```
8254     * $wgGroupsAddToSelf = [ 'sysop' => [ 'bot' ] ];
8255     * ```
8256     *
8257     * **Example:**
8258     * Implicit groups may be used for the source group, for instance:
8259     *
8260     * ```
8261     * $wgGroupsRemoveFromSelf = [ '*' => true ];
8262     * ```
8263     *
8264     * This allows users in the '*' group (i.e. any user) to remove themselves from
8265     * any group that they happen to be in.
8266     */
8267    public const GroupsAddToSelf = [
8268        'default' => [],
8269        'type' => 'map',
8270    ];
8271
8272    /**
8273     * @see self::GroupsAddToSelf
8274     */
8275    public const GroupsRemoveFromSelf = [
8276        'default' => [],
8277        'type' => 'map',
8278    ];
8279
8280    /**
8281     * A map of group names to the conditions under which the group can be granted.
8282     * The requirements are specified in the same way as for autopromotion.
8283     *
8284     * If `canBeIgnored` is set to true, these restrictions can be bypassed by users
8285     * who have the `ignore-restricted-groups` permission.
8286     *
8287     * If either of the `memberConditions` or `updaterConditions` keys are omitted,
8288     * they default to an empty array (i.e. no conditions). The default value for
8289     * `canBeIgnored` is false.
8290     *
8291     * ```
8292     * $wgRestrictedGroups = [
8293     *     'sysop' => [
8294     *         'memberConditions' => [ APCOND_EDITCOUNT, 1000 ],
8295     *         'updaterConditions' => [ !, APCOND_ISBOT ],
8296     *         'canBeIgnored' => false,
8297     *     ]
8298     * ]
8299     * ```
8300     */
8301    public const RestrictedGroups = [
8302        'default' => [],
8303        'type' => 'map',
8304    ];
8305
8306    /**
8307     * A list of user requirement conditions, which are considered private and therefore
8308     * shouldn't be used in computations before they are really needed. This helps to reduce
8309     * visibility of protected information about users.
8310     *
8311     * Using this setting does not fully prevent other users from inferring what is the result
8312     * of condition computation. For instance, a user rights log entry can still reveal that
8313     * the restrictions for the relevant group must have been satisfied.
8314     *
8315     * An example use of this setting is the Special:UserRights form, where all conditions
8316     * are evaluated on submission, but on viewing only the non-private ones are used.
8317     */
8318    public const UserRequirementsPrivateConditions = [
8319        'default' => [],
8320        'type' => 'list',
8321    ];
8322
8323    /**
8324     * Set of available actions that can be restricted via action=protect
8325     * You probably shouldn't change this.
8326     *
8327     * Translated through restriction-* messages.
8328     * RestrictionStore::listApplicableRestrictionTypes() will remove restrictions that are not
8329     * applicable to a specific title (create and upload)
8330     */
8331    public const RestrictionTypes = [
8332        'default' => [ 'create', 'edit', 'move', 'upload' ],
8333        'type' => 'list',
8334    ];
8335
8336    /**
8337     * Rights which can be required for each protection level (via action=protect)
8338     *
8339     * You can add a new protection level that requires a specific
8340     * permission by manipulating this array. The ordering of elements
8341     * dictates the order on the protection form's lists.
8342     *
8343     *   - '' will be ignored (i.e. unprotected)
8344     *   - 'autoconfirmed' is quietly rewritten to 'editsemiprotected' for backwards compatibility
8345     *   - 'sysop' is quietly rewritten to 'editprotected' for backwards compatibility
8346     */
8347    public const RestrictionLevels = [
8348        'default' => [ '', 'autoconfirmed', 'sysop' ],
8349        'type' => 'list',
8350    ];
8351
8352    /**
8353     * Restriction levels that can be used with cascading protection
8354     *
8355     * A page can only be protected with cascading protection if the
8356     * requested restriction level is included in this array.
8357     *
8358     * 'autoconfirmed' is quietly rewritten to 'editsemiprotected' for backwards compatibility.
8359     * 'sysop' is quietly rewritten to 'editprotected' for backwards compatibility.
8360     */
8361    public const CascadingRestrictionLevels = [
8362        'default' => [ 'sysop', ],
8363        'type' => 'list',
8364    ];
8365
8366    /**
8367     * Restriction levels that should be considered "semiprotected"
8368     *
8369     * Certain places in the interface recognize a dichotomy between "protected"
8370     * and "semiprotected", without further distinguishing the specific levels. In
8371     * general, if anyone can be eligible to edit a protection level merely by
8372     * reaching some condition in $wgAutopromote, it should probably be considered
8373     * "semiprotected".
8374     *
8375     * 'autoconfirmed' is quietly rewritten to 'editsemiprotected' for backwards compatibility.
8376     * 'sysop' is not changed, since it really shouldn't be here.
8377     */
8378    public const SemiprotectedRestrictionLevels = [
8379        'default' => [ 'autoconfirmed', ],
8380        'type' => 'list',
8381    ];
8382
8383    /**
8384     * Set the minimum permissions required to edit pages in each
8385     * namespace.  If you list more than one permission, a user must
8386     * have all of them to edit pages in that namespace.
8387     *
8388     * @note NS_MEDIAWIKI is implicitly restricted to 'editinterface'.
8389     */
8390    public const NamespaceProtection = [
8391        'default' => [],
8392        'type' => 'map',
8393    ];
8394
8395    /**
8396     * Pages in namespaces in this array can not be used as templates.
8397     *
8398     * Elements MUST be numeric namespace ids, you can safely use the MediaWiki
8399     * namespaces constants (NS_USER, NS_MAIN...).
8400     *
8401     * Among other things, this may be useful to enforce read-restrictions
8402     * which may otherwise be bypassed by using the template mechanism.
8403     */
8404    public const NonincludableNamespaces = [
8405        'default' => [],
8406        'type' => 'map',
8407    ];
8408
8409    /**
8410     * Number of seconds an account is required to age before it's given the
8411     * implicit 'autoconfirm' group membership. This can be used to limit
8412     * privileges of new accounts.
8413     *
8414     * Accounts created by earlier versions of the software may not have a
8415     * recorded creation date, and will always be considered to pass the age test.
8416     *
8417     * When left at 0, all registered accounts will pass.
8418     *
8419     * **Example:**
8420     * Set automatic confirmation to 10 minutes (which is 600 seconds):
8421     *
8422     * ```
8423     * $wgAutoConfirmAge = 600;     // ten minutes
8424     * ```
8425     *
8426     * Set age to one day:
8427     *
8428     * ```
8429     * $wgAutoConfirmAge = 3600*24; // one day
8430     * ```
8431     */
8432    public const AutoConfirmAge = [
8433        'default' => 0,
8434    ];
8435
8436    /**
8437     * Number of edits an account requires before it is autoconfirmed.
8438     *
8439     * Passing both this AND the time requirement is needed. Example:
8440     *
8441     * **Example:**
8442     *
8443     * ```
8444     * $wgAutoConfirmCount = 50;
8445     * ```
8446     */
8447    public const AutoConfirmCount = [
8448        'default' => 0,
8449    ];
8450
8451    /**
8452     * Array containing the conditions of automatic promotion of a user to specific groups.
8453     *
8454     * The basic syntax for `$wgAutopromote` is:
8455     *
8456     *     $wgAutopromote = [
8457     *         'groupname' => cond,
8458     *         'group2' => cond2,
8459     *     ];
8460     *
8461     * A `cond` may be:
8462     *  - a single condition without arguments:
8463     *      Note that Autopromote wraps a single non-array value into an array
8464     *      e.g. `APCOND_EMAILCONFIRMED` OR
8465     *           [ `APCOND_EMAILCONFIRMED` ]
8466     *  - a single condition with arguments:
8467     *      e.g. `[ APCOND_EDITCOUNT, 100 ]`
8468     *  - a set of conditions:
8469     *      e.g. `[ 'operand', cond1, cond2, ... ]`
8470     *
8471     * When constructing a set of conditions, the following conditions are available:
8472     *  - `&` (**AND**):
8473     *      promote if user matches **ALL** conditions
8474     *  - `|` (**OR**):
8475     *      promote if user matches **ANY** condition
8476     *  - `^` (**XOR**):
8477     *      promote if user matches **ONLY ONE OF THE CONDITIONS**
8478     *  - `!` (**NOT**):
8479     *      promote if user matces **NO** condition
8480     *  - [ APCOND_EMAILCONFIRMED ]:
8481     *      true if user has a confirmed e-mail
8482     *  - [ APCOND_EDITCOUNT, number of edits (if null or missing $wgAutoConfirmCount will be used)]:
8483     *      true if user has the at least the number of edits as the passed parameter
8484     *  - [ APCOND_AGE, seconds since registration (if null or missing $wgAutoConfirmAge will be used)]:
8485     *      true if the length of time since the user created their account
8486     *      is at least the same length of time as the passed parameter
8487     *  - [ APCOND_AGE_FROM_EDIT, seconds since first edit ]:
8488     *      true if the length of time since the user made their first edit
8489     *      is at least the same length of time as the passed parameter
8490     *  - [ APCOND_INGROUPS, group1, group2, ... ]:
8491     *      true if the user is a member of each of the passed groups
8492     *  - [ APCOND_ISIP, ip ]:
8493     *      true if the user has the passed IP address
8494     *  - [ APCOND_IPINRANGE, range ]:
8495     *      true if the user has an IP address in the range of the passed parameter
8496     *  - [ APCOND_BLOCKED ]:
8497     *      true if the user is sitewide blocked
8498     *  - [ APCOND_ISBOT ]:
8499     *      true if the user is a bot
8500     *  - similar constructs can be defined by extensions
8501     *
8502     * The sets of conditions are evaluated recursively, so you can use nested sets of conditions
8503     * linked by operands.
8504     *
8505     * Note that if $wgEmailAuthentication is disabled, APCOND_EMAILCONFIRMED will be true for any
8506     * user who has provided an e-mail address.
8507     */
8508    public const Autopromote = [
8509        'default' => [
8510            'autoconfirmed' => [ '&',
8511                [ APCOND_EDITCOUNT, null ], // NOTE: null means $wgAutoConfirmCount
8512                [ APCOND_AGE, null ], // NOTE: null means AutoConfirmAge
8513            ],
8514        ],
8515        'type' => 'map',
8516    ];
8517
8518    /**
8519     * Automatically add a usergroup to any user who matches certain conditions.
8520     *
8521     * Does not add the user to the group again if it has been removed.
8522     * Also, does not remove the group if the user no longer meets the criteria.
8523     *
8524     * The format is:
8525     *
8526     * ```
8527     * [ event => criteria, ... ]
8528     * ```
8529     *
8530     * The only recognised value for event is 'onEdit' (when the user edits).
8531     *
8532     * Criteria has the same format as $wgAutopromote
8533     *
8534     * @see self::Autopromote
8535     * @since 1.18
8536     */
8537    public const AutopromoteOnce = [
8538        'default' => [ 'onEdit' => [], ],
8539        'type' => 'map',
8540    ];
8541
8542    /**
8543     * Put user rights log entries for autopromotion in recent changes?
8544     *
8545     * @since 1.18
8546     */
8547    public const AutopromoteOnceLogInRC = [
8548        'default' => true,
8549    ];
8550
8551    /**
8552     * Defines a denylist of group names. One-shot autopromotions into these groups will not cause a
8553     * RecentChanges entry to be inserted even if AutopromoteOnceLogInRC is set, as long as they are the
8554     * only new groups the user was autopromoted to.
8555     *
8556     * @since 1.44
8557     */
8558    public const AutopromoteOnceRCExcludedGroups = [
8559        'default' => [],
8560        'type' => 'array',
8561    ];
8562
8563    /**
8564     * $wgAddGroups and $wgRemoveGroups can be used to give finer control over who
8565     * can assign which groups at Special:Userrights.
8566     *
8567     * **Example:**
8568     * Bureaucrats can add any group:
8569     *
8570     * ```
8571     * $wgAddGroups['bureaucrat'] = true;
8572     * ```
8573     *
8574     * Bureaucrats can only remove bots and sysops:
8575     *
8576     * ```
8577     * $wgRemoveGroups['bureaucrat'] = [ 'bot', 'sysop' ];
8578     * ```
8579     *
8580     * Sysops can make bots:
8581     *
8582     * ```
8583     * $wgAddGroups['sysop'] = [ 'bot' ];
8584     * ```
8585     *
8586     * Sysops can disable other sysops in an emergency, and disable bots:
8587     *
8588     * ```
8589     * $wgRemoveGroups['sysop'] = [ 'sysop', 'bot' ];
8590     * ```
8591     */
8592    public const AddGroups = [
8593        'default' => [],
8594        'type' => 'map',
8595        'mergeStrategy' => 'array_merge_recursive',
8596    ];
8597
8598    /**
8599     * @see self::AddGroups
8600     */
8601    public const RemoveGroups = [
8602        'default' => [],
8603        'type' => 'map',
8604        'mergeStrategy' => 'array_merge_recursive',
8605    ];
8606
8607    /**
8608     * A list of available rights, in addition to the ones defined by the core.
8609     * Rights in this list are denied unless explicitly granted, typically
8610     * using GroupPermissions.
8611     *
8612     * For extensions only.
8613     *
8614     * @see self::GroupPermissions
8615     * @see self::ImplicitRights
8616     */
8617    public const AvailableRights = [
8618        'default' => [],
8619        'type' => 'list',
8620        'items' => [ 'type' => 'string', ],
8621    ];
8622
8623    /**
8624     * A list of implicit rights, in addition to the ones defined by the core.
8625     * Rights in this list are granted implicitly to all users, but rate limits
8626     * may apply to them.
8627     *
8628     * Extensions that define rate limits should add the corresponding right to
8629     * either ImplicitRights or AvailableRights, depending on whether the right
8630     * should be granted to everyone.
8631     *
8632     * @since 1.41
8633     * @see self::RateLimits
8634     * @see self::AvailableRights
8635     */
8636    public const ImplicitRights = [
8637        'default' => [],
8638        'type' => 'list',
8639        'items' => [ 'type' => 'string', ]
8640    ];
8641
8642    /**
8643     * Optional to restrict deletion of pages with higher revision counts
8644     * to users with the 'bigdelete' permission. (Default given to sysops.)
8645     */
8646    public const DeleteRevisionsLimit = [
8647        'default' => 0,
8648    ];
8649
8650    /**
8651     * Page deletions with > this number of revisions will use the job queue.
8652     *
8653     * Revisions will be archived in batches of (at most) this size, one batch per job.
8654     */
8655    public const DeleteRevisionsBatchSize = [
8656        'default' => 1000,
8657    ];
8658
8659    /**
8660     * The maximum number of edits a user can have and
8661     * can still be hidden by users with the hideuser permission.
8662     *
8663     * This is limited for performance reason.
8664     * Set to false to disable the limit.
8665     *
8666     * @since 1.23
8667     */
8668    public const HideUserContribLimit = [
8669        'default' => 1000,
8670    ];
8671
8672    /**
8673     * Number of accounts each IP address may create per specified period(s).
8674     *
8675     * **Example:**
8676     *
8677     * ```
8678     * $wgAccountCreationThrottle = [
8679     *  // no more than 100 per month
8680     *  [
8681     *   'count' => 100,
8682     *   'seconds' => 30*86400,
8683     *  ],
8684     *  // no more than 10 per day
8685     *  [
8686     *   'count' => 10,
8687     *   'seconds' => 86400,
8688     *  ],
8689     * ];
8690     * ```
8691     *
8692     * @note For backwards compatibility reasons, this may also be given as a single
8693     *       integer, representing the number of account creations per day.
8694     * @see self::TempAccountCreationThrottle for the temporary accounts version of
8695     *       this throttle
8696     * @warning Requires $wgMainCacheType to be enabled
8697     */
8698    public const AccountCreationThrottle = [
8699        'default' => [ [
8700            'count' => 0,
8701            'seconds' => 86400,
8702        ] ],
8703        'type' => 'int|list',
8704    ];
8705
8706    /**
8707     * Number of temporary accounts each IP address may create per specified period(s).
8708     *
8709     * **Example:**
8710     *
8711     * ```
8712     * $wgTempAccountCreationThrottle = [
8713     *  // no more than 100 per month
8714     *  [
8715     *   'count' => 100,
8716     *   'seconds' => 30*86400,
8717     *  ],
8718     *  // no more than 6 per day
8719     *  [
8720     *   'count' => 6,
8721     *   'seconds' => 86400,
8722     *  ],
8723     * ];
8724     * ```
8725     *
8726     * @see self::AccountCreationThrottle for the regular account version of this throttle.
8727     * @warning Requires $wgMainCacheType to be enabled
8728     *
8729     * @since 1.42
8730     */
8731    public const TempAccountCreationThrottle = [
8732        'default' => [
8733            [
8734                'count' => 1,
8735                'seconds' => 600,
8736            ],
8737            [
8738                'count' => 6,
8739                'seconds' => 86400,
8740            ]
8741        ],
8742        'type' => 'list',
8743    ];
8744
8745    /**
8746     * Number of temporary accounts usernames each IP address may acquire per specified period(s).
8747     *
8748     * This should be set to a higher value than TempAccountCreationThrottle.
8749     *
8750     * On editing, we first attempt to acquire a temp username before proceeding with saving an edit
8751     * and potentially creating a temp account if the edit save is successful.
8752     *
8753     * Some edits may fail (due to core or extensions denying an edit); this throttle ensures that
8754     * there are limits to the number of temporary account names that can be acquired and stored in
8755     * the database.
8756     *
8757     * **Example:**
8758     *
8759     * ```
8760     * $wgTempAccountNameAcquisitionThrottle = [
8761     *  // no more than 100 per month
8762     *  [
8763     *   'count' => 100,
8764     *   'seconds' => 30*86400,
8765     *  ],
8766     *  // no more than 60 per day
8767     *  [
8768     *   'count' => 60,
8769     *   'seconds' => 86400,
8770     *  ],
8771     * ];
8772     * ```
8773     *
8774     * @see self::TempAccountCreationThrottle Make sure that TempAccountNameAcquisitionThrottle is greater than or
8775     *   equal to TempAccountCreationThrottle
8776     * @warning Requires $wgMainCacheType to be enabled
8777     *
8778     * @since 1.42
8779     */
8780    public const TempAccountNameAcquisitionThrottle = [
8781        'default' => [ [
8782            'count' => 60,
8783            'seconds' => 86400,
8784        ] ],
8785        'type' => 'list',
8786    ];
8787
8788    /**
8789     * Edits matching these regular expressions in body text
8790     * will be recognised as spam and rejected automatically.
8791     *
8792     * There's no administrator override on-wiki, so be careful what you set. :)
8793     * May be an array of regexes or a single string for backwards compatibility.
8794     *
8795     * @see https://en.wikipedia.org/wiki/Regular_expression
8796     * @note Each regex needs a beginning/end delimiter, eg: # or /
8797     */
8798    public const SpamRegex = [
8799        'default' => [],
8800        'type' => 'list',
8801    ];
8802
8803    /**
8804     * Same as SpamRegex except for edit summaries
8805     */
8806    public const SummarySpamRegex = [
8807        'default' => [],
8808        'type' => 'list',
8809    ];
8810
8811    /**
8812     * Whether to use DNS blacklists in $wgDnsBlacklistUrls to check for open
8813     * proxies
8814     *
8815     * @since 1.16
8816     */
8817    public const EnableDnsBlacklist = [
8818        'default' => false,
8819    ];
8820
8821    /**
8822     * List of DNS blacklists to use, if $wgEnableDnsBlacklist is true.
8823     *
8824     * This is an array of either a URL or an array with the URL and a key (should
8825     * the blacklist require a key).
8826     *
8827     * **Example:**
8828     *
8829     * ```
8830     * $wgDnsBlacklistUrls = [
8831     *   // String containing URL
8832     *   'http.dnsbl.sorbs.net.',
8833     *   // Array with URL and key, for services that require a key
8834     *   [ 'dnsbl.httpbl.net.', 'mykey' ],
8835     *   // Array with just the URL. While this works, it is recommended that you
8836     *   // just use a string as shown above
8837     *   [ 'opm.tornevall.org.' ]
8838     * ];
8839     * ```
8840     *
8841     * @note You should end the domain name with a . to avoid searching your
8842     * eventual domain search suffixes.
8843     * @since 1.16
8844     */
8845    public const DnsBlacklistUrls = [
8846        'default' => [],
8847        'type' => 'list',
8848    ];
8849
8850    /**
8851     * List of banned IP addresses.
8852     *
8853     * This can have the following formats:
8854     * - An array of addresses
8855     * - A string, in which case this is the path to a file
8856     *   containing the list of IP addresses, one per line
8857     */
8858    public const ProxyList = [
8859        'default' => [],
8860        'type' => 'string|list',
8861    ];
8862
8863    /**
8864     * Proxy whitelist, list of addresses that are assumed to be non-proxy despite
8865     * what the other methods might say.
8866     */
8867    public const ProxyWhitelist = [
8868        'default' => [],
8869        'type' => 'list',
8870    ];
8871
8872    /**
8873     * IP ranges that should be considered soft-blocked (anon-only, account
8874     * creation allowed). The intent is to use this to prevent anonymous edits from
8875     * shared resources such as Wikimedia Labs.
8876     *
8877     * @since 1.29
8878     */
8879    public const SoftBlockRanges = [
8880        'default' => [],
8881        'type' => 'list',
8882        'items' => [ 'type' => 'string', ],
8883    ];
8884
8885    /**
8886     * Whether to look at the X-Forwarded-For header's list of (potentially spoofed)
8887     * IPs and apply IP blocks to them. This allows for IP blocks to work with correctly-configured
8888     * (transparent) proxies without needing to block the proxies themselves.
8889     */
8890    public const ApplyIpBlocksToXff = [
8891        'default' => false,
8892    ];
8893
8894    /**
8895     * Simple rate limiter options to brake edit floods.
8896     *
8897     * Maximum number actions allowed in the given number of seconds; after that
8898     * the violating client receives HTTP 500 error pages until the period
8899     * elapses.
8900     *
8901     * **Example:**
8902     * Limits per configured per action and then type of users.
8903     *
8904     * ```
8905     * $wgRateLimits = [
8906     *     'edit' => [
8907     *         'anon' => [ x, y ], // any and all anonymous edits (aggregate)
8908     *         'user' => [ x, y ], // each logged-in user
8909     *         'user-global' => [ x, y ], // per username, across all sites (assumes names are
8910     * global)
8911     *         'newbie' => [ x, y ], // each new autoconfirmed accounts; overrides 'user'
8912     *         'ip' => [ x, y ], // each anon and recent account, across all sites
8913     *         'subnet' => [ x, y ], // ... within a /24 subnet in IPv4 or /64 in IPv6
8914     *         'ip-all' => [ x, y ], // per ip, across all sites
8915     *         'subnet-all' => [ x, y ], // ... within a /24 subnet in IPv4 or /64 in IPv6
8916     *         'groupName' => [ x, y ], // by group membership
8917     *     ]
8918     * ];
8919     * ```
8920     *
8921     * **Normally, the 'noratelimit' right allows a user to bypass any rate**
8922     * limit checks. This can be disabled on a per-action basis by setting the
8923     * special '&can-bypass' key to false in that action's configuration.
8924     *
8925     * ```
8926     * $wgRateLimits = [
8927     *     'some-action' => [
8928     *         '&can-bypass' => false,
8929     *         'user' => [ x, y ],
8930     * ];
8931     * ```
8932     *
8933     * @see self::ImplicitRights
8934     * @warning Requires that $wgMainCacheType is set to something persistent
8935     */
8936    public const RateLimits = [
8937        'default' => [
8938            // Page edits
8939            'edit' => [
8940                'ip' => [ 8, 60 ],
8941                'newbie' => [ 8, 60 ],
8942                'user' => [ 90, 60 ],
8943            ],
8944            // Page moves
8945            'move' => [
8946                'newbie' => [ 2, 120 ],
8947                'user' => [ 8, 60 ],
8948            ],
8949            // File uploads
8950            'upload' => [
8951                'ip' => [ 8, 60 ],
8952                'newbie' => [ 8, 60 ],
8953            ],
8954            // Page rollbacks
8955            'rollback' => [
8956                'user' => [ 10, 60 ],
8957                'newbie' => [ 5, 120 ]
8958            ],
8959            // Triggering password resets emails
8960            'mailpassword' => [
8961                'ip' => [ 5, 3600 ],
8962            ],
8963            // Emailing other users using MediaWiki
8964            'sendemail' => [
8965                'ip' => [ 5, 86400 ],
8966                'newbie' => [ 5, 86400 ],
8967                'user' => [ 20, 86400 ],
8968            ],
8969            'changeemail' => [
8970                'ip-all' => [ 10, 3600 ],
8971                'user' => [ 4, 86400 ]
8972            ],
8973            // since 1.33 - rate limit email confirmations
8974            'confirmemail' => [
8975                'ip-all' => [ 10, 3600 ],
8976                'user' => [ 4, 86400 ]
8977            ],
8978            // Purging pages
8979            'purge' => [
8980                'ip' => [ 30, 60 ],
8981                'user' => [ 30, 60 ],
8982            ],
8983            // Purges of link tables
8984            'linkpurge' => [
8985                'ip' => [ 30, 60 ],
8986                'user' => [ 30, 60 ],
8987            ],
8988            // Files rendered via thumb.php or thumb_handler.php
8989            'renderfile' => [
8990                'ip' => [ 700, 30 ],
8991                'user' => [ 700, 30 ],
8992            ],
8993            // Same as above but for non-standard thumbnails
8994            'renderfile-nonstandard' => [
8995                'ip' => [ 70, 30 ],
8996                'user' => [ 70, 30 ],
8997            ],
8998            // Stashing edits into cache before save
8999            'stashedit' => [
9000                'ip' => [ 30, 60 ],
9001                'newbie' => [ 30, 60 ],
9002            ],
9003            // Stash base HTML for VE edits
9004            'stashbasehtml' => [
9005                'ip' => [ 5, 60 ],
9006                'newbie' => [ 5, 60 ],
9007            ],
9008            // Adding or removing change tags
9009            'changetags' => [
9010                'ip' => [ 8, 60 ],
9011                'newbie' => [ 8, 60 ],
9012            ],
9013            // Changing the content model of a page
9014            'editcontentmodel' => [
9015                'newbie' => [ 2, 120 ],
9016                'user' => [ 8, 60 ],
9017            ],
9018        ],
9019        'type' => 'map',
9020        'mergeStrategy' => 'array_plus_2d',
9021    ];
9022
9023    /**
9024     * Array of IPs / CIDR ranges which should be excluded from rate limits.
9025     *
9026     * This may be useful for allowing NAT gateways for conferences, etc.
9027     */
9028    public const RateLimitsExcludedIPs = [
9029        'default' => [],
9030        'type' => 'list',
9031    ];
9032
9033    /**
9034     * Log IP addresses in the recentchanges table; can be accessed only by
9035     * extensions (e.g. CheckUser) or a DB admin
9036     * Used for retroactive autoblocks
9037     */
9038    public const PutIPinRC = [
9039        'default' => true,
9040    ];
9041
9042    /**
9043     * Integer defining default number of entries to show on
9044     * special pages which are query-pages such as Special:Whatlinkshere.
9045     */
9046    public const QueryPageDefaultLimit = [
9047        'default' => 50,
9048    ];
9049
9050    /**
9051     * Configuration for external query sources.
9052     *
9053     * This allows system administrators to off-load expensive QueryPage subclasses
9054     * to alternative query sources by fetching results over HTTP.
9055     * For example, you might periodically run your own version of a query via Hadoop,
9056     * and serve the result as a JSON file from a static HTTP server (T309738).
9057     *
9058     * While your external source will likely be a static file serving cached
9059     * results, MediaWiki will treat this external source as drop-in replacement
9060     * for the database, not as replacement for the cache.
9061     *
9062     * This means if you enable $wgMiserMode, your external service does not
9063     * require high-availabilty and high-traffic support because you still benefit
9064     * from persistent cache (in the querycache table) and offline pull (via
9065     * maintenance/updateSpecialPages.php, instead of a live user request).
9066     *
9067     * **Example:**
9068     *
9069     * ```php
9070     * $wgExternalQuerySources = [
9071     *     'Mostlinkedtemplates' => [
9072     *         'enabled' => true,
9073     *         'url' => 'https://example.org/data/Mostlinkedtemplates.json',
9074     *         'timeout' => 10, // seconds, optional
9075     *     ]
9076     * ];
9077     * ```
9078     *
9079     * @since 1.45
9080     */
9081    public const ExternalQuerySources = [
9082        'default' => [],
9083        'type' => 'map',
9084        'additionalProperties' => [
9085            'type' => 'object',
9086            'properties' => [
9087                'enabled' => [
9088                    'type' => 'boolean',
9089                    'default' => false,
9090                ],
9091                'url' => [
9092                    'type' => 'string',
9093                    'format' => 'uri',
9094                ],
9095                'timeout' => [
9096                    'type' => 'integer',
9097                    'default' => 10,
9098                ],
9099            ],
9100            'required' => [ 'enabled', 'url' ],
9101            'additionalProperties' => false,
9102        ],
9103    ];
9104
9105    /**
9106     * Limit password attempts to X attempts per Y seconds per IP per account.
9107     *
9108     * Value is an array of arrays. Each sub-array must have a key for count
9109     * (ie count of how many attempts before throttle) and a key for seconds.
9110     * If the key 'allIPs' (case sensitive) is present, then the limit is
9111     * just per account instead of per IP per account.
9112     *
9113     * @since 1.27 allIps support and multiple limits added in 1.27. Prior
9114     * to 1.27 this only supported having a single throttle.
9115     * @warning Requires $wgMainCacheType to be enabled
9116     */
9117    public const PasswordAttemptThrottle = [
9118        'default' => [
9119            // Short term limit
9120            [ 'count' => 5, 'seconds' => 300 ],
9121            // Long term limit. We need to balance the risk
9122            // of somebody using this as a DoS attack to lock someone
9123            // out of their account, and someone doing a brute force attack.
9124            [ 'count' => 150, 'seconds' => 60 * 60 * 48 ],
9125        ],
9126        'type' => 'list',
9127    ];
9128
9129    /**
9130     * Users authorize consumers (like Apps) to act on their behalf but only with
9131     * a subset of the user's normal account rights (signed off on by the user).
9132     * The possible rights to grant to a consumer are bundled into groups called
9133     * "grants". Each grant defines some rights it lets consumers inherit from the
9134     * account they may act on behalf of. Note that a user granting a right does
9135     * nothing if that user does not actually have that right to begin with.
9136     *
9137     * @since 1.27
9138     */
9139    public const GrantPermissions = [
9140        'default' => [
9141            'basic' => [
9142                'autocreateaccount' => true,
9143                'autoconfirmed' => true,
9144                'autopatrol' => true,
9145                'editsemiprotected' => true,
9146                'ipblock-exempt' => true,
9147                'nominornewtalk' => true,
9148                'patrolmarks' => true,
9149                'read' => true,
9150                'unwatchedpages' => true,
9151            ],
9152            'highvolume' => [
9153                'bot' => true,
9154                'apihighlimits' => true,
9155                'noratelimit' => true,
9156                'markbotedits' => true,
9157            ],
9158            'import' => [
9159                'import' => true,
9160                'importupload' => true,
9161            ],
9162            'editpage' => [
9163                'edit' => true,
9164                'minoredit' => true,
9165                'applychangetags' => true,
9166                'changetags' => true,
9167                'editcontentmodel' => true,
9168                'pagelang' => true,
9169            ],
9170            'editprotected' => [
9171                'edit' => true,
9172                'minoredit' => true,
9173                'applychangetags' => true,
9174                'changetags' => true,
9175                'editcontentmodel' => true,
9176                'editprotected' => true,
9177            ],
9178            'editmycssjs' => [
9179                'edit' => true,
9180                'minoredit' => true,
9181                'applychangetags' => true,
9182                'changetags' => true,
9183                'editcontentmodel' => true,
9184                'editmyusercss' => true,
9185                'editmyuserjson' => true,
9186                'editmyuserjs' => true,
9187            ],
9188            'editmyoptions' => [
9189                'editmyoptions' => true,
9190                'editmyuserjson' => true,
9191            ],
9192            'editinterface' => [
9193                'edit' => true,
9194                'minoredit' => true,
9195                'applychangetags' => true,
9196                'changetags' => true,
9197                'editcontentmodel' => true,
9198                'editinterface' => true,
9199                'edituserjson' => true,
9200                'editsitejson' => true,
9201            ],
9202            'editsiteconfig' => [
9203                'edit' => true,
9204                'minoredit' => true,
9205                'applychangetags' => true,
9206                'changetags' => true,
9207                'editcontentmodel' => true,
9208                'editinterface' => true,
9209                'edituserjson' => true,
9210                'editsitejson' => true,
9211                'editusercss' => true,
9212                'edituserjs' => true,
9213                'editsitecss' => true,
9214                'editsitejs' => true,
9215            ],
9216            'createeditmovepage' => [
9217                'edit' => true,
9218                'minoredit' => true,
9219                'applychangetags' => true,
9220                'changetags' => true,
9221                'editcontentmodel' => true,
9222                'createpage' => true,
9223                'createtalk' => true,
9224                'delete-redirect' => true,
9225                'move' => true,
9226                'move-rootuserpages' => true,
9227                'move-subpages' => true,
9228                'move-categorypages' => true,
9229                'suppressredirect' => true,
9230            ],
9231            'uploadfile' => [
9232                'upload' => true,
9233                'reupload-own' => true,
9234            ],
9235            'uploadeditmovefile' => [
9236                'upload' => true,
9237                'reupload-own' => true,
9238                'reupload' => true,
9239                'reupload-shared' => true,
9240                'upload_by_url' => true,
9241                'movefile' => true,
9242                'suppressredirect' => true,
9243            ],
9244            'patrol' => [
9245                'patrol' => true,
9246            ],
9247            'rollback' => [
9248                'rollback' => true,
9249            ],
9250            'blockusers' => [
9251                'block' => true,
9252                'blockemail' => true,
9253            ],
9254            'viewdeleted' => [
9255                'browsearchive' => true,
9256                'deletedhistory' => true,
9257                'deletedtext' => true,
9258            ],
9259            'viewrestrictedlogs' => [
9260                'suppressionlog' => true,
9261            ],
9262            'delete' => [
9263                'edit' => true,
9264                'minoredit' => true,
9265                'applychangetags' => true,
9266                'changetags' => true,
9267                'editcontentmodel' => true,
9268                'browsearchive' => true,
9269                'deletedhistory' => true,
9270                'deletedtext' => true,
9271                'delete' => true,
9272                'bigdelete' => true,
9273                'deletelogentry' => true,
9274                'deleterevision' => true,
9275                'undelete' => true,
9276            ],
9277            'oversight' => [
9278                'suppressrevision' => true,
9279                'viewsuppressed' => true,
9280            ],
9281            'protect' => [
9282                'edit' => true,
9283                'minoredit' => true,
9284                'applychangetags' => true,
9285                'changetags' => true,
9286                'editcontentmodel' => true,
9287                'editprotected' => true,
9288                'protect' => true,
9289            ],
9290            'viewmywatchlist' => [
9291                'viewmywatchlist' => true,
9292            ],
9293            'editmywatchlist' => [
9294                'editmywatchlist' => true,
9295            ],
9296            'sendemail' => [
9297                'sendemail' => true,
9298            ],
9299            'createaccount' => [
9300                'createaccount' => true,
9301            ],
9302            'privateinfo' => [
9303                'viewmyprivateinfo' => true,
9304            ],
9305            'mergehistory' => [
9306                'mergehistory' => true,
9307            ],
9308        ],
9309        'type' => 'map',
9310        'mergeStrategy' => 'array_plus_2d',
9311        'additionalProperties' => [
9312            'type' => 'map',
9313            'additionalProperties' => [ 'type' => 'boolean', ],
9314        ],
9315    ];
9316
9317    /**
9318     * Grant groups are used on some user interfaces to display conceptually
9319     * similar grants together.
9320     *
9321     * This configuration value should usually be set by extensions, not
9322     * site administrators.
9323     *
9324     * @see self::GrantPermissions
9325     * @since 1.27
9326     */
9327    public const GrantPermissionGroups = [
9328        'default' =>
9329            [
9330                // Hidden grants are implicitly present
9331                'basic'               => 'hidden',
9332
9333                'editpage'            => 'page-interaction',
9334                'createeditmovepage'  => 'page-interaction',
9335                'editprotected'       => 'page-interaction',
9336                'patrol'              => 'page-interaction',
9337
9338                'uploadfile'          => 'file-interaction',
9339                'uploadeditmovefile'  => 'file-interaction',
9340
9341                'sendemail'           => 'email',
9342
9343                'viewmywatchlist'     => 'watchlist-interaction',
9344                'editviewmywatchlist' => 'watchlist-interaction',
9345
9346                'editmycssjs'         => 'customization',
9347                'editmyoptions'       => 'customization',
9348
9349                'editinterface'       => 'administration',
9350                'editsiteconfig'      => 'administration',
9351                'rollback'            => 'administration',
9352                'blockusers'          => 'administration',
9353                'delete'              => 'administration',
9354                'viewdeleted'         => 'administration',
9355                'viewrestrictedlogs'  => 'administration',
9356                'protect'             => 'administration',
9357                'oversight'           => 'administration',
9358                'createaccount'       => 'administration',
9359                'mergehistory'        => 'administration',
9360                'import'              => 'administration',
9361
9362                'highvolume'          => 'high-volume',
9363
9364                'privateinfo'         => 'private-information',
9365            ],
9366        'type' => 'map',
9367        'additionalProperties' => [ 'type' => 'string', ],
9368    ];
9369
9370    /**
9371     * Group grants by risk level. Keys are grant names (i.e. keys from GrantPermissions),
9372     * values are GrantsInfo::RISK_* constants.
9373     *
9374     * Note that this classification is only informative; merely applying 'security' or 'internal'
9375     * to a grant won't prevent it from being available. It's used to give guidance to users
9376     * in various interfaces about the riskiness of the various grants.
9377     *
9378     * @since 1.42
9379     */
9380    public const GrantRiskGroups = [
9381        'default' => [
9382            'basic'               => GrantsInfo::RISK_LOW,
9383            'editpage'            => GrantsInfo::RISK_LOW,
9384            'createeditmovepage'  => GrantsInfo::RISK_LOW,
9385            'editprotected'       => GrantsInfo::RISK_VANDALISM,
9386            'patrol'              => GrantsInfo::RISK_LOW,
9387            'uploadfile'          => GrantsInfo::RISK_LOW,
9388            'uploadeditmovefile'  => GrantsInfo::RISK_LOW,
9389            'sendemail'           => GrantsInfo::RISK_SECURITY,
9390            'viewmywatchlist'     => GrantsInfo::RISK_LOW,
9391            'editviewmywatchlist' => GrantsInfo::RISK_LOW,
9392            'editmycssjs'         => GrantsInfo::RISK_SECURITY,
9393            'editmyoptions'       => GrantsInfo::RISK_SECURITY,
9394            'editinterface'       => GrantsInfo::RISK_VANDALISM,
9395            'editsiteconfig'      => GrantsInfo::RISK_SECURITY,
9396            'rollback'            => GrantsInfo::RISK_LOW,
9397            'blockusers'          => GrantsInfo::RISK_VANDALISM,
9398            'delete'              => GrantsInfo::RISK_VANDALISM,
9399            'viewdeleted'         => GrantsInfo::RISK_VANDALISM,
9400            'viewrestrictedlogs'  => GrantsInfo::RISK_SECURITY,
9401            'protect'             => GrantsInfo::RISK_VANDALISM,
9402            'oversight'           => GrantsInfo::RISK_SECURITY,
9403            'createaccount'       => GrantsInfo::RISK_LOW,
9404            'mergehistory'        => GrantsInfo::RISK_VANDALISM,
9405            'import'              => GrantsInfo::RISK_SECURITY,
9406            'highvolume'          => GrantsInfo::RISK_LOW,
9407            'privateinfo'         => GrantsInfo::RISK_LOW,
9408        ],
9409        'type' => 'map',
9410    ];
9411
9412    /**
9413     * @since 1.27
9414     */
9415    public const EnableBotPasswords = [
9416        'default' => true,
9417        'type' => 'boolean',
9418    ];
9419
9420    /**
9421     * Cluster for the bot_passwords table
9422     *
9423     * @since 1.27
9424     * @deprecated since 1.42 Use $wgVirtualDomainsMapping instead.
9425     */
9426    public const BotPasswordsCluster = [
9427        'default' => false,
9428        'type' => 'string|false',
9429    ];
9430
9431    /**
9432     * Database name for the bot_passwords table
9433     *
9434     * To use a database with a table prefix, set this variable to
9435     * "{$database}-{$prefix}".
9436     *
9437     * @since 1.27
9438     * @deprecated since 1.42 Use $wgVirtualDomainsMapping instead.
9439     */
9440    public const BotPasswordsDatabase = [
9441        'default' => false,
9442        'type' => 'string|false',
9443    ];
9444
9445    /**
9446     * Maximum number of bot passwords a user can create.
9447     *
9448     * @since 1.46
9449     */
9450    public const BotPasswordsLimit = [
9451        'default' => 100,
9452        'type' => 'int',
9453    ];
9454
9455    // endregion -- end of user rights settings
9456
9457    /***************************************************************************/
9458    // region   Security
9459    /** @name   Security */
9460
9461    /**
9462     * This should always be customised in LocalSettings.php
9463     */
9464    public const SecretKey = [
9465        'default' => false,
9466    ];
9467
9468    /**
9469     * RSA private key for issuing JWTs, as a PEM string.
9470     * Experimental, will probably be replaced by something more flexible.
9471     * @since 1.45
9472     * @see RsaJwtCodec
9473     */
9474    public const JwtPrivateKey = [
9475        'default' => false,
9476    ];
9477
9478    /**
9479     * RSA private key for verifying JWTs, as a PEM string.
9480     * Experimental, will probably be replaced by something more flexible.
9481     * @since 1.45
9482     * @see RsaJwtCodec
9483     */
9484    public const JwtPublicKey = [
9485        'default' => false,
9486    ];
9487
9488    /**
9489     * Allow user Javascript page?
9490     * This enables a lot of neat customizations, but may
9491     * increase security risk to users and server load.
9492     */
9493    public const AllowUserJs = [
9494        'default' => false,
9495    ];
9496
9497    /**
9498     * Allow user Cascading Style Sheets (CSS)?
9499     * This enables a lot of neat customizations, but may
9500     * increase security risk to users and server load.
9501     */
9502    public const AllowUserCss = [
9503        'default' => false,
9504    ];
9505
9506    /**
9507     * Allow style-related user-preferences?
9508     *
9509     * This controls whether the `editfont` and `underline` preferences
9510     * are available to users.
9511     */
9512    public const AllowUserCssPrefs = [
9513        'default' => true,
9514    ];
9515
9516    /**
9517     * Use the site's Javascript page?
9518     */
9519    public const UseSiteJs = [
9520        'default' => true,
9521    ];
9522
9523    /**
9524     * Use the site's Cascading Style Sheets (CSS)?
9525     */
9526    public const UseSiteCss = [
9527        'default' => true,
9528    ];
9529
9530    /**
9531     * Break out of framesets. This can be used to prevent clickjacking attacks,
9532     * or to prevent external sites from framing your site with ads.
9533     */
9534    public const BreakFrames = [
9535        'default' => false,
9536    ];
9537
9538    /**
9539     * The X-Frame-Options header to send on pages sensitive to clickjacking
9540     * attacks, such as edit pages. This prevents those pages from being displayed
9541     * in a frame or iframe. The options are:
9542     *
9543     *   - 'DENY': Do not allow framing. This is recommended for most wikis.
9544     *
9545     *   - 'SAMEORIGIN': Allow framing by pages on the same domain. This can be used
9546     *         to allow framing within a trusted domain. This is insecure if there
9547     *         is a page on the same domain which allows framing of arbitrary URLs.
9548     *
9549     *   - false: Allow all framing. This opens up the wiki to XSS attacks and thus
9550     *         full compromise of local user accounts. Private wikis behind a
9551     *         corporate firewall are especially vulnerable. This is not
9552     *         recommended.
9553     *
9554     * For extra safety, set $wgBreakFrames = true, to prevent framing on all pages,
9555     * not just edit pages.
9556     */
9557    public const EditPageFrameOptions = [
9558        'default' => 'DENY',
9559    ];
9560
9561    /**
9562     * Disallow framing of API pages directly, by setting the X-Frame-Options
9563     * header. Since the API returns CSRF tokens, allowing the results to be
9564     * framed can compromise your user's account security.
9565     *
9566     * Options are:
9567     *   - 'DENY': Do not allow framing. This is recommended for most wikis.
9568     *   - 'SAMEORIGIN': Allow framing by pages on the same domain.
9569     *   - false: Allow all framing.
9570     * Note: $wgBreakFrames will override this for human formatted API output.
9571     */
9572    public const ApiFrameOptions = [
9573        'default' => 'DENY',
9574    ];
9575
9576    /**
9577     * Controls Content-Security-Policy header
9578     *
9579     * @warning May cause slowness on Windows due to slow random number generator.
9580     *
9581     * @unstable EXPERIMENTAL
9582     * @since 1.32
9583     * @see https://www.w3.org/TR/CSP2/
9584     */
9585    public const CSPHeader = [
9586        'default' => false,
9587        'type' => 'false|object',
9588    ];
9589
9590    /**
9591     * Controls Content-Security-Policy-Report-Only header
9592     *
9593     * @since 1.32
9594     */
9595    public const CSPReportOnlyHeader = [
9596        'default' => false,
9597        'type' => 'false|object',
9598    ];
9599
9600    /**
9601     * List of urls which appear often to be triggering CSP reports
9602     * but do not appear to be caused by actual content, but by client
9603     * software inserting scripts (i.e. Ad-Ware).
9604     *
9605     * List based on results from Wikimedia logs.
9606     *
9607     * @since 1.28
9608     */
9609    public const CSPFalsePositiveUrls = [
9610        'default' => [
9611            'https://3hub.co' => true,
9612            'https://morepro.info' => true,
9613            'https://p.ato.mx' => true,
9614            'https://s.ato.mx' => true,
9615            'https://adserver.adtech.de' => true,
9616            'https://ums.adtechus.com' => true,
9617            'https://cas.criteo.com' => true,
9618            'https://cat.nl.eu.criteo.com' => true,
9619            'https://atpixel.alephd.com' => true,
9620            'https://rtb.metrigo.com' => true,
9621            'https://d5p.de17a.com' => true,
9622            'https://ad.lkqd.net/vpaid/vpaid.js' => true,
9623            'https://ad.lkqd.net/vpaid/vpaid.js?fusion=1.0' => true,
9624            'https://t.lkqd.net/t' => true,
9625            'chrome-extension' => true,
9626        ],
9627        'type' => 'map',
9628    ];
9629
9630    /**
9631     * Allow anonymous cross origin requests to the REST API.
9632     *
9633     * This should be disabled for intranet sites (sites behind a firewall).
9634     *
9635     * @since 1.36
9636     */
9637    public const AllowCrossOrigin = [
9638        'default' => false,
9639        'type' => 'boolean',
9640    ];
9641
9642    /**
9643     * Allows authenticated cross-origin requests to the REST API with session cookies.
9644     *
9645     * With this option enabled, any origin specified in $wgCrossSiteAJAXdomains may send session
9646     * cookies for authorization in the REST API.
9647     *
9648     * There is a performance impact by enabling this option. Therefore, it should be left disabled
9649     * for most wikis and clients should instead use OAuth to make cross-origin authenticated
9650     * requests.
9651     *
9652     * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials
9653     * @since 1.36
9654     */
9655    public const RestAllowCrossOriginCookieAuth = [
9656        'default' => false,
9657        'type' => 'boolean',
9658    ];
9659
9660    /**
9661     * Secret for session storage.
9662     *
9663     * This should be set in LocalSettings.php, otherwise $wgSecretKey will
9664     * be used.
9665     *
9666     * @since 1.27
9667     */
9668    public const SessionSecret = [
9669        'default' => false,
9670    ];
9671
9672    // endregion -- end of security
9673
9674    /***************************************************************************/
9675    // region   Cookie settings
9676    /** @name   Cookie settings */
9677
9678    /**
9679     * Default cookie lifetime, in seconds. Setting to 0 makes all cookies session-only.
9680     */
9681    public const CookieExpiration = [
9682        'default' => 30 * 86400,
9683    ];
9684
9685    /**
9686     * Default login cookie lifetime, in seconds.
9687     *
9688     * If $wgExtendLoginCookieExpiration is set to null, we use $wgCookieExpiration to
9689     * calculate the cookie lifetime instead. As with $wgCookieExpiration, 0 will make
9690     * login cookies session-only.
9691     */
9692    public const ExtendedLoginCookieExpiration = [
9693        'default' => 180 * 86400,
9694    ];
9695
9696    /**
9697     * JWT session cookie expiration, in seconds. Used both for cookie expiry and for
9698     * the expiry field inside the JWT object.
9699     *
9700     * @since 1.45
9701     * @see self::UseSessionCookieJwt
9702     */
9703    public const SessionCookieJwtExpiration = [
9704        'default' => 4 * 3600,
9705    ];
9706
9707    /**
9708     * Set to set an explicit domain on the login cookies eg, "justthis.domain.org"
9709     * or ".any.subdomain.net"
9710     */
9711    public const CookieDomain = [
9712        'default' => '',
9713    ];
9714
9715    /**
9716     * Set this variable if you want to restrict cookies to a certain path within
9717     * the domain specified by $wgCookieDomain.
9718     */
9719    public const CookiePath = [
9720        'default' => '/',
9721    ];
9722
9723    /**
9724     * Whether the "secure" flag should be set on the cookie. This can be:
9725     *   - true:      Set secure flag
9726     *   - false:     Don't set secure flag
9727     *   - "detect":  Set the secure flag if $wgServer is set to an HTTPS URL,
9728     *                or if $wgForceHTTPS is true.
9729     *
9730     * If $wgForceHTTPS is true, session cookies will be secure regardless of this
9731     * setting. However, other cookies will still be affected.
9732     */
9733    public const CookieSecure = [
9734        'default' => 'detect',
9735        'dynamicDefault' => [ 'use' => [ 'ForceHTTPS' ] ]
9736    ];
9737
9738    public static function getDefaultCookieSecure( bool $forceHTTPS ): bool {
9739        return $forceHTTPS || ( WebRequest::detectProtocol() === 'https' );
9740    }
9741
9742    /**
9743     * Cookies generated by MediaWiki have names starting with this prefix. Set it
9744     * to a string to use a custom prefix. Setting it to false causes the database
9745     * name to be used as a prefix.
9746     */
9747    public const CookiePrefix = [
9748        'default' => false,
9749        'dynamicDefault' => [
9750            'use' => [ 'SharedDB', 'SharedPrefix', 'SharedTables', 'DBname', 'DBprefix' ]
9751        ],
9752    ];
9753
9754    public static function getDefaultCookiePrefix(
9755        ?string $sharedDB, ?string $sharedPrefix, array $sharedTables, string $dbName, string $dbPrefix
9756    ): string {
9757        if ( $sharedDB && in_array( 'user', $sharedTables ) ) {
9758            return $sharedDB . ( $sharedPrefix ? "_$sharedPrefix" : '' );
9759        }
9760        return $dbName . ( $dbPrefix ? "_$dbPrefix" : '' );
9761    }
9762
9763    /**
9764     * Set authentication cookies to HttpOnly to prevent access by JavaScript,
9765     * in browsers that support this feature. This can mitigates some classes of
9766     * XSS attack.
9767     */
9768    public const CookieHttpOnly = [
9769        'default' => true,
9770    ];
9771
9772    /**
9773     * The SameSite cookie attribute used for login cookies. This can be "Lax",
9774     * "Strict", "None" or empty/null to omit the attribute.
9775     *
9776     * This only applies to login cookies, since the correct value for other
9777     * cookies depends on what kind of cookie it is.
9778     *
9779     * @since 1.35
9780     */
9781    public const CookieSameSite = [
9782        'default' => null,
9783        'type' => '?string',
9784    ];
9785
9786    /**
9787     * A list of cookies that vary the cache (for use by extensions)
9788     */
9789    public const CacheVaryCookies = [
9790        'default' => [],
9791        'type' => 'list',
9792    ];
9793
9794    /**
9795     * Override to customise the session name
9796     */
9797    public const SessionName = [
9798        'default' => false,
9799    ];
9800
9801    /**
9802     * Whether to set a cookie when a user is autoblocked. Doing so means that a blocked user, even
9803     * after logging out and moving to a new IP address, will still be blocked. This cookie will
9804     * contain an authentication code if $wgSecretKey is set, or otherwise will just be the block
9805     * ID (in which case there is a possibility of an attacker discovering the names of revdeleted
9806     * users, so it is best to use this in conjunction with $wgSecretKey being set).
9807     */
9808    public const CookieSetOnAutoblock = [
9809        'default' => true,
9810    ];
9811
9812    /**
9813     * Whether to set a cookie when a logged-out user is blocked. Doing so means that a blocked
9814     * user, even after moving to a new IP address, will still be blocked. This cookie will contain
9815     * an authentication code if $wgSecretKey is set, or otherwise will just be the block ID (in
9816     * which case there is a possibility of an attacker discovering the names of revdeleted users,
9817     * so it is best to use this in conjunction with $wgSecretKey being set).
9818     */
9819    public const CookieSetOnIpBlock = [
9820        'default' => true,
9821    ];
9822
9823    // endregion -- end of cookie settings
9824
9825    /***************************************************************************/
9826    // region   Profiling, testing and debugging
9827    /** @name   Profiling, testing and debugging */
9828    // See $wgProfiler for how to enable profiling.
9829
9830    /**
9831     * Enable verbose debug logging for all channels and log levels.
9832     *
9833     * See https://www.mediawiki.org/wiki/How_to_debug
9834     *
9835     * For static requests, this enables all channels and warning-level and
9836     * above only. Use $wgDebugRawPage to make those verbose as well.
9837     *
9838     * The debug log file should be not be web-accessible if it is used in
9839     * a production environment, as may contain private data.
9840     */
9841    public const DebugLogFile = [
9842        'default' => '',
9843    ];
9844
9845    /**
9846     * Prefix for debug log lines
9847     */
9848    public const DebugLogPrefix = [
9849        'default' => '',
9850    ];
9851
9852    /**
9853     * If true, instead of redirecting, show a page with a link to the redirect
9854     * destination. This allows for the inspection of PHP error messages, and easy
9855     * resubmission of form data. For developer use only.
9856     */
9857    public const DebugRedirects = [
9858        'default' => false,
9859    ];
9860
9861    /**
9862     * If true, debug logging is also enabled for load.php and action=raw requests.
9863     *
9864     * By default, $wgDebugLogFile enables all channels and warning-level and
9865     * above for static requests.
9866     *
9867     * This ensures that the debug log is likely a chronological record of
9868     * of specific web request you are debugging, instead of overlapping with
9869     * messages from static requests, which would make it unclear which message
9870     * originated from what request.
9871     *
9872     * Also, during development this can make browsing and JavaScript testing
9873     * considerably slower (T85805).
9874     */
9875    public const DebugRawPage = [
9876        'default' => false,
9877    ];
9878
9879    /**
9880     * Send debug data to an HTML comment in the output.
9881     *
9882     * This may occasionally be useful when supporting a non-technical end-user.
9883     * It's more secure than exposing the debug log file to the web, since the
9884     * output only contains private data for the current user. But it's not ideal
9885     * for development use since data is lost on fatal errors and redirects.
9886     */
9887    public const DebugComments = [
9888        'default' => false,
9889    ];
9890
9891    /**
9892     * Write SQL queries to the debug log.
9893     *
9894     * This setting is only used $wgLBFactoryConf['class'] is set to
9895     * '\Wikimedia\Rdbms\LBFactorySimple'; otherwise the DBO_DEBUG flag must be set in
9896     * the 'flags' option of the database connection to achieve the same functionality.
9897     */
9898    public const DebugDumpSql = [
9899        'default' => false,
9900    ];
9901
9902    /**
9903     * Performance expectations for DB usage
9904     *
9905     * @since 1.26
9906     */
9907    public const TrxProfilerLimits = [
9908        'default' => [
9909            // HTTP GET/HEAD requests.
9910            // Primary queries should not happen on GET requests
9911            'GET' => [
9912                'masterConns' => 0,
9913                'writes' => 0,
9914                'readQueryTime' => 5,
9915                'readQueryRows' => 10000
9916            ],
9917            // HTTP POST requests.
9918            // Primary reads and writes will happen for a subset of these.
9919            'POST' => [
9920                'readQueryTime' => 5,
9921                'writeQueryTime' => 1,
9922                'readQueryRows' => 100_000,
9923                'maxAffected' => 1000
9924            ],
9925            'POST-nonwrite' => [
9926                'writes' => 0,
9927                'readQueryTime' => 5,
9928                'readQueryRows' => 10000
9929            ],
9930            // Deferred updates that run after HTTP response is sent for GET requests
9931            'PostSend-GET' => [
9932                'readQueryTime' => 5,
9933                'writeQueryTime' => 1,
9934                'readQueryRows' => 10000,
9935                'maxAffected' => 1000,
9936                // Log primary queries under the post-send entry point as they are discouraged
9937                'masterConns' => 0,
9938                'writes' => 0,
9939            ],
9940            // Deferred updates that run after HTTP response is sent for POST requests
9941            'PostSend-POST' => [
9942                'readQueryTime' => 5,
9943                'writeQueryTime' => 1,
9944                'readQueryRows' => 100_000,
9945                'maxAffected' => 1000
9946            ],
9947            // Background job runner
9948            'JobRunner' => [
9949                'readQueryTime' => 30,
9950                'writeQueryTime' => 5,
9951                'readQueryRows' => 100_000,
9952                'maxAffected' => 500 // ballpark of $wgUpdateRowsPerQuery
9953            ],
9954            // Command-line scripts
9955            'Maintenance' => [
9956                'writeQueryTime' => 5,
9957                'maxAffected' => 1000
9958            ]
9959        ],
9960        'type' => 'map',
9961    ];
9962
9963    /**
9964     * Map of string log group names to log destinations.
9965     *
9966     * If set, wfDebugLog() output for that group will go to that file instead
9967     * of the regular $wgDebugLogFile. Useful for enabling selective logging
9968     * in production.
9969     *
9970     * Log destinations may be one of the following:
9971     * - false to completely remove from the output, including from $wgDebugLogFile.
9972     * - string values specifying a filename or URI.
9973     * - associative array with keys:
9974     *   - 'destination' desired filename or URI.
9975     *   - 'sample' an integer value, specifying a sampling factor (optional)
9976     *   - 'level' A \Psr\Log\LogLevel constant, indicating the minimum level
9977     *             to log (optional, since 1.25)
9978     *
9979     * **Example:**
9980     *
9981     * ```
9982     * $wgDebugLogGroups['redis'] = '/var/log/mediawiki/redis.log';
9983     * ```
9984     *
9985     * **Advanced example:**
9986     *
9987     * ```
9988     * $wgDebugLogGroups['memcached'] = [
9989     *     'destination' => '/var/log/mediawiki/memcached.log',
9990     *     'sample' => 1000,  // log 1 message out of every 1,000.
9991     *     'level' => \Psr\Log\LogLevel::WARNING
9992     * ];
9993     * ```
9994     */
9995    public const DebugLogGroups = [
9996        'default' => [],
9997        'type' => 'map',
9998    ];
9999
10000    /**
10001     * Default service provider for creating Psr\Log\LoggerInterface instances.
10002     *
10003     * The value should be an array suitable for use with
10004     * ObjectFactory::getObjectFromSpec(). The created object is expected to
10005     * implement the MediaWiki\Logger\Spi interface. See ObjectFactory for additional
10006     * details.
10007     *
10008     * Alternately the MediaWiki\Logger\LoggerFactory::registerProvider method can
10009     * be called to inject an MediaWiki\Logger\Spi instance into the LoggerFactory
10010     * and bypass the use of this configuration variable entirely.
10011     *
10012     * **To completely disable logging:**
10013     *
10014     * ```
10015     * $wgMWLoggerDefaultSpi = [ 'class' => \MediaWiki\Logger\NullSpi::class ];
10016     * ```
10017     *
10018     * @since 1.25
10019     * @see \MwLogger
10020     */
10021    public const MWLoggerDefaultSpi = [
10022        'default' => [ 'class' => 'MediaWiki\\Logger\\LegacySpi', ],
10023        'mergeStrategy' => 'replace',
10024        'type' => 'map',
10025    ];
10026
10027    /**
10028     * Display debug data at the bottom of the main content area.
10029     *
10030     * Useful for developers and technical users trying to working on a closed wiki.
10031     */
10032    public const ShowDebug = [
10033        'default' => false,
10034    ];
10035
10036    /**
10037     * Show the contents of $wgHooks in Special:Version
10038     */
10039    public const SpecialVersionShowHooks = [
10040        'default' => false,
10041    ];
10042
10043    /**
10044     * Show exception message and stack trace when printing details about uncaught exceptions
10045     * in web response output.
10046     *
10047     * This may reveal private information in error messages or function parameters.
10048     * If set to false, only the exception type or class name will be exposed.
10049     */
10050    public const ShowExceptionDetails = [
10051        'default' => false,
10052    ];
10053
10054    /**
10055     * If true, send the exception backtrace to the error log
10056     */
10057    public const LogExceptionBacktrace = [
10058        'default' => true,
10059    ];
10060
10061    /**
10062     * If true, the MediaWiki error handler passes errors/warnings to the default error handler
10063     * after logging them.
10064     */
10065    public const PropagateErrors = [
10066        'default' => true,
10067    ];
10068
10069    /**
10070     * Expose backend server host names through the API and various HTML comments
10071     */
10072    public const ShowHostnames = [
10073        'default' => false,
10074    ];
10075
10076    /**
10077     * Override server hostname detection with a hardcoded value.
10078     *
10079     * Should be a string, default false.
10080     *
10081     * @since 1.20
10082     */
10083    public const OverrideHostname = [
10084        'default' => false,
10085    ];
10086
10087    /**
10088     * If set to true MediaWiki will throw notices for some possible error
10089     * conditions and for deprecated functions.
10090     */
10091    public const DevelopmentWarnings = [
10092        'default' => false,
10093    ];
10094
10095    /**
10096     * Release limitation to wfDeprecated warnings, if set to a release number
10097     * development warnings will not be generated for deprecations added in releases
10098     * after the limit.
10099     */
10100    public const DeprecationReleaseLimit = [
10101        'default' => false,
10102    ];
10103
10104    /**
10105     * Profiler configuration.
10106     *
10107     * To use a profiler, set $wgProfiler in LocalSettings.php.
10108     *
10109     * Options:
10110     *
10111     * - 'class' (`string`): The Profiler subclass to use.
10112     *   Default: ProfilerStub.
10113     * - 'sampling' (`integer`): Only enable the profiler on one in this many requests.
10114     *   For requests that are not in the sampling,
10115     *   the 'class' option will be replaced with ProfilerStub.
10116     *   Default: `1`.
10117     * - 'threshold' (`float`): Only process the recorded data if the total elapsed
10118     *   time for a request is more than this number of seconds.
10119     *   Default: `0.0`.
10120     * - 'output' (`string|string[]`):  ProfilerOutput subclass or subclasess to use.
10121     *   Default: `[]`.
10122     *
10123     * The options array is passed in its entirety to the specified
10124     * Profiler `class`. Check individual Profiler subclasses for additional
10125     * options that may be available.
10126     *
10127     * Profiler subclasses available in MediaWiki core:
10128     *
10129     * - ProfilerXhprof: Based on XHProf or Tideways-XHProf.
10130     * - ProfilerExcimer: Based on Excimer.
10131     * - ProfilerSectionOnly
10132     *
10133     * Profiler output classes available in MediaWiki:
10134     *
10135     * - ProfilerOutputText: outputs profiling data in the web page body as
10136     *   a comment.  You can make the profiling data in HTML render visibly
10137     *   instead by setting the 'visible' configuration flag.
10138     *
10139     * - ProfilerOutputStats: outputs profiling data in a format as configured
10140     *   by $wgStatsFormat. It expects that $wgStatsTarget is set.
10141     *
10142     * - ProfilerOutputDump: outputs dump files that are compatible
10143     *   with the XHProf gui. It expects that `$wgProfiler['outputDir']`
10144     *   is set as well.
10145     *
10146     * Examples:
10147     *
10148     * ```
10149     * $wgProfiler = [
10150     *   'class' => ProfilerXhprof::class,
10151     *   'output' => ProfilerOutputText::class,
10152     * ];
10153     * ```
10154     *
10155     * ```
10156     * $wgProfiler = [
10157     *   'class' => ProfilerXhprof::class,
10158     *   'output' => [ ProfilerOutputText::class ],
10159     *   'sampling' => 50, // one in every 50 requests
10160     * ];
10161     * ```
10162     *
10163     * For performance, the profiler is always disabled for CLI scripts as they
10164     * could be long running and the data would accumulate. Use the `--profiler`
10165     * parameter of maintenance scripts to override this.
10166     *
10167     * @since 1.17.0
10168     */
10169    public const Profiler = [
10170        'default' => [],
10171        'type' => 'map',
10172        'mergeStrategy' => 'replace',
10173    ];
10174
10175    /**
10176     * Destination of statsd metrics.
10177     *
10178     * A host or host:port of a statsd server. Port defaults to 8125.
10179     *
10180     * If not set, statsd metrics will not be collected.
10181     *
10182     * @see MediaWiki::emitBufferedStats()
10183     * @since 1.25
10184     */
10185    public const StatsdServer = [
10186        'default' => false,
10187    ];
10188
10189    /**
10190     * Prefix for metric names sent to $wgStatsdServer.
10191     *
10192     * @see \MediaWiki\MediaWikiServices::getInstance()->getStatsdDataFactory
10193     * @see \Wikimedia\Stats\BufferingStatsdDataFactory
10194     * @since 1.25
10195     */
10196    public const StatsdMetricPrefix = [
10197        'default' => 'MediaWiki',
10198    ];
10199
10200    /**
10201     * Stats output target URI e.g. udp://127.0.0.1:8125
10202     *
10203     * If null, metrics will not be sent.
10204     * Note: this only affects metrics instantiated by the StatsFactory service
10205     *
10206     * @since 1.38
10207     */
10208    public const StatsTarget = [
10209        'default' => null,
10210        'type' => '?string',
10211    ];
10212
10213    /**
10214     * Stats output format
10215     *
10216     * If null, metrics will not be rendered nor sent.
10217     * Note: this only affects metrics instantiated by the StatsFactory service
10218     *
10219     * @see \Wikimedia\Stats\OutputFormats::SUPPORTED_FORMATS
10220     * @since 1.41
10221     */
10222    public const StatsFormat = [
10223        'default' => null,
10224        'type' => '?string',
10225    ];
10226
10227    /**
10228     * Stats service name prefix
10229     *
10230     * Required.  Must not be zero-length.
10231     * Defaults to: 'mediawiki'
10232     * Note: this only affects metrics instantiated by the StatsFactory service
10233     *
10234     * @since 1.41
10235     */
10236    public const StatsPrefix = [
10237        'default' => 'mediawiki',
10238        'type' => 'string',
10239    ];
10240
10241    /**
10242     * Configuration for OpenTelemetry instrumentation, or `null` to disable it.
10243     * Possible keys:
10244     * - `samplingProbability`: probability in % of sampling a trace for which no sampling decision has been
10245     * taken yet. Must be between 0 and 100.
10246     * - `serviceName`: name of the service being instrumented.
10247     * - `endpoint`: URL of the OpenTelemetry collector to send trace data to.
10248     * This has to be an endpoint accepting OTLP data over HTTP (not gRPC).
10249     *
10250     * An example config to send data to a local OpenTelemetry or Jaeger collector instance:
10251     * ```
10252     * $wgOpenTelemetryConfig = [
10253     *  'samplingProbability' => 0.1,
10254     *  'serviceName' => 'mediawiki-local',
10255     *  'endpoint' => 'http://127.0.0.1:4318/v1/traces',
10256     * ];
10257     * ```
10258     * @since 1.43
10259     */
10260    public const OpenTelemetryConfig = [
10261        'default' => null,
10262        'type' => 'map|null'
10263    ];
10264
10265    /**
10266     * InfoAction retrieves a list of transclusion links (both to and from).
10267     *
10268     * This number puts a limit on that query in the case of highly transcluded
10269     * templates.
10270     */
10271    public const PageInfoTransclusionLimit = [
10272        'default' => 50,
10273    ];
10274
10275    /**
10276     * Allow running of QUnit tests via [[Special:JavaScriptTest]].
10277     */
10278    public const EnableJavaScriptTest = [
10279        'default' => false,
10280    ];
10281
10282    /**
10283     * Overwrite the caching key prefix with custom value.
10284     *
10285     * @since 1.19
10286     */
10287    public const CachePrefix = [
10288        'default' => false,
10289    ];
10290
10291    /**
10292     * Display the new debugging toolbar. This also enables profiling on database
10293     * queries and other useful output.
10294     *
10295     * Will be ignored if $wgUseFileCache or $wgUseCdn is enabled.
10296     *
10297     * @since 1.19
10298     */
10299    public const DebugToolbar = [
10300        'default' => false,
10301    ];
10302
10303    // endregion -- end of profiling, testing and debugging
10304
10305    /***************************************************************************/
10306    // region   Search
10307    /** @name   Search */
10308
10309    /**
10310     * Set this to true to disable the full text search feature.
10311     */
10312    public const DisableTextSearch = [
10313        'default' => false,
10314    ];
10315
10316    /**
10317     * Set to true to have nicer highlighted text in search results,
10318     * by default off due to execution overhead
10319     */
10320    public const AdvancedSearchHighlighting = [
10321        'default' => false,
10322    ];
10323
10324    /**
10325     * Regexp to match word boundaries, defaults for non-CJK languages
10326     * should be empty for CJK since the words are not separate
10327     */
10328    public const SearchHighlightBoundaries = [
10329        'default' => '[\\p{Z}\\p{P}\\p{C}]',
10330    ];
10331
10332    /**
10333     * Templates for OpenSearch suggestions, defaults to API action=opensearch
10334     *
10335     * Sites with heavy load would typically have these point to a custom
10336     * PHP wrapper to avoid firing up mediawiki for every keystroke
10337     *
10338     * Placeholders: {searchTerms}
10339     */
10340    public const OpenSearchTemplates = [
10341        'default' => [
10342            'application/x-suggestions+json' => false,
10343            'application/x-suggestions+xml' => false,
10344        ],
10345        'type' => 'map',
10346    ];
10347
10348    /**
10349     * This was previously a used to force empty responses from ApiOpenSearch
10350     * with the 'suggest' parameter set.
10351     *
10352     * @deprecated since 1.35 No longer used
10353     */
10354    public const EnableOpenSearchSuggest = [
10355        'default' => true,
10356        'obsolete' => 'Since 1.35, no longer used',
10357        'description' => 'Has been emitting warnings since 1.39 (LTS). ' .
10358            'Can be removed completely in 1.44, assuming 1.43 is an LTS release.'
10359    ];
10360
10361    /**
10362     * Integer defining default number of entries to show on
10363     * OpenSearch call.
10364     */
10365    public const OpenSearchDefaultLimit = [
10366        'default' => 10,
10367    ];
10368
10369    /**
10370     * Minimum length of extract in <Description>. Actual extracts will last until the end of
10371     * sentence.
10372     */
10373    public const OpenSearchDescriptionLength = [
10374        'default' => 100,
10375    ];
10376
10377    /**
10378     * Expiry time for search suggestion responses
10379     */
10380    public const SearchSuggestCacheExpiry = [
10381        'default' => 1200,
10382    ];
10383
10384    /**
10385     * If you've disabled search semi-permanently, this also disables updates to the
10386     * table. If you ever re-enable, be sure to rebuild the search table.
10387     */
10388    public const DisableSearchUpdate = [
10389        'default' => false,
10390    ];
10391
10392    /**
10393     * List of namespaces which are searched by default.
10394     *
10395     * **Example:**
10396     *
10397     * ```
10398     * $wgNamespacesToBeSearchedDefault[NS_MAIN] = true;
10399     * $wgNamespacesToBeSearchedDefault[NS_PROJECT] = true;
10400     * ```
10401     */
10402    public const NamespacesToBeSearchedDefault = [
10403        'default' => [ NS_MAIN => true, ],
10404        'type' => 'map',
10405    ];
10406
10407    /**
10408     * Disable the internal MySQL-based search, to allow it to be
10409     * implemented by an extension instead.
10410     */
10411    public const DisableInternalSearch = [
10412        'default' => false,
10413    ];
10414
10415    /**
10416     * Set this to a URL to forward search requests to some external location.
10417     *
10418     * If the URL includes '$1', this will be replaced with the URL-encoded
10419     * search term. Before using this, $wgDisableTextSearch must be set to true.
10420     *
10421     * **Example:**
10422     * To forward to Google you'd have something like:
10423     *
10424     * ```
10425     * $wgSearchForwardUrl =
10426     * 'https://www.google.com/search?q=$1' .
10427     * '&domains=https://example.com' .
10428     * '&sitesearch=https://example.com' .
10429     * '&ie=utf-8&oe=utf-8';
10430     * ```
10431     */
10432    public const SearchForwardUrl = [
10433        'default' => null,
10434    ];
10435
10436    /**
10437     * Array of namespaces to generate a Google sitemap for when the
10438     * maintenance/generateSitemap.php script is run. If this is false, the API
10439     * will consult NamespaceRobotPolicies, whereas the maintenance script will
10440     * produce a sitemap for all namespaces.
10441     */
10442    public const SitemapNamespaces = [
10443        'default' => false,
10444        'type' => 'false|list',
10445    ];
10446
10447    /**
10448     * @deprecated since 1.45 and ignored
10449     */
10450    public const SitemapNamespacesPriorities = [
10451        'deprecated' => 'since 1.45 and ignored',
10452        'default' => false,
10453        'type' => 'false|map',
10454    ];
10455
10456    /**
10457     * Configuration for the sitemaps REST API endpoint /rest.php/site/v1/sitemap/0
10458     *
10459     * To use this API, set `$wgSitemapApiConfig['enabled'] = true` and then add
10460     * to robots.txt something like:
10461     *
10462     *   Sitemap: http://www.example.org/w/rest.php/site/v1/sitemap/0
10463     *
10464     * Search engines like Google will then use the sitemap to efficiently
10465     * discover pages on your site.
10466     *
10467     * If you have more than 500M pages (sitemapsPerIndex × pagesPerSitemap)
10468     * you can list multiple sitemaps in robots.txt, incrementing the number in
10469     * the index URL.
10470     *
10471     * An associative array with the following keys:
10472     *  - enabled: Whether to deliver sitemaps.
10473     *    Default: false.
10474     *  - sitemapsPerIndex: The maximum number of sitemap files to link to from
10475     *    each index file. This must be 50,000 or less to comply with the
10476     *    protocol.
10477     *    Default: 50,000.
10478     *  - pagesPerSitemap: The maximum number of URLs to link to from each
10479     *    sitemap file. This must be 50,000 or less to comply with the protocol.
10480     *    It might take a few seconds to render a sitemap with 50,000 URLs.
10481     *    Default: 10,000.
10482     *  - expiry: The cache expiry time in seconds.
10483     *    Default: 3600 (1 hour).
10484     *
10485     * @see https://www.sitemaps.org/protocol.html
10486     * @see \MediaWiki\Rest\Handler\SitemapHandlerBase
10487     * @since 1.45
10488     */
10489    public const SitemapApiConfig = [
10490        'default' => [],
10491        'type' => 'object',
10492        'additionalProperties' => [
10493            'enabled' => [ 'type' => 'bool' ],
10494            'sitemapsPerIndex' => [ 'type' => 'int' ],
10495            'pagesPerSitemap' => [ 'type' => 'int' ],
10496            'expiry' => [ 'type' => 'int' ],
10497        ]
10498    ];
10499
10500    /**
10501     * Options for Special:Search completion widget form created by SearchFormWidget class.
10502     *
10503     * Settings that can be used:
10504     * - showDescriptions: true/false - whether to show opensearch description results
10505     * - performSearchOnClick:  true/false - whether to perform search on click
10506     * See also TitleWidget.js UI widget.
10507     *
10508     * @since 1.34
10509     */
10510    public const SpecialSearchFormOptions = [
10511        'default' => [],
10512        'type' => 'map',
10513    ];
10514
10515    /**
10516     * Set true to allow logged-in users to set a preference whether or not matches in
10517     * search results should force redirection to that page. If false, the preference is
10518     * not exposed and cannot be altered from site default. To change your site's default
10519     * preference, set via $wgDefaultUserOptions['search-match-redirect'].
10520     *
10521     * @since 1.35
10522     */
10523    public const SearchMatchRedirectPreference = [
10524        'default' => false,
10525        'type' => 'boolean',
10526    ];
10527
10528    /**
10529     * Controls whether zero-result search queries with suggestions should display results for
10530     * these suggestions.
10531     *
10532     * @since 1.26
10533     */
10534    public const SearchRunSuggestedQuery = [
10535        'default' => true,
10536        'type' => 'boolean',
10537    ];
10538
10539    // endregion -- end of search settings
10540
10541    /***************************************************************************/
10542    // region   Edit user interface
10543    /** @name   Edit user interface */
10544
10545    /**
10546     * Path to the GNU diff3 utility. If the file doesn't exist, edit conflicts will
10547     * fall back to the old behavior (no merging).
10548     */
10549    public const Diff3 = [
10550        'default' => '/usr/bin/diff3',
10551    ];
10552
10553    /**
10554     * Path to the GNU diff utility.
10555     */
10556    public const Diff = [
10557        'default' => '/usr/bin/diff',
10558    ];
10559
10560    /**
10561     * Which namespaces have special treatment where they should be preview-on-open
10562     * Internally only Category: pages apply, but using this extensions (e.g. Semantic MediaWiki)
10563     * can specify namespaces of pages they have special treatment for
10564     */
10565    public const PreviewOnOpenNamespaces = [
10566        'default' => [
10567            NS_CATEGORY => true
10568        ],
10569        'type' => 'map',
10570    ];
10571
10572    /**
10573     * Enable the UniversalEditButton for browsers that support it
10574     * (currently only Firefox with an extension)
10575     * See http://universaleditbutton.org for more background information
10576     */
10577    public const UniversalEditButton = [
10578        'default' => true,
10579    ];
10580
10581    /**
10582     * If user doesn't specify any edit summary when making a an edit, MediaWiki
10583     * will try to automatically create one. This feature can be disabled by set-
10584     * ting this variable false.
10585     */
10586    public const UseAutomaticEditSummaries = [
10587        'default' => true,
10588    ];
10589
10590    // endregion -- end edit UI
10591
10592    /***************************************************************************/
10593    // region   Maintenance
10594    /** @name   Maintenance */
10595    // See also $wgSiteNotice
10596
10597    /**
10598     * For colorized maintenance script output, is your terminal background dark ?
10599     */
10600    public const CommandLineDarkBg = [
10601        'default' => false,
10602    ];
10603
10604    /**
10605     * Set this to a string to put the wiki into read-only mode. The text will be
10606     * used as an explanation to users.
10607     *
10608     * This prevents most write operations via the web interface. Cache updates may
10609     * still be possible. To prevent database writes completely, use the read_only
10610     * option in MySQL.
10611     */
10612    public const ReadOnly = [
10613        'default' => null,
10614    ];
10615
10616    /**
10617     * Set this to true to put the wiki watchlists into read-only mode.
10618     *
10619     * @since 1.31
10620     */
10621    public const ReadOnlyWatchedItemStore = [
10622        'default' => false,
10623        'type' => 'boolean',
10624    ];
10625
10626    /**
10627     * If this lock file exists (size > 0), the wiki will be forced into read-only mode.
10628     *
10629     * Its contents will be shown to users as part of the read-only warning
10630     * message.
10631     *
10632     * Will default to "{$wgUploadDirectory}/lock_yBgMBwiR" in Setup.php
10633     */
10634    public const ReadOnlyFile = [
10635        'default' => false,
10636        'dynamicDefault' => [ 'use' => [ 'UploadDirectory' ] ]
10637    ];
10638
10639    /**
10640     * @param mixed $uploadDirectory Value of UploadDirectory
10641     * @return string
10642     */
10643    public static function getDefaultReadOnlyFile( $uploadDirectory ): string {
10644        return "$uploadDirectory/lock_yBgMBwiR";
10645    }
10646
10647    /**
10648     * When you run the web-based upgrade utility, it will tell you what to set
10649     * this to in order to authorize the upgrade process. It will subsequently be
10650     * used as a password, to authorize further upgrades.
10651     *
10652     * For security, do not set this to a guessable string. Use the value supplied
10653     * by the install/upgrade process. To cause the upgrader to generate a new key,
10654     * delete the old key from LocalSettings.php.
10655     */
10656    public const UpgradeKey = [
10657        'default' => false,
10658    ];
10659
10660    /**
10661     * Fully specified path to git binary
10662     */
10663    public const GitBin = [
10664        'default' => '/usr/bin/git',
10665    ];
10666
10667    /**
10668     * Map GIT repository URLs to viewer URLs to provide links in Special:Version
10669     *
10670     * Key is a pattern passed to preg_match() and preg_replace(),
10671     * without the delimiters (which are #) and must match the whole URL.
10672     * The value is the replacement for the key (it can contain $1, etc.)
10673     * %h will be replaced by the short SHA-1 (7 first chars) and %H by the
10674     * full SHA-1 of the HEAD revision.
10675     * %r will be replaced with a URL-encoded version of $1.
10676     * %R will be replaced with $1 and no URL-encoding
10677     *
10678     * @since 1.20
10679     */
10680    public const GitRepositoryViewers = [
10681        'default' => [
10682            'https://(?:[a-z0-9_]+@)?gerrit.wikimedia.org/r/(?:p/)?(.*)' => 'https://gerrit.wikimedia.org/g/%R/+/%H',
10683            'ssh://(?:[a-z0-9_]+@)?gerrit.wikimedia.org:29418/(.*)' => 'https://gerrit.wikimedia.org/g/%R/+/%H',
10684        ],
10685        'type' => 'map',
10686    ];
10687
10688    /**
10689     * Initial content to create when installing a wiki. An array of page info
10690     * arrays. Each must contain at least one of:
10691     *   - title: The title to create (string)
10692     *   - titlemsg: The name of a message to read the title from
10693     *
10694     * And one of:
10695     *   - text: The text to write to the page (string)
10696     *   - textmsg: The name of a message to read the page contents from
10697     *
10698     * The text may contain
10699     *   - {{InstallerOption:<name>}}: This will be replaced with the named option value
10700     *   - {{InstallerConfig:<name>}}: This will be replaced with the named config value
10701     *
10702     * @see \InstallPreConfigured
10703     * @since 1.44
10704     */
10705    public const InstallerInitialPages = [
10706        'default' => [
10707            [
10708                'titlemsg' => 'mainpage',
10709                'text' => "{{subst:int:mainpagetext}}\n\n{{subst:int:mainpagedocfooter}}",
10710            ]
10711        ],
10712        'type' => 'list'
10713    ];
10714
10715    // endregion -- End of maintenance
10716
10717    /***************************************************************************/
10718    // region   Recent changes, new pages, watchlist and history
10719    /** @name   Recent changes, new pages, watchlist and history */
10720
10721    /**
10722     * Recentchanges items are periodically purged; entries older than this many
10723     * seconds will go.
10724     *
10725     * Default: 90 days = about three months
10726     */
10727    public const RCMaxAge = [
10728        'default' => 90 * 24 * 3600,
10729    ];
10730
10731    /**
10732     * Page watchers inactive for more than this many seconds are considered inactive.
10733     *
10734     * Used mainly by action=info. Default: 180 days = about six months.
10735     *
10736     * @since 1.26
10737     */
10738    public const WatchersMaxAge = [
10739        'default' => 180 * 24 * 3600,
10740    ];
10741
10742    /**
10743     * If active watchers (per above) are this number or less, do not disclose it.
10744     *
10745     * Left to 1, prevents unprivileged users from knowing for sure that there are 0.
10746     * Set to -1 if you want to always complement watchers count with this info.
10747     *
10748     * @since 1.26
10749     */
10750    public const UnwatchedPageSecret = [
10751        'default' => 1,
10752    ];
10753
10754    /**
10755     * Filter $wgRCLinkDays by $wgRCMaxAge to avoid showing links for numbers
10756     * higher than what will be stored. Note that this is disabled by default
10757     * because we sometimes do have RC data which is beyond the limit for some
10758     * reason, and some users may use the high numbers to display that data which
10759     * is still there.
10760     */
10761    public const RCFilterByAge = [
10762        'default' => false,
10763    ];
10764
10765    /**
10766     * List of Limits options to list in the Special:Recentchanges and
10767     * Special:Recentchangeslinked pages.
10768     */
10769    public const RCLinkLimits = [
10770        'default' => [ 50, 100, 250, 500 ],
10771        'type' => 'list',
10772    ];
10773
10774    /**
10775     * List of Days options to list in the Special:Recentchanges and
10776     * Special:Recentchangeslinked pages.
10777     *
10778     * @see \MediaWiki\SpecialPage\ChangesListSpecialPage::getLinkDays
10779     */
10780    public const RCLinkDays = [
10781        'default' => [ 1, 3, 7, 14, 30 ],
10782        'type' => 'list',
10783    ];
10784
10785    /**
10786     * Configuration for feeds to which notifications about recent changes will be sent.
10787     *
10788     * The following feed classes are available by default:
10789     * - 'UDPRCFeedEngine' - sends recent changes over UDP to the specified server.
10790     * - 'RedisPubSubFeedEngine' - send recent changes to Redis.
10791     *
10792     * Only 'class' or 'uri' is required. If 'uri' is set instead of 'class', then
10793     * RecentChange::getEngine() is used to determine the class. All options are
10794     * passed to the constructor.
10795     *
10796     * Common options:
10797     * - 'class' -- The class to use for this feed (must implement RCFeed).
10798     * - 'omit_bots' -- Exclude bot edits from the feed. (default: false)
10799     * - 'omit_anon' -- Exclude anonymous edits from the feed. (default: false)
10800     * - 'omit_user' -- Exclude edits by registered users from the feed. (default: false)
10801     * - 'omit_minor' -- Exclude minor edits from the feed. (default: false)
10802     * - 'omit_patrolled' -- Exclude patrolled edits from the feed. (default: false)
10803     *
10804     * FormattedRCFeed-specific options:
10805     * - 'uri' -- [required] The address to which the messages are sent.
10806     *   The uri scheme of this string will be looked up in $wgRCEngines
10807     *   to determine which FormattedRCFeed class to use.
10808     * - 'formatter' -- [required] The class (implementing RCFeedFormatter) which will
10809     *   produce the text to send. This can also be an object of the class.
10810     *   Formatters available by default: JSONRCFeedFormatter, XMLRCFeedFormatter,
10811     *   IRCColourfulRCFeedFormatter.
10812     *
10813     * IRCColourfulRCFeedFormatter-specific options:
10814     * - 'add_interwiki_prefix' -- whether the titles should be prefixed with
10815     *   the first entry in the $wgLocalInterwikis array
10816     *
10817     * JSONRCFeedFormatter-specific options:
10818     * - 'channel' -- if set, the 'channel' parameter is also set in JSON values.
10819     *
10820     * **Examples:**
10821     *
10822     * ```
10823     * $wgRCFeeds['example'] = [
10824     *     'uri' => 'udp://localhost:1336',
10825     *     'formatter' => 'JSONRCFeedFormatter',
10826     *     'add_interwiki_prefix' => false,
10827     *     'omit_bots' => true,
10828     * ];
10829     * ```
10830     *
10831     * ```
10832     * $wgRCFeeds['example'] = [
10833     *     'uri' => 'udp://localhost:1338',
10834     *     'formatter' => 'IRCColourfulRCFeedFormatter',
10835     *     'add_interwiki_prefix' => false,
10836     *     'omit_bots' => true,
10837     * ];
10838     * ```
10839     *
10840     * ```
10841     * $wgRCFeeds['example'] = [
10842     *     'class' => ExampleRCFeed::class,
10843     * ];
10844     * ```
10845     *
10846     * @since 1.22
10847     */
10848    public const RCFeeds = [
10849        'default' => [],
10850        'type' => 'map',
10851    ];
10852
10853    /**
10854     * Used by RecentChange::getEngine to find the correct engine for a given URI scheme.
10855     *
10856     * Keys are scheme names, values are names of FormattedRCFeed sub classes.
10857     *
10858     * @since 1.22
10859     */
10860    public const RCEngines = [
10861        'default' => [
10862            'redis' => RedisPubSubFeedEngine::class,
10863            'udp' => UDPRCFeedEngine::class,
10864        ],
10865        'type' => 'map',
10866    ];
10867
10868    /**
10869     * Treat category membership changes as a RecentChange.
10870     *
10871     * Changes are mentioned in RC for page actions as follows:
10872     * - creation: pages created with categories are mentioned
10873     * - edit: category additions/removals to existing pages are mentioned
10874     * - move: nothing is mentioned (unless templates used depend on the title)
10875     * - deletion: nothing is mentioned
10876     * - undeletion: nothing is mentioned
10877     *
10878     * @since 1.27
10879     */
10880    public const RCWatchCategoryMembership = [
10881        'default' => false,
10882    ];
10883
10884    /**
10885     * Use RC Patrolling to check for vandalism (from recent changes and watchlists)
10886     * New pages and new files are included.
10887     *
10888     * @note If you disable all patrolling features, you probably also want to
10889     * remove 'patrol' from $wgFilterLogTypes so a show/hide link isn't shown on
10890     * Special:Log.
10891     */
10892    public const UseRCPatrol = [
10893        'default' => true,
10894    ];
10895
10896    /**
10897     * Polling rate, in seconds, used by the 'live update' and 'view newest' features
10898     * of the RCFilters app on SpecialRecentChanges and Special:Watchlist.
10899     *
10900     * 0 to disable completely.
10901     */
10902    public const StructuredChangeFiltersLiveUpdatePollingRate = [
10903        'default' => 3,
10904    ];
10905
10906    /**
10907     * Use new page patrolling to check new pages on Special:Newpages
10908     *
10909     * @note If you disable all patrolling features, you probably also want to
10910     * remove 'patrol' from $wgFilterLogTypes so a show/hide link isn't shown on
10911     * Special:Log.
10912     */
10913    public const UseNPPatrol = [
10914        'default' => true,
10915    ];
10916
10917    /**
10918     * Use file patrolling to check new files on Special:Newfiles
10919     *
10920     * @note If you disable all patrolling features, you probably also want to
10921     * remove 'patrol' from $wgFilterLogTypes so a show/hide link isn't shown on
10922     * Special:Log.
10923     * @since 1.27
10924     */
10925    public const UseFilePatrol = [
10926        'default' => true,
10927    ];
10928
10929    /**
10930     * Provide syndication feeds (RSS, Atom) for, e.g., Recentchanges, Newpages
10931     */
10932    public const Feed = [
10933        'default' => true,
10934    ];
10935
10936    /**
10937     * Set maximum number of results to return in syndication feeds (RSS, Atom) for
10938     * eg Recentchanges, Newpages.
10939     */
10940    public const FeedLimit = [
10941        'default' => 50,
10942    ];
10943
10944    /**
10945     * _Minimum_ timeout for cached Recentchanges feed, in seconds.
10946     *
10947     * A cached version will continue to be served out even if changes
10948     * are made, until this many seconds runs out since the last render.
10949     *
10950     * If set to 0, feed caching is disabled. Use this for debugging only;
10951     * feed generation can be pretty slow with diffs.
10952     */
10953    public const FeedCacheTimeout = [
10954        'default' => 60,
10955    ];
10956
10957    /**
10958     * When generating Recentchanges RSS/Atom feed, diffs will not be generated for
10959     * pages larger than this size.
10960     */
10961    public const FeedDiffCutoff = [
10962        'default' => 32768,
10963    ];
10964
10965    /**
10966     * Override the site's default RSS/ATOM feed for recentchanges that appears on
10967     * every page. Some sites might have a different feed they'd like to promote
10968     * instead of the RC feed (maybe like a "Recent New Articles" or "Breaking news" one).
10969     *
10970     * Should be a format as key (either 'rss' or 'atom') and an URL to the feed
10971     * as value.
10972     *
10973     * **Example:**
10974     * Configure the 'atom' feed to https://example.com/somefeed.xml
10975     *
10976     * ```
10977     * $wgSiteFeed['atom'] = "https://example.com/somefeed.xml";
10978     * ```
10979     */
10980    public const OverrideSiteFeed = [
10981        'default' => [],
10982        'type' => 'map',
10983    ];
10984
10985    /**
10986     * Available feeds objects.
10987     *
10988     * Should probably only be defined when a page is syndicated ie when
10989     * $wgOut->isSyndicated() is true.
10990     */
10991    public const FeedClasses = [
10992        'default' => [
10993            'rss' => \MediaWiki\Feed\RSSFeed::class,
10994            'atom' => \MediaWiki\Feed\AtomFeed::class,
10995        ],
10996        'type' => 'map',
10997    ];
10998
10999    /**
11000     * Which feed types should we provide by default?  This can include 'rss',
11001     * 'atom', neither, or both.
11002     */
11003    public const AdvertisedFeedTypes = [
11004        'default' => [ 'atom', ],
11005        'type' => 'list',
11006    ];
11007
11008    /**
11009     * Show watching users in recent changes, watchlist and page history views
11010     */
11011    public const RCShowWatchingUsers = [
11012        'default' => false,
11013    ];
11014
11015    /**
11016     * Show the amount of changed characters in recent changes
11017     */
11018    public const RCShowChangedSize = [
11019        'default' => true,
11020    ];
11021
11022    /**
11023     * If the difference between the character counts of the text
11024     * before and after the edit is below that value, the value will be
11025     * highlighted on the RC page.
11026     */
11027    public const RCChangedSizeThreshold = [
11028        'default' => 500,
11029    ];
11030
11031    /**
11032     * Show "Updated (since my last visit)" marker in RC view, watchlist and history
11033     * view for watched pages with new changes
11034     */
11035    public const ShowUpdatedMarker = [
11036        'default' => true,
11037    ];
11038
11039    /**
11040     * Disable links to talk pages of anonymous users (IPs) in listings on special
11041     * pages like page history, Special:Recentchanges, etc.
11042     */
11043    public const DisableAnonTalk = [
11044        'default' => false,
11045    ];
11046
11047    /**
11048     * Allow filtering by change tag in recentchanges, history, etc
11049     * Has no effect if no tags are defined.
11050     */
11051    public const UseTagFilter = [
11052        'default' => true,
11053    ];
11054
11055    /**
11056     * List of core tags to enable.
11057     *
11058     * @since 1.31
11059     * @since 1.36 Added 'mw-manual-revert' and 'mw-reverted'
11060     * @see \MediaWiki\ChangeTags\ChangeTags::TAG_CONTENT_MODEL_CHANGE
11061     * @see \MediaWiki\ChangeTags\ChangeTags::TAG_NEW_REDIRECT
11062     * @see \MediaWiki\ChangeTags\ChangeTags::TAG_REMOVED_REDIRECT
11063     * @see \MediaWiki\ChangeTags\ChangeTags::TAG_CHANGED_REDIRECT_TARGET
11064     * @see \MediaWiki\ChangeTags\ChangeTags::TAG_BLANK
11065     * @see \MediaWiki\ChangeTags\ChangeTags::TAG_REPLACE
11066     * @see \MediaWiki\ChangeTags\ChangeTags::TAG_RECREATE
11067     * @see \MediaWiki\ChangeTags\ChangeTags::TAG_ROLLBACK
11068     * @see \MediaWiki\ChangeTags\ChangeTags::TAG_UNDO
11069     * @see \MediaWiki\ChangeTags\ChangeTags::TAG_MANUAL_REVERT
11070     * @see \MediaWiki\ChangeTags\ChangeTags::TAG_REVERTED
11071     * @see \MediaWiki\ChangeTags\ChangeTags::TAG_SERVER_SIDE_UPLOAD
11072     * @see \MediaWiki\ChangeTags\ChangeTags::TAG_IPBLOCK_APPEAL
11073     */
11074    public const SoftwareTags = [
11075        'default' => [
11076            'mw-contentmodelchange' => true,
11077            'mw-new-redirect' => true,
11078            'mw-removed-redirect' => true,
11079            'mw-changed-redirect-target' => true,
11080            'mw-blank' => true,
11081            'mw-replace' => true,
11082            'mw-recreated' => true,
11083            'mw-rollback' => true,
11084            'mw-undo' => true,
11085            'mw-manual-revert' => true,
11086            'mw-reverted' => true,
11087            'mw-server-side-upload' => true,
11088            'mw-ipblock-appeal' => true,
11089        ],
11090        'type' => 'map',
11091        'additionalProperties' => [ 'type' => 'boolean', ],
11092    ];
11093
11094    /**
11095     * If set to an integer, pages that are watched by this many users or more
11096     * will not require the unwatchedpages permission to view the number of
11097     * watchers.
11098     *
11099     * @since 1.21
11100     */
11101    public const UnwatchedPageThreshold = [
11102        'default' => false,
11103    ];
11104
11105    /**
11106     * Flags (letter symbols) shown in recent changes and watchlist to indicate
11107     * certain types of edits.
11108     *
11109     * To register a new one:
11110     *
11111     * ```
11112     * $wgRecentChangesFlags['flag'] => [
11113     *   // message for the letter displayed next to rows on changes lists
11114     *   'letter' => 'letter-msg',
11115     *   // message for the tooltip of the letter
11116     *   'title' => 'tooltip-msg',
11117     *   // optional (defaults to 'tooltip-msg'), message to use in the legend box
11118     *   'legend' => 'legend-msg',
11119     *   // optional (defaults to 'flag'), CSS class to put on changes lists rows
11120     *   'class' => 'css-class',
11121     *   // optional (defaults to 'any'), how top-level flag is determined.  'any'
11122     *   // will set the top-level flag if any line contains the flag, 'all' will
11123     *   // only be set if all lines contain the flag.
11124     *   'grouping' => 'any',
11125     * ];
11126     * ```
11127     *
11128     * @since 1.22
11129     */
11130    public const RecentChangesFlags = [
11131        'default' => [
11132            'newpage' => [
11133                'letter' => 'newpageletter',
11134                'title' => 'recentchanges-label-newpage',
11135                'legend' => 'recentchanges-legend-newpage',
11136                'grouping' => 'any',
11137            ],
11138            'minor' => [
11139                'letter' => 'minoreditletter',
11140                'title' => 'recentchanges-label-minor',
11141                'legend' => 'recentchanges-legend-minor',
11142                'class' => 'minoredit',
11143                'grouping' => 'all',
11144            ],
11145            'bot' => [
11146                'letter' => 'boteditletter',
11147                'title' => 'recentchanges-label-bot',
11148                'legend' => 'recentchanges-legend-bot',
11149                'class' => 'botedit',
11150                'grouping' => 'all',
11151            ],
11152            'unpatrolled' => [
11153                'letter' => 'unpatrolledletter',
11154                'title' => 'recentchanges-label-unpatrolled',
11155                'legend' => 'recentchanges-legend-unpatrolled',
11156                'grouping' => 'any',
11157            ],
11158        ],
11159        'type' => 'map',
11160    ];
11161
11162    /**
11163     * Whether to enable the watchlist expiry feature.
11164     *
11165     * @since 1.35
11166     */
11167    public const WatchlistExpiry = [
11168        'default' => false,
11169        'type' => 'boolean',
11170    ];
11171
11172    /**
11173     * Whether to enable the watchlist labels feature.
11174     *
11175     * @since 1.46
11176     */
11177    public const EnableWatchlistLabels = [
11178        'default' => false,
11179        'type' => 'boolean',
11180    ];
11181
11182    /**
11183     * Maximum number of labels a user can create for their watchlist.
11184     *
11185     * @since 1.46
11186     */
11187    public const WatchlistLabelsMaxPerUser = [
11188        'default' => 100,
11189        'type' => 'integer',
11190    ];
11191
11192    /**
11193     * Chance of expired watchlist items being purged on any page edit.
11194     *
11195     * Only has effect if $wgWatchlistExpiry is true.
11196     *
11197     * If this is zero, expired watchlist items will not be removed
11198     * and the purgeExpiredWatchlistItems.php maintenance script should be run periodically.
11199     *
11200     * @since 1.35
11201     */
11202    public const WatchlistPurgeRate = [
11203        'default' => 0.1,
11204        'type' => 'float',
11205    ];
11206
11207    /**
11208     * Relative maximum duration for watchlist expiries, as accepted by strtotime().
11209     *
11210     * This relates to finite watchlist expiries only. Pages can be watched indefinitely
11211     * regardless of what this is set to.
11212     *
11213     * This is used to ensure the watchlist_expiry table doesn't grow to be too big.
11214     *
11215     * Only has effect if $wgWatchlistExpiry is true.
11216     *
11217     * Set to null to allow expiries of any duration.
11218     *
11219     * @since 1.35
11220     */
11221    public const WatchlistExpiryMaxDuration = [
11222        'default' => '1 year',
11223        'type' => '?string',
11224    ];
11225
11226    /**
11227     * Allow Watchlist and RecentChangesLinked queries to be partitioned by
11228     * rc_timestamp. This may help with performance. (T403798)
11229     *
11230     * @since 1.45
11231     */
11232    public const EnableChangesListQueryPartitioning = [
11233        'default' => false,
11234        'type' => 'bool',
11235    ];
11236
11237    // endregion -- end RC/watchlist
11238
11239    /***************************************************************************/
11240    // region   Copyright and credits settings
11241    /** @name   Copyright and credits settings */
11242
11243    /**
11244     * Override for copyright metadata.
11245     *
11246     * This is the name of the page containing information about the wiki's copyright status,
11247     * which will be added as a link in the footer if it is specified. It overrides
11248     * $wgRightsUrl if both are specified.
11249     */
11250    public const RightsPage = [
11251        'default' => null,
11252    ];
11253
11254    /**
11255     * Set this to specify an external URL containing details about the content license used on your
11256     * wiki.
11257     *
11258     * If $wgRightsPage is set then this setting is ignored.
11259     */
11260    public const RightsUrl = [
11261        'default' => null,
11262    ];
11263
11264    /**
11265     * If either $wgRightsUrl or $wgRightsPage is specified then this variable gives the text for
11266     * the link. Otherwise, it will be treated as raw HTML.
11267     *
11268     * If using $wgRightsUrl then this value must be specified. If using $wgRightsPage then the
11269     * name
11270     * of the page will also be used as the link text if this variable is not set.
11271     */
11272    public const RightsText = [
11273        'default' => null,
11274    ];
11275
11276    /**
11277     * Override for copyright metadata.
11278     */
11279    public const RightsIcon = [
11280        'default' => null,
11281    ];
11282
11283    /**
11284     * Set this to true if you want detailed copyright information forms on Upload.
11285     */
11286    public const UseCopyrightUpload = [
11287        'default' => false,
11288    ];
11289
11290    /**
11291     * Set this to the number of authors that you want to be credited below an
11292     * article text. Set it to zero to hide the attribution block, and a negative
11293     * number (like -1) to show all authors. Note that this will require 2-3 extra
11294     * database hits, which can have a not insignificant impact on performance for
11295     * large wikis.
11296     */
11297    public const MaxCredits = [
11298        'default' => 0,
11299    ];
11300
11301    /**
11302     * If there are more than $wgMaxCredits authors, show $wgMaxCredits of them.
11303     *
11304     * Otherwise, link to a separate credits page.
11305     */
11306    public const ShowCreditsIfMax = [
11307        'default' => true,
11308    ];
11309
11310    // endregion -- end of copyright and credits settings
11311
11312    /***************************************************************************/
11313    // region   Import / Export
11314    /** @name   Import / Export */
11315
11316    /**
11317     * List of interwiki prefixes for wikis we'll accept as sources for
11318     * Special:Import and API action=import. Since complete page history can be
11319     * imported, these should be 'trusted'.
11320     *
11321     * This can either be a regular array, or an associative map specifying
11322     * subprojects on the interwiki map of the target wiki, or a mix of the two,
11323     * e.g.
11324     *
11325     * ```
11326     * $wgImportSources = [
11327     *     'wikipedia' => [ 'cs', 'en', 'fr', 'zh' ],
11328     *     'wikispecies',
11329     *     'wikia' => [ 'animanga', 'brickipedia', 'desserts' ],
11330     * ];
11331     * ```
11332     *
11333     * If you have a very complex import sources setup, you can lazy-load it using
11334     * the ImportSources hook.
11335     *
11336     * If a user has the 'import' permission but not the 'importupload' permission,
11337     * they will only be able to run imports through this transwiki interface.
11338     */
11339    public const ImportSources = [
11340        'default' => [],
11341        'type' => 'map',
11342    ];
11343
11344    /**
11345     * Optional default target namespace for interwiki imports.
11346     *
11347     * Can use this to create an incoming "transwiki"-style queue.
11348     * Set to numeric key, not the name.
11349     *
11350     * Users may override this in the Special:Import dialog.
11351     */
11352    public const ImportTargetNamespace = [
11353        'default' => null,
11354    ];
11355
11356    /**
11357     * If set to false, disables the full-history option on Special:Export.
11358     *
11359     * This is currently poorly optimized for long edit histories, so is
11360     * disabled on Wikimedia's sites.
11361     */
11362    public const ExportAllowHistory = [
11363        'default' => true,
11364    ];
11365
11366    /**
11367     * If set nonzero, Special:Export requests for history of pages with
11368     * more revisions than this will be rejected. On some big sites things
11369     * could get bogged down by very very long pages.
11370     */
11371    public const ExportMaxHistory = [
11372        'default' => 0,
11373    ];
11374
11375    /**
11376     * Return distinct author list (when not returning full history)
11377     */
11378    public const ExportAllowListContributors = [
11379        'default' => false,
11380    ];
11381
11382    /**
11383     * If non-zero, Special:Export accepts a "pagelink-depth" parameter
11384     * up to this specified level, which will cause it to include all
11385     * pages linked to from the pages you specify. Since this number
11386     * can become *really really large* and could easily break your wiki,
11387     * it's disabled by default for now.
11388     *
11389     * @warning There's a HARD CODED limit of 5 levels of recursion to prevent a
11390     * crazy-big export from being done by someone setting the depth number too
11391     * high. In other words, last resort safety net.
11392     */
11393    public const ExportMaxLinkDepth = [
11394        'default' => 0,
11395    ];
11396
11397    /**
11398     * Whether to allow the "export all pages in namespace" option
11399     */
11400    public const ExportFromNamespaces = [
11401        'default' => false,
11402    ];
11403
11404    /**
11405     * Whether to allow exporting the entire wiki into a single file
11406     */
11407    public const ExportAllowAll = [
11408        'default' => false,
11409    ];
11410
11411    /**
11412     * Maximum number of pages returned by the GetPagesFromCategory and
11413     * GetPagesFromNamespace functions.
11414     *
11415     * @since 1.27
11416     */
11417    public const ExportPagelistLimit = [
11418        'default' => 5000,
11419    ];
11420
11421    /**
11422     * The schema to use by default when generating XML dumps. This allows sites to control
11423     * explicitly when to make breaking changes to their export and dump format.
11424     */
11425    public const XmlDumpSchemaVersion = [
11426        'default' => XML_DUMP_SCHEMA_VERSION_11,
11427    ];
11428
11429    // endregion -- end of import/export
11430
11431    /***************************************************************************/
11432    // region   Wiki Farm
11433    /** @name   Wiki Farm */
11434
11435    /**
11436     * A directory that contains site-specific configuration files.
11437     *
11438     * Setting this will enable multi-tenant ("wiki farm") mode, causing
11439     * site-specific settings to be loaded based on information from the web request.
11440     *
11441     * @unstable EXPERIMENTAL
11442     * @since 1.38
11443     */
11444    public const WikiFarmSettingsDirectory = [
11445        'default' => null
11446    ];
11447
11448    /**
11449     * The file extension to be used when looking up site-specific settings files in
11450     * $wgWikiFarmSettingsDirectory, such as 'json' or 'yaml'.
11451     *
11452     * @unstable EXPERIMENTAL
11453     * @since 1.38
11454     */
11455    public const WikiFarmSettingsExtension = [
11456        'default' => 'yaml'
11457    ];
11458
11459    // endregion -- End Wiki Farm
11460
11461    /***************************************************************************/
11462    // region   Extensions
11463    /** @name   Extensions */
11464
11465    /**
11466     * A list of callback functions which are called once MediaWiki is fully
11467     * initialised
11468     */
11469    public const ExtensionFunctions = [
11470        'default' => [],
11471        'type' => 'list',
11472    ];
11473
11474    /**
11475     * Extension messages files.
11476     *
11477     * Associative array mapping extension name to the filename where messages can be
11478     * found. The file should contain variable assignments. Any of the variables
11479     * present in languages/messages/MessagesEn.php may be defined, but the most common
11480     * ones are $namespaceNames and $namespaceAliases for namespaces, $specialPageAliases
11481     * for special page names and $magicWords for magic words.
11482     *
11483     * Variables defined in extensions will override conflicting variables defined
11484     * in the core.
11485     *
11486     * Before MediaWiki 1.23, this variable was most commonly used to define messages,
11487     * but since the introduction of $wgMessageDirs in that version, that is discouraged;
11488     * instead, store messages in JSON format and use $wgMessagesDirs. For setting other
11489     * variables than $messages, $wgExtensionMessagesFiles should still be used. Use a
11490     * DIFFERENT key, because any entry having a key that also exists in $wgMessagesDirs
11491     * will be ignored.
11492     *
11493     * Extensions using the JSON message format can preserve backward compatibility with
11494     * earlier versions of MediaWiki by using a compatibility shim, such as one generated
11495     * by the generateJsonI18n.php maintenance script, listing it under the SAME key
11496     * as for the $wgMessagesDirs entry.
11497     *
11498     * **Example:**
11499     *
11500     * ```
11501     * $wgExtensionMessagesFiles['ConfirmEdit'] = __DIR__.'/ConfirmEdit.i18n.php';
11502     * ```
11503     */
11504    public const ExtensionMessagesFiles = [
11505        'default' => [],
11506        'type' => 'map',
11507    ];
11508
11509    /**
11510     * Extension messages directories.
11511     *
11512     * Associative array mapping extension name to the path of the directory where message files can
11513     * be found. The message files are expected to be JSON files named for their language code, e.g.
11514     * en.json, de.json, etc. Extensions with messages in multiple places may specify an array of
11515     * message directories.
11516     *
11517     * Message directories in core should be added to LocalisationCache::getMessagesDirs()
11518     *
11519     * **Simple example:**
11520     *
11521     * ```
11522     * $wgMessagesDirs['Example'] = __DIR__ . '/i18n';
11523     * ```
11524     *
11525     * **Complex example:**
11526     *
11527     * ```
11528     * $wgMessagesDirs['Example'] = [
11529     *     __DIR__ . '/lib/ve/i18n',
11530     *     __DIR__ . '/lib/ooui/i18n',
11531     *     __DIR__ . '/i18n',
11532     * ]
11533     * ```
11534     *
11535     * @since 1.23
11536     */
11537    public const MessagesDirs = [
11538        'default' => [],
11539        'type' => 'map',
11540    ];
11541
11542    /**
11543     * Message directories containing JSON files for localisation of special page aliases.
11544     *
11545     * Associative array mapping extension name to the directory where configurations can be
11546     * found. The directory is expected to contain JSON files corresponding to each language code.
11547     *
11548     * Variables defined in extensions will override conflicting variables defined
11549     * in the core. We recommend using this configuration to set variables that require localisation:
11550     * special page aliases, and in the future namespace aliases and magic words.
11551     *
11552     * **Simple example**: extension.json
11553     * ```
11554     * "TranslationAliasesDirs": {
11555     *   "TranslationNotificationsAlias": "i18n/aliases"
11556     * }
11557     * ```
11558     * **Complex example**: extension.json
11559     *  ```
11560     *  "TranslationAliasesDirs": {
11561     *    "TranslationNotificationsAlias": [ "i18n/special-page-aliases", "i18n/magic-words", "i18n/namespaces" ]
11562     *  }
11563     *  ```
11564     *
11565     * @unstable EXPERIMENTAL
11566     * @since 1.42
11567     */
11568    public const TranslationAliasesDirs = [
11569        'default' => [],
11570        'type' => 'map',
11571    ];
11572
11573    /**
11574     * Array of files with list(s) of extension entry points to be used in
11575     * maintenance/mergeMessageFileList.php
11576     *
11577     * @since 1.22
11578     */
11579    public const ExtensionEntryPointListFiles = [
11580        'default' => [],
11581        'type' => 'map',
11582    ];
11583
11584    /**
11585     * Whether to include the NewPP limit report as a HTML comment
11586     */
11587    public const EnableParserLimitReporting = [
11588        'default' => true,
11589    ];
11590
11591    /**
11592     * List of valid skin names
11593     *
11594     * The key should be the name in all lower case.
11595     *
11596     * As of 1.35, the value should be a an array in the form of the ObjectFactory specification.
11597     *
11598     * For example for 'foobarskin' where the PHP class is 'MediaWiki\Skins\FooBar\FooBarSkin' set:
11599     *
11600     * **skin.json Example:**
11601     *
11602     * ```
11603     * "ValidSkinNames": {
11604     *    "foobarskin": {
11605     *        "displayname": "FooBarSkin",
11606     *        "class": "MediaWiki\\Skins\\FooBar\\FooBarSkin"
11607     *    }
11608     * }
11609     * ```
11610     *
11611     * Historically, the value was a properly cased name for the skin (and is still currently
11612     * supported). This value will be prefixed with "Skin" to create the class name of the
11613     * skin to load. Use SkinFactory::getInstalledSkins() as an accessor if you wish to have access to the
11614     * full list.
11615     */
11616    public const ValidSkinNames = [
11617        'default' => [],
11618        'type' => 'map',
11619    ];
11620
11621    /**
11622     * Special page list. This is an associative array mapping the (canonical) names of
11623     * special pages to either a class name or a ObjectFactory spec to be instantiated, or a callback to use for
11624     * creating the special page object. In all cases, the result must be an instance of SpecialPage.
11625     */
11626    public const SpecialPages = [
11627        'default' => [],
11628        'type' => 'map',
11629    ];
11630
11631    /**
11632     * Obsolete switch that controlled legacy case-insensitive classloading.
11633     *
11634     * Case-insensitive classloading was needed for loading data that had
11635     * been serialized by PHP 4 with the class names converted to lowercase.
11636     * It is no longer necessary since 1.31; the lowercase forms in question
11637     * are now listed in autoload.php (T166759).
11638     *
11639     * @deprecated since 1.35
11640     */
11641    public const AutoloadAttemptLowercase = [
11642        'default' => false,
11643        'obsolete' => 'Since 1.40; no longer has any effect.',
11644        'description' => 'Has been emitting warnings since 1.39 (LTS). ' .
11645            'Can be removed completely in 1.44, assuming 1.43 is an LTS release.'
11646    ];
11647
11648    /**
11649     * Add information about an installed extension, keyed by its type.
11650     *
11651     * This is for use from LocalSettings.php and legacy PHP-entrypoint
11652     * extensions. In general, extensions should (only) declare this
11653     * information in their extension.json file.
11654     *
11655     * The 'name', 'path' and 'author' keys are required.
11656     *
11657     * ```
11658     * $wgExtensionCredits['other'][] = [
11659     *     'path' => __FILE__,
11660     *     'name' => 'Example extension',
11661     *     'namemsg' => 'exampleextension-name',
11662     *     'author' => [
11663     *         'Foo Barstein',
11664     *     ],
11665     *     'version' => '0.0.1',
11666     *     'url' => 'https://example.org/example-extension/',
11667     *     'descriptionmsg' => 'exampleextension-desc',
11668     *     'license-name' => 'GPL-2.0-or-later',
11669     * ];
11670     * ```
11671     *
11672     * The extensions are listed on Special:Version. This page also looks for a file
11673     * named COPYING or LICENSE (optional .txt extension) and provides a link to
11674     * view said file. When the 'license-name' key is specified, this file is
11675     * interpreted as wikitext.
11676     *
11677     * - $type: One of 'specialpage', 'parserhook', 'variable', 'media', 'antispam',
11678     *    'skin', 'api', or 'other', or any additional types as specified through the
11679     *    ExtensionTypes hook as used in SpecialVersion::getExtensionTypes().
11680     *
11681     * - name: Name of extension as an inline string instead of localizable message.
11682     *    Do not omit this even if 'namemsg' is provided, as it is used to override
11683     *    the path Special:Version uses to find extension's license info, and is
11684     *    required for backwards-compatibility with MediaWiki 1.23 and older.
11685     *
11686     * - namemsg (since MW 1.24): A message key for a message containing the
11687     *    extension's name, if the name is localizable. (For example, skin names
11688     *    usually are.)
11689     *
11690     * - author: A string or an array of strings. Authors can be linked using
11691     *    the regular wikitext link syntax. To have an internationalized version of
11692     *    "and others" show, add an element "...". This element can also be linked,
11693     *    for instance "[https://example ...]".
11694     *
11695     * - descriptionmsg: A message key or an array with message key and parameters:
11696     *    `'descriptionmsg' => 'exampleextension-desc',`
11697     *
11698     * - description: Description of extension as an inline string instead of
11699     *    localizable message (omit in favour of 'descriptionmsg').
11700     *
11701     * - license-name: Short name of the license (used as label for the link), such
11702     *   as "GPL-2.0-or-later" or "MIT" (https://spdx.org/licenses/ for a list of identifiers).
11703     *
11704     * @see \MediaWiki\Specials\SpecialVersion::getCredits
11705     */
11706    public const ExtensionCredits = [
11707        'default' => [],
11708        'type' => 'map',
11709    ];
11710
11711    /**
11712     * Global list of hooks.
11713     *
11714     * The key is one of the events made available by MediaWiki, you can find
11715     * a description for most of them in their respective hook interfaces. For
11716     * overview of the hook system see docs/Hooks.md. The array is used internally
11717     * by HookContainer::run().
11718     *
11719     * The value can be one of:
11720     *
11721     * - A function name: `$wgHooks['event_name'][] = $function;`
11722     *
11723     * - A function with some data: `$wgHooks['event_name'][] = [ $function, $data ];`
11724     *
11725     *
11726     * - A an object method: `$wgHooks['event_name'][] = [ $object, 'method' ];`
11727     *
11728     * - A closure:
11729     * ```
11730     * $wgHooks['event_name'][] = function ( $hookParam ) {
11731     *     // Handler code goes here.
11732     * };
11733     * ```
11734     *
11735     * @warning You should always append to an event array or you will end up
11736     * deleting a previous registered hook.
11737     * @warning Hook handlers should be registered at file scope. Registering
11738     * handlers after file scope can lead to unexpected results due to caching.
11739     */
11740    public const Hooks = [
11741        'default' => [],
11742        'type' => 'map',
11743        'mergeStrategy' => 'array_merge_recursive',
11744    ];
11745
11746    /**
11747     * List of service wiring files to be loaded by the default instance of MediaWikiServices. Each
11748     * file listed here is expected to return an associative array mapping service names to
11749     * instantiator functions. Extensions may add wiring files to define their own services.
11750     * However, this cannot be used to replace existing services - use the MediaWikiServices hook
11751     * for that.
11752     *
11753     * @note the default wiring file will be added automatically by Setup.php
11754     * @see \MediaWiki\MediaWikiServices
11755     * @see \Wikimedia\Services\ServiceContainer::loadWiringFiles() for details on loading
11756     *   service instantiator functions.
11757     * @see docs/Injection.md for an overview of dependency
11758     *   injection in MediaWiki.
11759     */
11760    public const ServiceWiringFiles = [
11761        'default' => [],
11762        'type' => 'list',
11763    ];
11764
11765    /**
11766     * Maps jobs to their handlers; extensions
11767     * can add to this to provide custom jobs.
11768     *
11769     * Since 1.40, job handlers can be specified as object specs
11770     * for use with ObjectFactory, using an array, a plain class name,
11771     * or a callback.
11772     *
11773     * @note The constructor signature of job classes has to follow one of two patterns:
11774     * Either it takes a parameter array as the first argument, followed by any services it
11775     * needs to have injected: ( array $params, ... ).
11776     * Or it takes a PageReference as the first parameter, followed by the parameter array,
11777     * followed by any services: ( PageReference $page, array $params, ... ).
11778     * In order to signal to the JobFactory that the $page parameter should be omitted from
11779     * the constructor arguments, the job class has to be a subclass of GenericParameterJob,
11780     * or the object specification for the job has to set the 'needsPage' key to false.
11781     * If a callback is used, its signature follows the same rules.
11782     */
11783    public const JobClasses = [
11784        'default' => [
11785            'deletePage' => DeletePageJob::class,
11786            'refreshLinks' => RefreshLinksJob::class,
11787            'deleteLinks' => DeleteLinksJob::class,
11788            'htmlCacheUpdate' => HTMLCacheUpdateJob::class,
11789            'sendMail' => [
11790                'class' => EmaillingJob::class,
11791                'services' => [
11792                    0 => 'Emailer'
11793                ]
11794            ],
11795            'enotifNotify' => [
11796                'class' => RecentChangeNotifyJob::class,
11797                'services' => [
11798                    'RecentChangeLookup',
11799                ],
11800            ],
11801            'fixDoubleRedirect' => [
11802                'class' => DoubleRedirectJob::class,
11803                'services' => [
11804                    'RevisionLookup',
11805                    'MagicWordFactory',
11806                    'WikiPageFactory',
11807                ],
11808                // This job requires a title
11809                'needsPage' => true,
11810            ],
11811            'AssembleUploadChunks' => AssembleUploadChunksJob::class,
11812            'PublishStashedFile' => PublishStashedFileJob::class,
11813            'ThumbnailRender' => ThumbnailRenderJob::class,
11814            'UploadFromUrl' => UploadFromUrlJob::class,
11815            'recentChangesUpdate' => RecentChangesUpdateJob::class,
11816            'refreshLinksPrioritized' => RefreshLinksJob::class,
11817            'refreshLinksDynamic' => RefreshLinksJob::class,
11818            'activityUpdateJob' => ActivityUpdateJob::class,
11819            'categoryMembershipChange' => [
11820                'class' => CategoryMembershipChangeJob::class,
11821                'services' => [
11822                    'RecentChangeFactory',
11823                ],
11824            ],
11825            'CategoryCountUpdateJob' => [
11826                'class' => CategoryCountUpdateJob::class,
11827                'services' => [
11828                    'ConnectionProvider',
11829                    'NamespaceInfo',
11830                ],
11831            ],
11832            'clearUserWatchlist' => ClearUserWatchlistJob::class,
11833            'watchlistExpiry' => WatchlistExpiryJob::class,
11834            'cdnPurge' => CdnPurgeJob::class,
11835            'userGroupExpiry' => UserGroupExpiryJob::class,
11836            'clearWatchlistNotifications' => ClearWatchlistNotificationsJob::class,
11837            'userOptionsUpdate' => UserOptionsUpdateJob::class,
11838            'revertedTagUpdate' => RevertedTagUpdateJob::class,
11839            'null' => NullJob::class,
11840            'userEditCountInit' => UserEditCountInitJob::class,
11841            'parsoidCachePrewarm' => [
11842                'class' => ParsoidCachePrewarmJob::class,
11843                'services' => [
11844                    'ParserOutputAccess',
11845                    'PageStore',
11846                    'RevisionLookup',
11847                    'ParsoidSiteConfig',
11848                ],
11849                // tell the JobFactory not to include the $page parameter in the constructor call
11850                'needsPage' => false
11851            ],
11852            'renameUserTable' => [
11853                'class' => RenameUserTableJob::class,
11854                'services' => [
11855                    'MainConfig',
11856                    'DBLoadBalancerFactory'
11857                ]
11858            ],
11859            'renameUserDerived' => [
11860                'class' => RenameUserDerivedJob::class,
11861                'services' => [
11862                    'RenameUserFactory',
11863                    'UserFactory'
11864                ]
11865            ],
11866            // 'renameUser' is a alias for backward compatibility
11867            // it should be removed in the future releases
11868            'renameUser' => [
11869                'class' => RenameUserTableJob::class,
11870                'services' => [
11871                    'MainConfig',
11872                    'DBLoadBalancerFactory'
11873                ]
11874            ],
11875        ],
11876        'type' => 'map',
11877    ];
11878
11879    /**
11880     * Jobs that must be explicitly requested, i.e. aren't run by job runners unless
11881     * special flags are set. The values here are keys of $wgJobClasses.
11882     *
11883     * These can be:
11884     * - Very long-running jobs.
11885     * - Jobs that you would never want to run as part of a page rendering request.
11886     * - Jobs that you want to run on specialized machines ( like transcoding, or a particular
11887     *   machine on your cluster has 'outside' web access you could restrict uploadFromUrl )
11888     * These settings should be global to all wikis.
11889     */
11890    public const JobTypesExcludedFromDefaultQueue = [
11891        'default' => [ 'AssembleUploadChunks', 'PublishStashedFile', 'UploadFromUrl' ],
11892        'type' => 'list',
11893    ];
11894
11895    /**
11896     * Map of job types to how many job "work items" should be run per second
11897     * on each job runner process. The meaning of "work items" varies per job,
11898     * but typically would be something like "pages to update". A single job
11899     * may have a variable number of work items, as is the case with batch jobs.
11900     *
11901     * This is used by runJobs.php and not jobs run via $wgJobRunRate.
11902     * These settings should be global to all wikis.
11903     */
11904    public const JobBackoffThrottling = [
11905        'default' => [],
11906        'type' => 'map',
11907        'additionalProperties' => [ 'type' => 'float', ],
11908    ];
11909
11910    /**
11911     * Map of job types to configuration arrays.
11912     *
11913     * This determines which queue class and storage system is used for each job type.
11914     * Job types that do not have explicit configuration will use the 'default' config.
11915     * These settings should be global to all wikis.
11916     */
11917    public const JobTypeConf = [
11918        'default' => [
11919            'default' => [
11920                'class' => JobQueueDB::class,
11921                'order' => 'random',
11922                'claimTTL' => 3600
11923            ],
11924        ],
11925        'additionalProperties' => [
11926            'type' => 'object',
11927            'properties' => [
11928                'class' => [ 'type' => 'string' ],
11929                'order' => [ 'type' => 'string' ],
11930                'claimTTL' => [ 'type' => 'int' ]
11931            ],
11932        ],
11933        'type' => 'map',
11934    ];
11935
11936    /**
11937     * Whether to include the number of jobs that are queued
11938     * for the API's maxlag parameter.
11939     *
11940     * The total number of jobs will be divided by this to get an
11941     * estimated second of maxlag. Typically bots backoff at maxlag=5,
11942     * so setting this to the max number of jobs that should be in your
11943     * queue divided by 5 should have the effect of stopping bots once
11944     * that limit is hit.
11945     *
11946     * @since 1.29
11947     */
11948    public const JobQueueIncludeInMaxLagFactor = [
11949        'default' => false,
11950    ];
11951
11952    /**
11953     * Additional functions to be performed with updateSpecialPages.
11954     *
11955     * Expensive Querypages are already updated.
11956     */
11957    public const SpecialPageCacheUpdates = [
11958        'default' => [
11959            'Statistics' => [ SiteStatsUpdate::class, 'cacheUpdate' ]
11960        ],
11961        'type' => 'map',
11962    ];
11963
11964    /**
11965     * Page property link table invalidation lists. When a page property
11966     * changes, this may require other link tables to be updated (eg
11967     * adding __HIDDENCAT__ means the hiddencat tracking category will
11968     * have been added, so the categorylinks table needs to be rebuilt).
11969     *
11970     * This array can be added to by extensions.
11971     */
11972    public const PagePropLinkInvalidations = [
11973        'default' => [ 'hiddencat' => 'categorylinks', ],
11974        'type' => 'map',
11975    ];
11976
11977    // endregion -- End extensions
11978
11979    /***************************************************************************/
11980    // region   Categories
11981    /** @name   Categories */
11982
11983    /**
11984     * On category pages, show thumbnail gallery for images belonging to that
11985     * category instead of listing them as articles.
11986     */
11987    public const CategoryMagicGallery = [
11988        'default' => true,
11989    ];
11990
11991    /**
11992     * Paging limit for categories
11993     */
11994    public const CategoryPagingLimit = [
11995        'default' => 200,
11996    ];
11997
11998    /**
11999     * Specify how category names should be sorted, when listed on a category page.
12000     *
12001     * A sorting scheme is also known as a collation.
12002     *
12003     * Available values are:
12004     *
12005     *   - uppercase: Converts the category name to upper case, and sorts by that.
12006     *
12007     *   - identity: Does no conversion. Sorts by binary value of the string.
12008     *
12009     *   - uca-default: Provides access to the Unicode Collation Algorithm with
12010     *     the default element table. This is a compromise collation which sorts
12011     *     all languages in a mediocre way. However, it is better than "uppercase".
12012     *
12013     * To use the uca-default collation, you must have PHP's intl extension
12014     * installed. See https://www.php.net/manual/en/intl.setup.php . The details of the
12015     * resulting collation will depend on the version of ICU installed on the
12016     * server.
12017     *
12018     * After you change this, you must run maintenance/updateCollation.php to fix
12019     * the sort keys in the database.
12020     *
12021     * Extensions can define there own collations by subclassing Collation
12022     * and using the Collation::factory hook.
12023     */
12024    public const CategoryCollation = [
12025        'default' => 'uppercase',
12026    ];
12027
12028    /**
12029     * Additional category collations to store during LinksUpdate. This can be used
12030     * to perform online migration of categories from one collation to another. An
12031     * array of associative arrays each having the following keys:
12032     *
12033     * - table: (string) The table name
12034     * - collation: (string) The collation to use for cl_sortkey
12035     * - fakeCollation: (string) The collation name to insert into cl_collation
12036     *
12037     * @since 1.38
12038     */
12039    public const TempCategoryCollations = [
12040        'default' => [],
12041        'type' => 'list',
12042    ];
12043
12044    /**
12045     * Whether to sort categories in OutputPage for display.
12046     *
12047     * The value of CategoryCollation is used for sorting.
12048     *
12049     * @unstable EXPERIMENTAL This feature is used for Parsoid development,
12050     * but its future as a core feature will depend on community uptake.
12051     */
12052    public const SortedCategories = [
12053        'default' => false,
12054        'type' => 'boolean',
12055    ];
12056
12057    /**
12058     * Array holding default tracking category names.
12059     *
12060     * Array contains the system messages for each tracking category.
12061     * Tracking categories allow pages with certain characteristics to be tracked.
12062     * It works by adding any such page to a category automatically.
12063     *
12064     * A message with the suffix '-desc' should be added as a description message
12065     * to have extra information on Special:TrackingCategories.
12066     *
12067     * @deprecated since 1.25 Extensions should now register tracking categories using
12068     * the new extension registration system.
12069     * @since 1.23
12070     */
12071    public const TrackingCategories = [
12072        'default' => [],
12073        'type' => 'list',
12074        'deprecated' => 'since 1.25 Extensions should now register tracking categories using ' .
12075            'the new extension registration system.',
12076    ];
12077
12078    // endregion -- End categories
12079
12080    /***************************************************************************/
12081    // region   Logging
12082    /** @name   Logging */
12083
12084    /**
12085     * The logging system has two levels: an event type, which describes the
12086     * general category and can be viewed as a named subset of all logs; and
12087     * an action, which is a specific kind of event that can exist in that
12088     * log type.
12089     *
12090     * Note that code should call LogPage::validTypes() to get a list of valid
12091     * log types instead of checking the global variable.
12092     */
12093    public const LogTypes = [
12094        'default' => [
12095            '',
12096            'block',
12097            'protect',
12098            'rights',
12099            'delete',
12100            'upload',
12101            'move',
12102            'import',
12103            'interwiki',
12104            'patrol',
12105            'merge',
12106            'suppress',
12107            'tag',
12108            'managetags',
12109            'contentmodel',
12110            'renameuser',
12111        ],
12112        'type' => 'list',
12113    ];
12114
12115    /**
12116     * This restricts log access to those who have a certain right
12117     * Users without this will not see it in the option menu and can not view it
12118     * Restricted logs are not added to recent changes
12119     * Logs should remain non-transcludable
12120     * Format: logtype => permissiontype
12121     */
12122    public const LogRestrictions = [
12123        'default' => [ 'suppress' => 'suppressionlog', ],
12124        'type' => 'map',
12125    ];
12126
12127    /**
12128     * Show/hide links on Special:Log will be shown for these log types.
12129     *
12130     * This is associative array of log type => boolean "hide by default"
12131     *
12132     * See $wgLogTypes for a list of available log types.
12133     *
12134     * **Example:**
12135     *
12136     * `$wgFilterLogTypes = [ 'move' => true, 'import' => false ];`
12137     *
12138     * Will display show/hide links for the move and import logs. Move logs will be
12139     * hidden by default unless the link is clicked. Import logs will be shown by
12140     * default, and hidden when the link is clicked.
12141     *
12142     * A message of the form logeventslist-[type]-log should be added, and will be
12143     * used for the link text.
12144     */
12145    public const FilterLogTypes = [
12146        'default' => [
12147            'patrol' => true,
12148            'tag' => true,
12149            'newusers' => false,
12150        ],
12151        'type' => 'map',
12152    ];
12153
12154    /**
12155     * Lists the message key string for each log type. The localized messages
12156     * will be listed in the user interface.
12157     *
12158     * Extensions with custom log types may add to this array.
12159     *
12160     * @since 1.19, if you follow the naming convention log-name-TYPE,
12161     * where TYPE is your log type, you don't need to use this array.
12162     */
12163    public const LogNames = [
12164        'default' => [
12165            '' => 'all-logs-page',
12166            'block' => 'blocklogpage',
12167            'protect' => 'protectlogpage',
12168            'rights' => 'rightslog',
12169            'delete' => 'dellogpage',
12170            'upload' => 'uploadlogpage',
12171            'move' => 'movelogpage',
12172            'import' => 'importlogpage',
12173            'patrol' => 'patrol-log-page',
12174            'merge' => 'mergelog',
12175            'suppress' => 'suppressionlog',
12176        ],
12177        'type' => 'map',
12178    ];
12179
12180    /**
12181     * Lists the message key string for descriptive text to be shown at the
12182     * top of each log type.
12183     *
12184     * Extensions with custom log types may add to this array.
12185     *
12186     * @since 1.19, if you follow the naming convention log-description-TYPE,
12187     * where TYPE is your log type, yoy don't need to use this array.
12188     */
12189    public const LogHeaders = [
12190        'default' => [
12191            '' => 'alllogstext',
12192            'block' => 'blocklogtext',
12193            'delete' => 'dellogpagetext',
12194            'import' => 'importlogpagetext',
12195            'merge' => 'mergelogpagetext',
12196            'move' => 'movelogpagetext',
12197            'patrol' => 'patrol-log-header',
12198            'protect' => 'protectlogtext',
12199            'rights' => 'rightslogtext',
12200            'suppress' => 'suppressionlogtext',
12201            'upload' => 'uploadlogpagetext',
12202        ],
12203        'type' => 'map',
12204    ];
12205
12206    /**
12207     * Maps log actions to message keys, for formatting log entries of each type
12208     * and action when displaying logs to the user.
12209     * The array keys are composed as "$type/$action".
12210     *
12211     * Extensions with custom log types may add to this array.
12212     */
12213    public const LogActions = [
12214        'default' => [],
12215        'type' => 'map',
12216    ];
12217
12218    /**
12219     * The same as above, but here values are class names or ObjectFactory specifications,
12220     * not messages. The specification must resolve to a LogFormatter subclass,
12221     * and will receive the LogEntry object as its first constructor argument.
12222     * The type can be specified as '*' (e.g. 'block/*') to handle all types.
12223     *
12224     * @see \MediaWiki\Logging\LogPage::actionText
12225     * @see \MediaWiki\Logging\LogFormatter
12226     */
12227    public const LogActionsHandlers = [
12228        'default' => [
12229            'block/block' => [
12230                'class' => BlockLogFormatter::class,
12231                'services' => [
12232                    'TitleParser',
12233                    'NamespaceInfo',
12234                ]
12235            ],
12236            'block/reblock' => [
12237                'class' => BlockLogFormatter::class,
12238                'services' => [
12239                    'TitleParser',
12240                    'NamespaceInfo',
12241                ]
12242            ],
12243            'block/unblock' => [
12244                'class' => BlockLogFormatter::class,
12245                'services' => [
12246                    'TitleParser',
12247                    'NamespaceInfo',
12248                ]
12249            ],
12250            'contentmodel/change' => ContentModelLogFormatter::class,
12251            'contentmodel/new' => ContentModelLogFormatter::class,
12252            'delete/delete' => DeleteLogFormatter::class,
12253            'delete/delete_redir' => DeleteLogFormatter::class,
12254            'delete/delete_redir2' => DeleteLogFormatter::class,
12255            'delete/event' => DeleteLogFormatter::class,
12256            'delete/restore' => DeleteLogFormatter::class,
12257            'delete/revision' => DeleteLogFormatter::class,
12258            'import/interwiki' => ImportLogFormatter::class,
12259            'import/upload' => ImportLogFormatter::class,
12260            'interwiki/iw_add' => InterwikiLogFormatter::class,
12261            'interwiki/iw_delete' => InterwikiLogFormatter::class,
12262            'interwiki/iw_edit' => InterwikiLogFormatter::class,
12263            'managetags/activate' => LogFormatter::class,
12264            'managetags/create' => LogFormatter::class,
12265            'managetags/deactivate' => LogFormatter::class,
12266            'managetags/delete' => LogFormatter::class,
12267            'merge/merge' => [
12268                'class' => MergeLogFormatter::class,
12269                'services' => [
12270                    'TitleParser',
12271                ]
12272            ],
12273            'merge/merge-into' => [
12274                'class' => MergeLogFormatter::class,
12275                'services' => [
12276                    'TitleParser',
12277                ]
12278            ],
12279            'move/move' => [
12280                'class' => MoveLogFormatter::class,
12281                'services' => [
12282                    'TitleParser',
12283                ]
12284            ],
12285            'move/move_redir' => [
12286                'class' => MoveLogFormatter::class,
12287                'services' => [
12288                    'TitleParser',
12289                ]
12290            ],
12291            'patrol/patrol' => PatrolLogFormatter::class,
12292            'patrol/autopatrol' => PatrolLogFormatter::class,
12293            'protect/modify' => [
12294                'class' => ProtectLogFormatter::class,
12295                'services' => [
12296                    'TitleParser',
12297                ]
12298            ],
12299            'protect/move_prot' => [
12300                'class' => ProtectLogFormatter::class,
12301                'services' => [
12302                    'TitleParser',
12303                ]
12304            ],
12305            'protect/protect' => [
12306                'class' => ProtectLogFormatter::class,
12307                'services' => [
12308                    'TitleParser',
12309                ]
12310            ],
12311            'protect/unprotect' => [
12312                'class' => ProtectLogFormatter::class,
12313                'services' => [
12314                    'TitleParser',
12315                ]
12316            ],
12317            'renameuser/renameuser' => [
12318                'class' => RenameuserLogFormatter::class,
12319                'services' => [
12320                    'TitleParser',
12321                ]
12322            ],
12323            'rights/autopromote' => RightsLogFormatter::class,
12324            'rights/rights' => RightsLogFormatter::class,
12325            'suppress/block' => [
12326                'class' => BlockLogFormatter::class,
12327                'services' => [
12328                    'TitleParser',
12329                    'NamespaceInfo',
12330                ]
12331            ],
12332            'suppress/delete' => DeleteLogFormatter::class,
12333            'suppress/event' => DeleteLogFormatter::class,
12334            'suppress/reblock' => [
12335                'class' => BlockLogFormatter::class,
12336                'services' => [
12337                    'TitleParser',
12338                    'NamespaceInfo',
12339                ]
12340            ],
12341            'suppress/revision' => DeleteLogFormatter::class,
12342            'tag/update' => TagLogFormatter::class,
12343            'upload/overwrite' => UploadLogFormatter::class,
12344            'upload/revert' => UploadLogFormatter::class,
12345            'upload/upload' => UploadLogFormatter::class,
12346        ],
12347        'type' => 'map',
12348    ];
12349
12350    /**
12351     * List of log types that can be filtered by action types
12352     *
12353     * To each action is associated the list of log_action
12354     * subtypes to search for, usually one, but not necessarily so
12355     * Extensions may append to this array
12356     *
12357     * @since 1.27
12358     */
12359    public const ActionFilteredLogs = [
12360        'default' => [
12361            'block' => [
12362                'block' => [ 'block' ],
12363                'reblock' => [ 'reblock' ],
12364                'unblock' => [ 'unblock' ],
12365            ],
12366            'contentmodel' => [
12367                'change' => [ 'change' ],
12368                'new' => [ 'new' ],
12369            ],
12370            'delete' => [
12371                'delete' => [ 'delete' ],
12372                'delete_redir' => [ 'delete_redir', 'delete_redir2' ],
12373                'restore' => [ 'restore' ],
12374                'event' => [ 'event' ],
12375                'revision' => [ 'revision' ],
12376            ],
12377            'import' => [
12378                'interwiki' => [ 'interwiki' ],
12379                'upload' => [ 'upload' ],
12380            ],
12381            'managetags' => [
12382                'create' => [ 'create' ],
12383                'delete' => [ 'delete' ],
12384                'activate' => [ 'activate' ],
12385                'deactivate' => [ 'deactivate' ],
12386            ],
12387            'move' => [
12388                'move' => [ 'move' ],
12389                'move_redir' => [ 'move_redir' ],
12390            ],
12391            'newusers' => [
12392                'create' => [ 'create', 'newusers' ],
12393                'create2' => [ 'create2' ],
12394                'autocreate' => [ 'autocreate' ],
12395                'byemail' => [ 'byemail' ],
12396            ],
12397            'protect' => [
12398                'protect' => [ 'protect' ],
12399                'modify' => [ 'modify' ],
12400                'unprotect' => [ 'unprotect' ],
12401                'move_prot' => [ 'move_prot' ],
12402            ],
12403            'rights' => [
12404                'rights' => [ 'rights' ],
12405                'autopromote' => [ 'autopromote' ],
12406            ],
12407            'suppress' => [
12408                'event' => [ 'event' ],
12409                'revision' => [ 'revision' ],
12410                'delete' => [ 'delete' ],
12411                'block' => [ 'block' ],
12412                'reblock' => [ 'reblock' ],
12413            ],
12414            'upload' => [
12415                'upload' => [ 'upload' ],
12416                'overwrite' => [ 'overwrite' ],
12417                'revert' => [ 'revert' ],
12418            ],
12419        ],
12420        'type' => 'map',
12421    ];
12422
12423    /**
12424     * Maintain a log of newusers at Special:Log/newusers?
12425     */
12426    public const NewUserLog = [
12427        'default' => true,
12428    ];
12429
12430    /**
12431     * Maintain a log of page creations at Special:Log/create?
12432     *
12433     * @since 1.32
12434     */
12435    public const PageCreationLog = [
12436        'default' => true,
12437    ];
12438
12439    // endregion -- end logging
12440
12441    /***************************************************************************/
12442    // region   Special pages (general and miscellaneous)
12443    /** @name   Special pages (general and miscellaneous) */
12444
12445    /**
12446     * Allow special page inclusions such as {{Special:Allpages}}
12447     */
12448    public const AllowSpecialInclusion = [
12449        'default' => true,
12450    ];
12451
12452    /**
12453     * Set this to an array of special page names to prevent
12454     * maintenance/updateSpecialPages.php from updating those pages.
12455     *
12456     * Mapping each special page name to a run mode like 'periodical' if a cronjob is set up.
12457     */
12458    public const DisableQueryPageUpdate = [
12459        'default' => false,
12460    ];
12461
12462    /**
12463     * On Special:Unusedimages, consider images "used", if they are put
12464     * into a category. Default (false) is not to count those as used.
12465     */
12466    public const CountCategorizedImagesAsUsed = [
12467        'default' => false,
12468    ];
12469
12470    /**
12471     * Maximum number of links to a redirect page listed on
12472     * Special:Whatlinkshere/RedirectDestination
12473     */
12474    public const MaxRedirectLinksRetrieved = [
12475        'default' => 500,
12476    ];
12477
12478    /**
12479     * Shortest CIDR limits that can be checked in any individual range check
12480     * at Special:Contributions.
12481     *
12482     * @since 1.30
12483     */
12484    public const RangeContributionsCIDRLimit = [
12485        'default' => [
12486            'IPv4' => 16,
12487            'IPv6' => 32,
12488        ],
12489        'type' => 'map',
12490        'additionalProperties' => [ 'type' => 'integer', ],
12491    ];
12492
12493    // endregion -- end special pages
12494
12495    /***************************************************************************/
12496    // region   Actions
12497    /** @name   Actions */
12498
12499    /**
12500     * Map of allowed values for the "title=foo&action=<action>" parameter.
12501     * to the corresponding handler code.
12502     * See ActionFactory for the syntax. Core defaults are in ActionFactory::CORE_ACTIONS,
12503     * anything here overrides that.
12504     */
12505    public const Actions = [
12506        'default' => [],
12507        'type' => 'map',
12508    ];
12509
12510    // endregion -- end actions
12511
12512    /***************************************************************************/
12513    // region   Robot (search engine crawler) policy
12514    /** @name   Robot (search engine crawler) policy */
12515    // See also $wgNoFollowLinks.
12516
12517    /**
12518     * Default robot policy.  The default policy is to encourage indexing and fol-
12519     * lowing of links.  It may be overridden on a per-namespace and/or per-page
12520     * basis.
12521     */
12522    public const DefaultRobotPolicy = [
12523        'default' => 'index,follow',
12524    ];
12525
12526    /**
12527     * Robot policies per namespaces. The default policy is given above, the array
12528     * is made of namespace constants as defined in includes/Defines.php.  You can-
12529     * not specify a different default policy for NS_SPECIAL: it is always noindex,
12530     * nofollow.  This is because a number of special pages (e.g., ListPages) have
12531     * many permutations of options that display the same data under redundant
12532     * URLs, so search engine spiders risk getting lost in a maze of twisty special
12533     * pages, all alike, and never reaching your actual content.
12534     *
12535     * **Example:**
12536     *
12537     * ```
12538     * $wgNamespaceRobotPolicies = [ NS_TALK => 'noindex' ];
12539     * ```
12540     */
12541    public const NamespaceRobotPolicies = [
12542        'default' => [],
12543        'type' => 'map',
12544    ];
12545
12546    /**
12547     * Robot policies per article. These override the per-namespace robot policies.
12548     *
12549     * Must be in the form of an array where the key part is a properly canonicalised
12550     * text form title and the value is a robot policy.
12551     *
12552     * **Example:**
12553     *
12554     * ```
12555     * $wgArticleRobotPolicies = [
12556     *         'Main Page' => 'noindex,follow',
12557     *         'User:Bob' => 'index,follow',
12558     * ];
12559     * ```
12560     *
12561     * **Example that DOES NOT WORK because the names are not canonical text**
12562     * forms:
12563     *
12564     * ```
12565     * $wgArticleRobotPolicies = [
12566     *   // Underscore, not space!
12567     *   'Main_Page' => 'noindex,follow',
12568     *   // "Project", not the actual project name!
12569     *   'Project:X' => 'index,follow',
12570     *   // Needs to be "Abc", not "abc" (unless $wgCapitalLinks is false for that namespace)!
12571     *   'abc' => 'noindex,nofollow'
12572     * ];
12573     * ```
12574     */
12575    public const ArticleRobotPolicies = [
12576        'default' => [],
12577        'type' => 'map',
12578    ];
12579
12580    /**
12581     * An array of namespace keys in which the __INDEX__/__NOINDEX__ magic words
12582     * will not function, so users can't decide whether pages in that namespace are
12583     * indexed by search engines.  If set to null, default to $wgContentNamespaces.
12584     *
12585     * **Example:**
12586     *
12587     * ```
12588     * $wgExemptFromUserRobotsControl = [ NS_MAIN, NS_TALK, NS_PROJECT ];
12589     * ```
12590     */
12591    public const ExemptFromUserRobotsControl = [
12592        'default' => null,
12593        'type' => '?list',
12594    ];
12595
12596    // endregion End robot policy
12597
12598    /***************************************************************************/
12599    // region   Action API and REST API
12600    /** @name   Action API and REST API
12601     */
12602
12603    /**
12604     * WARNING: SECURITY THREAT - debug use only
12605     *
12606     * Disables many security checks in the API for debugging purposes.
12607     * This flag should never be used on the production servers, as it introduces
12608     * a number of potential security holes. Even when enabled, the validation
12609     * will still be performed, but instead of failing, API will return a warning.
12610     * Also, there will always be a warning notifying that this flag is set.
12611     * At this point, the flag allows GET requests to go through for modules
12612     * requiring POST.
12613     *
12614     * @since 1.21
12615     */
12616    public const DebugAPI = [
12617        'default' => false,
12618    ];
12619
12620    /**
12621     * API module extensions.
12622     *
12623     * Associative array mapping module name to modules specs;
12624     * Each module spec is an associative array containing at least
12625     * the 'class' key for the module's class, and optionally a
12626     * 'factory' key for the factory function to use for the module.
12627     *
12628     * That factory function will be called with two parameters,
12629     * the parent module (an instance of ApiBase, usually ApiMain)
12630     * and the name the module was registered under. The return
12631     * value must be an instance of the class given in the 'class'
12632     * field.
12633     *
12634     * For backward compatibility, the module spec may also be a
12635     * simple string containing the module's class name. In that
12636     * case, the class' constructor will be called with the parent
12637     * module and module name as parameters, as described above.
12638     *
12639     * Examples for registering API modules:
12640     *
12641     * ```
12642     * $wgAPIModules['foo'] = 'ApiFoo';
12643     * $wgAPIModules['bar'] = [
12644     *   'class' => ApiBar::class,
12645     *   'factory' => function( $main, $name ) { ... }
12646     * ];
12647     * $wgAPIModules['xyzzy'] = [
12648     *   'class' => ApiXyzzy::class,
12649     *   'factory' => [ XyzzyFactory::class, 'newApiModule' ]
12650     * ];
12651     * ```
12652     * Extension modules may override the core modules.
12653     * See ApiMain::MODULES for a list of the core modules.
12654     */
12655    public const APIModules = [
12656        'default' => [],
12657        'type' => 'map',
12658    ];
12659
12660    /**
12661     * API format module extensions.
12662     *
12663     * Associative array mapping format module name to module specs (see $wgAPIModules).
12664     * Extension modules may override the core modules.
12665     *
12666     * See ApiMain::FORMATS for a list of the core format modules.
12667     */
12668    public const APIFormatModules = [
12669        'default' => [],
12670        'type' => 'map',
12671    ];
12672
12673    /**
12674     * API Query meta module extensions.
12675     *
12676     * Associative array mapping meta module name to module specs (see $wgAPIModules).
12677     * Extension modules may override the core modules.
12678     *
12679     * See ApiQuery::QUERY_META_MODULES for a list of the core meta modules.
12680     */
12681    public const APIMetaModules = [
12682        'default' => [],
12683        'type' => 'map',
12684    ];
12685
12686    /**
12687     * API Query prop module extensions.
12688     *
12689     * Associative array mapping prop module name to module specs (see $wgAPIModules).
12690     * Extension modules may override the core modules.
12691     *
12692     * See ApiQuery::QUERY_PROP_MODULES for a list of the core prop modules.
12693     */
12694    public const APIPropModules = [
12695        'default' => [],
12696        'type' => 'map',
12697    ];
12698
12699    /**
12700     * API Query list module extensions.
12701     *
12702     * Associative array mapping list module name to module specs (see $wgAPIModules).
12703     * Extension modules may override the core modules.
12704     *
12705     * See ApiQuery::QUERY_LIST_MODULES for a list of the core list modules.
12706     */
12707    public const APIListModules = [
12708        'default' => [],
12709        'type' => 'map',
12710    ];
12711
12712    /**
12713     * Maximum amount of rows to scan in a DB query in the API
12714     * The default value is generally fine
12715     */
12716    public const APIMaxDBRows = [
12717        'default' => 5000,
12718    ];
12719
12720    /**
12721     * The maximum size (in bytes) of an API result.
12722     *
12723     * @warning Do not set this lower than $wgMaxArticleSize*1024
12724     */
12725    public const APIMaxResultSize = [
12726        'default' => 8_388_608,
12727    ];
12728
12729    /**
12730     * The maximum number of uncached diffs that can be retrieved in one API
12731     * request. Set this to 0 to disable API diffs altogether
12732     */
12733    public const APIMaxUncachedDiffs = [
12734        'default' => 1,
12735    ];
12736
12737    /**
12738     * Maximum amount of DB lag on a majority of DB replica DBs to tolerate
12739     * before forcing bots to retry any write requests via API errors.
12740     *
12741     * This should be lower than the 'max lag' value in $wgLBFactoryConf.
12742     */
12743    public const APIMaxLagThreshold = [
12744        'default' => 7,
12745    ];
12746
12747    /**
12748     * Set the timeout for the API help text cache. If set to 0, caching disabled
12749     */
12750    public const APICacheHelpTimeout = [
12751        'default' => 60 * 60,
12752    ];
12753
12754    /**
12755     * The ApiQueryQueryPages module should skip pages that are redundant to true
12756     * API queries.
12757     */
12758    public const APIUselessQueryPages = [
12759        'default' => [
12760            'MIMEsearch',
12761            'LinkSearch',
12762        ],
12763        'type' => 'list',
12764    ];
12765
12766    /**
12767     * Enable previewing licences via AJAX.
12768     */
12769    public const AjaxLicensePreview = [
12770        'default' => true,
12771    ];
12772
12773    /**
12774     * Settings for incoming cross-site AJAX requests:
12775     * Newer browsers support cross-site AJAX when the target resource allows requests
12776     * from the origin domain by the Access-Control-Allow-Origin header.
12777     *
12778     * This is currently only used by the API (requests to api.php)
12779     * $wgCrossSiteAJAXdomains can be set using a wildcard syntax:
12780     *
12781     * - '*' matches any number of characters
12782     * - '?' matches any 1 character
12783     *
12784     * **Example:**
12785     *
12786     * ```
12787     * $wgCrossSiteAJAXdomains = [
12788     *     'www.mediawiki.org',
12789     *     '*.wikipedia.org',
12790     *     '*.wikimedia.org',
12791     *     '*.wiktionary.org',
12792     * ];
12793     * ```
12794     */
12795    public const CrossSiteAJAXdomains = [
12796        'default' => [],
12797        'type' => 'map',
12798    ];
12799
12800    /**
12801     * Domains that should not be allowed to make AJAX requests,
12802     * even if they match one of the domains allowed by $wgCrossSiteAJAXdomains
12803     * Uses the same syntax as $wgCrossSiteAJAXdomains
12804     */
12805    public const CrossSiteAJAXdomainExceptions = [
12806        'default' => [],
12807        'type' => 'map',
12808    ];
12809
12810    /**
12811     * List of allowed headers for cross-origin API requests.
12812     */
12813    public const AllowedCorsHeaders = [
12814        'default' => [
12815            /* simple headers (see spec) */
12816            'Accept',
12817            'Accept-Language',
12818            'Content-Language',
12819            'Content-Type',
12820            /* non-authorable headers in XHR, which are however requested by some UAs */
12821            'Accept-Encoding',
12822            'DNT',
12823            'Origin',
12824            /* MediaWiki whitelist */
12825            'User-Agent',
12826            'Api-User-Agent',
12827            /* Allowing caching preflight requests, see T269636 */
12828            'Access-Control-Max-Age',
12829            /* OAuth 2.0, see T322944 */
12830            'Authorization',
12831        ],
12832        'type' => 'list',
12833    ];
12834
12835    /**
12836     * Additional REST API Route files.
12837     *
12838     * A common usage is to enable development/experimental endpoints only on test wikis.
12839     */
12840    public const RestAPIAdditionalRouteFiles = [
12841        'default' => [],
12842        'type' => 'list',
12843    ];
12844
12845    /**
12846     * A list of OpenAPI specs to be made available for exploration on
12847     * Special:RestSandbox. If none are given, Special:RestSandbox is disabled.
12848     *
12849     * This is an associative array, arbitrary spec IDs to spec descriptions.
12850     * Each spec description is an array with the following keys:
12851     * - url: the URL that will return the OpenAPI spec.
12852     * - name: the name of the API, to be shown on Special:RestSandbox.
12853     *   Ignored if msg is given.
12854     * - msg: a message key for the name of the API, to be shown on
12855     *   Special:RestSandbox.
12856     * - file: optional module definition file name. If supplied, information therein is used for
12857     *   name and/or url. Info supplied directly in config (via url/name/msg) takes precedence.
12858     *
12859     * @unstable Introduced in 1.43. We may want to rename or change this to
12860     * accommodate the need to list external APIs in a central discovery
12861     * document.
12862     */
12863    public const RestSandboxSpecs = [
12864        'default' => [],
12865        'type' => 'map',
12866        'additionalProperties' => [
12867            'type' => 'object',
12868            'properties' => [
12869                'url' => [ 'type' => 'string', 'format' => 'url' ],
12870                'name' => [ 'type' => 'string' ],
12871                'file' => [ 'type' => 'string' ],
12872                'msg' => [ 'type' => 'string', 'description' => 'a message key' ]
12873            ],
12874        ]
12875    ];
12876
12877    // endregion -- End AJAX and API
12878
12879    /***************************************************************************/
12880    // region   Shell and process control
12881    /** @name   Shell and process control */
12882
12883    /**
12884     * Maximum amount of virtual memory available to shell processes under linux, in KiB.
12885     */
12886    public const MaxShellMemory = [
12887        'default' => 307_200,
12888    ];
12889
12890    /**
12891     * Maximum file size created by shell processes under linux, in KiB
12892     * ImageMagick convert for example can be fairly hungry for scratch space
12893     */
12894    public const MaxShellFileSize = [
12895        'default' => 102_400,
12896    ];
12897
12898    /**
12899     * Maximum CPU time in seconds for shell processes under Linux
12900     */
12901    public const MaxShellTime = [
12902        'default' => 180,
12903    ];
12904
12905    /**
12906     * Maximum wall clock time (i.e. real time, of the kind the clock on the wall
12907     * would measure) in seconds for shell processes under Linux
12908     */
12909    public const MaxShellWallClockTime = [
12910        'default' => 180,
12911    ];
12912
12913    /**
12914     * Under Linux: a cgroup directory used to constrain memory usage of shell
12915     * commands. The directory must be writable by the user which runs MediaWiki.
12916     *
12917     * If specified, this is used instead of ulimit, which is inaccurate, and
12918     * causes malloc() to return NULL, which exposes bugs in C applications, making
12919     * them segfault or deadlock.
12920     *
12921     * A wrapper script will create a cgroup for each shell command that runs, as
12922     * a subgroup of the specified cgroup. If the memory limit is exceeded, the
12923     * kernel will send a SIGKILL signal to a process in the subgroup.
12924     *
12925     * **Example:**
12926     *
12927     * ```
12928     * mkdir -p /sys/fs/cgroup/memory/mediawiki
12929     * mkdir -m 0777 /sys/fs/cgroup/memory/mediawiki/job
12930     * echo '$wgShellCgroup = "/sys/fs/cgroup/memory/mediawiki/job";' >> LocalSettings.php
12931     * ```
12932     * The reliability of cgroup cleanup can be improved by installing a
12933     * notify_on_release script in the root cgroup, see e.g.
12934     * https://gerrit.wikimedia.org/r/#/c/40784
12935     */
12936    public const ShellCgroup = [
12937        'default' => false,
12938    ];
12939
12940    /**
12941     * Executable path of the PHP cli binary. Should be set up on install.
12942     */
12943    public const PhpCli = [
12944        'default' => '/usr/bin/php',
12945    ];
12946
12947    /**
12948     * Method to use to restrict shell commands
12949     *
12950     * Supported options:
12951     * - 'autodetect': Autodetect if any restriction methods are available
12952     * - 'firejail': Use firejail <https://firejail.wordpress.com/>
12953     * - false: Don't use any restrictions
12954     *
12955     * @note If using firejail with MediaWiki running in a home directory different
12956     * from the webserver user, firejail 0.9.44+ is required.
12957     * @since 1.31
12958     */
12959    public const ShellRestrictionMethod = [
12960        'default' => 'autodetect',
12961        'type' => 'string|false',
12962    ];
12963
12964    /**
12965     * Shell commands can be run on a remote server using Shellbox. To use this
12966     * feature, set this to the URLs mapped by the service, and also configure $wgShellboxSecretKey.
12967     *
12968     * You can also disable a certain service by setting it to false or null.
12969     *
12970     * 'default' would be the default URL if no URL is defined for that service.
12971     *
12972     * For more information about installing Shellbox, see
12973     * https://www.mediawiki.org/wiki/Shellbox
12974     *
12975     * @since 1.37
12976     */
12977    public const ShellboxUrls = [
12978        'default' => [ 'default' => null, ],
12979        'type' => 'map',
12980        'additionalProperties' => [
12981            'type' => 'string|false|null',
12982        ],
12983    ];
12984
12985    /**
12986     * The secret key for HMAC verification of Shellbox requests. Set this to
12987     * a long random string.
12988     *
12989     * @since 1.36
12990     */
12991    public const ShellboxSecretKey = [
12992        'default' => null,
12993        'type' => '?string',
12994    ];
12995
12996    /**
12997     * The POSIX-compatible shell to use when running scripts. This is used by
12998     * some media handling shell commands.
12999     *
13000     * If ShellboxUrls is configured, this path should exist on the remote side.
13001     * On Windows this should be the full path to bash.exe, not git-bash.exe.
13002     *
13003     * @since 1.42
13004     */
13005    public const ShellboxShell = [
13006        'default' => '/bin/sh',
13007        'type' => '?string',
13008    ];
13009
13010    // endregion -- end Shell and process control
13011
13012    /***************************************************************************/
13013    // region   HTTP client
13014    /** @name   HTTP client */
13015
13016    /**
13017     * Timeout for HTTP requests done internally, in seconds.
13018     *
13019     * @since 1.5
13020     */
13021    public const HTTPTimeout = [
13022        'default' => 25,
13023        'type' => 'float',
13024    ];
13025
13026    /**
13027     * Timeout for connections done internally (in seconds).
13028     *
13029     * Only supported if cURL is installed, ignored otherwise.
13030     *
13031     * @since 1.22
13032     */
13033    public const HTTPConnectTimeout = [
13034        'default' => 5.0,
13035        'type' => 'float',
13036    ];
13037
13038    /**
13039     * The maximum HTTP request timeout in seconds. If any specified or configured
13040     * request timeout is larger than this, then this value will be used instead.
13041     * Zero is interpreted as "no limit".
13042     *
13043     * @since 1.35
13044     */
13045    public const HTTPMaxTimeout = [
13046        'default' => 0,
13047        'type' => 'float',
13048    ];
13049
13050    /**
13051     * The maximum HTTP connect timeout in seconds. If any specified or configured
13052     * connect timeout is larger than this, then this value will be used instead.
13053     * Zero is interpreted as "no limit".
13054     *
13055     * @since 1.35
13056     */
13057    public const HTTPMaxConnectTimeout = [
13058        'default' => 0,
13059        'type' => 'float',
13060    ];
13061
13062    /**
13063     * Timeout for HTTP requests done internally for transwiki imports, in seconds.
13064     *
13065     * @since 1.29
13066     */
13067    public const HTTPImportTimeout = [
13068        'default' => 25,
13069    ];
13070
13071    /**
13072     * Timeout for Asynchronous (background) HTTP requests, in seconds.
13073     */
13074    public const AsyncHTTPTimeout = [
13075        'default' => 25,
13076    ];
13077
13078    /**
13079     * Proxy to use for CURL requests.
13080     */
13081    public const HTTPProxy = [
13082        'default' => '',
13083    ];
13084
13085    /**
13086     * A list of URL domains that will be routed to the proxy specified by
13087     * $wgLocalHTTPProxy.
13088     *
13089     * @since 1.25
13090     */
13091    public const LocalVirtualHosts = [
13092        'default' => [],
13093        'type' => 'map',
13094    ];
13095
13096    /**
13097     * Proxy to use for requests to domains in $wgLocalVirtualHosts
13098     *
13099     * If set to false, no reverse proxy will be used for local requests.
13100     *
13101     * @since 1.38
13102     */
13103    public const LocalHTTPProxy = [
13104        'default' => false,
13105        'type' => 'string|false',
13106    ];
13107
13108    /**
13109     * Whether to respect/honour
13110     *  - request ID provided by the incoming request via the `X-Request-Id`
13111     *  - trace context provided by the incoming request via the `tracestate` and `traceparent`
13112     *
13113     * Set to `true` if the entity sitting in front of MediaWiki sanitises external requests.
13114     *
13115     * Default: `false`.
13116     */
13117    public const AllowExternalReqID = [
13118        'default' => false,
13119    ];
13120
13121    /**
13122     * How to generate the request ID when MediaWiki generates it internally.
13123     * Must be one of: 'rand24', 'uuid4'
13124     *
13125     * Default: 'rand24'
13126     *
13127     * @since 1.46
13128     */
13129    public const GenerateReqIDFormat = [
13130        'default' => 'rand24',
13131        'type' => 'string',
13132    ];
13133
13134    // endregion -- End HTTP client
13135
13136    /***************************************************************************/
13137    // region   Job queue
13138    /** @name   Job queue */
13139
13140    /**
13141     * Number of jobs to perform per request. May be less than one in which case jobs are
13142     * performed probabilistically. If this is zero, jobs will not be done during ordinary
13143     * apache requests. In this case, maintenance/runJobs.php should be run in loop every
13144     * few seconds via a service or cron job. If using a cron job, be sure to handle the
13145     * case where the script is already running (e.g. via `/usr/bin/flock -n <lock_file>`).
13146     *
13147     * If this is set to a non-zero number, then it is highly recommended that PHP run in
13148     * fastcgi mode (php_fpm). When using a standard Apache PHP handler (mod_php), it is
13149     * recommended that output_buffering and zlib.output_compression both be set to "Off",
13150     * allowing MediaWiki to install an unlimited size output buffer on the fly. Setting
13151     * output_buffering to an integer (e.g. 4096) or enabling zlib.output_compression can
13152     * cause user-visible slowness as background tasks execute during web requests.
13153     *
13154     * Regardless of the web server engine in use, be sure to configure a sufficient number
13155     * processes/threads in order to avoid exhaustion (which will cause user-visible slowness).
13156     */
13157    public const JobRunRate = [
13158        'default' => 1,
13159    ];
13160
13161    /**
13162     * When $wgJobRunRate > 0, try to run jobs asynchronously, spawning a new process
13163     * to handle the job execution, instead of blocking the request until the job
13164     * execution finishes.
13165     *
13166     * @since 1.23
13167     */
13168    public const RunJobsAsync = [
13169        'default' => false,
13170    ];
13171
13172    /**
13173     * Number of rows to update per job
13174     */
13175    public const UpdateRowsPerJob = [
13176        'default' => 300,
13177    ];
13178
13179    /**
13180     * Number of rows to update per query
13181     */
13182    public const UpdateRowsPerQuery = [
13183        'default' => 100,
13184    ];
13185
13186    // endregion -- End job queue
13187
13188    /***************************************************************************/
13189    // region   Miscellaneous
13190    /** @name   Miscellaneous */
13191
13192    /**
13193     * Allow redirection to another page when a user logs in.
13194     *
13195     * To enable, set to a string like 'Main Page'
13196     */
13197    public const RedirectOnLogin = [
13198        'default' => null,
13199    ];
13200
13201    /**
13202     * Global configuration variable for Virtual REST Services.
13203     *
13204     * Use the 'path' key to define automatically mounted services. The value for this
13205     * key is a map of path prefixes to service configuration. The latter is an array of:
13206     *   - class : the fully qualified class name
13207     *   - options : map of arguments to the class constructor
13208     * Such services will be available to handle queries under their path from the VRS
13209     * singleton, e.g. MediaWikiServices::getInstance()->getVirtualRESTServiceClient();
13210     *
13211     * Auto-mounting example for Parsoid:
13212     *
13213     * $wgVirtualRestConfig['paths']['/parsoid/'] = [
13214     *     'class' => ParsoidVirtualRESTService::class,
13215     *     'options' => [
13216     *         'url' => 'http://localhost:8000',
13217     *         'prefix' => 'enwiki',
13218     *         'domain' => 'en.wikipedia.org'
13219     *     ]
13220     * ];
13221     *
13222     * Parameters for different services can also be declared inside the 'modules' value,
13223     * which is to be treated as an associative array. The parameters in 'global' will be
13224     * merged with service-specific ones. The result will then be passed to
13225     * VirtualRESTService::__construct() in the module.
13226     *
13227     * Example config for Parsoid:
13228     *
13229     *   $wgVirtualRestConfig['modules']['parsoid'] = [
13230     *     'url' => 'http://localhost:8000',
13231     *     'prefix' => 'enwiki',
13232     *     'domain' => 'en.wikipedia.org',
13233     *   ];
13234     *
13235     * @since 1.25
13236     */
13237    public const VirtualRestConfig = [
13238        'default' => [
13239            'paths' => [],
13240            'modules' => [],
13241            'global' => [
13242                # Timeout in seconds
13243                'timeout' => 360,
13244                # 'domain' is set to $wgCanonicalServer in Setup.php
13245                'forwardCookies' => false,
13246                'HTTPProxy' => null
13247            ]
13248        ],
13249        'mergeStrategy' => 'array_plus_2d',
13250        'type' => 'map',
13251    ];
13252
13253    /**
13254     * Mapping of event channels (or channel categories) to EventRelayer configuration.
13255     *
13256     * By setting up a PubSub system (like Kafka) and enabling a corresponding EventRelayer class
13257     * that uses it, MediaWiki can broadcast events to all subscribers. Certain features like WAN
13258     * cache purging and CDN cache purging will emit events to this system. Appropriate listeners
13259     * can subscribe to the channel and take actions based on the events. For example, a local daemon
13260     * can run on each CDN cache node and perform local purges based on the URL purge channel
13261     * events.
13262     *
13263     * Some extensions may want to use "channel categories" so that different channels can also
13264     * share the same custom relayer instance (e.g. when it's likely to be overridden). They can use
13265     * EventRelayerGroup::getRelayer() based on the category but call notify() on various different
13266     * actual channels. One reason for this would be that some systems have very different
13267     * performance vs durability needs, so one system (e.g. Kafka) may not be suitable for all
13268     * uses.
13269     *
13270     * The 'default' key is for all channels (or channel categories) without an explicit entry
13271     * here.
13272     *
13273     * @since 1.27
13274     */
13275    public const EventRelayerConfig = [
13276        'default' => [
13277            'default' => [ 'class' => EventRelayerNull::class, ],
13278        ],
13279        'type' => 'map',
13280    ];
13281
13282    /**
13283     * Share data about this installation with MediaWiki developers
13284     *
13285     * When set to true, MediaWiki will periodically ping https://www.mediawiki.org/ with basic
13286     * data about this MediaWiki instance. This data includes, for example, the type of system,
13287     * PHP version, and chosen database backend. The Wikimedia Foundation shares this data with
13288     * MediaWiki developers to help guide future development efforts.
13289     *
13290     * For details about what data is sent, see: https://www.mediawiki.org/wiki/Manual:$wgPingback
13291     *
13292     * For the pingback privacy policy, see:
13293     * https://wikimediafoundation.org/wiki/MediaWiki_Pingback_Privacy_Statement
13294     *
13295     * Aggregate pingback data is available at: https://pingback.wmcloud.org/
13296     *
13297     * @since 1.28
13298     */
13299    public const Pingback = [
13300        'default' => false,
13301        'type' => 'boolean',
13302    ];
13303
13304    /**
13305     * Origin Trials tokens.
13306     *
13307     * @since 1.33
13308     */
13309    public const OriginTrials = [
13310        'default' => [],
13311        'type' => 'list',
13312    ];
13313
13314    /**
13315     * Expiry of the endpoint definition for the Reporting API.
13316     *
13317     * @unstable EXPERIMENTAL
13318     * @since 1.34
13319     */
13320    public const ReportToExpiry = [
13321        'default' => 86400,
13322        'type' => 'integer',
13323    ];
13324
13325    /**
13326     * List of endpoints for the Reporting API.
13327     *
13328     * @unstable EXPERIMENTAL
13329     * @since 1.34
13330     */
13331    public const ReportToEndpoints = [
13332        'default' => [],
13333        'type' => 'list',
13334    ];
13335
13336    /**
13337     * List of Feature Policy Reporting types to enable.
13338     *
13339     * Each entry is turned into a Feature-Policy-Report-Only header.
13340     *
13341     * @unstable EXPERIMENTAL
13342     * @since 1.34
13343     */
13344    public const FeaturePolicyReportOnly = [
13345        'default' => [],
13346        'type' => 'list',
13347    ];
13348
13349    /**
13350     * List of preferred skins to be listed higher in Special:Preferences
13351     *
13352     * @since 1.38
13353     */
13354    public const SkinsPreferred = [
13355        'default' => [ 'vector-2022', 'vector' ],
13356        'type' => 'list',
13357    ];
13358
13359    /**
13360     * List of skins that show a link to the Special:Contribute page
13361     *
13362     * @since 1.40
13363     */
13364    public const SpecialContributeSkinsEnabled = [
13365        'default' => [],
13366        'type' => 'list',
13367    ];
13368
13369    /**
13370     * Allow redirection to another page when a user selects New Page on Special:Contribute page
13371     *
13372     */
13373    public const SpecialContributeNewPageTarget = [
13374        'default' => null,
13375        'type' => '?string',
13376    ];
13377
13378    /**
13379     * Whether to enable the client-side edit recovery feature.
13380     *
13381     * @unstable Temporary feature flag, T341844
13382     * @since 1.41
13383     */
13384    public const EnableEditRecovery = [
13385        'default' => false,
13386        'type' => 'boolean',
13387    ];
13388
13389    /**
13390     * Number of seconds to keep edit recovery data after the edit is stored.
13391     */
13392    public const EditRecoveryExpiry = [
13393        'default' => 30 * 24 * 3600,
13394        'type' => 'integer',
13395    ];
13396
13397    /**
13398     * Whether to use Codex in Special:Block form.
13399     *
13400     * @unstable Temporary feature flag, T358153
13401     * @since 1.42
13402     */
13403    public const UseCodexSpecialBlock = [
13404        'default' => false,
13405        'type' => 'boolean',
13406    ];
13407
13408    /**
13409     * Whether to display a confirmation screen during user log out.
13410     *
13411     * @unstable Temporary feature flag, T357484
13412     * @since 1.42
13413     */
13414    public const ShowLogoutConfirmation = [
13415        'default' => false,
13416        'type' => 'boolean',
13417    ];
13418
13419    /**
13420     * Whether to show indicators on a page when it is protected.
13421     *
13422     * @since 1.43
13423     */
13424    public const EnableProtectionIndicators = [
13425        'default' => true,
13426        'type' => 'boolean',
13427    ];
13428
13429    /**
13430     * OutputPipelineStages to add to the DefaultOutputPipeline.
13431     *
13432     * @unstable EXPERIMENTAL
13433     * @since 1.43
13434     */
13435    public const OutputPipelineStages = [
13436        'default' => [],
13437        'type' => 'map',
13438    ];
13439
13440    /**
13441     * Allow temporarily disabling use of certain features. Useful for
13442     * large site operators to push people to newer APIs while still
13443     * keeping the breakage short and contained.
13444     *
13445     * This should be an array, where a key is a feature name and the value
13446     * is an array of shutdown arrays, each containing the following keys:
13447     *     'start' => Shutdown start, parsed with strtotime(). (required)
13448     *     'end' => Shutdown end, parsed with strtotime(). (required)
13449     *     'percentage' => Number between 0 and 100. If set, only a certain
13450     *       percentage of requests will be blocked.
13451     *
13452     * For example:
13453     * @code
13454     * $wgFeatureShutdown = [
13455     *   'pre-1.24-tokens' => [
13456     *     [
13457     *       'start' => '2021-07-01T00:00 +00:00',
13458     *       'end' => '2021-08-01T00:00 +00:00',
13459     *       'percentage' => 50,
13460     *     ],
13461     *   ],
13462     * ];
13463     * @encdode
13464     *
13465     * @since 1.44
13466     */
13467    public const FeatureShutdown = [
13468        'default' => [],
13469        'type' => 'list',
13470    ];
13471
13472    /**
13473     * Whether Article should clone the ParserOutput before postprocessing.
13474     *
13475     * @unstable Temporary feature flag, T410923
13476     * @since 1.45
13477     */
13478    public const CloneArticleParserOutput = [
13479        'default' => true,
13480        'type' => 'boolean',
13481    ];
13482
13483    /**
13484     * Whether parser functions should use Leximorph handlers instead of Language methods.
13485     *
13486     * @unstable Temporary feature flag, T389281
13487     * @since 1.45
13488     */
13489    public const UseLeximorph = [
13490        'default' => false,
13491        'type' => 'boolean',
13492    ];
13493
13494    /**
13495     * Whether to use the post-OutputTransform cache
13496     *
13497     * @unstable Temporary feature flag, T348255
13498     * @deprecated replaced by UsePostprocCacheLegacy and UsePostprocCacheParsoid
13499     * @since 1.46
13500     */
13501    public const UsePostprocCache = [
13502        'default' => false,
13503        'type' => 'boolean',
13504    ];
13505
13506    /**
13507     * Whether to use the post-OutputTransform cache for legacy parses
13508     *
13509     * @unstable Temporary feature flag, T348255
13510     * @since 1.46
13511     */
13512    public const UsePostprocCacheLegacy = [
13513        'default' => false,
13514        'type' => 'boolean'
13515    ];
13516
13517    /**
13518     * Whether to use the post-OutputTransform cache for Parsoid parses
13519     *
13520     * @unstable Temporary feature flag, T348255
13521     * @since 1.46
13522     */
13523    public const UsePostprocCacheParsoid = [
13524        'default' => false,
13525        'type' => 'boolean'
13526    ];
13527
13528    /**
13529     * Sample rate for collecting statistics on unsafe key values in ParserCache.
13530     * Zero disables collection; 1000 means "1 in every 1000 parses will
13531     * be sampled".
13532     *
13533     * @warning This is EXPERIMENTAL and will disappear once analysis is
13534     *  complete.
13535     * @unstable temporary statistics gathering
13536     * @since 1.46
13537     */
13538    public const ParserOptionsLogUnsafeSampleRate = [
13539        'default' => 0,
13540        'type' => 'integer'
13541    ];
13542
13543    // endregion -- End Miscellaneous
13544}