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\PreviouslyRenamedAccountPreAuthenticationProvider;
23use MediaWiki\Auth\ResetPasswordSecondaryAuthenticationProvider;
24use MediaWiki\Auth\TemporaryPasswordAuthenticationRequest;
25use MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider;
26use MediaWiki\Auth\ThrottlePreAuthenticationProvider;
27use MediaWiki\Config\ConfigException;
28use MediaWiki\Content\CssContentHandler;
29use MediaWiki\Content\FallbackContentHandler;
30use MediaWiki\Content\JavaScriptContentHandler;
31use MediaWiki\Content\JsonContentHandler;
32use MediaWiki\Content\TextContentHandler;
33use MediaWiki\Content\VueContentHandler;
34use MediaWiki\Content\WikitextContentHandler;
35use MediaWiki\Deferred\SiteStatsUpdate;
36use MediaWiki\FileRepo\LocalRepo;
37use MediaWiki\JobQueue\JobQueueDB;
38use MediaWiki\JobQueue\Jobs\AssembleUploadChunksJob;
39use MediaWiki\JobQueue\Jobs\CategoryCountUpdateJob;
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\RecentChanges\CategoryMembershipChangeJob;
79use MediaWiki\RecentChanges\RecentChangeNotifyJob;
80use MediaWiki\RecentChanges\RecentChangesUpdateJob;
81use MediaWiki\RenameUser\Job\RenameUserDerivedJob;
82use MediaWiki\RenameUser\Job\RenameUserTableJob;
83use MediaWiki\Request\WebRequest;
84use MediaWiki\Session\SessionManager;
85use MediaWiki\Settings\Source\JsonSchemaTrait;
86use MediaWiki\Site\MediaWikiSite;
87use MediaWiki\Storage\SqlBlobStore;
88use MediaWiki\Title\NamespaceInfo;
89use MediaWiki\User\CentralId\LocalIdLookup;
90use MediaWiki\User\Options\UserOptionsUpdateJob;
91use MediaWiki\User\Registration\LocalUserRegistrationProvider;
92use MediaWiki\User\UserEditCountInitJob;
93use MediaWiki\User\UserGroupExpiryJob;
94use MediaWiki\Watchlist\ActivityUpdateJob;
95use MediaWiki\Watchlist\ClearUserWatchlistJob;
96use MediaWiki\Watchlist\ClearWatchlistNotificationsJob;
97use MediaWiki\Watchlist\WatchlistExpiryJob;
98use ReflectionClass;
99use Wikimedia\EventRelayer\EventRelayerNull;
100use Wikimedia\ObjectCache\APCUBagOStuff;
101use Wikimedia\ObjectCache\EmptyBagOStuff;
102use Wikimedia\ObjectCache\HashBagOStuff;
103use Wikimedia\ObjectCache\MemcachedPeclBagOStuff;
104use Wikimedia\ObjectCache\MemcachedPhpBagOStuff;
105
106/**
107 * This class contains schema declarations for all configuration variables
108 * known to MediaWiki core. The schema definitions follow the JSON Schema
109 * specification.
110 *
111 * @see https://json-schema.org/learn/getting-started-step-by-step.html
112 * @see https://json-schema.org/understanding-json-schema/
113 *
114 * The following JSON schema keys are used by MediaWiki:
115 * - default: the configuration variable's default value.
116 * - type: identifies the allowed value type or types. In addition to JSON Schema types,
117 *         PHPDoc style type definitions are supported for convenience.
118 *         Note that 'array' must not be used for associative arrays.
119 *         To avoid confusion, use 'list' for sequential arrays and 'map' for associative arrays
120 *         with uniform values. The 'object' type should be used for structures that have a known
121 *         set of meaningful properties, especially if each property may have a different kind
122 *         of value.
123 *         See {@link \MediaWiki\Settings\Source\JsonTypeHelper} for details.
124 *
125 * The following additional keys are used by MediaWiki:
126 * - mergeStrategy: see the {@link \MediaWiki\Settings\Config\MergeStrategy}.
127 * - dynamicDefault: Specified a callback that computes the effective default at runtime, based
128 *   on the value of other config variables or on the system environment.
129 *   See {@link \MediaWiki\Settings\Source\ReflectionSchemaSource}
130 *   and {@link \MediaWiki\Settings\DynamicDefaultValues} for details.
131 *
132 * @note After changing this file, run maintenance/generateConfigSchema.php to update
133 *       all the files derived from the information in MainConfigSchema.
134 *
135 * @since 1.39
136 */
137class MainConfigSchema {
138    use JsonSchemaTrait;
139
140    /**
141     * Returns a generator for iterating over all config settings and their default values.
142     * The primary use of this method is to import default values into local scope.
143     * @code
144     *   foreach ( MainConfigSchema::listDefaultValues( 'wg' ) as $var => $value ) {
145     *       $$var = $value;
146     *   }
147     * @endcode
148     *
149     * There should be no reason for application logic to do this.
150     *
151     * @note This method is relatively slow, it should not be used by
152     *       performance critical code. Application logic should generally
153     *       use ConfigSchema instead
154     *
155     * @param string $prefix A prefix to prepend to each setting name.
156     *        Typically, this will be "wg" when constructing global
157     *        variable names.
158     *
159     * @return Generator<string,mixed> $settingName => $defaultValue
160     */
161    public static function listDefaultValues( string $prefix = '' ): Generator {
162        $class = new ReflectionClass( self::class );
163        foreach ( $class->getReflectionConstants() as $const ) {
164            if ( !$const->isPublic() ) {
165                continue;
166            }
167
168            $value = $const->getValue();
169
170            if ( !is_array( $value ) ) {
171                // Just in case we end up having some other kind of constant on this class.
172                continue;
173            }
174
175            if ( isset( $value['obsolete'] ) ) {
176                continue;
177            }
178
179            $name = $const->getName();
180            yield "$prefix$name" => self::getDefaultFromJsonSchema( $value );
181        }
182    }
183
184    /**
185     * Returns the default value of the given config setting.
186     *
187     * @note This method is relatively slow, it should not be used by
188     *       performance critical code. Application logic should generally
189     *       use ConfigSchema instead
190     *
191     * @param string $name The config setting name.
192     *
193     * @return mixed The given config setting's default value, or null
194     *         if no default value is specified in the schema.
195     */
196    public static function getDefaultValue( string $name ) {
197        $class = new ReflectionClass( self::class );
198        if ( !$class->hasConstant( $name ) ) {
199            throw new InvalidArgumentException( "Unknown setting: $name" );
200        }
201        $value = $class->getConstant( $name );
202
203        if ( !is_array( $value ) ) {
204            // Might happen if we end up having other kinds of constants on this class.
205            throw new InvalidArgumentException( "Unknown setting: $name" );
206        }
207
208        return self::getDefaultFromJsonSchema( $value );
209    }
210
211    /***************************************************************************/
212    /**
213     * Registry of factory functions to create config objects:
214     * The 'main' key must be set, and the value should be a valid
215     * callable.
216     *
217     * @since 1.23
218     */
219    public const ConfigRegistry = [
220        'default' => [
221            'main' => 'MediaWiki\\Config\\GlobalVarConfig::newInstance',
222        ],
223        'type' => 'map',
224    ];
225
226    /**
227     * Name of the site. It must be changed in LocalSettings.php
228     */
229    public const Sitename = [
230        'default' => 'MediaWiki',
231    ];
232
233    /***************************************************************************/
234    // region   Server URLs and file paths
235    /** @name   Server URLs and file paths
236     *
237     * In this section, a "path" is usually a host-relative URL, i.e. a URL without
238     * the host part, that starts with a slash. In most cases a full URL is also
239     * acceptable. A "directory" is a local file path.
240     *
241     * In both paths and directories, trailing slashes should not be included.
242     */
243
244    /**
245     * URL of the server.
246     *
247     * **Example:**
248     * ```
249     * $wgServer = 'http://example.com';
250     * ```
251     *
252     * This must be set in LocalSettings.php. The MediaWiki installer does this
253     * automatically since 1.18.
254     *
255     * If you want to use protocol-relative URLs on your wiki, set this to a
256     * protocol-relative URL like '//example.com' and set $wgCanonicalServer
257     * to a fully qualified URL.
258     */
259    public const Server = [
260        'default' => false,
261    ];
262
263    /**
264     * Canonical URL of the server, to use in IRC feeds and notification e-mails.
265     *
266     * Must be fully qualified, even if $wgServer is protocol-relative.
267     *
268     * Defaults to $wgServer, expanded to a fully qualified http:// URL if needed.
269     *
270     * @since 1.18
271     */
272    public const CanonicalServer = [
273        'default' => false,
274    ];
275
276    /**
277     * Server name. This is automatically computed by parsing the bare
278     * hostname out of $wgCanonicalServer. It should not be customized.
279     *
280     * @since 1.24
281     */
282    public const ServerName = [
283        'default' => false,
284    ];
285
286    /**
287     * When the wiki is running behind a proxy and this is set to true, assumes that the proxy
288     * exposes the wiki on the standard ports (443 for https and 80 for http).
289     *
290     * @since 1.26
291     */
292    public const AssumeProxiesUseDefaultProtocolPorts = [
293        'default' => true,
294        'type' => 'boolean',
295    ];
296
297    /**
298     * For installations where the canonical server is HTTP but HTTPS is optionally
299     * supported, you can specify a non-standard HTTPS port here. $wgServer should
300     * be a protocol-relative URL.
301     *
302     * If HTTPS is always used, just specify the port number in $wgServer.
303     *
304     * @see https://phabricator.wikimedia.org/T67184
305     * @since 1.24
306     */
307    public const HttpsPort = [
308        'default' => 443,
309    ];
310
311    /**
312     * If this is true, when an insecure HTTP request is received, always redirect
313     * to HTTPS. This overrides and disables the preferhttps user preference, and it
314     * overrides $wgSecureLogin.
315     *
316     * $wgServer may be either https or protocol-relative. If $wgServer starts with
317     * "http://", an exception will be thrown.
318     *
319     * If a reverse proxy or CDN is used to forward requests from HTTPS to HTTP,
320     * the request header "X-Forwarded-Proto: https" should be sent to suppress
321     * the redirect.
322     *
323     * In addition to setting this to true, for optimal security, the web server
324     * should also be configured to send Strict-Transport-Security response headers.
325     *
326     * @since 1.35
327     */
328    public const ForceHTTPS = [
329        'default' => false,
330        'type' => 'boolean',
331    ];
332
333    /**
334     * The path we should point to.
335     *
336     * It might be a virtual path in case with use apache mod_rewrite for example.
337     *
338     * This *needs* to be set correctly.
339     *
340     * Other paths will be set to defaults based on it unless they are directly
341     * set in LocalSettings.php
342     */
343    public const ScriptPath = [
344        'default' => '/wiki',
345    ];
346
347    /**
348     * Whether to support URLs like index.php/Page_title.
349     * The effective default value is determined at runtime:
350     * it will be enabled in environments where it is expected to be safe.
351     *
352     * Override this to false if $_SERVER['PATH_INFO'] contains unexpectedly
353     * incorrect garbage, or to true if it is really correct.
354     *
355     * The default $wgArticlePath will be set based on this value at runtime, but if
356     * you have customized it, having this incorrectly set to true can cause
357     * redirect loops when "pretty URLs" are used.
358     *
359     * @since 1.2.1
360     */
361    public const UsePathInfo = [
362        'dynamicDefault' => true,
363    ];
364
365    public static function getDefaultUsePathInfo(): bool {
366        // These often break when PHP is set up in CGI mode.
367        // PATH_INFO *may* be correct if cgi.fix_pathinfo is set, but then again it may not;
368        // lighttpd converts incoming path data to lowercase on systems
369        // with case-insensitive filesystems, and there have been reports of
370        // problems on Apache as well.
371        return !str_contains( PHP_SAPI, 'cgi' ) && !str_contains( PHP_SAPI, 'apache2filter' ) &&
372            !str_contains( PHP_SAPI, 'isapi' );
373    }
374
375    /**
376     * The URL path to index.php.
377     *
378     * Defaults to "{$wgScriptPath}/index.php".
379     */
380    public const Script = [
381        'default' => false,
382        'dynamicDefault' => [ 'use' => [ 'ScriptPath' ] ]
383    ];
384
385    /**
386     * @param mixed $scriptPath Value of ScriptPath
387     * @return string
388     */
389    public static function getDefaultScript( $scriptPath ): string {
390        return "$scriptPath/index.php";
391    }
392
393    /**
394     * The URL path to load.php.
395     *
396     * Defaults to "{$wgScriptPath}/load.php".
397     *
398     * @since 1.17
399     */
400    public const LoadScript = [
401        'default' => false,
402        'dynamicDefault' => [ 'use' => [ 'ScriptPath' ] ]
403    ];
404
405    /**
406     * @param mixed $scriptPath Value of ScriptPath
407     * @return string
408     */
409    public static function getDefaultLoadScript( $scriptPath ): string {
410        return "$scriptPath/load.php";
411    }
412
413    /**
414     * The URL path to the REST API.
415     * Defaults to "{$wgScriptPath}/rest.php"
416     *
417     * @since 1.34
418     */
419    public const RestPath = [
420        'default' => false,
421        'dynamicDefault' => [ 'use' => [ 'ScriptPath' ] ]
422    ];
423
424    /**
425     * @param mixed $scriptPath Value of ScriptPath
426     * @return string
427     */
428    public static function getDefaultRestPath( $scriptPath ): string {
429        return "$scriptPath/rest.php";
430    }
431
432    /**
433     * The URL path of the skins directory.
434     *
435     * Defaults to "{$wgResourceBasePath}/skins".
436     *
437     * @since 1.3
438     */
439    public const StylePath = [
440        'default' => false,
441        'dynamicDefault' => [ 'use' => [ 'ResourceBasePath' ] ]
442    ];
443
444    /**
445     * @param mixed $resourceBasePath Value of ResourceBasePath
446     * @return string
447     */
448    public static function getDefaultStylePath( $resourceBasePath ): string {
449        return "$resourceBasePath/skins";
450    }
451
452    /**
453     * The URL path of the skins directory. Should not point to an external domain.
454     *
455     * Defaults to "{$wgScriptPath}/skins".
456     *
457     * @since 1.17
458     */
459    public const LocalStylePath = [
460        'default' => false,
461        'dynamicDefault' => [ 'use' => [ 'ScriptPath' ] ]
462    ];
463
464    /**
465     * @param mixed $scriptPath Value of ScriptPath
466     * @return string
467     */
468    public static function getDefaultLocalStylePath( $scriptPath ): string {
469        // Avoid ResourceBasePath here since that may point to a different domain (e.g. CDN)
470        return "$scriptPath/skins";
471    }
472
473    /**
474     * The URL path of the extensions directory.
475     *
476     * Defaults to "{$wgResourceBasePath}/extensions".
477     *
478     * @since 1.16
479     */
480    public const ExtensionAssetsPath = [
481        'default' => false,
482        'dynamicDefault' => [ 'use' => [ 'ResourceBasePath' ] ]
483    ];
484
485    /**
486     * @param mixed $resourceBasePath Value of ResourceBasePath
487     * @return string
488     */
489    public static function getDefaultExtensionAssetsPath( $resourceBasePath ): string {
490        return "$resourceBasePath/extensions";
491    }
492
493    /**
494     * Extensions directory in the file system.
495     *
496     * Defaults to "{$IP}/extensions" in Setup.php
497     *
498     * @note This configuration variable is used to locate extensions while loading settings.
499     * @since 1.25
500     */
501    public const ExtensionDirectory = [
502        'default' => null,
503        'type' => '?string',
504    ];
505
506    /**
507     * Skins directory in the file system.
508     *
509     * Defaults to "{$IP}/skins" in Setup.php.
510     *
511     * @note This configuration variable is used to locate skins while loading settings.
512     * @since 1.3
513     */
514    public const StyleDirectory = [
515        'default' => null,
516        'type' => '?string',
517    ];
518
519    /**
520     * The URL path for primary article page views. This path should contain $1,
521     * which is replaced by the article title.
522     *
523     * Defaults to "{$wgScript}/$1" or "{$wgScript}?title=$1",
524     * depending on $wgUsePathInfo.
525     */
526    public const ArticlePath = [
527        'default' => false,
528        'dynamicDefault' => [ 'use' => [ 'Script', 'UsePathInfo' ] ]
529    ];
530
531    /**
532     * @param string $script Value of Script
533     * @param mixed $usePathInfo Value of UsePathInfo
534     * @return string
535     */
536    public static function getDefaultArticlePath( string $script, $usePathInfo ): string {
537        if ( $usePathInfo ) {
538            return "$script/$1";
539        }
540        return "$script?title=$1";
541    }
542
543    /**
544     * The URL path to $wgUploadDirectory. Shortcut for $wgLocalFileRepo['url'].
545     *
546     * Defaults to "{$wgScriptPath}/images".
547     */
548    public const UploadPath = [
549        'default' => false,
550        'dynamicDefault' => [ 'use' => [ 'ScriptPath' ] ]
551    ];
552
553    /**
554     * @param mixed $scriptPath Value of ScriptPath
555     * @return string
556     */
557    public static function getDefaultUploadPath( $scriptPath ): string {
558        return "$scriptPath/images";
559    }
560
561    /**
562     * The base path for img_auth.php. This is used to interpret the request URL
563     * for requests to img_auth.php that do not match the base upload path. If
564     * false, "{$wgScriptPath}/img_auth.php" is used.
565     *
566     * Normally, requests to img_auth.php have a REQUEST_URI which matches
567     * $wgUploadPath, and in that case, setting this should not be necessary.
568     * This variable is used in case img_auth.php is accessed via a different path
569     * than $wgUploadPath.
570     *
571     * @since 1.35
572     */
573    public const ImgAuthPath = [
574        'default' => false,
575    ];
576
577    /**
578     * The base path for thumb_handler.php. This is used to interpret the request URL
579     * for requests to thumb_handler.php that do not match the base upload path.
580     *
581     * @since 1.36
582     */
583    public const ThumbPath = [
584        'default' => false,
585    ];
586
587    /**
588     * The filesystem path of the images directory.
589     *
590     * Defaults to "{$IP}/images" in Setup.php.
591     */
592    public const UploadDirectory = [
593        'default' => false,
594        'type' => '?string|false',
595    ];
596
597    /**
598     * Directory where the cached page will be saved.
599     *
600     * Defaults to "{$wgUploadDirectory}/cache".
601     */
602    public const FileCacheDirectory = [
603        'default' => false,
604        'dynamicDefault' => [ 'use' => [ 'UploadDirectory' ] ]
605    ];
606
607    /**
608     * @param mixed $uploadDirectory Value of UploadDirectory
609     * @return string
610     */
611    public static function getDefaultFileCacheDirectory( $uploadDirectory ): string {
612        return "$uploadDirectory/cache";
613    }
614
615    /**
616     * The URL path of the wiki logo. The logo size should be 135x135 pixels.
617     *
618     * Defaults to "$wgResourceBasePath/resources/assets/change-your-logo.svg".
619     * Developers should retrieve this logo (and other variants) using
620     * the static function MediaWiki\ResourceLoader\SkinModule::getAvailableLogos
621     * Ignored if $wgLogos is set.
622     */
623    public const Logo = [
624        'default' => false,
625        'dynamicDefault' => [ 'use' => [ 'ResourceBasePath' ] ]
626    ];
627
628    /**
629     * @param mixed $resourceBasePath Value of ResourceBasePath
630     * @return string
631     */
632    public static function getDefaultLogo( $resourceBasePath ): string {
633        return "$resourceBasePath/resources/assets/change-your-logo.svg";
634    }
635
636    /**
637     * Specification for different versions of the wiki logo.
638     *
639     * This is an array which should have the following k/v pairs:
640     * All path values can be either absolute or relative URIs
641     *
642     * The `1x` key is a path to the 1x version of square logo (should be 135x135 pixels)
643     * The `2x` key is a path to the 2x version of square logo
644     * The `svg` key is a path to the svg version of square logo
645     * The `icon` key is a path to the version of the logo without wordmark and tagline
646     * The `wordmark` key may be null or an array with the following fields
647     *  - `src` path to wordmark version
648     *  - `1x` path to svg wordmark version (if you want to
649     *     support browsers with SVG support with an SVG logo)
650     *  - `width` width of the logo in pixels
651     *  - `height` height of the logo in pixels
652     * The `tagline` key may be null or array with the following fields
653     *  - `src` path to tagline image
654     *  - `width` width of the tagline in pixels
655     *  - `height` height of the tagline in pixels
656     *
657     *
658     * @par Example:
659     * @code
660     * $wgLogos = [
661     *    '1x' => 'path/to/1x_version.png',
662     *    '2x' => 'path/to/2x_version.png',
663     *    'svg' => 'path/to/svg_version.svg',
664     *    'icon' => 'path/to/icon.png',
665     *    'wordmark' => [
666     *      'src' => 'path/to/wordmark_version.png',
667     *      '1x' => 'path/to/wordmark_version.svg',
668     *      'width' => 135,
669     *      'height' => 20,
670     *    ],
671     *    'tagline' => [
672     *      'src' => 'path/to/tagline_version.png',
673     *      'width' => 135,
674     *      'height' => 15,
675     *    ]
676     * ];
677     * @endcode
678     *
679     * Defaults to [ "1x" => $wgLogo ],
680     *   or [ "1x" => "$wgResourceBasePath/resources/assets/change-your-logo.svg" ] if $wgLogo is not set.
681     * @since 1.35
682     */
683    public const Logos = [
684        'default' => false,
685        'type' => 'map|false',
686    ];
687
688    /**
689     * The URL path of the icon.
690     *
691     * @since 1.6
692     */
693    public const Favicon = [
694        'default' => '/favicon.ico',
695    ];
696
697    /**
698     * The URL path of the icon for iPhone and iPod Touch web app bookmarks.
699     *
700     * Defaults to no icon.
701     *
702     * @since 1.12
703     */
704    public const AppleTouchIcon = [
705        'default' => false,
706    ];
707
708    /**
709     * Value for the referrer policy meta tag.
710     *
711     * One or more of the values defined in the Referrer Policy specification:
712     * https://w3c.github.io/webappsec-referrer-policy/
713     * ('no-referrer', 'no-referrer-when-downgrade', 'same-origin',
714     * 'origin', 'strict-origin', 'origin-when-cross-origin',
715     * 'strict-origin-when-cross-origin', or 'unsafe-url')
716     * Setting it to false prevents the meta tag from being output
717     * (which results in falling back to the Referrer-Policy header,
718     * or 'no-referrer-when-downgrade' if that's not set either.)
719     * Setting it to an array (supported since 1.31) will create a meta tag for
720     * each value, in the reverse of the order (meaning that the first array element
721     * will be the default and the others used as fallbacks for browsers which do not
722     * understand it).
723     *
724     * @since 1.25
725     */
726    public const ReferrerPolicy = [
727        'default' => false,
728        'type' => 'list|string|false',
729    ];
730
731    /**
732     * The local filesystem path to a temporary directory. This must not be web-accessible.
733     *
734     * When this setting is set to false, its value will automatically be decided
735     * through the first call to wfTempDir(). See that method's implementation for
736     * the actual detection logic.
737     *
738     * To find the temporary path for the current wiki, developers must not use
739     * this variable directly. Use the global function wfTempDir() instead.
740     *
741     * The temporary directory is expected to be shared with other applications,
742     * including other MediaWiki instances (which might not run the same version
743     * or configuration). When storing files here, take care to avoid conflicts
744     * with other instances of MediaWiki. For example, when caching the result
745     * of a computation, the file name should incorporate the input of the
746     * computation so that it cannot be confused for the result of a similar
747     * computation by another MediaWiki instance.
748     *
749     * @see \wfTempDir()
750     * @note Default changed to false in MediaWiki 1.20.
751     */
752    public const TmpDirectory = [
753        'default' => false,
754    ];
755
756    /**
757     * If set, this server URL is prepended to $wgUploadPath in the default
758     * value of $wgLocalFileRepo['url'].
759     *
760     * It is meant for controlling web access to $wgUploadPath via an alternative
761     * domain name, instead of $wgServer, such as may be needed if your images
762     * are uploaded to a third-party file storage service.
763     *
764     * For other customizations, set $wgLocalFileRepo['url'] directly instead.
765     *
766     * @since 1.4
767     */
768    public const UploadBaseUrl = [
769        'default' => '',
770    ];
771
772    /**
773     * To enable remote on-demand scaling, set this to the thumbnail base URL.
774     *
775     * Full thumbnail URL will be like $wgUploadStashScalerBaseUrl/e/e6/Foo.jpg/123px-Foo.jpg
776     * where 'e6' are the first two characters of the MD5 hash of the file name.
777     *
778     * @deprecated since 1.36 Use thumbProxyUrl in $wgLocalFileRepo
779     *
780     * If $wgUploadStashScalerBaseUrl and thumbProxyUrl are both false, thumbs are
781     * rendered locally as needed.
782     * @since 1.17
783     */
784    public const UploadStashScalerBaseUrl = [
785        'default' => false,
786        'deprecated' => 'since 1.36 Use thumbProxyUrl in $wgLocalFileRepo',
787    ];
788
789    /**
790     * To set 'pretty' URL paths for actions other than
791     * plain page views, add to this array.
792     *
793     * **Example:**
794     * Set pretty URL for the edit action:
795     *
796     * ```
797     *   'edit' => "$wgScriptPath/edit/$1"
798     * ```
799     * There must be an appropriate script or rewrite rule in place to handle these URLs.
800     *
801     * @since 1.5
802     */
803    public const ActionPaths = [
804        'default' => [],
805        'type' => 'map',
806    ];
807
808    /**
809     * When enabled, the domain root will show the wiki's main page,
810     * instead of redirecting to the main page.
811     *
812     * @since 1.34
813     */
814    public const MainPageIsDomainRoot = [
815        'default' => false,
816        'type' => 'boolean',
817    ];
818
819    // endregion -- end of server URLs and file paths
820
821    /***************************************************************************/
822    // region   Files and file uploads
823    /** @name   Files and file uploads */
824
825    /**
826     * Allow users to upload files.
827     *
828     * Use $wgLocalFileRepo to control how and where uploads are stored.
829     * Disabled by default as for security reasons.
830     * See <https://www.mediawiki.org/wiki/Manual:Configuring_file_uploads>.
831     *
832     * @since 1.5
833     */
834    public const EnableUploads = [
835        'default' => false,
836    ];
837
838    /**
839     * The maximum age of temporary (incomplete) uploaded files
840     */
841    public const UploadStashMaxAge = [
842        'default' => 6 * 3600, // 6 hours
843    ];
844
845    /**
846     * Enable deferred upload tasks that use the job queue.
847     *
848     * Only enable this if job runners are set up for both the
849     * 'AssembleUploadChunks','PublishStashedFile' and 'UploadFromUrl' job types.
850     */
851    public const EnableAsyncUploads = [
852        'default' => false,
853    ];
854
855    /**
856     * Enable the async processing of upload by url in Special:Upload.
857     *
858     * Only works if EnableAsyncUploads is also enabled
859     */
860    public const EnableAsyncUploadsByURL = [
861        'default' => false,
862    ];
863
864    /**
865     * To disable file delete/restore temporarily
866     */
867    public const UploadMaintenance = [
868        'default' => false,
869    ];
870
871    /**
872     * Additional characters that are not allowed in filenames. They are replaced with '-' when
873     * uploading. Like $wgLegalTitleChars, this is a regexp character class.
874     *
875     * Slashes and backslashes are disallowed regardless of this setting, but included here for
876     * completeness.
877     *
878     * @deprecated since 1.41; no longer customizable
879     */
880    public const IllegalFileChars = [
881        'default' => ':\\/\\\\',
882        'deprecated' => 'since 1.41; no longer customizable',
883    ];
884
885    /**
886     * Where to move deleted files to. Shortcut for $wgLocalFileRepo['deletedDir'].
887     *
888     * Defaults to "{$wgUploadDirectory}/deleted".
889     */
890    public const DeletedDirectory = [
891        'default' => false,
892        'dynamicDefault' => [ 'use' => [ 'UploadDirectory' ] ]
893    ];
894
895    /**
896     * @param mixed $uploadDirectory Value of UploadDirectory
897     * @return string
898     */
899    public static function getDefaultDeletedDirectory( $uploadDirectory ): string {
900        return "$uploadDirectory/deleted";
901    }
902
903    /**
904     * Set this to true if you use img_auth and want the user to see details on why access failed.
905     */
906    public const ImgAuthDetails = [
907        'default' => false,
908    ];
909
910    /**
911     * Map of relative URL directories to match to internal mwstore:// base storage paths.
912     *
913     * For img_auth.php requests, everything after "img_auth.php/" is checked to see
914     * if starts with any of the prefixes defined here. The prefixes should not overlap.
915     * The prefix that matches has a corresponding storage path, which the rest of the URL
916     * is assumed to be relative to. The file at that path (or a 404) is send to the client.
917     *
918     * Example:
919     * $wgImgAuthUrlPathMap['/timeline/'] = 'mwstore://local-fs/timeline-render/';
920     * The above maps ".../img_auth.php/timeline/X" to "mwstore://local-fs/timeline-render/".
921     * The name "local-fs" should correspond by name to an entry in $wgFileBackends.
922     *
923     * @see self::FileBackends
924     */
925    public const ImgAuthUrlPathMap = [
926        'default' => [],
927        'type' => 'map',
928    ];
929
930    /**
931     * File repository structures
932     *
933     * $wgLocalFileRepo is a single repository structure, and $wgForeignFileRepos is
934     * an array of such structures. Each repository structure is an associative
935     * array of properties configuring the repository.
936     *
937     * Properties required for all repos:
938     *   - class            The class name for the repository. May come from the core or an extension.
939     *                      The core repository classes are FileRepo, LocalRepo, ForeignDBRepo.
940     *
941     *   - name             A unique name for the repository (but $wgLocalFileRepo should be 'local').
942     *                      The name should consist of alpha-numeric characters.
943     *
944     * Optional common properties:
945     *   - backend          A file backend name (see $wgFileBackends). If not specified, or
946     *                      if the name is not present in $wgFileBackends, an FSFileBackend
947     *                      will automatically be configured.
948     *   - lockManager      If a file backend is automatically configured, this will be lock
949     *                      manager name used. A lock manager named in $wgLockManagers, or one of
950     *                      the default lock managers "fsLockManager" or "nullLockManager". Default
951     *                      "fsLockManager".
952     *   - favicon          URL to a favicon. This is exposed via FileRepo::getInfo and
953     *                      ApiQueryFileRepoInfo. Originally for use by MediaViewer (T77093).
954     *
955     * For most core repos:
956     *   - zones            Associative array of zone names that each map to an array with:
957     *                          container  : backend container name the zone is in
958     *                          directory  : root path within container for the zone
959     *                          url        : base URL to the root of the zone
960     *                          urlsByExt  : map of file extension types to base URLs
961     *                                       (useful for using a different cache for videos)
962     *                      Zones default to using "<repo name>-<zone name>" as the container name
963     *                      and default to using the container root as the zone's root directory.
964     *                      Nesting of zone locations within other zones should be avoided.
965     *   - url              Public zone URL. The 'zones' settings take precedence.
966     *   - hashLevels       The number of directory levels for hash-based division of files.
967     *
968     *                      Set this to 0 if you do not want MediaWiki to divide your images
969     *                      directory into many subdirectories.
970     *
971     *                      It is recommended to leave this enabled. In previous versions of
972     *                      MediaWiki, some users set this to false to allow images to be added to
973     *                      the wiki by copying them into $wgUploadDirectory and then running
974     *                      maintenance/rebuildImages.php to register them in the database.
975     *                      This is no longer supported, use maintenance/importImages.php instead.
976     *
977     *                      Default: 2.
978     *   - deletedHashLevels
979     *                      Optional 'hashLevels' override for the 'deleted' zone.
980     *   - thumbScriptUrl   The URL for thumb.php (optional, not recommended)
981     *   - transformVia404  Whether to skip media file transformation on parse and rely on a 404
982     *                      handler instead.
983     *   - thumbProxyUrl    Optional. URL of where to proxy thumb.php requests to. This is
984     *                      also used internally for remote thumbnailing of upload stash files.
985     *                      Example: http://127.0.0.1:8888/wiki/dev/thumb/
986     *   - thumbProxySecret Optional value of the X-Swift-Secret header to use in requests to
987     *                      thumbProxyUrl
988     *   - disableLocalTransform
989     *                      If present and true, local image scaling will be disabled. If attempted,
990     *                      it will show an error to the user and log an error message. To avoid an
991     *                      error, thumbProxyUrl must be set, as well as either transformVia404
992     *                      (preferred) or thumbScriptUrl.
993     *   - initialCapital   Equivalent to $wgCapitalLinks (or $wgCapitalLinkOverrides[NS_FILE],
994     *                      determines whether filenames implicitly start with a capital letter.
995     *                      The current implementation may give incorrect description page links
996     *                      when the local $wgCapitalLinks and initialCapital are mismatched.
997     *   - pathDisclosureProtection
998     *                      May be 'paranoid' to remove all parameters from error messages, 'none' to
999     *                      leave the paths in unchanged, or 'simple' to replace paths with
1000     *                      placeholders. Default for LocalRepo is 'simple'.
1001     *   - fileMode         This allows wikis to set the file mode when uploading/moving files. Default
1002     *                      is 0644.
1003     *   - directory        The local filesystem directory where public files are stored. Not used for
1004     *                      some remote repos.
1005     *   - deletedDir       The local filesystem directory where public files are moved to (from
1006     *                      'directory') when they are deleted, at which points they become private.
1007     *                      Defaults to false, which disables the file deletion feature.
1008     *   - thumbDir         The base thumbnail directory. Defaults to "<directory>/thumb".
1009     *   - thumbUrl         The base thumbnail URL. Defaults to "<url>/thumb".
1010     *   - isPrivate        Set this if measures should always be taken to keep the files private.
1011     *                      One should not trust this to assure that the files are not web readable;
1012     *                      the server configuration should be done manually depending on the backend.
1013     *   - useJsonMetadata  Whether handler metadata should be stored in JSON format. Default: true.
1014     *   - useSplitMetadata Whether handler metadata should be split up and stored in the text table.
1015     *                      Default: false.
1016     *   - splitMetadataThreshold
1017     *                      If the media handler opts in, large metadata items will be split into a
1018     *                      separate blob in the database if the item is larger than this threshold.
1019     *                      Default: 1000
1020     *   - updateCompatibleMetadata
1021     *                      When true, image metadata will be upgraded by reloading it from the original
1022     *                      file, if the handler indicates that it is out of date.
1023     *
1024     *                      By default, when purging a file or otherwise refreshing file metadata, it
1025     *                      is only reloaded when the metadata is invalid. Valid data originally loaded
1026     *                      by a current or older compatible version is left unchanged. Enable this
1027     *                      to also reload and upgrade metadata that was stored by an older compatible
1028     *                      version. See also MediaHandler::isMetadataValid, and RefreshImageMetadata.
1029     *
1030     *                      Default: false.
1031     *
1032     *   - reserializeMetadata
1033     *                      If true, image metadata will be automatically rewritten to the database
1034     *                      if its serialization format is out of date. Default: false
1035     *
1036     * These settings describe a foreign MediaWiki installation. They are optional, and will be ignored
1037     * for local repositories:
1038     *   - descBaseUrl       URL of image description pages, e.g. https://en.wikipedia.org/wiki/File:
1039     *   - scriptDirUrl      URL of the MediaWiki installation, equivalent to $wgScriptPath, e.g.
1040     *                       https://en.wikipedia.org/w
1041     *   - articleUrl        Equivalent to $wgArticlePath, e.g. https://en.wikipedia.org/wiki/$1
1042     *   - fetchDescription  Fetch the text of the remote file description page and display them
1043     *                       on the local wiki.
1044     *   - abbrvThreshold    File names over this size will use the short form of thumbnail names.
1045     *                       Short thumbnail names only have the width, parameters, and the extension.
1046     *
1047     * ForeignDBRepo:
1048     *   - dbType, dbServer, dbUser, dbPassword, dbName, dbFlags
1049     *                       equivalent to the corresponding member of $wgDBservers
1050     *   - tablePrefix       Table prefix, the foreign wiki's $wgDBprefix
1051     *   - hasSharedCache    Set to true if the foreign wiki's $wgMainCacheType is identical to,
1052     *                       and accessible from, this wiki.
1053     *
1054     * ForeignAPIRepo:
1055     *   - apibase              Use for the foreign API's URL
1056     *   - apiThumbCacheExpiry  How long to locally cache thumbs for
1057     *
1058     * If you set $wgForeignFileRepos to an array of repository structures, those will
1059     * be searched after the local file repo.
1060     * Otherwise, you will only have access to local media files.
1061     *
1062     * @see SetupDynamicConfig.php for expansion of below initial values.
1063     */
1064    public const LocalFileRepo = [
1065        'default' => [
1066            'class' => LocalRepo::class,
1067            'name' => 'local',
1068            'directory' => null, // $wgUploadDirectory
1069            'scriptDirUrl' => null, // $wgScriptPath
1070            'favicon' => null, // $wgFavicon
1071            'url' => null, // $wgUploadBaseUrl . $wgUploadPath
1072            'hashLevels' => null, // $wgHashedUploadDirectory
1073            'thumbScriptUrl' => null, // $wgThumbnailScriptPath
1074            'transformVia404' => null, // $wgGenerateThumbnailOnParse
1075            'deletedDir' => null, // $wgDeletedDirectory
1076            'deletedHashLevels' => null, // $wgHashedUploadDirectory
1077            'updateCompatibleMetadata' => null, // $wgUpdateCompatibleMetadata
1078            'reserializeMetadata' => null, // $wgUpdateCompatibleMetadata
1079        ],
1080        'type' => 'map',
1081    ];
1082
1083    /**
1084     * Enable the use of files from one or more other wikis.
1085     *
1086     * If you operate multiple wikis, you can declare a shared upload path here.
1087     * Uploads to the local wiki will NOT be stored here - See $wgLocalFileRepo
1088     * and $wgUploadDirectory for that.
1089     *
1090     * When performing file lookups (e.g. via `[[File:..]]` syntax), the wiki will
1091     * only consider the foreign repository if no file of the given name is found
1092     * in the local repository ($wgLocalFileRepo).
1093     *
1094     * If you set $wgUseInstantCommons to true, this automatically includes
1095     * an entry for Wikimedia Commons.
1096     *
1097     * @since 1.11
1098     * @see self::LocalFileRepo
1099     */
1100    public const ForeignFileRepos = [
1101        'default' => [],
1102        'type' => 'list',
1103    ];
1104
1105    /**
1106     * Use Wikimedia Commons as a foreign file repository.
1107     *
1108     * This is a shortcut for adding an entry to $wgForeignFileRepos
1109     * for https://commons.wikimedia.org, using ForeignAPIRepo with the
1110     * default settings.
1111     *
1112     * @since 1.16
1113     */
1114    public const UseInstantCommons = [
1115        'default' => false,
1116    ];
1117
1118    /**
1119     * Shortcut for adding an entry to $wgForeignFileRepos.
1120     *
1121     * Uses the following variables:
1122     *
1123     * - directory: $wgSharedUploadDirectory.
1124     * - url: $wgSharedUploadPath.
1125     * - hashLevels: Based on $wgHashedSharedUploadDirectory.
1126     * - thumbScriptUrl: $wgSharedThumbnailScriptPath.
1127     * - transformVia404: Based on $wgGenerateThumbnailOnParse.
1128     * - descBaseUrl: $wgRepositoryBaseUrl.
1129     * - fetchDescription: $wgFetchCommonsDescriptions.
1130     *
1131     * If $wgSharedUploadDBname is set, it uses the ForeignDBRepo
1132     * class, with also the following variables:
1133     *
1134     * - dbName: $wgSharedUploadDBname.
1135     * - dbType: $wgDBtype.
1136     * - dbServer: $wgDBserver.
1137     * - dbUser: $wgDBuser.
1138     * - dbPassword: $wgDBpassword.
1139     * - dbFlags: Based on $wgDebugDumpSql.
1140     * - tablePrefix: $wgSharedUploadDBprefix,
1141     * - hasSharedCache: $wgCacheSharedUploads.
1142     *
1143     * @since 1.3
1144     */
1145    public const UseSharedUploads = [
1146        'default' => false,
1147        'type' => 'boolean',
1148    ];
1149
1150    /**
1151     * Shortcut for the 'directory' setting of $wgForeignFileRepos.
1152     *
1153     * Only used if $wgUseSharedUploads is enabled.
1154     *
1155     * @since 1.3
1156     */
1157    public const SharedUploadDirectory = [
1158        'default' => null,
1159        'type' => '?string',
1160    ];
1161
1162    /**
1163     * Shortcut for the 'url' setting of $wgForeignFileRepos.
1164     *
1165     * Only used if $wgUseSharedUploads is enabled.
1166     *
1167     * @since 1.3
1168     */
1169    public const SharedUploadPath = [
1170        'default' => null,
1171        'type' => '?string',
1172    ];
1173
1174    /**
1175     * Shortcut for the 'hashLevels' setting of $wgForeignFileRepos.
1176     *
1177     * Only used if $wgUseSharedUploads is enabled.
1178     *
1179     * @since 1.3
1180     */
1181    public const HashedSharedUploadDirectory = [
1182        'default' => true,
1183        'type' => 'boolean',
1184    ];
1185
1186    /**
1187     * Shortcut for the 'descBaseUrl' setting of $wgForeignFileRepos.
1188     *
1189     * Only used if $wgUseSharedUploads is enabled.
1190     *
1191     * @since 1.5
1192     */
1193    public const RepositoryBaseUrl = [
1194        'default' => 'https://commons.wikimedia.org/wiki/File:',
1195    ];
1196
1197    /**
1198     * Shortcut for the 'fetchDescription' setting of $wgForeignFileRepos.
1199     *
1200     * Only used if $wgUseSharedUploads is enabled.
1201     *
1202     * @since 1.5
1203     */
1204    public const FetchCommonsDescriptions = [
1205        'default' => false,
1206        'type' => 'boolean',
1207    ];
1208
1209    /**
1210     * Shortcut for the ForeignDBRepo 'dbName' setting in $wgForeignFileRepos.
1211     *
1212     * Set this to false if the uploads do not come from a wiki.
1213     * Only used if $wgUseSharedUploads is enabled.
1214     *
1215     * @since 1.4
1216     */
1217    public const SharedUploadDBname = [
1218        'default' => false,
1219        'type' => 'false|string',
1220    ];
1221
1222    /**
1223     * Shortcut for the ForeignDBRepo 'tablePrefix' setting in $wgForeignFileRepos.
1224     *
1225     * Only used if $wgUseSharedUploads is enabled.
1226     *
1227     * @since 1.5
1228     */
1229    public const SharedUploadDBprefix = [
1230        'default' => '',
1231        'type' => 'string',
1232    ];
1233
1234    /**
1235     * Shortcut for the ForeignDBRepo 'hasSharedCache' setting in $wgForeignFileRepos.
1236     *
1237     * Only used if $wgUseSharedUploads is enabled.
1238     *
1239     * @since 1.5
1240     */
1241    public const CacheSharedUploads = [
1242        'default' => true,
1243        'type' => 'boolean',
1244    ];
1245
1246    /**
1247     * Array of foreign file repo names (set in $wgForeignFileRepos above) that
1248     * are allowable upload targets. These wikis must have some method of
1249     * authentication (i.e. CentralAuth), and be CORS-enabled for this wiki.
1250     *
1251     * The string 'local' signifies the default local file repository.
1252     *
1253     * Example:
1254     * $wgForeignUploadTargets = [ 'shared' ];
1255     */
1256    public const ForeignUploadTargets = [
1257        'default' => [ 'local', ],
1258        'type' => 'list',
1259    ];
1260
1261    /**
1262     * Configuration for file uploads using the embeddable upload dialog
1263     * (https://www.mediawiki.org/wiki/Upload_dialog).
1264     *
1265     * This applies also to foreign uploads to this wiki (the configuration is loaded by remote
1266     * wikis using the action=query&meta=siteinfo API).
1267     *
1268     * See below for documentation of each property. None of the properties may be omitted.
1269     */
1270    public const UploadDialog = [
1271        'default' =>
1272            [
1273                'fields' =>
1274                    [
1275                        'description' => true,
1276                        'date' => false,
1277                        'categories' => false,
1278                    ],
1279                'licensemessages' =>
1280                    [
1281                        'local' => 'generic-local',
1282                        'foreign' => 'generic-foreign',
1283                    ],
1284                'comment' =>
1285                    [
1286                        'local' => '',
1287                        'foreign' => '',
1288                    ],
1289                'format' =>
1290                    [
1291                        'filepage' => '$DESCRIPTION',
1292                        'description' => '$TEXT',
1293                        'ownwork' => '',
1294                        'license' => '',
1295                        'uncategorized' => '',
1296                    ],
1297            ],
1298        'type' => 'map',
1299    ];
1300
1301    /**
1302     * File backend structure configuration.
1303     *
1304     * This is an array of file backend configuration arrays.
1305     * Each backend configuration has the following parameters:
1306     *  - name        : A unique name for the backend
1307     *  - class       : The file backend class to use
1308     *  - wikiId      : A unique string that identifies the wiki (container prefix)
1309     *  - lockManager : The name of a lock manager (see $wgLockManagers) [optional]
1310     *
1311     * See FileBackend::__construct() for more details.
1312     * Additional parameters are specific to the file backend class used.
1313     * These settings should be global to all wikis when possible.
1314     *
1315     * FileBackendMultiWrite::__construct() is augmented with a 'template' option that
1316     * can be used in any of the values of the 'backends' array. Its value is the name of
1317     * another backend in $wgFileBackends. When set, it pre-fills the array with all of the
1318     * configuration of the named backend. Explicitly set values in the array take precedence.
1319     *
1320     * There are two particularly important aspects about each backend:
1321     *   - a) Whether it is fully qualified or wiki-relative.
1322     *        By default, the paths of files are relative to the current wiki,
1323     *        which works via prefixing them with the current wiki ID when accessed.
1324     *        Setting 'domainId' forces the backend to be fully qualified by prefixing
1325     *        all paths with the specified value instead. This can be useful if
1326     *        multiple wikis need to share the same data. Note that 'name' is *not*
1327     *        part of any prefix and thus should not be relied upon for namespacing.
1328     *   - b) Whether it is only defined for some wikis or is defined on all
1329     *        wikis in the wiki farm. Defining a backend globally is useful
1330     *        if multiple wikis need to share the same data.
1331     *
1332     * One should be aware of these aspects when configuring a backend for use with
1333     * any basic feature or plugin. For example, suppose an extension stores data for
1334     * different wikis in different directories and sometimes needs to access data from
1335     * a foreign wiki's directory in order to render a page on given wiki. The extension
1336     * would need a fully qualified backend that is defined on all wikis in the wiki farm.
1337     */
1338    public const FileBackends = [
1339        'default' => [],
1340        'type' => 'map',
1341    ];
1342
1343    /**
1344     * List of lock manager backend configurations.
1345     *
1346     * Each backend configuration has the following parameters:
1347     *  - name  : A unique name for the lock manager
1348     *  - class : The lock manager class to use
1349     *
1350     * See LockManager::__construct() for more details.
1351     * Additional parameters are specific to the lock manager class used.
1352     * These settings should be global to all wikis.
1353     *
1354     * Minimal example:
1355     *
1356     * ```
1357     * $wgLockManagers[] = [
1358     *   'name' => 'locky-mc-lock-face',
1359     *   'class' => 'MemcLockManager',
1360     *   'lockServers' => [
1361     *     '127.0.0.1:11211',
1362     *   ],
1363     * ];
1364     * ```
1365     */
1366    public const LockManagers = [
1367        'default' => [],
1368        'type' => 'list',
1369    ];
1370
1371    /**
1372     * Name of the default lock manager from the list of conferred lock managers
1373     *
1374     * If not set, none means the database will be used as the default lock management.
1375     */
1376    public const DefaultLockManager = [
1377        'default' => null,
1378        'type' => '?string'
1379    ];
1380
1381    /**
1382     * Whether to show Exif data.
1383     * The effective default value is determined at runtime:
1384     * enabled if PHP's EXIF extension module is loaded.
1385     *
1386     * Requires PHP's Exif extension: https://www.php.net/manual/en/ref.exif.php
1387     *
1388     * @note FOR WINDOWS USERS:
1389     * To enable Exif functions, add the following line to the "Windows
1390     * extensions" section of php.ini:
1391     *
1392     * ```{.ini}
1393     * extension=extensions/php_exif.dll
1394     * ```
1395     */
1396    public const ShowEXIF = [
1397        'dynamicDefault' => [ 'callback' => [ self::class, 'getDefaultShowEXIF' ] ],
1398    ];
1399
1400    public static function getDefaultShowEXIF(): bool {
1401        return function_exists( 'exif_read_data' );
1402    }
1403
1404    /**
1405     * Shortcut for the 'updateCompatibleMetadata' setting of $wgLocalFileRepo.
1406     */
1407    public const UpdateCompatibleMetadata = [
1408        'default' => false,
1409    ];
1410
1411    /**
1412     * Allow for upload to be copied from an URL.
1413     *
1414     * The timeout for copy uploads is set by $wgCopyUploadTimeout.
1415     * You have to assign the user right 'upload_by_url' to a user group, to use this.
1416     */
1417    public const AllowCopyUploads = [
1418        'default' => false,
1419    ];
1420
1421    /**
1422     * A list of domains copy uploads can come from
1423     *
1424     * @since 1.20
1425     */
1426    public const CopyUploadsDomains = [
1427        'default' => [],
1428        'type' => 'list',
1429    ];
1430
1431    /**
1432     * Enable copy uploads from Special:Upload. $wgAllowCopyUploads must also be
1433     * true. If $wgAllowCopyUploads is true, but this is false, you will only be
1434     * able to perform copy uploads from the API or extensions (e.g. UploadWizard).
1435     */
1436    public const CopyUploadsFromSpecialUpload = [
1437        'default' => false,
1438    ];
1439
1440    /**
1441     * Proxy to use for copy upload requests.
1442     *
1443     * @since 1.20
1444     */
1445    public const CopyUploadProxy = [
1446        'default' => false,
1447    ];
1448
1449    /**
1450     * Different timeout for upload by url
1451     * This could be useful since when fetching large files, you may want a
1452     * timeout longer than the default $wgHTTPTimeout. False means fallback
1453     * to default.
1454     *
1455     * @since 1.22
1456     */
1457    public const CopyUploadTimeout = [
1458        'default' => false,
1459        'type' => 'false|integer',
1460    ];
1461
1462    /**
1463     * If true, the value of $wgCopyUploadsDomains will be merged with the
1464     * contents of MediaWiki:Copyupload-allowed-domains.
1465     *
1466     * @since 1.39
1467     */
1468    public const CopyUploadAllowOnWikiDomainConfig = [
1469        'default' => false,
1470    ];
1471
1472    /**
1473     * Max size for uploads, in bytes.
1474     *
1475     * If not set to an array, applies to all uploads. If set to an array, per upload
1476     * type maximums can be set, using the file and url keys. If the `*` key is set
1477     * this value will be used as maximum for non-specified types.
1478     *
1479     * The below example would set the maximum for all uploads to 250 KiB except,
1480     * for upload-by-url, which would have a maximum of 500 KiB.
1481     *
1482     * **Example:**
1483     *
1484     * ```
1485     * $wgMaxUploadSize = [
1486     *     '*' => 250 * 1024,
1487     *     'url' => 500 * 1024,
1488     * ];
1489     * ```
1490     * Default: 100 MiB.
1491     */
1492    public const MaxUploadSize = [
1493        'default' => 1024 * 1024 * 100,
1494    ];
1495
1496    /**
1497     * Minimum upload chunk size, in bytes.
1498     *
1499     * When using chunked upload, non-final chunks smaller than this will be rejected.
1500     *
1501     * Note that this may be further reduced by the `upload_max_filesize` and
1502     * `post_max_size` PHP settings. Use ApiUpload::getMinUploadChunkSize to
1503     * get the effective minimum chunk size used by MediaWiki.
1504     *
1505     * Default: 1 KiB.
1506     *
1507     * @since 1.26
1508     * @see \ApiUpload::getMinUploadChunkSize
1509     */
1510    public const MinUploadChunkSize = [
1511        'default' => 1024,
1512    ];
1513
1514    /**
1515     * Point the upload navigation link to an external URL
1516     * Useful if you want to use a shared repository by default
1517     * without disabling local uploads (use $wgEnableUploads = false for that).
1518     *
1519     * **Example:**
1520     *
1521     * ```
1522     * $wgUploadNavigationUrl = 'https://commons.wikimedia.org/wiki/Special:Upload';
1523     * ```
1524     */
1525    public const UploadNavigationUrl = [
1526        'default' => false,
1527    ];
1528
1529    /**
1530     * Point the upload link for missing files to an external URL, as with
1531     * $wgUploadNavigationUrl. The URL will get "(?|&)wpDestFile=<filename>"
1532     * appended to it as appropriate.
1533     */
1534    public const UploadMissingFileUrl = [
1535        'default' => false,
1536    ];
1537
1538    /**
1539     * Give a path here to use thumb.php for thumbnail generation on client
1540     * request, instead of generating them on render and outputting a static URL.
1541     *
1542     * This is necessary if some of your apache servers don't have read/write
1543     * access to the thumbnail path.
1544     *
1545     * **Example:**
1546     *
1547     * ```
1548     * $wgThumbnailScriptPath = "{$wgScriptPath}/thumb.php";
1549     * ```
1550     */
1551    public const ThumbnailScriptPath = [
1552        'default' => false,
1553    ];
1554
1555    /**
1556     * Shortcut for the 'thumbScriptUrl' setting of $wgForeignFileRepos.
1557     *
1558     * Only used if $wgUseSharedUploads is enabled.
1559     *
1560     * @since 1.3
1561     */
1562    public const SharedThumbnailScriptPath = [
1563        'default' => false,
1564        'type' => 'string|false',
1565    ];
1566
1567    /**
1568     * Shortcut for setting `hashLevels=2` and `deletedHashLevels=3` in $wgLocalFileRepo.
1569     *
1570     * @note Only used if $wgLocalFileRepo is not set.
1571     */
1572    public const HashedUploadDirectory = [
1573        'default' => true,
1574        'type' => 'boolean',
1575    ];
1576
1577    /**
1578     * Controls whether thumb.php and img_auth.php send CSP headers
1579     *
1580     * Note: This does not control general uploads. There is a .htaccess
1581     * in the images directory which will add a CSP header in some web server
1582     * configurations
1583     *
1584     * @since 1.45
1585     */
1586    public const CSPUploadEntryPoint = [
1587        'default' => true,
1588        'type' => 'boolean',
1589    ];
1590
1591    /**
1592     * This is the list of preferred extensions for uploading files. Uploading files
1593     * with extensions not in this list will trigger a warning.
1594     *
1595     * @warning If you add any OpenOffice or Microsoft Office file formats here,
1596     * such as odt or doc, and untrusted users are allowed to upload files, then
1597     * your wiki will be vulnerable to cross-site request forgery (CSRF).
1598     */
1599    public const FileExtensions = [
1600        'default' => [ 'png', 'gif', 'jpg', 'jpeg', 'webp', ],
1601        'type' => 'list',
1602    ];
1603
1604    /**
1605     * Files with these extensions will never be allowed as uploads.
1606     *
1607     * An array of file extensions to prevent being uploaded. You should
1608     * append to this array if you want to prevent additional file extensions.
1609     *
1610     * @since 1.37; previously $wgFileBlacklist
1611     */
1612    public const ProhibitedFileExtensions = [
1613        'default' => [
1614            # HTML may contain cookie-stealing JavaScript and web bugs
1615            'html', 'htm', 'js', 'jsb', 'mhtml', 'mht', 'xhtml', 'xht',
1616            # PHP scripts may execute arbitrary code on the server
1617            'php', 'phtml', 'php3', 'php4', 'php5', 'phps', 'phar',
1618            # Other types that may be interpreted by some servers
1619            'shtml', 'jhtml', 'pl', 'py', 'cgi',
1620            # May contain harmful executables for Windows victims
1621            'exe', 'scr', 'dll', 'msi', 'vbs', 'bat', 'com', 'pif', 'cmd', 'vxd', 'cpl',
1622            # T341565
1623            'xml',
1624        ],
1625        'type' => 'list',
1626    ];
1627
1628    /**
1629     * Files with these MIME types will never be allowed as uploads
1630     * if $wgVerifyMimeType is enabled.
1631     *
1632     * @since 1.37; previously $wgMimeTypeBlacklist
1633     */
1634    public const MimeTypeExclusions = [
1635        'default' => [
1636            # HTML may contain cookie-stealing JavaScript and web bugs
1637            'text/html',
1638            # Similarly with JavaScript itself
1639            'application/javascript', 'text/javascript', 'text/x-javascript', 'application/x-shellscript',
1640            # PHP scripts may execute arbitrary code on the server
1641            'application/x-php', 'text/x-php',
1642            # Other types that may be interpreted by some servers
1643            'text/x-python', 'text/x-perl', 'text/x-bash', 'text/x-sh', 'text/x-csh',
1644            # Client-side hazards on Internet Explorer
1645            'text/scriptlet', 'application/x-msdownload',
1646            # Windows metafile, client-side vulnerability on some systems
1647            'application/x-msmetafile',
1648            # Files that look like java files
1649            'application/java',
1650            # XML files generally - T341565
1651            'application/xml', 'text/xml',
1652        ],
1653        'type' => 'list',
1654    ];
1655
1656    /**
1657     * This is a flag to determine whether or not to check file extensions on upload.
1658     *
1659     * @warning Setting this to false is insecure for public wikis.
1660     */
1661    public const CheckFileExtensions = [
1662        'default' => true,
1663    ];
1664
1665    /**
1666     * If this is turned off, users may override the warning for files not covered
1667     * by $wgFileExtensions.
1668     *
1669     * @warning Setting this to false is insecure for public wikis.
1670     */
1671    public const StrictFileExtensions = [
1672        'default' => true,
1673    ];
1674
1675    /**
1676     * Setting this to true will disable the upload system's checks for HTML/JavaScript.
1677     *
1678     * @warning THIS IS VERY DANGEROUS on a publicly editable site, so USE
1679     * $wgGroupPermissions TO RESTRICT UPLOADING to only those that you trust
1680     */
1681    public const DisableUploadScriptChecks = [
1682        'default' => false,
1683    ];
1684
1685    /**
1686     * Warn if uploaded files are larger than this (in bytes), or false to disable
1687     */
1688    public const UploadSizeWarning = [
1689        'default' => false,
1690    ];
1691
1692    /**
1693     * list of trusted media-types and MIME types.
1694     *
1695     * Use the MEDIATYPE_xxx constants to represent media types.
1696     * This list is used by File::isSafeFile
1697     *
1698     * Types not listed here will have a warning about unsafe content
1699     * displayed on the images description page. It would also be possible
1700     * to use this for further restrictions, like disabling direct
1701     * [[media:...]] links for non-trusted formats.
1702     */
1703    public const TrustedMediaFormats = [
1704        'default' => [
1705            MEDIATYPE_BITMAP, // all bitmap formats
1706            MEDIATYPE_AUDIO, // all audio formats
1707            MEDIATYPE_VIDEO, // all plain video formats
1708            "image/svg+xml", // svg (only needed if inline rendering of svg is not supported)
1709            "application/pdf", // PDF files
1710            # "application/x-shockwave-flash", //flash/shockwave movie
1711        ],
1712        'type' => 'list',
1713    ];
1714
1715    /**
1716     * Plugins for media file type handling.
1717     *
1718     * Each entry in the array maps a MIME type to a class name
1719     *
1720     * Core media handlers are listed in MediaHandlerFactory,
1721     * and extensions should use extension.json.
1722     */
1723    public const MediaHandlers = [
1724        'default' => [],
1725        'type' => 'map',
1726    ];
1727
1728    /**
1729     * Toggles native image lazy loading, via the "loading" attribute.
1730     *
1731     * @unstable EXPERIMENTAL
1732     * @since 1.34
1733     */
1734    public const NativeImageLazyLoading = [
1735        'default' => false,
1736        'type' => 'boolean',
1737    ];
1738
1739    /**
1740     * Media handler overrides for parser tests (they don't need to generate actual
1741     * thumbnails, so a mock will do)
1742     */
1743    public const ParserTestMediaHandlers = [
1744        'default' => [
1745            'image/jpeg' => 'MockBitmapHandler',
1746            'image/png' => 'MockBitmapHandler',
1747            'image/gif' => 'MockBitmapHandler',
1748            'image/tiff' => 'MockBitmapHandler',
1749            'image/webp' => 'MockBitmapHandler',
1750            'image/x-ms-bmp' => 'MockBitmapHandler',
1751            'image/x-bmp' => 'MockBitmapHandler',
1752            'image/x-xcf' => 'MockBitmapHandler',
1753            'image/svg+xml' => 'MockSvgHandler',
1754            'image/vnd.djvu' => 'MockDjVuHandler',
1755        ],
1756        'type' => 'map',
1757    ];
1758
1759    /**
1760     * Whether to enable server-side image thumbnailing. If false, images will
1761     * always be sent to the client in full resolution, with appropriate width= and
1762     * height= attributes on the <img> tag for the client to do its own scaling.
1763     */
1764    public const UseImageResize = [
1765        'default' => true,
1766    ];
1767
1768    /**
1769     * Resizing can be done using PHP's internal image libraries or using
1770     * ImageMagick or another third-party converter, e.g. GraphicMagick.
1771     *
1772     * These support more file formats than PHP, which only supports PNG,
1773     * GIF, JPG, XBM and WBMP.
1774     *
1775     * Use Image Magick instead of PHP builtin functions.
1776     */
1777    public const UseImageMagick = [
1778        'default' => false,
1779    ];
1780
1781    /**
1782     * The convert command shipped with ImageMagick
1783     */
1784    public const ImageMagickConvertCommand = [
1785        'default' => '/usr/bin/convert',
1786    ];
1787
1788    /**
1789     * Array of max pixel areas for interlacing per MIME type
1790     *
1791     * @since 1.27
1792     */
1793    public const MaxInterlacingAreas = [
1794        'default' => [],
1795        'type' => 'map',
1796    ];
1797
1798    /**
1799     * Sharpening parameter to ImageMagick
1800     */
1801    public const SharpenParameter = [
1802        'default' => '0x0.4',
1803    ];
1804
1805    /**
1806     * Reduction in linear dimensions below which sharpening will be enabled
1807     */
1808    public const SharpenReductionThreshold = [
1809        'default' => 0.85,
1810    ];
1811
1812    /**
1813     * Temporary directory used for ImageMagick. The directory must exist. Leave
1814     * this set to false to let ImageMagick decide for itself.
1815     */
1816    public const ImageMagickTempDir = [
1817        'default' => false,
1818    ];
1819
1820    /**
1821     * Use another resizing converter, e.g. GraphicMagick
1822     * %s will be replaced with the source path, %d with the destination
1823     * %w and %h will be replaced with the width and height.
1824     *
1825     * **Example for GraphicMagick:**
1826     *
1827     * ```
1828     * $wgCustomConvertCommand = "gm convert %s -resize %wx%h %d"
1829     * ```
1830     * Leave as false to skip this.
1831     */
1832    public const CustomConvertCommand = [
1833        'default' => false,
1834    ];
1835
1836    /**
1837     * used for lossless jpeg rotation
1838     *
1839     * @since 1.21
1840     */
1841    public const JpegTran = [
1842        'default' => '/usr/bin/jpegtran',
1843    ];
1844
1845    /**
1846     * At default setting of 'yuv420', JPEG thumbnails will use 4:2:0 chroma
1847     * subsampling to reduce file size, at the cost of possible color fringing
1848     * at sharp edges.
1849     *
1850     * See https://en.wikipedia.org/wiki/Chroma_subsampling
1851     *
1852     * Supported values:
1853     *   false - use scaling system's default (same as pre-1.27 behavior)
1854     *   'yuv444' - luma and chroma at same resolution
1855     *   'yuv422' - chroma at 1/2 resolution horizontally, full vertically
1856     *   'yuv420' - chroma at 1/2 resolution in both dimensions
1857     *
1858     * This setting is currently supported only for the ImageMagick backend;
1859     * others may default to 4:2:0 or 4:4:4 or maintaining the source file's
1860     * sampling in the thumbnail.
1861     *
1862     * @since 1.27
1863     */
1864    public const JpegPixelFormat = [
1865        'default' => 'yuv420',
1866    ];
1867
1868    /**
1869     * When scaling a JPEG thumbnail, this is the quality we request
1870     * from the backend. It should be an integer between 1 and 100,
1871     * with 100 indicating 100% quality.
1872     *
1873     * @since 1.32
1874     */
1875    public const JpegQuality = [
1876        'default' => 80,
1877    ];
1878
1879    /**
1880     * Some tests and extensions use exiv2 to manipulate the Exif metadata in some
1881     * image formats.
1882     */
1883    public const Exiv2Command = [
1884        'default' => '/usr/bin/exiv2',
1885    ];
1886
1887    /**
1888     * Path to exiftool binary. Used for lossless ICC profile swapping.
1889     *
1890     * @since 1.26
1891     */
1892    public const Exiftool = [
1893        'default' => '/usr/bin/exiftool',
1894    ];
1895
1896    /**
1897     * Scalable Vector Graphics (SVG) may be uploaded as images.
1898     *
1899     * Since SVG support is not yet standard in browsers, it is
1900     * necessary to rasterize SVGs to PNG as a fallback format.
1901     *
1902     * An external program is required to perform this conversion.
1903     * If set to an array, the first item is a PHP callable and any further items
1904     * are passed as parameters after $srcPath, $dstPath, $width, $height
1905     */
1906    public const SVGConverters = [
1907        'default' => [
1908            'ImageMagick' => '$path/convert -background "#ffffff00" -thumbnail $widthx$height\\! $input PNG:$output',
1909            'inkscape' => '$path/inkscape -w $width -o $output $input',
1910            'batik' => 'java -Djava.awt.headless=true -jar $path/batik-rasterizer.jar -w $width -d $output $input',
1911            'rsvg' => '$path/rsvg-convert -w $width -h $height -o $output $input',
1912            'ImagickExt' => [ 'SvgHandler::rasterizeImagickExt', ],
1913        ],
1914        'type' => 'map',
1915    ];
1916
1917    /**
1918     * Pick a converter defined in $wgSVGConverters
1919     */
1920    public const SVGConverter = [
1921        'default' => 'ImageMagick',
1922    ];
1923
1924    /**
1925     * If not in the executable PATH, specify the SVG converter path.
1926     */
1927    public const SVGConverterPath = [
1928        'default' => '',
1929    ];
1930
1931    /**
1932     * Don't scale a SVG larger than this
1933     */
1934    public const SVGMaxSize = [
1935        'default' => 5120,
1936    ];
1937
1938    /**
1939     * Don't read SVG metadata beyond this point.
1940     *
1941     * Default is 5 MiB
1942     */
1943    public const SVGMetadataCutoff = [
1944        'default' => 1024 * 1024 * 5,
1945    ];
1946
1947    /**
1948     * Whether native rendering by the browser agent is allowed
1949     *
1950     * Default is true, which disables all SVG conversion.
1951     * Setting it to the string 'partial' will only allow native rendering
1952     * when the filesize is below SVGNativeRenderingSizeLimit and if the
1953     * file contains at most 1 language.
1954     *
1955     * @since 1.41
1956     */
1957    public const SVGNativeRendering = [
1958        'default' => true,
1959        'type' => 'string|boolean',
1960    ];
1961
1962    /**
1963     * Filesize limit for allowing SVGs to render natively by the browser agent
1964     *
1965     * Default is 50kB.
1966     *
1967     * @since 1.41
1968     */
1969    public const SVGNativeRenderingSizeLimit = [
1970        'default' => 50 * 1024,
1971    ];
1972
1973    /**
1974     * Whether thumbnails should be generated in target language (usually, same as
1975     * page language), if available.
1976     *
1977     * Currently, applies only to SVG images that use the systemLanguage attribute
1978     * to specify text language.
1979     *
1980     * @since 1.33
1981     */
1982    public const MediaInTargetLanguage = [
1983        'default' => true,
1984    ];
1985
1986    /**
1987     * The maximum number of pixels a source image can have if it is to be scaled
1988     * down by a scaler that requires the full source image to be decompressed
1989     * and stored in decompressed form, before the thumbnail is generated.
1990     *
1991     * This provides a limit on memory usage for the decompression side of the
1992     * image scaler. The limit is used when scaling PNGs with any of the
1993     * built-in image scalers, such as ImageMagick or GD. It is ignored for
1994     * JPEGs with ImageMagick, and when using the VipsScaler extension.
1995     *
1996     * If set to false, MediaWiki will not check the size of the image before
1997     * attempting to scale it. Extensions may still override this setting by
1998     * using the BitmapHandlerCheckImageArea hook.
1999     *
2000     * The default is 50 MB if decompressed to RGBA form, which corresponds to
2001     * 12.5 million pixels or 3500x3500.
2002     */
2003    public const MaxImageArea = [
2004        'default' => 12_500_000,
2005        'type' => 'string|integer|false',
2006    ];
2007
2008    /**
2009     * Force thumbnailing of animated GIFs above this size to a single
2010     * frame instead of an animated thumbnail.  As of MW 1.17 this limit
2011     * is checked against the total size of all frames in the animation.
2012     *
2013     *
2014     * It probably makes sense to keep this equal to $wgMaxImageArea.
2015     */
2016    public const MaxAnimatedGifArea = [
2017        'default' => 12_500_000,
2018    ];
2019
2020    /**
2021     * Browsers don't support TIFF inline generally...
2022     * For inline display, we need to convert to PNG or JPEG.
2023     *
2024     * Note scaling should work with ImageMagick, but may not with GD scaling.
2025     *
2026     * **Example:**
2027     *
2028     * ```
2029     * // PNG is lossless, but inefficient for photos
2030     * $wgTiffThumbnailType = [ 'png', 'image/png' ];
2031     * // JPEG is good for photos, but has no transparency support. Bad for diagrams.
2032     * $wgTiffThumbnailType = [ 'jpg', 'image/jpeg' ];
2033     * ```
2034     */
2035    public const TiffThumbnailType = [
2036        'default' => [],
2037        'type' => 'list',
2038        'mergeStrategy' => 'replace',
2039    ];
2040
2041    /**
2042     * If rendered thumbnail files are older than this timestamp, they
2043     * will be rerendered on demand as if the file didn't already exist.
2044     *
2045     * Update if there is some need to force thumbs and SVG rasterizations
2046     * to rerender, such as fixes to rendering bugs.
2047     */
2048    public const ThumbnailEpoch = [
2049        'default' => '20030516000000',
2050    ];
2051
2052    /**
2053     * Certain operations are avoided if there were too many recent failures,
2054     * for example, thumbnail generation. Bump this value to invalidate all
2055     * memory of failed operations and thus allow further attempts to resume.
2056     *
2057     * This is useful when a cause for the failures has been found and fixed.
2058     */
2059    public const AttemptFailureEpoch = [
2060        'default' => 1,
2061    ];
2062
2063    /**
2064     * If set, inline scaled images will still produce "<img>" tags ready for
2065     * output instead of showing an error message.
2066     *
2067     * This may be useful if errors are transitory, especially if the site
2068     * is configured to automatically render thumbnails on request.
2069     *
2070     * On the other hand, it may obscure error conditions from debugging.
2071     * Enable the debug log or the 'thumbnail' log group to make sure errors
2072     * are logged to a file for review.
2073     */
2074    public const IgnoreImageErrors = [
2075        'default' => false,
2076    ];
2077
2078    /**
2079     * Render thumbnails while parsing wikitext.
2080     *
2081     * If set to false, then the Parser will output valid thumbnail URLs without
2082     * generating or storing the thumbnail files. This can significantly speed up
2083     * processing on the web server. The site admin needs to configure a 404 handler
2084     * in order for the URLs in question to regenerate the thumbnails in question
2085     * on-demand. This can enable concurrency and also save computing resources
2086     * as not every resolution of every image on every page is accessed between
2087     * re-parses of the article. For example, re-parses triggered by bot edits,
2088     * or cascading updates from template edits.
2089     *
2090     * If you use $wgLocalFileRepo, then you will also need to set the following:
2091     *
2092     * ```
2093     * $wgLocalFileRepo['transformVia404'] = true;
2094     * ```
2095     *
2096     * @since 1.7.0
2097     */
2098    public const GenerateThumbnailOnParse = [
2099        'default' => true,
2100        'type' => 'boolean',
2101    ];
2102
2103    /**
2104     * Show thumbnails for old images on the image description page
2105     */
2106    public const ShowArchiveThumbnails = [
2107        'default' => true,
2108    ];
2109
2110    /**
2111     * If set to true, images that contain certain the exif orientation tag will
2112     * be rotated accordingly. If set to null, try to auto-detect whether a scaler
2113     * is available that can rotate.
2114     */
2115    public const EnableAutoRotation = [
2116        'default' => null,
2117        'type' => '?boolean',
2118    ];
2119
2120    /**
2121     * Internal name of virus scanner. This serves as a key to the
2122     * $wgAntivirusSetup array. Set this to NULL to disable virus scanning. If not
2123     * null, every file uploaded will be scanned for viruses.
2124     */
2125    public const Antivirus = [
2126        'default' => null,
2127        'type' => '?string',
2128    ];
2129
2130    /**
2131     * Configuration for different virus scanners. This an associative array of
2132     * associative arrays. It contains one setup array per known scanner type.
2133     *
2134     * The entry is selected by $wgAntivirus, i.e.
2135     * valid values for $wgAntivirus are the keys defined in this array.
2136     *
2137     * The configuration array for each scanner contains the following keys:
2138     * "command", "codemap", "messagepattern":
2139     *
2140     * "command" is the full command to call the virus scanner - %f will be
2141     * replaced with the name of the file to scan. If not present, the filename
2142     * will be appended to the command. Note that this must be overwritten if the
2143     * scanner is not in the system path; in that case, please set
2144     * $wgAntivirusSetup[$wgAntivirus]['command'] to the desired command with full
2145     * path.
2146     *
2147     * "codemap" is a mapping of exit code to return codes of the detectVirus
2148     * function in SpecialUpload.
2149     *   - An exit code mapped to AV_SCAN_FAILED causes the function to consider
2150     *     the scan to be failed. This will pass the file if $wgAntivirusRequired
2151     *     is not set.
2152     *   - An exit code mapped to AV_SCAN_ABORTED causes the function to consider
2153     *     the file to have an unsupported format, which is probably immune to
2154     *     viruses. This causes the file to pass.
2155     *   - An exit code mapped to AV_NO_VIRUS will cause the file to pass, meaning
2156     *     no virus was found.
2157     *   - All other codes (like AV_VIRUS_FOUND) will cause the function to report
2158     *     a virus.
2159     *   - You may use "*" as a key in the array to catch all exit codes not mapped otherwise.
2160     *
2161     * "messagepattern" is a perl regular expression to extract the meaningful part of the scanners
2162     * output. The relevant part should be matched as group one (\1).
2163     * If not defined or the pattern does not match, the full message is shown to the user.
2164     */
2165    public const AntivirusSetup = [
2166        'default' => [
2167            # setup for clamav
2168            'clamav' => [
2169                'command' => 'clamscan --no-summary ',
2170                'codemap' => [
2171                    "0" => AV_NO_VIRUS, # no virus
2172                    "1" => AV_VIRUS_FOUND, # virus found
2173                    "52" => AV_SCAN_ABORTED, # unsupported file format (probably immune)
2174                    "*" => AV_SCAN_FAILED, # else scan failed
2175                ],
2176                'messagepattern' => '/.*?:(.*)/sim',
2177            ],
2178        ],
2179        'type' => 'map',
2180    ];
2181
2182    /**
2183     * Determines if a failed virus scan (AV_SCAN_FAILED) will cause the file to be rejected.
2184     */
2185    public const AntivirusRequired = [
2186        'default' => true,
2187    ];
2188
2189    /**
2190     * Determines if the MIME type of uploaded files should be checked
2191     */
2192    public const VerifyMimeType = [
2193        'default' => true,
2194    ];
2195
2196    /**
2197     * Sets the MIME type definition file to use by includes/libs/mime/MimeAnalyzer.php.
2198     *
2199     * When this is set to the path of a mime.types file, MediaWiki will use this
2200     * file to map MIME types to file extensions and vice versa, in lieu of its
2201     * internal MIME map. Note that some MIME mappings are considered "baked in"
2202     * and cannot be overridden. See includes/libs/mime/MimeMapMinimal.php for a
2203     * full list.
2204     * example: $wgMimeTypeFile = '/etc/mime.types';
2205     */
2206    public const MimeTypeFile = [
2207        'default' => 'internal',
2208    ];
2209
2210    /**
2211     * Sets the MIME type info file to use by includes/libs/mime/MimeAnalyzer.php.
2212     *
2213     * Set to null to use the minimum set of built-in defaults only.
2214     */
2215    public const MimeInfoFile = [
2216        'default' => 'internal',
2217    ];
2218
2219    /**
2220     * Sets an external MIME detector program. The command must print only
2221     * the MIME type to standard output.
2222     *
2223     * The name of the file to process will be appended to the command given here.
2224     * If not set or NULL, PHP's mime_content_type function will be used.
2225     *
2226     * **Example:**
2227     *
2228     * ```
2229     * #$wgMimeDetectorCommand = "file -bi"; // use external MIME detector (Linux)
2230     * ```
2231     */
2232    public const MimeDetectorCommand = [
2233        'default' => null,
2234        'type' => '?string',
2235    ];
2236
2237    /**
2238     * Switch for trivial MIME detection. Used by thumb.php to disable all fancy
2239     * things, because only a few types of images are needed and file extensions
2240     * can be trusted.
2241     */
2242    public const TrivialMimeDetection = [
2243        'default' => false,
2244    ];
2245
2246    /**
2247     * Additional XML types we can allow via MIME-detection.
2248     *
2249     * array = [ 'rootElement' => 'associatedMimeType' ]
2250     */
2251    public const XMLMimeTypes = [
2252        'default' => [
2253            'http://www.w3.org/2000/svg:svg' => 'image/svg+xml',
2254            'svg' => 'image/svg+xml',
2255            'http://www.lysator.liu.se/~alla/dia/:diagram' => 'application/x-dia-diagram',
2256            'http://www.w3.org/1999/xhtml:html' => 'text/html',
2257            'html' => 'text/html',
2258        ],
2259        'type' => 'map',
2260    ];
2261
2262    /**
2263     * Limit images on image description pages to a user-selectable limit.
2264     *
2265     * In order to reduce disk usage, limits can only be selected from this list.
2266     * The user preference is saved as an array offset in the database, by default
2267     * the offset is set with $wgDefaultUserOptions['imagesize']. Make sure you
2268     * change it if you alter the array (see T10858).
2269     *
2270     * This list is also used by ImagePage for alternate size links.
2271     */
2272    public const ImageLimits = [
2273        'default' => [
2274            [ 320, 240 ],
2275            [ 640, 480 ],
2276            [ 800, 600 ],
2277            [ 1024, 768 ],
2278            [ 1280, 1024 ],
2279            [ 2560, 2048 ],
2280        ],
2281        'type' => 'list',
2282    ];
2283
2284    /**
2285     * Adjust thumbnails on image pages according to a user setting. In order to
2286     * reduce disk usage, the values can only be selected from a list. This is the
2287     * list of settings the user can choose from:
2288     */
2289    public const ThumbLimits = [
2290        'default' => [
2291            120,
2292            150,
2293            180,
2294            200,
2295            220,
2296            250,
2297            300,
2298            400,
2299        ],
2300        'type' => 'list',
2301    ];
2302
2303    /**
2304     * Defines what namespaces thumbnails will be displayed for in Special:Search.
2305     * This is the list of namespaces for which thumbnails (or a placeholder in
2306     * the absence of a thumbnail) will be shown:
2307     */
2308    public const ThumbnailNamespaces = [
2309        'default' => [ NS_FILE ],
2310        'type' => 'list',
2311        'items' => [ 'type' => 'integer', ],
2312    ];
2313
2314    /**
2315     * Array of image widths used as steps for thumbnail sizes.
2316     *
2317     * Requested thumbnail widths are rounded up to the nearest step
2318     * The thumbnail with smallest step that has larger value than requested will be shown
2319     * but it will be downsized via HTML values.
2320     *
2321     * It increases the bandwidth to the users by serving slightly large thumbnail sizes they
2322     * have requested but it will save resources by de-duplicating thumbnail generation and storage.
2323     *
2324     * Note that these steps are "best effort" and MediaWiki might decide to use the requested size
2325     * for any reason.
2326     *
2327     * @see MediaWiki\Media\ImageHandler::getSteppedThumbWidth
2328     * @since 1.43.7
2329     */
2330    public const ThumbnailSteps = [
2331        'default' => null,
2332        'type' => '?list',
2333    ];
2334
2335    /**
2336     * An array of image widths used as reference buckets for thumbnail generation.
2337     *
2338     * Speed up thumbnail generation and save server-side CPU/memory resources by
2339     * generating thumbnails based on reference buckets, instead of always re-scaling
2340     * the original. This performance gain comes at a small loss in quality.
2341     *
2342     * If more than one bucket is set, the buckets are chained, with smaller buckets
2343     * generated from a higher bucket when possible. It is recommended that buckets
2344     * are whole multiples of each other (e.g. pick powers-of-2 like 256px/1024px,
2345     * or starting elsewhere such as 320px/1280px) to minimize loss of sharpness
2346     * through chaining (T69525).
2347     *
2348     * This feature is opt-in per media handler. By default, only JpegHandler enables this.
2349     *
2350     * @see MediaWiki\Media\MediaHandler::supportsBucketing
2351     * @see MediaWiki\FileRepo\File\File::getThumbnailBucket
2352     * @see $wgThumbnailMinimumBucketDistance
2353     * @since 1.24
2354     */
2355    public const ThumbnailBuckets = [
2356        'default' => null,
2357        'type' => '?list',
2358    ];
2359
2360    /**
2361     * Minimum distance between requested width and a reference bucket.
2362     *
2363     * When $wgThumbnailBuckets is enabled, this distance represents how many extra pixels of
2364     * width the bucket needs to qualify for use as a reference for a given thumbnail. This
2365     * distance minimizes loss of sharpness due to insufficient pixels to inform resizing.
2366     *
2367     * For example, with the following buckets:
2368     *
2369     * $wgThumbnailBuckets = [ 320, 1280, 2560 ];
2370     *
2371     * It is recommended to generate a 300px thumbnail from the 1280px bucket and not
2372     * the 320px bucket. This is achieved by setting a distance of 50:
2373     *
2374     * $wgThumbnailMinimumBucketDistance = 50;
2375     *
2376     * @see $wgThumbnailBuckets
2377     * @see MediaWiki\FileRepo\File\File::getThumbnailBucket
2378     * @since 1.24
2379     */
2380    public const ThumbnailMinimumBucketDistance = [
2381        'default' => 50,
2382    ];
2383
2384    /**
2385     * When defined, is an array of thumbnail widths to be rendered at upload time. The idea is to
2386     * prerender common thumbnail sizes, in order to avoid the necessity to render them on demand,
2387     * which has a performance impact for the first client to view a certain size.
2388     *
2389     * This obviously means that more disk space is needed per upload upfront.
2390     *
2391     * @since 1.25
2392     */
2393    public const UploadThumbnailRenderMap = [
2394        'default' => [],
2395        'type' => 'map',
2396    ];
2397
2398    /**
2399     * The method through which the thumbnails will be prerendered for the entries in
2400     * $wgUploadThumbnailRenderMap
2401     *
2402     * The method can be either "http" or "jobqueue". The former uses an http request to hit the
2403     * thumbnail's URL.
2404     * This method only works if thumbnails are configured to be rendered by a 404 handler. The
2405     * latter option uses the job queue to render the thumbnail.
2406     *
2407     * @since 1.25
2408     */
2409    public const UploadThumbnailRenderMethod = [
2410        'default' => 'jobqueue',
2411    ];
2412
2413    /**
2414     * When using the "http" $wgUploadThumbnailRenderMethod, lets one specify a custom Host HTTP
2415     * header.
2416     *
2417     * @since 1.25
2418     */
2419    public const UploadThumbnailRenderHttpCustomHost = [
2420        'default' => false,
2421    ];
2422
2423    /**
2424     * When using the "http" $wgUploadThumbnailRenderMethod, lets one specify a custom domain to
2425     * send the HTTP request to.
2426     *
2427     * @since 1.25
2428     */
2429    public const UploadThumbnailRenderHttpCustomDomain = [
2430        'default' => false,
2431    ];
2432
2433    /**
2434     * When this variable is true and JPGs use the sRGB ICC profile, swaps it for the more
2435     * lightweight
2436     * (and free) TinyRGB profile when generating thumbnails.
2437     *
2438     * @since 1.26
2439     */
2440    public const UseTinyRGBForJPGThumbnails = [
2441        'default' => false,
2442    ];
2443
2444    /**
2445     * Parameters for the "<gallery>" tag.
2446     *
2447     * Fields are:
2448     * - imagesPerRow:   Default number of images per-row in the gallery. 0 -> Adapt to screensize
2449     * - imageWidth:     Width of the cells containing images in galleries (in "px")
2450     * - imageHeight:    Height of the cells containing images in galleries (in "px")
2451     * - captionLength:  Length to truncate filename to in caption when using "showfilename".
2452     *                   A value of 'true' will truncate the filename to one line using CSS
2453     *                   and will be the behaviour after deprecation.
2454     *                   @deprecated since 1.28
2455     * - showBytes:      Show the filesize in bytes in categories
2456     * - showDimensions: Show the dimensions (width x height) in categories
2457     * - mode:           Gallery mode
2458     */
2459    public const GalleryOptions = [
2460        'default' => [],
2461        'type' => 'map',
2462    ];
2463
2464    /**
2465     * Adjust width of upright images when parameter 'upright' is used
2466     * This allows a nicer look for upright images without the need to fix the width
2467     * by hardcoded px in wiki sourcecode.
2468     */
2469    public const ThumbUpright = [
2470        'default' => 0.75,
2471    ];
2472
2473    /**
2474     * Default value for chmod-ing of new directories.
2475     */
2476    public const DirectoryMode = [
2477        'default' => 0o777,
2478    ];
2479
2480    /**
2481     * Generate and use thumbnails suitable for High DPI screens with 2x pixel densities.
2482     *
2483     * This means a 320x240 thumbnail on the wiki will also generate a 640x480
2484     * thumbnail, linked via the srcset attribute.
2485     *
2486     * @see MediaWiki\Linker\Linker::processResponsiveImages
2487     * @see wfThumbIsStandard
2488     */
2489    public const ResponsiveImages = [
2490        'default' => true,
2491    ];
2492
2493    /**
2494     * Add a preconnect link for browsers to a remote FileRepo host.
2495     *
2496     * This is an optional performance enhancement designed for wiki farm where
2497     * $wgForeignFileRepos or $wgLocalFileRepo is set to serve thumbnails from a
2498     * separate hostname (e.g. not local `/w/images`). The feature expects at most
2499     * a single remote hostname to be used.
2500     *
2501     * If multiple foreign repos are registered that serve images from different hostnames,
2502     * only the first will be preconnected.
2503     *
2504     * This may cause unneeded HTTP connections in browsers on wikis where a foreign repo is
2505     * enabled but where a local repo is more commonly used.
2506     *
2507     * @since 1.35
2508     */
2509    public const ImagePreconnect = [
2510        'default' => false,
2511    ];
2512
2513    /**
2514     * Add tracking query parameters to URLs for media thumbnails and originals.
2515     *
2516     * The values include the site requesting the image (e.g. 'www.mediawiki.org'),
2517     * the software component involved (e.g. 'parser' or 'imageinfo') and the
2518     * format of the requested image ('original', 'thumbnail' or 'thumbnail_unscaled').
2519     *
2520     * These values are not used by MediaWiki, but they may be used by the server
2521     * hosting the files. The intended use case is applying different rate limits
2522     * depending on how and where the file is used.
2523     *
2524     * @since 1.46
2525     */
2526    public const TrackMediaRequestProvenance = [
2527        'default' => false,
2528    ];
2529
2530    /***************************************************************************/
2531    // region   DJVU settings
2532    /** @name   DJVU settings */
2533
2534    /**
2535     * Whether to use BoxedCommand or not.
2536     *
2537     * @unstable Temporary feature flag for T352515
2538     * @since 1.42
2539     */
2540    public const DjvuUseBoxedCommand = [
2541        'default' => false,
2542    ];
2543
2544    /**
2545     * Path of the djvudump executable
2546     * Enable this and $wgDjvuRenderer to enable djvu rendering
2547     * example: $wgDjvuDump = 'djvudump';
2548     *
2549     * If this is set, {@link self::ShellboxShell} must be set to the correct
2550     * shell path.
2551     */
2552    public const DjvuDump = [
2553        'default' => null,
2554        'type' => '?string',
2555    ];
2556
2557    /**
2558     * Path of the ddjvu DJVU renderer
2559     * Enable this and $wgDjvuDump to enable djvu rendering
2560     * example: $wgDjvuRenderer = 'ddjvu';
2561     */
2562    public const DjvuRenderer = [
2563        'default' => null,
2564        'type' => '?string',
2565    ];
2566
2567    /**
2568     * Path of the djvutxt DJVU text extraction utility
2569     * Enable this and $wgDjvuDump to enable text layer extraction from djvu files
2570     * example: $wgDjvuTxt = 'djvutxt';
2571     *
2572     * If this is set, {@link self::ShellboxShell} must be set to the correct
2573     *  shell path.
2574     */
2575    public const DjvuTxt = [
2576        'default' => null,
2577        'type' => '?string',
2578    ];
2579
2580    /**
2581     * Shell command for the DJVU post processor
2582     * Default: pnmtojpeg, since ddjvu generates ppm output
2583     * Set this to false to output the ppm file directly.
2584     */
2585    public const DjvuPostProcessor = [
2586        'default' => 'pnmtojpeg',
2587        'type' => '?string',
2588    ];
2589
2590    /**
2591     * File extension for the DJVU post processor output
2592     */
2593    public const DjvuOutputExtension = [
2594        'default' => 'jpg',
2595    ];
2596
2597    // endregion -- end of DJvu
2598
2599    // endregion -- end of file uploads
2600
2601    /***************************************************************************/
2602    // region   Email settings
2603    /** @name   Email settings */
2604
2605    /**
2606     * Site admin email address.
2607     *
2608     * Defaults to "wikiadmin@$wgServerName" (in Setup.php).
2609     */
2610    public const EmergencyContact = [
2611        'default' => false,
2612    ];
2613
2614    /**
2615     * URL to use for the OpenAPI termsOfService field in the REST API.
2616     *
2617     * Defaults to null, so the field is omitted unless a wiki explicitly configures it.
2618     */
2619    public const RestTermsOfServiceUrl = [
2620        'default' => null,
2621        'type' => '?string',
2622    ];
2623
2624    /**
2625     * Sender email address for e-mail notifications.
2626     *
2627     * The address we use as sender when a user requests a password reminder,
2628     * as well as other e-mail notifications.
2629     *
2630     * Defaults to "apache@$wgServerName" (in Setup.php).
2631     */
2632    public const PasswordSender = [
2633        'default' => false,
2634    ];
2635
2636    /**
2637     * Reply-To address for e-mail notifications.
2638     *
2639     * Defaults to $wgPasswordSender (in Setup.php).
2640     */
2641    public const NoReplyAddress = [
2642        'default' => false,
2643    ];
2644
2645    /**
2646     * Set to true to enable the e-mail basic features:
2647     * Password reminders, etc. If sending e-mail on your
2648     * server doesn't work, you might want to disable this.
2649     */
2650    public const EnableEmail = [
2651        'default' => true,
2652    ];
2653
2654    /**
2655     * Set to true to enable user-to-user e-mail.
2656     *
2657     * This can potentially be abused, as it's hard to track.
2658     */
2659    public const EnableUserEmail = [
2660        'default' => true,
2661    ];
2662
2663    /**
2664     * If true put the sending user's email in a Reply-To header
2665     * instead of From (false). ($wgPasswordSender will be used as From.)
2666     *
2667     * Some mailers (eg SMTP) set the SMTP envelope sender to the From value,
2668     * which can cause problems with SPF validation and leak recipient addresses
2669     * when bounces are sent to the sender. In addition, DMARC restrictions
2670     * can cause emails to fail to be received when false.
2671     */
2672    public const UserEmailUseReplyTo = [
2673        'default' => true,
2674    ];
2675
2676    /**
2677     * Minimum time, in hours, which must elapse between password reminder
2678     * emails for a given account. This is to prevent abuse by mail flooding.
2679     */
2680    public const PasswordReminderResendTime = [
2681        'default' => 24,
2682    ];
2683
2684    /**
2685     * The time, in seconds, when an emailed temporary password expires.
2686     */
2687    public const NewPasswordExpiry = [
2688        'default' => 3600 * 24 * 7,
2689    ];
2690
2691    /**
2692     * The time, in seconds, when an email confirmation email expires
2693     */
2694    public const UserEmailConfirmationTokenExpiry = [
2695        'default' => 7 * 24 * 60 * 60,
2696    ];
2697
2698    /**
2699     * The number of days that a user's password is good for. After this number of days, the
2700     * user will be asked to reset their password. Set to false to disable password expiration.
2701     */
2702    public const PasswordExpirationDays = [
2703        'default' => false,
2704    ];
2705
2706    /**
2707     * If a user's password is expired, the number of seconds when they can still login,
2708     * and cancel their password change, but are sent to the password change form on each login.
2709     */
2710    public const PasswordExpireGrace = [
2711        'default' => 3600 * 24 * 7,
2712    ];
2713
2714    /**
2715     * SMTP Mode.
2716     *
2717     * For using a direct (authenticated) SMTP server connection.
2718     * Default to false or fill an array :
2719     *
2720     * ```
2721     * $wgSMTP = [
2722     *     'host'     => 'SMTP domain',
2723     *     'IDHost'   => 'domain for MessageID',
2724     *     'port'     => '25',
2725     *     'auth'     => [true|false],
2726     *     'username' => [SMTP username],
2727     *     'password' => [SMTP password],
2728     * ];
2729     * ```
2730     */
2731    public const SMTP = [
2732        'default' => false,
2733        'type' => 'false|map',
2734    ];
2735
2736    /**
2737     * Additional email parameters, will be passed as the last argument to mail() call.
2738     */
2739    public const AdditionalMailParams = [
2740        'default' => null,
2741    ];
2742
2743    /**
2744     * For parts of the system that have been updated to provide HTML email content, send
2745     * both text and HTML parts as the body of the email
2746     */
2747    public const AllowHTMLEmail = [
2748        'default' => false,
2749    ];
2750
2751    /**
2752     * Allow sending of e-mail notifications with the editor's address as sender.
2753     *
2754     * This setting depends on $wgEnotifRevealEditorAddress also being enabled.
2755     * If both are enabled, notifications for actions from users that have opted-in,
2756     * will be sent to other users with their address as "From" instead of "Reply-To".
2757     *
2758     * If disabled, or not opted-in, notifications come from $wgPasswordSender.
2759     */
2760    public const EnotifFromEditor = [
2761        'default' => false,
2762        'type' => 'boolean',
2763    ];
2764
2765    /**
2766     * Require email authentication before sending mail to an email address.
2767     *
2768     * This is highly recommended. It prevents MediaWiki from being used as an open
2769     * spam relay.
2770     */
2771    public const EmailAuthentication = [
2772        'default' => true,
2773    ];
2774
2775    /**
2776     * Whether to show a banner to logged-in users who have not yet confirmed their email address.
2777     *
2778     * Requires {@link MainConfigSchema::EmailAuthentication} to be enabled.
2779     */
2780    public const EmailConfirmationBanner = [
2781        'default' => false,
2782        'type' => 'boolean',
2783    ];
2784
2785    /**
2786     * Allow users to enable email notification ("enotif") on watchlist changes.
2787     */
2788    public const EnotifWatchlist = [
2789        'default' => false,
2790    ];
2791
2792    /**
2793     * Allow users to enable email notification ("enotif") when someone edits their
2794     * user talk page.
2795     *
2796     * The owner of the user talk page must also have the 'enotifusertalkpages' user
2797     * preference set to true.
2798     */
2799    public const EnotifUserTalk = [
2800        'default' => false,
2801    ];
2802
2803    /**
2804     * Allow sending of e-mail notifications with the editor's address in "Reply-To".
2805     *
2806     * Note, enabling this only actually uses it in notification e-mails if the user
2807     * opted-in to this feature. This feature flag also controls visibility of the
2808     * 'enotifrevealaddr' preference, which, if users opt into, will make e-mail
2809     * notifications about their actions use their address as "Reply-To".
2810     *
2811     * To set the address as "From" instead of "Reply-To", also enable $wgEnotifFromEditor.
2812     *
2813     * If disabled, or not opted-in, notifications come from $wgPasswordSender.
2814     */
2815    public const EnotifRevealEditorAddress = [
2816        'default' => false,
2817        'type' => 'boolean',
2818    ];
2819
2820    /**
2821     * Potentially send notification mails on minor edits to pages. This is enabled
2822     * by default.  If this is false, users will never be notified on minor edits.
2823     *
2824     * If it is true, editors with the 'nominornewtalk' right (typically bots) will still not
2825     * trigger notifications for minor edits they make (to any page, not just user talk).
2826     *
2827     * Finally, if the watcher/recipient has the 'enotifminoredits' user preference set to
2828     * false, they will not receive notifications for minor edits.
2829     *
2830     * User talk notifications are also affected by $wgEnotifMinorEdits, the above settings,
2831     * $wgEnotifUserTalk, and the preference described there.
2832     */
2833    public const EnotifMinorEdits = [
2834        'default' => true,
2835    ];
2836
2837    /**
2838     * Use real name instead of username in e-mail "from" field.
2839     */
2840    public const EnotifUseRealName = [
2841        'default' => false,
2842    ];
2843
2844    /**
2845     * Array of usernames who will be sent a notification email for every change
2846     * which occurs on a wiki. Users will not be notified of their own changes.
2847     */
2848    public const UsersNotifiedOnAllChanges = [
2849        'default' => [],
2850        'type' => 'map',
2851    ];
2852
2853    // endregion -- end of email settings
2854
2855    /***************************************************************************/
2856    // region  Database settings
2857    /** @name   Database settings */
2858
2859    /**
2860     * Current wiki database name
2861     *
2862     * This should only contain alphanumeric and underscore characters ([A-Za-z0-9_]+).
2863     * Spaces, quotes, backticks, dots, and hyphens are likely to be problematic.
2864     *
2865     * This is used to determine the current/local wiki ID (WikiMap::getCurrentWikiDbDomain).
2866     *
2867     * This should still be set even if $wgLBFactoryConf is configured.
2868     */
2869    public const DBname = [
2870        'default' => 'my_wiki',
2871    ];
2872
2873    /**
2874     * Current wiki database schema name
2875     *
2876     * This should only contain alphanumeric and underscore characters ([A-Za-z0-9_]+).
2877     * Spaces, quotes, backticks, dots, and hyphens are likely to be problematic.
2878     *
2879     * This is used to determine the current/local wiki ID (WikiMap::getCurrentWikiDbDomain).
2880     *
2881     * This should still be set even if $wgLBFactoryConf is configured.
2882     */
2883    public const DBmwschema = [
2884        'default' => null,
2885        'type' => '?string',
2886    ];
2887
2888    /**
2889     * Current wiki database table name prefix
2890     *
2891     * This should only contain alphanumeric and underscore characters ([A-Za-z0-9_]+).
2892     * If it's a non-empty string, then it preferably should end with an underscore.
2893     * Spaces, quotes, backticks, dots, and hyphens are especially likely to be problematic.
2894     *
2895     * This is used to determine the current/local wiki ID (WikiMap::getCurrentWikiDbDomain).
2896     *
2897     * This should still be set even if $wgLBFactoryConf is configured.
2898     */
2899    public const DBprefix = [
2900        'default' => '',
2901    ];
2902
2903    /**
2904     * Database host name or IP address
2905     */
2906    public const DBserver = [
2907        'default' => 'localhost',
2908    ];
2909
2910    /**
2911     * Database port number
2912     */
2913    public const DBport = [
2914        'default' => 5432,
2915    ];
2916
2917    /**
2918     * Database username
2919     */
2920    public const DBuser = [
2921        'default' => 'wikiuser',
2922    ];
2923
2924    /**
2925     * Database user's password
2926     */
2927    public const DBpassword = [
2928        'default' => '',
2929    ];
2930
2931    /**
2932     * Database type
2933     */
2934    public const DBtype = [
2935        'default' => 'mysql',
2936    ];
2937
2938    /**
2939     * Whether to use SSL in DB connection.
2940     *
2941     * This setting is only used if $wgLBFactoryConf['class'] is set to
2942     * '\Wikimedia\Rdbms\LBFactorySimple' and $wgDBservers is an empty array; otherwise
2943     * the 'ssl' parameter of the server array must be set to achieve the same functionality.
2944     */
2945    public const DBssl = [
2946        'default' => false,
2947    ];
2948
2949    /**
2950     * Whether to use compression in DB connection.
2951     *
2952     * This setting is only used $wgLBFactoryConf['class'] is set to
2953     * '\Wikimedia\Rdbms\LBFactorySimple' and $wgDBservers is an empty array; otherwise
2954     * the DBO_COMPRESS flag must be set in the 'flags' option of the database
2955     * connection to achieve the same functionality.
2956     */
2957    public const DBcompress = [
2958        'default' => false,
2959    ];
2960
2961    /**
2962     * Check for warnings after DB queries and throw an exception if an
2963     * unacceptable warning is detected.
2964     *
2965     * This setting is only used if $wgLBFactoryConf['class'] is set to
2966     * '\Wikimedia\Rdbms\LBFactorySimple' and $wgDBservers is an empty array.
2967     * Otherwise, the 'strictWarnings' parameter of the server array must be set
2968     * to achieve the same functionality.
2969     *
2970     * @since 1.42
2971     */
2972    public const DBStrictWarnings = [
2973        'default' => false,
2974    ];
2975
2976    /**
2977     * Separate username for maintenance tasks. Leave as null to use the default.
2978     */
2979    public const DBadminuser = [
2980        'default' => null,
2981    ];
2982
2983    /**
2984     * Separate password for maintenance tasks. Leave as null to use the default.
2985     */
2986    public const DBadminpassword = [
2987        'default' => null,
2988    ];
2989
2990    /**
2991     * Search type.
2992     *
2993     * Leave as null to select the default search engine for the
2994     * selected database type (eg SearchMySQL), or set to a class
2995     * name to override to a custom search engine.
2996     *
2997     * If the canonical name for the search engine doesn't match the class name
2998     * (because it's namespaced for example), you can add a mapping for this in
2999     * SearchMappings in extension.json.
3000     */
3001    public const SearchType = [
3002        'default' => null,
3003    ];
3004
3005    /**
3006     * Alternative search types
3007     *
3008     * Sometimes you want to support multiple search engines for testing. This
3009     * allows users to select their search engine of choice via url parameters
3010     * to Special:Search and the action=search API. If using this, there's no
3011     * need to add $wgSearchType to it, that is handled automatically.
3012     *
3013     * If the canonical name for the search engine doesn't match the class name
3014     * (because it's namespaced for example), you can add a mapping for this in
3015     * SearchMappings in extension.json.
3016     */
3017    public const SearchTypeAlternatives = [
3018        'default' => null,
3019    ];
3020
3021    /**
3022     * MySQL table options to use during installation or update
3023     */
3024    public const DBTableOptions = [
3025        'default' => 'ENGINE=InnoDB, DEFAULT CHARSET=binary',
3026    ];
3027
3028    /**
3029     * SQL Mode - default is turning off all modes, including strict, if set.
3030     *
3031     * null can be used to skip the setting for performance reasons and assume
3032     * the DBA has done their best job.
3033     * String override can be used for some additional fun :-)
3034     */
3035    public const SQLMode = [
3036        'default' => '',
3037    ];
3038
3039    /**
3040     * To override default SQLite data directory ($docroot/../data)
3041     */
3042    public const SQLiteDataDir = [
3043        'default' => '',
3044    ];
3045
3046    /**
3047     * Shared database for multiple wikis. Commonly used for storing a user table
3048     * for single sign-on. The server for this database must be the same as for the
3049     * main database.
3050     *
3051     * For backwards compatibility the shared prefix is set to the same as the local
3052     * prefix, and the user table is listed in the default list of shared tables.
3053     * The user_properties table is also added so that users will continue to have their
3054     * preferences shared (preferences were stored in the user table prior to 1.16)
3055     *
3056     * $wgSharedTables may be customized with a list of tables to share in the shared
3057     * database. However it is advised to limit what tables you do share as many of
3058     * MediaWiki's tables may have side effects if you try to share them.
3059     *
3060     * $wgSharedPrefix is the table prefix for the shared database. It defaults to
3061     * $wgDBprefix.
3062     *
3063     * $wgSharedSchema is the table schema for the shared database. It defaults to
3064     * $wgDBmwschema.
3065     */
3066    public const SharedDB = [
3067        'default' => null,
3068    ];
3069
3070    /**
3071     * @see self::SharedDB
3072     */
3073    public const SharedPrefix = [
3074        'default' => false,
3075        'dynamicDefault' => [ 'use' => [ 'DBprefix' ] ]
3076    ];
3077
3078    /**
3079     * @param mixed $dbPrefix Value of DBprefix
3080     * @return mixed
3081     */
3082    public static function getDefaultSharedPrefix( $dbPrefix ) {
3083        return $dbPrefix;
3084    }
3085
3086    /**
3087     * @see self::SharedDB
3088     * The installer will add 'actor' to this list for all new wikis.
3089     */
3090    public const SharedTables = [
3091        'default' => [
3092            'user',
3093            'user_properties',
3094            'user_autocreate_serial',
3095        ],
3096        'type' => 'list',
3097    ];
3098
3099    /**
3100     * @see self::SharedDB
3101     * @since 1.23
3102     */
3103    public const SharedSchema = [
3104        'default' => false,
3105        'dynamicDefault' => [ 'use' => [ 'DBmwschema' ] ]
3106    ];
3107
3108    /**
3109     * @param mixed $dbMwschema Value of DBmwschema
3110     * @return mixed
3111     */
3112    public static function getDefaultSharedSchema( $dbMwschema ) {
3113        return $dbMwschema;
3114    }
3115
3116    /**
3117     * Database load balancer
3118     * This is a two-dimensional array, a list of server info structures
3119     * Fields are:
3120     *   - host:        Host name
3121     *   - dbname:      Default database name
3122     *   - user:        DB user
3123     *   - password:    DB password
3124     *   - type:        DB type
3125     *   - driver:      DB driver (when there are multiple drivers)
3126     *
3127     *   - load:        Ratio of DB_REPLICA load, must be >=0, the sum of all loads must be >0.
3128     *                  If this is zero for any given server, no normal query traffic will be
3129     *                  sent to it. It will be excluded from lag checks in maintenance scripts.
3130     *                  The only way it can receive traffic is if groupLoads is used.
3131     *
3132     *   - flags:       (optional) Bit field of properties:
3133     *                  - DBO_DEFAULT:    Transactional-ize web requests and use autocommit otherwise
3134     *                  - DBO_DEBUG:      Equivalent of $wgDebugDumpSql
3135     *                  - DBO_SSL:        Use TLS connection encryption if available (deprecated)
3136     *                  - DBO_COMPRESS:   Use protocol compression with database connections
3137     *                  - DBO_PERSISTENT: Enables persistent database connections
3138     *
3139     *   - ssl:         (optional) Boolean, whether to use TLS encryption. Overrides DBO_SSL.
3140     *   - max lag:     (optional) Maximum replication lag before a replica DB goes out of rotation
3141     *   - is static:   (optional) Set to true if the dataset is static and no replication is used.
3142     *   - cliMode:     (optional) Connection handles will not assume that requests are short-lived
3143     *                  nor that INSERT..SELECT can be rewritten into a buffered SELECT and INSERT.
3144     *                  This is what DBO_DEFAULT uses to determine when a web request is present.
3145     *                  [Default: true if MW_ENTRY_POINT is 'cli', otherwise false]
3146     *
3147     *   These and any other user-defined properties will be assigned to the mLBInfo member
3148     *   variable of the Database object.
3149     *
3150     * Leave at false to use the single-server variables above. If you set this
3151     * variable, the single-server variables will generally be ignored (except
3152     * perhaps in some command-line scripts).
3153     *
3154     * The first server listed in this array (with key 0) will be the primary. The
3155     * rest of the servers will be replica DBs. To prevent writes to your replica DBs due to
3156     * accidental misconfiguration or MediaWiki bugs, set read_only=1 on all your
3157     * replica DBs in my.cnf. You can set read_only mode at runtime using:
3158     *
3159     * ```
3160     *     SET @@read_only=1;
3161     * ```
3162     *
3163     * Since the effect of writing to a replica DB is so damaging and difficult to clean
3164     * up, we at Wikimedia set read_only=1 in my.cnf on all our DB servers, even
3165     * our primaries, and then set read_only=0 on primaries at runtime.
3166     */
3167    public const DBservers = [
3168        'default' => false,
3169        'type' => 'false|list',
3170    ];
3171
3172    /**
3173     * Configuration for the ILBFactory service
3174     *
3175     * The "class" setting must point to a LBFactory subclass, which is also responsible
3176     * for reading $wgDBservers, $wgDBserver, etc.
3177     *
3178     * To set up a wiki farm with multiple database clusters, set the "class" to
3179     * LBFactoryMulti. See {@link Wikimedia::Rdbms::LBFactoryMulti LBFactoryMulti} docs for
3180     * information on how to configure the rest of the $wgLBFactoryConf array.
3181     */
3182    public const LBFactoryConf = [
3183        'default' => [
3184            'class' => 'Wikimedia\\Rdbms\\LBFactorySimple',
3185        ],
3186        'type' => 'map',
3187        'mergeStrategy' => 'replace',
3188    ];
3189
3190    /**
3191     * After a state-changing request is done by a client, this determines
3192     * how many seconds that client should keep using the primary datacenter.
3193     *
3194     * This avoids unexpected stale or 404 responses due to replication lag.
3195     *
3196     * This must be greater than or equal to
3197     * Wikimedia\Rdbms\ChronologyProtector::POSITION_COOKIE_TTL.
3198     *
3199     * @since 1.27
3200     */
3201    public const DataCenterUpdateStickTTL = [
3202        'default' => 10,
3203    ];
3204
3205    /**
3206     * File to log database errors to
3207     */
3208    public const DBerrorLog = [
3209        'default' => false,
3210    ];
3211
3212    /**
3213     * Timezone to use in the error log.
3214     *
3215     * Defaults to the wiki timezone ($wgLocaltimezone).
3216     *
3217     * A list of usable timezones can found at:
3218     * https://www.php.net/manual/en/timezones.php
3219     *
3220     * **Examples:**
3221     *
3222     * ```
3223     * $wgDBerrorLogTZ = 'UTC';
3224     * $wgDBerrorLogTZ = 'GMT';
3225     * $wgDBerrorLogTZ = 'PST8PDT';
3226     * $wgDBerrorLogTZ = 'Europe/Sweden';
3227     * $wgDBerrorLogTZ = 'CET';
3228     * ```
3229     *
3230     * @since 1.20
3231     */
3232    public const DBerrorLogTZ = [
3233        'default' => false,
3234        'dynamicDefault' => [ 'use' => [ 'Localtimezone' ] ]
3235    ];
3236
3237    public static function getDefaultDBerrorLogTZ( ?string $localtimezone ): string {
3238        // NOTE: Extra fallback, in case $localtimezone is ''.
3239        //       Many existing LocalSettings files have $wgLocaltimezone = ''
3240        //       in them, erroneously generated by the installer.
3241        return $localtimezone ?: self::getDefaultLocaltimezone();
3242    }
3243
3244    /**
3245     * List of all wiki IDs that reside on the current wiki farm.
3246     *
3247     * The wikis listed here must meet the following requirements in order to
3248     * be be considered part of the same wiki farm:
3249     *
3250     * - reachable for cross-wiki database queries, via \Wikimedia\Rdbms\IConnectionProvider,
3251     *   as configured by $wgLBFactoryConf
3252     * - share the same $wgMainCacheType backend (e.g. the same Memcached cluster),
3253     *   so that cache updates and purges via BagOStuff::makeGlobalKey and
3254     *   WANObjectCache work correctly.
3255     *
3256     * Examples of cross-wiki features enabled through this setting:
3257     *
3258     * - SpecialUserRights, to assign a local user group from a central wiki.
3259     * - JobQueueGroup::push, to queue a job for another wiki
3260     *   (e.g. GlobalUsage, MassMessage, and Wikibase extensions).
3261     * - RenameUser (when using $wgSharedDB), to globally apply the rename to revisions
3262     *   logging tables on all wikis.
3263     *
3264     * Each wiki ID must consist of 1-3 hyphen-delimited alphanumeric components (each with no
3265     * hyphens nor spaces) of any of the forms:
3266     *
3267     * - "<DB NAME>"
3268     * - "<DB NAME>-<TABLE PREFIX>"
3269     * - "<DB NAME>-<DB SCHEMA>-<TABLE PREFIX>"
3270     *
3271     * If hyphens appear in any of the components, then the domain ID parsing may not work
3272     * and site functionality might be affected. If the schema ($wgDBmwschema) is set to the
3273     * default of "mediawiki" on all wikis, then the schema should be omitted from wiki IDs.
3274     *
3275     * @see WikiMap::getWikiIdFromDbDomain
3276     * @see SiteConfiguration::getLocalDatabases
3277     * @see self::LocalVirtualHosts
3278     */
3279    public const LocalDatabases = [
3280        'default' => [],
3281        'type' => 'list',
3282        'items' => [ 'type' => 'string', ],
3283    ];
3284
3285    /**
3286     * If lag is higher than $wgDatabaseReplicaLagWarning, show a warning in some special
3287     * pages (like watchlist). If the lag is higher than $wgDatabaseReplicaLagCritical,
3288     * show a more obvious warning.
3289     *
3290     * @since 1.36
3291     */
3292    public const DatabaseReplicaLagWarning = [
3293        'default' => 10,
3294    ];
3295
3296    /**
3297     * @see self::DatabaseReplicaLagWarning
3298     * @since 1.36
3299     */
3300    public const DatabaseReplicaLagCritical = [
3301        'default' => 30,
3302    ];
3303
3304    /**
3305     * Max execution time for queries of several expensive special pages such as RecentChanges
3306     * in milliseconds.
3307     *
3308     * @since 1.38
3309     */
3310    public const MaxExecutionTimeForExpensiveQueries = [
3311        'default' => 0,
3312    ];
3313
3314    /**
3315     * Mapping of virtual domain to external cluster db.
3316     *
3317     * If no entry is set, the code assumes local database.
3318     * For example, for routing queries of virtual domain 'vdomain'
3319     * to 'wikishared' database in 'extension1' cluster. The config should be like this:
3320     *  [ 'vdomain' => [ 'cluster' => 'extension1', 'db' => 'wikishared' ] ]
3321     *
3322     * If the database needs to be the local domain, just set the 'db' to false.
3323     *
3324     * If you want to get another db in the main cluster, just omit 'cluster'. For example:
3325     *  [ 'centralauth' => [ 'db' => 'centralauth' ] ]
3326     *
3327     * @since 1.41
3328     */
3329    public const VirtualDomainsMapping = [
3330        'default' => [],
3331        'type' => 'map',
3332    ];
3333
3334    /**
3335     * Migration stage for file tables
3336     *
3337     * Use the SCHEMA_COMPAT_XXX flags. Supported values:
3338     *
3339     *   - SCHEMA_COMPAT_WRITE_OLD | SCHEMA_COMPAT_READ_OLD (SCHEMA_COMPAT_OLD)
3340     *   - SCHEMA_COMPAT_WRITE_BOTH | SCHEMA_COMPAT_READ_OLD
3341     *   - SCHEMA_COMPAT_WRITE_BOTH | SCHEMA_COMPAT_READ_NEW
3342     *
3343     * History:
3344     *   - 1.44: Added
3345     *   - 1.47: Added support for reading new schema
3346     */
3347    public const FileSchemaMigrationStage = [
3348        'default' => SCHEMA_COMPAT_OLD,
3349        'type' => 'integer',
3350    ];
3351
3352    /**
3353     * Gaps in the externallinks table for certain domains.
3354     *
3355     * If you have identified certain domains for which externallinks searches are slow,
3356     * you can use this setting to make MediaWiki skip large el_id ranges,
3357     * rather than having the database scan through them fruitlessly.
3358     *
3359     * Each key in the array is a domain name in el_to_domain_index form,
3360     * e.g. 'https://com.example.'.
3361     * The value is an array with integer keys and values,
3362     * where each entry is a range (from => to, both inclusive)
3363     * of el_id values where this domain is known to have no entries.
3364     * (Subdomains are included, i.e., configuring an entry here guarantees to MediaWiki
3365     * that there are no rows where the el_to_domain_index starts with this value.)
3366     *
3367     * History:
3368     *   - 1.41: Added
3369     */
3370    public const ExternalLinksDomainGaps = [
3371        'default' => [],
3372        'type' => 'map',
3373    ];
3374
3375    // endregion -- End of DB settings
3376
3377    /***************************************************************************/
3378    // region   Content handlers and storage
3379    /** @name   Content handlers and storage */
3380
3381    /**
3382     * Plugins for page content model handling.
3383     *
3384     * Each entry in the array maps a model id to an ObjectFactory specification
3385     * that creates an instance of the appropriate ContentHandler subclass.
3386     *
3387     * @since 1.21
3388     */
3389    public const ContentHandlers = [
3390        'default' =>
3391            [
3392                // the usual case
3393                CONTENT_MODEL_WIKITEXT => [
3394                    'class' => WikitextContentHandler::class,
3395                    'services' => [
3396                        'TitleFactory',
3397                        'ParserFactory',
3398                        'GlobalIdGenerator',
3399                        'LanguageNameUtils',
3400                        'LinkRenderer',
3401                        'MagicWordFactory',
3402                        'ParsoidParserFactory',
3403                    ],
3404                ],
3405                CONTENT_MODEL_JAVASCRIPT => [
3406                    'class' => JavaScriptContentHandler::class,
3407                    'services' => [
3408                        'MainConfig',
3409                        'ParserFactory',
3410                        'UserOptionsLookup',
3411                        'CodeHighlighter',
3412                    ],
3413                ],
3414                // simple implementation, for use by extensions, etc.
3415                CONTENT_MODEL_JSON => [
3416                    'class' => JsonContentHandler::class,
3417                    'services' => [
3418                        'ParsoidParserFactory',
3419                        'TitleFactory',
3420                    ],
3421                ],
3422                CONTENT_MODEL_CSS => [
3423                    'class' => CssContentHandler::class,
3424                    'services' => [
3425                        'MainConfig',
3426                        'ParserFactory',
3427                        'UserOptionsLookup',
3428                        'CodeHighlighter',
3429                    ],
3430                ],
3431                CONTENT_MODEL_VUE => [
3432                    'class' => VueContentHandler::class,
3433                    'services' => [
3434                        'MainConfig',
3435                        'ParserFactory',
3436                        'CodeHighlighter',
3437                    ]
3438                ],
3439                // plain text, for use by extensions, etc.
3440                CONTENT_MODEL_TEXT => TextContentHandler::class,
3441                // fallback for unknown models, from imports or extensions that were removed
3442                CONTENT_MODEL_UNKNOWN => FallbackContentHandler::class,
3443            ],
3444        'type' => 'map',
3445    ];
3446
3447    /**
3448     * Associative array mapping namespace IDs to the name of the content model pages in that
3449     * namespace should have by default (use the CONTENT_MODEL_XXX constants). If no special
3450     * content type is defined for a given namespace, pages in that namespace will use the
3451     * CONTENT_MODEL_WIKITEXT
3452     * (except for the special case of JS and CS pages).
3453     *
3454     * @note To determine the default model for a new page's main slot, or any slot in general,
3455     * use SlotRoleHandler::getDefaultModel() together with SlotRoleRegistry::getRoleHandler().
3456     * @since 1.21
3457     */
3458    public const NamespaceContentModels = [
3459        'default' => [],
3460        'type' => 'map',
3461    ];
3462
3463    /**
3464     * Determines which types of text are parsed as wikitext. This does not imply that these kinds
3465     * of texts are also rendered as wikitext, it only means that links, magic words, etc will have
3466     * the effect on the database they would have on a wikitext page.
3467     *
3468     * Note that table of contents information will be *suppressed* for all
3469     * text models in this list other than wikitext.
3470     *
3471     * @todo Make the ToC suppression configurable by the content model
3472     * (T313455), not a side effect of inclusion here.
3473     *
3474     * @todo On the long run, it would be nice to put categories etc into a separate structure,
3475     * or at least parse only the contents of comments in the scripts.
3476     * @since 1.21
3477     */
3478    public const TextModelsToParse = [
3479        'default' => [
3480            CONTENT_MODEL_WIKITEXT, // Just for completeness, wikitext will always be parsed.
3481            CONTENT_MODEL_JAVASCRIPT, // Make categories etc work, people put them into comments.
3482            CONTENT_MODEL_CSS, // Make categories etc work, people put them into comments.
3483        ],
3484        'type' => 'list',
3485    ];
3486
3487    /**
3488     * We can also compress text stored in the 'text' table. If this is set on, new
3489     * revisions will be compressed on page save if zlib support is available. Any
3490     * compressed revisions will be decompressed on load regardless of this setting,
3491     * but will not be readable at all if zlib support is not available.
3492     */
3493    public const CompressRevisions = [
3494        'default' => false,
3495    ];
3496
3497    /**
3498     * List of enabled ExternalStore protocols.
3499     *
3500     * @see \ExternalStoreAccess
3501     *
3502     * ```
3503     * $wgExternalStores = [ "DB" ];
3504     * ```
3505     */
3506    public const ExternalStores = [
3507        'default' => [],
3508        'type' => 'list',
3509    ];
3510
3511    /**
3512     * Shortcut for setting `$wgLBFactoryConf["externalClusters"]`.
3513     *
3514     * This is only applicable when using the default LBFactory
3515     * of {@link Wikimedia::Rdbms::LBFactorySimple LBFactorySimple}.
3516     * It is ignored if a different LBFactory is set, or if `externalClusters`
3517     * is already set explicitly.
3518     *
3519     * @see \ExternalStoreAccess
3520     *
3521     * **Example:**
3522     * Create a cluster named 'blobs_cluster1':
3523     *
3524     * ```
3525     * $wgExternalServers = [
3526     *     'blobs_cluster1' => <array in the same format as $wgDBservers>
3527     * ];
3528     * ```
3529     */
3530    public const ExternalServers = [
3531        'default' => [],
3532        'type' => 'map',
3533    ];
3534
3535    /**
3536     * The place to put new text blobs or false to put them in the text table
3537     * of the local wiki database.
3538     *
3539     * @see \ExternalStoreAccess
3540     *
3541     * **Example:**
3542     *
3543     * ```
3544     * $wgDefaultExternalStore = [ 'DB://cluster1', 'DB://cluster2' ];
3545     * ```
3546     */
3547    public const DefaultExternalStore = [
3548        'default' => false,
3549        'type' => 'list|false',
3550    ];
3551
3552    /**
3553     * Revision text may be cached in the main WAN cache to reduce load on external
3554     * storage servers and object extraction overhead for frequently-loaded revisions.
3555     *
3556     * Set to 0 to disable, or number of seconds before cache expiry.
3557     */
3558    public const RevisionCacheExpiry = [
3559        'default' => SqlBlobStore::DEFAULT_TTL,
3560        'type' => 'integer',
3561    ];
3562
3563    /**
3564     * Enable page language feature
3565     * Allows setting page language in database
3566     *
3567     * @since 1.24
3568     */
3569    public const PageLanguageUseDB = [
3570        'default' => false,
3571        'type' => 'boolean',
3572    ];
3573
3574    /**
3575     * Specify the difference engine to use.
3576     *
3577     * Supported values:
3578     * - 'external': Use an external diff engine, which must be specified via $wgExternalDiffEngine
3579     * - 'wikidiff2': Use the wikidiff2 PHP extension
3580     * - 'php': PHP implementations included in MediaWiki
3581     *
3582     * The default (null) is to use the first engine that's available.
3583     *
3584     * @since 1.35
3585     */
3586    public const DiffEngine = [
3587        'default' => null,
3588        'type' => '?string',
3589    ];
3590
3591    /**
3592     * Name of the external diff engine to use.
3593     */
3594    public const ExternalDiffEngine = [
3595        'default' => false,
3596        'type' => 'string|false',
3597    ];
3598
3599    /**
3600     * Options for wikidiff2:
3601     *   - useMultiFormat: (bool) Whether to use wikidiff2_multi_format_diff()
3602     *     if it is available. This temporarily defaults to false, during
3603     *     migration to the new code. It is available in wikidiff2 1.14.0+.
3604     *
3605     * The following options are only effective if wikidiff2_multi_format_diff()
3606     * is enabled. See README.md in wikidiff2 for details:
3607     *
3608     *   - numContextLines
3609     *   - changeThreshold
3610     *   - movedLineThreshold
3611     *   - maxMovedLines
3612     *   - maxWordLevelDiffComplexity
3613     *   - maxSplitSize
3614     *   - initialSplitThreshold
3615     *   - finalSplitThreshold
3616     *
3617     * Also:
3618     *   - formatOptions: An array of format-specific overrides. The key may
3619     *     be "inline" or "table" and the value is an array with keys
3620     *     numContextLines, changeThreshold, etc.
3621     * @since 1.41
3622     */
3623    public const Wikidiff2Options = [
3624        'default' => [],
3625        'type' => 'map'
3626    ];
3627
3628    // endregion -- end of Content handlers and storage
3629
3630    /***************************************************************************/
3631    // region   Performance hacks and limits
3632    /** @name   Performance hacks and limits */
3633
3634    /**
3635     * Set a limit on server request wall clock time.
3636     *
3637     * If the Excimer extension is enabled, setting this will cause an exception
3638     * to be thrown after the specified number of seconds. If the extension is
3639     * not available, set_time_limit() will be called instead.
3640     *
3641     * @since 1.36
3642     */
3643    public const RequestTimeLimit = [
3644        'default' => null,
3645        'type' => '?integer',
3646    ];
3647
3648    /**
3649     * The request time limit for "slow" write requests that should not be
3650     * interrupted due to the risk of data corruption.
3651     *
3652     * The limit will only be raised. If the pre-existing time limit is larger,
3653     * then this will have no effect.
3654     *
3655     * @since 1.26
3656     */
3657    public const TransactionalTimeLimit = [
3658        'default' => 120,
3659    ];
3660
3661    /**
3662     * The maximum time critical sections are allowed to stay open. Critical
3663     * sections are used to defer Excimer request timeouts. If Excimer is available
3664     * and this time limit is exceeded, an exception will be thrown at the next
3665     * opportunity, typically after a long-running function like a DB query returns.
3666     *
3667     * Critical sections may wrap long-running queries, and it's generally better
3668     * for the timeout to be handled a few milliseconds later when the critical
3669     * section exits, so this should be a large number.
3670     *
3671     * This limit is ignored in command-line mode.
3672     *
3673     * @since 1.36
3674     */
3675    public const CriticalSectionTimeLimit = [
3676        'default' => 180.0,
3677        'type' => 'float',
3678    ];
3679
3680    /**
3681     * Disable database-intensive features
3682     */
3683    public const MiserMode = [
3684        'default' => false,
3685    ];
3686
3687    /**
3688     * Disable all query pages if miser mode is on, not just some
3689     */
3690    public const DisableQueryPages = [
3691        'default' => false,
3692    ];
3693
3694    /**
3695     * Number of rows to cache in 'querycache' table when miser mode is on
3696     */
3697    public const QueryCacheLimit = [
3698        'default' => 1000,
3699    ];
3700
3701    /**
3702     * Number of links to a page required before it is deemed "wanted"
3703     */
3704    public const WantedPagesThreshold = [
3705        'default' => 1,
3706    ];
3707
3708    /**
3709     * Enable slow parser functions
3710     */
3711    public const AllowSlowParserFunctions = [
3712        'default' => false,
3713    ];
3714
3715    /**
3716     * Allow schema updates
3717     */
3718    public const AllowSchemaUpdates = [
3719        'default' => true,
3720    ];
3721
3722    /**
3723     * Maximum article size in kibibytes
3724     */
3725    public const MaxArticleSize = [
3726        'default' => 2048,
3727    ];
3728
3729    /**
3730     * The minimum amount of memory that MediaWiki "needs"; MediaWiki will try to
3731     * raise PHP's memory limit if it's below this amount.
3732     */
3733    public const MemoryLimit = [
3734        'default' => '50M',
3735    ];
3736
3737    /**
3738     * Configuration for processing pool control, for use in high-traffic wikis.
3739     *
3740     * An implementation is provided in the PoolCounter extension.
3741     *
3742     * This configuration array maps pool types to an associative array. The only
3743     * defined key in the associative array is "class", which gives the class name.
3744     * The remaining elements are passed through to the class as constructor
3745     * parameters.
3746     *
3747     * **Processing pools used in MediaWiki core:**
3748     * - ArticleView: parsing caused by users viewing a wiki page (per page and revision)
3749     * - HtmlRestApi: parsing caused by requests to the REST API (per page and revision)
3750     * - ApiParser: parsing caused by action=parse (per requesting user)
3751     * - FileRender: thumbnail generation (per file name)
3752     * - FileRenderExpensive: expensive thumbnail generation (per file name)
3753     * - GetLocalFileCopy: expensive thumbnail generation (per file name)
3754     * - diff: revision diff (per content hash)
3755     * - SpecialContributions: list user contributions (per requesting user)
3756     *
3757     * **Example using local redis instance:**
3758     *
3759     * ```
3760     * $wgPoolCounterConf = [ 'ArticleView' => [
3761     *   'class' => PoolCounterRedis::class,
3762     *   'timeout' => 15, // wait timeout in seconds
3763     *   'workers' => 1, // maximum number of active threads in each pool
3764     *   'maxqueue' => 5, // maximum number of total threads in each pool
3765     *   'servers' => [ '127.0.0.1' ],
3766     *   'redisConfig' => []
3767     * ] ];
3768     * ```
3769     *
3770     * **Example using C daemon from <https://gerrit.wikimedia.org/g/mediawiki/services/poolcounter>**
3771     *
3772     * ```
3773     * $wgPoolCountClientConf = [
3774     *   'servers' => [ '127.0.0.1' ],
3775     *   'timeout' => 0.5,
3776     *   'connect_timeout' => 0.01,
3777     * ];
3778     *
3779     * $wgPoolCounterConf = [ 'ArticleView' => [
3780     *   'class' => 'PoolCounter_Client',
3781     *   'timeout' => 15, // wait timeout in seconds
3782     *   'workers' => 5, // maximum number of active threads in each pool
3783     *   'maxqueue' => 50, // maximum number of total threads in each pool
3784     *   ... any extension-specific options...
3785     * ] ];
3786     * ```
3787     *
3788     * @since 1.16
3789     */
3790    public const PoolCounterConf = [
3791        'default' => null,
3792        'type' => '?map',
3793    ];
3794
3795    /**
3796     * Configuration array for the PoolCounter client.
3797     *
3798     * - servers: Array of hostnames, or hostname:port. The default port is 7531.
3799     * - timeout: Connection timeout.
3800     * - connect_timeout: [Since 1.28] Alternative connection timeout. If set, it is used
3801     *   instead of `timeout` and will be retried once if a connection fails
3802     *   to be established. Background: https://phabricator.wikimedia.org/T105378.
3803     *
3804     * @see \MediaWiki\PoolCounter\PoolCounterClient
3805     * @since 1.16
3806     */
3807    public const PoolCountClientConf = [
3808        'default' => [
3809            'servers' => [
3810                '127.0.0.1'
3811            ],
3812            'timeout' => 0.1,
3813        ],
3814        'type' => 'map',
3815    ];
3816
3817    /**
3818     * Max time (in seconds) a user-generated transaction can spend in writes.
3819     *
3820     * If exceeded, the transaction is rolled back with an error instead of being committed.
3821     *
3822     * @since 1.27
3823     */
3824    public const MaxUserDBWriteDuration = [
3825        'default' => false,
3826        'type' => 'integer|false',
3827    ];
3828
3829    /**
3830     * Max time (in seconds) a job-generated transaction can spend in writes.
3831     *
3832     * If exceeded, the transaction is rolled back with an error instead of being committed.
3833     *
3834     * @since 1.30
3835     */
3836    public const MaxJobDBWriteDuration = [
3837        'default' => false,
3838        'type' => 'integer|false',
3839    ];
3840
3841    /**
3842     * LinkHolderArray batch size
3843     * For debugging
3844     */
3845    public const LinkHolderBatchSize = [
3846        'default' => 1000,
3847    ];
3848
3849    /**
3850     * Maximum number of pages to move at once when moving subpages with a page.
3851     */
3852    public const MaximumMovedPages = [
3853        'default' => 100,
3854    ];
3855
3856    /**
3857     * Force deferred updates to be run before sending a response to the client,
3858     * instead of attempting to run them after sending the response. Setting this
3859     * to true is useful for end-to-end testing, to ensure that the effects of a
3860     * request are visible to any subsequent requests, even if they are made
3861     * immediately after the first one. Note however that this does not ensure
3862     * that database replication is complete, nor does it execute any jobs
3863     * enqueued for later.
3864     * There should be no reason to set this in a normal production environment.
3865     *
3866     * @since 1.38
3867     */
3868    public const ForceDeferredUpdatesPreSend = [
3869        'default' => false,
3870    ];
3871
3872    /**
3873     * Whether site_stats table should have multiple rows. If set to true, in each update,
3874     * one of ten rows gets updated at random to reduce lock wait time in wikis
3875     * that have lots of concurrent edits.
3876     * It should be set to true in really large wikis with big flow of edits,
3877     * Otherwise it can cause inaccuracy in data.
3878     *
3879     * @since 1.39
3880     */
3881    public const MultiShardSiteStats = [
3882        'default' => false,
3883        'type' => 'boolean',
3884    ];
3885
3886    // endregion -- end performance hacks
3887
3888    /***************************************************************************/
3889    // region   Cache settings
3890    /** @name   Cache settings */
3891
3892    /**
3893     * Directory for caching data in the local filesystem. Should not be accessible
3894     * from the web.
3895     *
3896     * Note: if multiple wikis share the same localisation cache directory, they
3897     * must all have the same set of extensions. You can set a directory just for
3898     * the localisation cache using $wgLocalisationCacheConf['storeDirectory'].
3899     */
3900    public const CacheDirectory = [
3901        'default' => false,
3902    ];
3903
3904    /**
3905     * Main cache type. This should be a cache with fast access, but it may have
3906     * limited space. By default, it is disabled, since the stock database cache
3907     * is not fast enough to make it worthwhile.
3908     *
3909     * The options are:
3910     *
3911     * - CACHE_ANYTHING:   Use anything, as long as it works
3912     * - CACHE_NONE:       Do not cache
3913     * - CACHE_DB:         Store cache objects in the DB
3914     * - CACHE_MEMCACHED:  MemCached, must specify servers in $wgMemCachedServers
3915     * - CACHE_ACCEL:      APC or APCu
3916     * - (other):          A string may be used which identifies a cache
3917     *                     configuration in $wgObjectCaches.
3918     *
3919     * For a multi-datacenter setup, the underlying service should be configured
3920     * to broadcast operations by WANObjectCache using Mcrouter or Dynomite.
3921     * See @ref wanobjectcache-deployment "Deploying WANObjectCache".
3922     * To configure the `broadcastRoutingPrefix` WANObjectCache parameter,
3923     * use $wgWANObjectCache.
3924     *
3925     * @see self::MessageCacheType
3926     * @see self::ParserCacheType
3927     */
3928    public const MainCacheType = [
3929        'default' => CACHE_NONE,
3930    ];
3931
3932    /**
3933     * The cache type for storing the contents of the MediaWiki namespace. This
3934     * cache is used for a small amount of data which is expensive to regenerate.
3935     *
3936     * For available types see $wgMainCacheType.
3937     */
3938    public const MessageCacheType = [
3939        'default' => CACHE_ANYTHING,
3940    ];
3941
3942    /**
3943     * The cache type for storing page content HTML (e.g. parsed from wikitext).
3944     *
3945     * Parsing wikitext is considered an expensive operation. It is recommended
3946     * to give your parser cache plenty of storage space, such that long tail cache
3947     * hits are possible.
3948     *
3949     * The default parser cache backend (when MainCacheType is left to CACHE_NONE)
3950     * is effectively CACHE_DB (SqlBagOStuff). If you set up a main cache type
3951     * such as memcached, it is recommended to set this explicitly to CACHE_DB.
3952     *
3953     * Advice for large wiki farms:
3954     * - Consider allocating a dedicated database to ParserCache.
3955     *   Register it in $wgObjectCaches and point $wgParserCacheType to it.
3956     * - Consider using MultiWriteBagOStuff to add a higher tier with Memcached
3957     *   in front of the lower database tier.
3958     * - Consider setting `'purgePeriod' => 0` in the dedicated SqlBagOStuff
3959     *   entry in $wgObjectCaches. This disables the automatic purging of
3960     *   expired rows (which would normally happen in the background of
3961     *   write requests). You can then schedule the purgeParserCache.php script
3962     *   to e.g. once a day prune expired rows from the a dedicated maintenance
3963     *   server.
3964     *
3965     * For available types see $wgMainCacheType.
3966     */
3967    public const ParserCacheType = [
3968        'default' => CACHE_ANYTHING,
3969    ];
3970
3971    /**
3972     * The cache backend for storing authenticated session data when $wgAnonSessionCacheType
3973     * is set. Otherwise, when $wgAnonSessionCacheType is unset, this will be used for all types
3974     * of sessions.
3975     *
3976     * Used by MediaWiki\Session\SessionStore. See $wgMainCacheType for available types.
3977     *
3978     * See [SessionStore Storage expectations](@ref SessionStore-storage-expectations).
3979     */
3980    public const SessionCacheType = [
3981        'default' => CACHE_ANYTHING,
3982    ];
3983
3984    /**
3985     * The cache backend for storing anonymous session data. When false, $wgSessionCacheType
3986     * will be used.
3987     *
3988     * Used by MediaWiki\Session\SessionCache. See $wgSessionCacheType for available types.
3989     *
3990     * @since 1.45
3991     */
3992    public const AnonSessionCacheType = [
3993        'default' => false
3994    ];
3995
3996    /**
3997     * The cache type for storing language conversion tables,
3998     * which are used when parsing certain text and interface messages.
3999     *
4000     * For available types see $wgMainCacheType.
4001     *
4002     * @since 1.20
4003     */
4004    public const LanguageConverterCacheType = [
4005        'default' => CACHE_ANYTHING,
4006    ];
4007
4008    /**
4009     * Advanced object cache configuration.
4010     *
4011     * Use this to define the class names and constructor parameters which are used
4012     * for the various cache types. Custom cache types may be defined here and
4013     * referenced from $wgMainCacheType, $wgMessageCacheType, $wgParserCacheType,
4014     * or $wgLanguageConverterCacheType.
4015     *
4016     * The format is an associative array where the key is a cache identifier, and
4017     * the value is an associative array of parameters. One of the following
4018     * parameters specifying the class must be given:
4019     *
4020     *   - class: The class name which will be used.
4021     *   - factory: A callable function which will generate a suitable cache object.
4022     *
4023     * The following parameters are shared and understood by most classes:
4024     *
4025     *   - loggroup: The log channel to use.
4026     *
4027     * For SqlBagOStuff, the main configured database will be used, unless one of the following
4028     * three parameters is given:
4029     *
4030     *   - server: Server config map for Database::factory() that describes the database to
4031     *      use for all key operations in the current region. This is overridden by "servers".
4032     *   - servers: Map of tag strings to server config maps, each for Database::factory(),
4033     *      describing the set of database servers on which to distribute key operations in the
4034     *      current region. Data is distributed among the servers via key hashing based on the
4035     *      server tags. Therefore, each tag represents a shard of the dataset. Tags are useful
4036     *      for failover using cold-standby servers and for managing shards with replica servers
4037     *      in multiple regions (each having different hostnames).
4038     *   - cluster: The ExternalStore cluster name to use.
4039     *
4040     * SqlBagOStuff also accepts the following optional parameters:
4041     *
4042     *   - dbDomain: The database name to pass to the LoadBalancer.
4043     *   - purgePeriod: The average number of object cache writes in between garbage collection
4044     *      operations, where expired entries are removed from the database. Or in other words,
4045     *      the probability of performing a purge is one in every this number. If set to zero,
4046     *      purging will never be done at runtime (for use with PurgeParserCache).
4047     *   - purgeLimit: Maximum number of rows to purge at once.
4048     *   - tableName: The table name to use, default is "objectcache".
4049     *   - shards: The number of tables to use for data storage on each server. If greater than
4050     *      1, table names are formed in the style objectcacheNNN where NNN is the shard index,
4051     *      between 0 and shards-1. The number of digits used in the suffix is the minimum number
4052     *      required to hold the largest shard index. Data is distributed among the tables via
4053     *      key hashing. This helps mitigate MySQL bugs 61735 and 61736.
4054     *   - writeBatchSize: Default maximum number of rows to change in each query for write
4055     *      operations that can be chunked into a set of smaller writes.
4056     *   - dataRedundancy: When set to a number higher than one, instead of sharding values,
4057     *     it writes to that many servers (out of all servers) and reads from all of them too.
4058     *     In case of inconsistency between servers, it picks the value with the highest exptime.
4059     *     Mostly useful for stronger consistency such as mainstash.
4060     *     This option has many limitations (for example when TTL is set to indef or changes)
4061     *     and it shouldn't be used to handle race conditions nor canonical data.
4062     *     The main point of data redundancy is to allow depool of a cluster for maintenance
4063     *     without displacing too many keys.
4064     *
4065     * For MemcachedPhpBagOStuff parameters see {@link MemcachedPhpBagOStuff::__construct}
4066     *
4067     * For MemcachedPeclBagOStuff parameters see {@link MemcachedPeclBagOStuff::__construct}
4068     *
4069     * For RedisBagOStuff parameters see {@link Wikimedia\ObjectCache\RedisBagOStuff::__construct}
4070     */
4071    public const ObjectCaches = [
4072        'default' => [
4073            CACHE_NONE => [ 'class' => EmptyBagOStuff::class, 'reportDupes' => false ],
4074            CACHE_DB => [ 'class' => SqlBagOStuff::class, 'loggroup' => 'SQLBagOStuff' ],
4075
4076            'memcached-php' => [ 'class' => MemcachedPhpBagOStuff::class, 'loggroup' => 'memcached' ],
4077            'memcached-pecl' => [ 'class' => MemcachedPeclBagOStuff::class, 'loggroup' => 'memcached' ],
4078            'hash' => [ 'class' => HashBagOStuff::class, 'reportDupes' => false ],
4079
4080            // Deprecated since 1.35.
4081            // - To configure a wg*CacheType variable to use the local server cache,
4082            //   use CACHE_ACCEL instead, which will select these automatically.
4083            // - To access the object for the local server cache at run-time,
4084            //   use MediaWikiServices::getLocalServerObjectCache()
4085            //   instead of e.g. ObjectCache::getInstance( 'apcu' ).
4086            // - To instantiate a new one of these explicitly, do so directly
4087            //   by using `new APCUBagOStuff( [ … ] )`
4088            // - To instantiate a new one of these including auto-detection and fallback,
4089            //   use ObjectCache::makeLocalServerCache().
4090            'apc' => [ 'class' => APCUBagOStuff::class, 'reportDupes' => false ],
4091            'apcu' => [ 'class' => APCUBagOStuff::class, 'reportDupes' => false ],
4092        ],
4093        'type' => 'map',
4094    ];
4095
4096    /**
4097     * Extra parameters to the WANObjectCache constructor.
4098     *
4099     * See @ref wanobjectcache-deployment "Deploying WANObjectCache".
4100     *
4101     * @since 1.40
4102     */
4103    public const WANObjectCache = [
4104        'default' => [],
4105        'type' => 'map',
4106    ];
4107
4108    /**
4109     * The stash store backend for MicroStash.
4110     *
4111     * This store should be optimized for ephemeral data, and should be able to handle
4112     * a high volume of writes and reads. The dataset access scope should be across
4113     * all servers that serve the application.
4114     *
4115     * Note that the TTL of the data written to this store must be respected completely
4116     * before the data gets evicted from the store (whether the data is used or not).
4117     * The store must not evict data based on LRU or popularity before the TTL expires.
4118     *
4119     * Expectations for sysadmins:
4120     *
4121     * 1. The data written to this store is generally short-lived (seconds/minutes),
4122     * 2. This store must reliably persist and should not evict data until the TTL expires,
4123     * 3. The same store must be accessed by all application servers (i.e. no visible lag or
4124     *    split reality),
4125     * 4. This store should handle a high volume of both writes and reads,
4126     *    with reads completing with consistently low latencies.
4127     *
4128     * Examples users:
4129     *
4130     * - {@link MediaWiki::Permissions::RateLimiter RateLimiter} (via RStatsFactory)
4131     * - {@link Wikimedia::Rdbms::ChronologyProtector ChronologyProtector}
4132     *    See also [ChronologyProtector requirements](@ref ChronologyProtector-storage-requirements),
4133     *    for more detailed system administrator requirements for multi-DC operations.
4134     *
4135     * Valid options are the keys of {@link $wgObjectCaches}, e.g. CACHE_* constants.
4136     *
4137     * @see \Wikimedia\ObjectCache\BagOStuff
4138     * @since 1.42
4139     */
4140    public const MicroStashType = [
4141        'default' => CACHE_ANYTHING,
4142        'type' => 'string|int',
4143    ];
4144
4145    /**
4146     * The object store type of the main stash.
4147     *
4148     * This should be a fast storage system optimized for lightweight data, both ephemeral and
4149     * permanent, for things like counters, tokens, and blobs. The dataset access scope should
4150     * include all the application servers in all datacenters. Thus, the data must be replicated
4151     * among all datacenters. The store should have "Last Write Wins" eventual consistency. Per
4152     * https://en.wikipedia.org/wiki/PACELC_theorem, the store should act as a PA/EL distributed
4153     * system for these operations.
4154     *
4155     * The multi-datacenter strategy for MediaWiki is to have CDN route HTTP POST requests to the
4156     * primary datacenter and HTTP GET/HEAD/OPTIONS requests to the closest datacenter to the
4157     * client. The stash accepts write operations from any datacenter, but cross-datacenter
4158     * replication is asynchronous.
4159     *
4160     * Modules that use the main stash can expect race conditions to occur if a key can receive
4161     * write operations originating from multiple datacenters. To improve consistency, callers
4162     * should avoid main stash updates during non-POST requests. In any case, callers should
4163     * gracefully tolerate occasional key evictions, temporary inconsistencies among datacenters,
4164     * and violations of linearizability (e.g. during timeouts). Modules that can never handle
4165     * these kinds of anomalies should use other storage mediums.
4166     *
4167     * Valid options are the keys of {@link $wgObjectCaches}, e.g. CACHE_* constants.
4168     *
4169     * @see \Wikimedia\ObjectCache\BagOStuff
4170     * @since 1.26
4171     */
4172    public const MainStash = [
4173        'default' => CACHE_DB,
4174    ];
4175
4176    /**
4177     * Configuration for the caching related to parsoid output. The configuration contains the
4178     * following keys:
4179     *
4180     * - StashType: The type of object store to be used by the ParsoidOutputStash service,
4181     *       which stores the base state of HTML based edits.
4182     *       Valid options are the keys of {@link $wgObjectCaches}, e.g. CACHE_* constants.
4183     *       By default, the value of the MainStash setting will be used.
4184     *       This should be an object store that provides fairly solid persistence guarantees,
4185     *       since losing an entry from the stash may mean that the user can't save their edit.
4186     *       If null, the value of the MainStash configuration setting will be used.
4187     *
4188     * - StashDuration: The number of seconds for which an entry in the stash should be kept.
4189     *       Should be long enough for users to finish editing,
4190     *       since losing an entry from the stash may mean that the user can't save their edit.
4191     *       This is set to one day by default.
4192     *
4193     * - WarmParsoidParserCache: Setting this to true will pre-populate the parsoid parser cache
4194     *       with parsoid outputs on page edits. This speeds up loading HTML into Visual Editor.
4195     *
4196     * @since 1.39
4197     * @unstable Per MediaWiki 1.39, the structure of this configuration is still subject to
4198     *           change.
4199     */
4200    public const ParsoidCacheConfig = [
4201        'type' => 'object',
4202        'properties' => [
4203            'StashType' => [ 'type' => 'int|string|null', 'default' => null ],
4204            'StashDuration' => [ 'type' => 'int', 'default' => 24 * 60 * 60 ],
4205            'WarmParsoidParserCache' => [ 'type' => 'bool', 'default' => false ],
4206        ]
4207    ];
4208
4209    /**
4210     * Sample rate for collecting statistics on Parsoid selective update.
4211     *
4212     * Zero disables collection; 1000 means "1 in every 1000 parses will
4213     * be sampled".
4214     *
4215     * @warning This is EXPERIMENTAL and will disappear once analysis is
4216     * complete.
4217     */
4218    public const ParsoidSelectiveUpdateSampleRate = [
4219        'type' => 'integer',
4220        'default' => 0,
4221    ];
4222
4223    /**
4224     * Per-namespace configuration for the ParserCache filter.
4225     *
4226     * There is one top level key for each cache name supported in ParserCacheFactory.
4227     * The per-namespace configuration is given separately for each cache.
4228     *
4229     * For each namespace, this defines a set of filter options, which are represented
4230     * as an associative array. The following keys are supported in this array:
4231     *
4232     * - minCpuTime: causes the parser cache to not save any output that took fewer
4233     *   than the given number of seconds of CPU time to generate, according to
4234     *   ParserOutput::getTimeProfile(). Set to 0 to always cache, or to
4235     *   PHP_INT_MAX to disable caching for this namespace.
4236     *
4237     * If no filter options are defined for a given namespace, the filter options
4238     * under the "default" key will be used for pages in that namespace.
4239     *
4240     * @since 1.42
4241     */
4242    public const ParserCacheFilterConfig = [
4243        'type' => 'map',
4244        'default' => [ // default value
4245            'pcache' => [ // old parser cache
4246                'default' => [ // all namespaces
4247                    // 0 means no threshold.
4248                    // Use PHP_INT_MAX to disable cache.
4249                    'minCpuTime' => 0
4250                ],
4251            ],
4252            'postproc-pcache' => [ // postprocessing output cache
4253                'default' => [ // all namespaces
4254                    // 0 means no threshold.
4255                    // Use PHP_INT_MAX to disable cache.
4256                    'minCpuTime' => PHP_INT_MAX
4257                ],
4258            ],
4259            'parsoid-pcache' => [ // parsoid output cache
4260                'default' => [ // all namespaces
4261                    // 0 means no threshold.
4262                    // Use PHP_INT_MAX to disable cache.
4263                    'minCpuTime' => 0
4264                ],
4265            ],
4266            'postproc-parsoid-pcache' => [ // parsoid postprocessing output cache
4267                'default' => [ // all namespaces
4268                    // 0 means no threshold.
4269                    // Use PHP_INT_MAX to disable cache.
4270                    'minCpuTime' => 0
4271                ],
4272            ],
4273        ],
4274        'additionalProperties' => [ // caches
4275            'type' => 'map',
4276            'description' => 'A map of namespace IDs to filter definitions.',
4277            'additionalProperties' => [ // namespaces
4278                'type' => 'map',
4279                'description' => 'A map of filter names to values.',
4280                'properties' => [ // filters
4281                    'minCpuTime' => [ 'type' => 'float' ]
4282                ]
4283            ],
4284        ],
4285    ];
4286
4287    /**
4288     * Secret string for HMAC hashing in ChronologyProtector [optional]
4289     *
4290     * @since 1.41
4291     */
4292    public const ChronologyProtectorSecret = [
4293        'default' => '',
4294        'type' => 'string',
4295    ];
4296
4297    /**
4298     * The expiry time for the parser cache, in seconds.
4299     *
4300     * The default is 86400 (one day).
4301     */
4302    public const ParserCacheExpireTime = [
4303        'default' => 60 * 60 * 24,
4304    ];
4305
4306    /**
4307     * The expiry time for "not ready" asynchronous content in the parser
4308     * cache, in seconds.  This should be rather short, to allow the
4309     * "not ready" content to be replaced by "ready" content.
4310     *
4311     * The default is 60 (one minute).
4312     *
4313     * @since 1.44
4314     */
4315    public const ParserCacheAsyncExpireTime = [
4316        'default' => 60,
4317    ];
4318
4319    /**
4320     * Whether to re-run the refresh links jobs when asynchronous content
4321     * becomes ready.  This is needed if the asynchronous content can affect
4322     * categories or other page metadata.
4323     *
4324     * @since 1.44
4325     */
4326    public const ParserCacheAsyncRefreshJobs = [
4327        'default' => true,
4328    ];
4329
4330    /**
4331     * The expiry time for the parser cache for old revisions, in seconds.
4332     *
4333     * The default is 3600 (cache disabled).
4334     */
4335    public const OldRevisionParserCacheExpireTime = [
4336        'default' => 60 * 60,
4337    ];
4338
4339    /**
4340     * The expiry time to use for session storage, in seconds.
4341     */
4342    public const ObjectCacheSessionExpiry = [
4343        'default' => 60 * 60,
4344    ];
4345
4346    /**
4347     * Whether to use PHP session handling ($_SESSION and session_*() functions)
4348     *
4349     * If the constant MW_NO_SESSION is defined, this is forced to 'disable'.
4350     *
4351     * If the constant MW_NO_SESSION_HANDLER is defined, this is ignored and PHP
4352     * session handling will function independently of SessionHandler.
4353     * SessionHandler and PHP's session handling may attempt to override each
4354     * others' cookies.
4355     *
4356     * @since 1.27
4357     * @deprecated since 1.45 Integration with PHP session handling will be removed in the future
4358     */
4359    public const PHPSessionHandling = [
4360        'default' => 'warn',
4361        'type' => 'string',
4362        'deprecated' => 'since 1.45 Integration with PHP session handling will be removed in the future',
4363    ];
4364
4365    /**
4366     * Time in seconds to remember IPs for, for the purposes of logging IP changes within the
4367     * same session. This is meant more for debugging errors in the authentication system than
4368     * for detecting abuse.
4369     *
4370     * @since 1.36
4371     */
4372    public const SuspiciousIpExpiry = [
4373        'default' => false,
4374        'type' => 'integer|false',
4375    ];
4376
4377    /**
4378     * Number of internal PBKDF2 iterations to use when deriving session secrets.
4379     *
4380     * @since 1.28
4381     */
4382    public const SessionPbkdf2Iterations = [
4383        'default' => 10001,
4384    ];
4385
4386    /**
4387     * Include a JWT alongside the session cookie when using cookie-based sessions.
4388     *
4389     * @note The JWT cookie intentionally has the same name on all wikis, to make it easier for
4390     *   edge infrastructure to handle it. If multiple wikis use the same domain, without
4391     *   appropriate $wgCookieDomain settings, enabling this will break session handling.
4392     *
4393     * @since 1.45
4394     * @see SessionManager::getJwtData()
4395     */
4396    public const UseSessionCookieJwt = [
4397        'default' => false,
4398    ];
4399
4400    /**
4401     * The wiki's URL that would create, sign and issue JWTs using the configured
4402     * private key. The entity is identified by the `iss` claim in the JWT payload.
4403     *
4404     * @since 1.46
4405     */
4406    public const JwtSessionCookieIssuer = [
4407        'default' => null,
4408    ];
4409
4410    /**
4411     * The list of MemCached servers and port numbers
4412     */
4413    public const MemCachedServers = [
4414        'default' => [ '127.0.0.1:11211', ],
4415        'type' => 'list',
4416    ];
4417
4418    /**
4419     * Use persistent connections to MemCached, which are shared across multiple
4420     * requests.
4421     */
4422    public const MemCachedPersistent = [
4423        'default' => false,
4424    ];
4425
4426    /**
4427     * Read/write timeout for MemCached server communication, in microseconds.
4428     */
4429    public const MemCachedTimeout = [
4430        'default' => 500_000,
4431    ];
4432
4433    /**
4434     * Set this to true to maintain a copy of the message cache on the local server.
4435     *
4436     * This layer of message cache is in addition to the one configured by $wgMessageCacheType.
4437     *
4438     * The local copy is put in APC. If APC is not installed, this setting does nothing.
4439     *
4440     * Note that this is about the message cache, which stores interface messages
4441     * maintained as wiki pages. This is separate from the localisation cache for interface
4442     * messages provided by the software, which is configured by $wgLocalisationCacheConf.
4443     */
4444    public const UseLocalMessageCache = [
4445        'default' => false,
4446    ];
4447
4448    /**
4449     * Instead of caching everything, only cache those messages which have
4450     * been customised in the site content language. This means that
4451     * MediaWiki:Foo/ja is ignored if MediaWiki:Foo doesn't exist.
4452     *
4453     * This option is probably only useful for translatewiki.net.
4454     */
4455    public const AdaptiveMessageCache = [
4456        'default' => false,
4457    ];
4458
4459    /**
4460     * Localisation cache configuration.
4461     *
4462     * Used by service wiring to decide how to construct the
4463     * LocalisationCache instance. Associative array with keys:
4464     *
4465     * class:       The class to use for constructing the LocalisationCache object.
4466     *              This may be overridden by extensions to a subclass of LocalisationCache.
4467     *              Sub classes are expected to still honor the 'storeClass', 'storeDirectory'
4468     *              and 'manualRecache' options where applicable.
4469     *
4470     * storeClass:  Which LCStore class implementation to use. This is optional.
4471     *              The default LocalisationCache class offers the 'store' option
4472     *              as abstraction for this.
4473     *
4474     * store:       How and where to store localisation cache data.
4475     *              This option is ignored if 'storeClass' is explicitly set to a class name.
4476     *              Must be one of:
4477     *              - 'detect' (default): Automatically select 'files' if 'storeDirectory'
4478     *                 or $wgCacheDirectory is set, and fall back to 'db' otherwise.
4479     *              - 'files': Store in $wgCacheDirectory as CDB files.
4480     *              - 'array': Store in $wgCacheDirectory as PHP static array files.
4481     *              - 'db': Store in the l10n_cache database table.
4482     *
4483     * storeDirectory: If the selected LCStore class puts its data in files, then it
4484     *                 will use this directory. If set to false (default), then
4485     *                 $wgCacheDirectory is used instead.
4486     *
4487     * manualRecache: Set this to true to disable cache updates on web requests.
4488     *                Use maintenance/rebuildLocalisationCache.php instead.
4489     */
4490    public const LocalisationCacheConf = [
4491        'properties' => [
4492            'class' => [ 'type' => 'string', 'default' => LocalisationCache::class ],
4493            'store' => [ 'type' => 'string', 'default' => 'detect' ],
4494            'storeClass' => [ 'type' => 'false|string', 'default' => false ],
4495            'storeDirectory' => [ 'type' => 'false|string', 'default' => false ],
4496            'storeServer' => [ 'type' => 'object', 'default' => [] ],
4497            'forceRecache' => [ 'type' => 'bool', 'default' => false ],
4498            'manualRecache' => [ 'type' => 'bool', 'default' => false ],
4499        ],
4500        'type' => 'object',
4501    ];
4502
4503    /**
4504     * Allow client-side caching of pages
4505     */
4506    public const CachePages = [
4507        'default' => true,
4508    ];
4509
4510    /**
4511     * Set this to current time to invalidate all prior cached pages. Affects both
4512     * client-side and server-side caching.
4513     *
4514     * You can get the current date on your server by using the command:
4515     *
4516     * @verbatim date +%Y%m%d%H%M%S
4517     * @endverbatim
4518     */
4519    public const CacheEpoch = [
4520        'default' => '20030516000000',
4521    ];
4522
4523    /**
4524     * Directory where GitInfo will look for pre-computed cache files. If false,
4525     * $wgCacheDirectory/gitinfo will be used.
4526     */
4527    public const GitInfoCacheDirectory = [
4528        'default' => false,
4529    ];
4530
4531    /**
4532     * This will cache static pages for non-logged-in users to reduce
4533     * database traffic on public sites. ResourceLoader requests to default
4534     * language and skins are cached as well as single module requests.
4535     */
4536    public const UseFileCache = [
4537        'default' => false,
4538    ];
4539
4540    /**
4541     * Depth of the subdirectory hierarchy to be created under
4542     * $wgFileCacheDirectory.  The subdirectories will be named based on
4543     * the MD5 hash of the title.  A value of 0 means all cache files will
4544     * be put directly into the main file cache directory.
4545     */
4546    public const FileCacheDepth = [
4547        'default' => 2,
4548    ];
4549
4550    /**
4551     * Append a configured value to the parser cache and the sitenotice key so
4552     * that they can be kept separate for some class of activity.
4553     */
4554    public const RenderHashAppend = [
4555        'default' => '',
4556    ];
4557
4558    /**
4559     * If on, the sidebar navigation links are cached for users with the
4560     * current language set. This can save a touch of load on a busy site
4561     * by shaving off extra message lookups.
4562     *
4563     * However it is also fragile: changing the site configuration, or
4564     * having a variable $wgArticlePath, can produce broken links that
4565     * don't update as expected.
4566     */
4567    public const EnableSidebarCache = [
4568        'default' => false,
4569    ];
4570
4571    /**
4572     * Expiry time for the sidebar cache, in seconds
4573     */
4574    public const SidebarCacheExpiry = [
4575        'default' => 86400,
4576    ];
4577
4578    /**
4579     * When using the file cache, we can store the cached HTML gzipped to save disk
4580     * space. Pages will then also be served compressed to clients that support it.
4581     *
4582     * Requires zlib support enabled in PHP.
4583     */
4584    public const UseGzip = [
4585        'default' => false,
4586    ];
4587
4588    /**
4589     * Invalidate various caches when LocalSettings.php changes. This is equivalent
4590     * to setting $wgCacheEpoch to the modification time of LocalSettings.php, as
4591     * was previously done in the default LocalSettings.php file.
4592     *
4593     * On high-traffic wikis, this should be set to false, to avoid the need to
4594     * check the file modification time, and to avoid the performance impact of
4595     * unnecessary cache invalidations.
4596     */
4597    public const InvalidateCacheOnLocalSettingsChange = [
4598        'default' => true,
4599    ];
4600
4601    /**
4602     * When loading extensions through the extension registration system, this
4603     * can be used to invalidate the cache. A good idea would be to set this to
4604     * one file, you can just `touch` that one to invalidate the cache
4605     *
4606     * **Example:**
4607     *
4608     * ```
4609     * $wgExtensionInfoMTime = filemtime( "$IP/LocalSettings.php" );
4610     * ```
4611     *
4612     * If set to false, the mtime for each individual JSON file will be checked,
4613     * which can be slow if a large number of extensions are being loaded.
4614     */
4615    public const ExtensionInfoMTime = [
4616        'default' => false,
4617        'type' => 'integer|false',
4618    ];
4619
4620    /**
4621     * If this is set to true, phpunit will run integration tests against remote
4622     * caches defined in $wgObjectCaches.
4623     *
4624     * @since 1.38
4625     */
4626    public const EnableRemoteBagOStuffTests = [
4627        'default' => false,
4628    ];
4629
4630    // endregion -- end of cache settings
4631
4632    /***************************************************************************/
4633    // region   HTTP proxy (CDN) settings
4634    /** @name   HTTP proxy (CDN) settings
4635     *
4636     * Many of these settings apply to any HTTP proxy used in front of MediaWiki,
4637     * although they are sometimes still referred to as Squid settings for
4638     * historical reasons.
4639     *
4640     * Achieving a high hit ratio with an HTTP proxy requires special configuration.
4641     * See https://www.mediawiki.org/wiki/Manual:Performance_tuning#Page_view_caching
4642     * for more details.
4643     */
4644
4645    /**
4646     * Enable/disable CDN.
4647     *
4648     * See https://www.mediawiki.org/wiki/Manual:Performance_tuning#Page_view_caching
4649     *
4650     * @since 1.34 Renamed from $wgUseSquid.
4651     */
4652    public const UseCdn = [
4653        'default' => false,
4654    ];
4655
4656    /**
4657     * Add X-Forwarded-Proto to the Vary and Key headers for API requests and
4658     * RSS/Atom feeds. Use this if you have an SSL termination setup
4659     * and need to split the cache between HTTP and HTTPS for API requests,
4660     * feed requests and HTTP redirect responses in order to prevent cache
4661     * pollution. This does not affect 'normal' requests to index.php other than
4662     * HTTP redirects.
4663     */
4664    public const VaryOnXFP = [
4665        'default' => false,
4666    ];
4667
4668    /**
4669     * Internal server name as known to CDN, if different.
4670     *
4671     * **Example:**
4672     *
4673     * ```
4674     * $wgInternalServer = 'http://yourinternal.tld:8000';
4675     * ```
4676     */
4677    public const InternalServer = [
4678        'default' => false,
4679    ];
4680
4681    /**
4682     * Cache TTL for the CDN sent as s-maxage (without ESI) or
4683     * Surrogate-Control (with ESI). Without ESI, you should strip
4684     * out s-maxage in the CDN config.
4685     *
4686     * 18000 seconds = 5 hours, more cache hits with 2678400 = 31 days.
4687     *
4688     * @since 1.34 Renamed from $wgSquidMaxage
4689     */
4690    public const CdnMaxAge = [
4691        'default' => 18000,
4692    ];
4693
4694    /**
4695     * Cache timeout for the CDN when DB replica DB lag is high
4696     *
4697     * @see self::CdnMaxAge
4698     * @since 1.27
4699     */
4700    public const CdnMaxageLagged = [
4701        'default' => 30,
4702    ];
4703
4704    /**
4705     * Cache timeout when delivering a stale ParserCache response due to PoolCounter
4706     * contention.
4707     *
4708     * @since 1.35
4709     */
4710    public const CdnMaxageStale = [
4711        'default' => 10,
4712    ];
4713
4714    /**
4715     * If set, any SquidPurge call on a URL or URLs will send a second purge no less than
4716     * this many seconds later via the job queue. This requires delayed job support.
4717     *
4718     * This should be safely higher than the 'max lag' value in $wgLBFactoryConf, so that
4719     * replica DB lag does not cause page to be stuck in stales states in CDN.
4720     *
4721     * This also fixes race conditions in two-tiered CDN setups (e.g. cdn2 => cdn1 => MediaWiki).
4722     * If a purge for a URL reaches cdn2 before cdn1 and a request reaches cdn2 for that URL,
4723     * it will populate the response from the stale cdn1 value. When cdn1 gets the purge, cdn2
4724     * will still be stale. If the rebound purge delay is safely higher than the time to relay
4725     * a purge to all nodes, then the rebound purge will clear cdn2 after cdn1 was cleared.
4726     *
4727     * @since 1.27
4728     */
4729    public const CdnReboundPurgeDelay = [
4730        'default' => 0,
4731    ];
4732
4733    /**
4734     * Cache timeout for the CDN when a response is known to be wrong or incomplete (due to load)
4735     *
4736     * @see self::CdnMaxAge
4737     * @since 1.27
4738     */
4739    public const CdnMaxageSubstitute = [
4740        'default' => 60,
4741    ];
4742
4743    /**
4744     * Default maximum age for raw CSS/JS accesses
4745     *
4746     * 300 seconds = 5 minutes.
4747     */
4748    public const ForcedRawSMaxage = [
4749        'default' => 300,
4750    ];
4751
4752    /**
4753     * List of proxy servers to purge on changes; default port is 80. Use IP addresses.
4754     *
4755     * When MediaWiki is running behind a proxy, it will trust X-Forwarded-For
4756     * headers sent/modified from these proxies when obtaining the remote IP address
4757     *
4758     * For a list of trusted servers which *aren't* purged, see $wgSquidServersNoPurge.
4759     *
4760     * @since 1.34 Renamed from $wgSquidServers.
4761     */
4762    public const CdnServers = [
4763        'default' => [],
4764        'type' => 'map',
4765    ];
4766
4767    /**
4768     * As with $wgCdnServers, except these servers aren't purged on page changes;
4769     * use to set a list of trusted proxies, etc. Supports both individual IP
4770     * addresses and CIDR blocks.
4771     *
4772     * @since 1.23 Supports CIDR ranges
4773     * @since 1.34 Renamed from $wgSquidServersNoPurge
4774     */
4775    public const CdnServersNoPurge = [
4776        'default' => [],
4777        'type' => 'map',
4778    ];
4779
4780    /**
4781     * Routing configuration for HTCP multicast purging. Add elements here to
4782     * enable HTCP and determine which purges are sent where. If set to an empty
4783     * array, HTCP is disabled.
4784     *
4785     * Each key in this array is a regular expression to match against the purged
4786     * URL, or an empty string to match all URLs. The purged URL is matched against
4787     * the regexes in the order specified, and the first rule whose regex matches
4788     * is used, all remaining rules will thus be ignored.
4789     *
4790     * **Example configuration to send purges for upload.wikimedia.org to one**
4791     * multicast group and all other purges to another:
4792     *
4793     * ```
4794     * $wgHTCPRouting = [
4795     *         '|^https?://upload\.wikimedia\.org|' => [
4796     *                 'host' => '239.128.0.113',
4797     *                 'port' => 4827,
4798     *         ],
4799     *         '' => [
4800     *                 'host' => '239.128.0.112',
4801     *                 'port' => 4827,
4802     *         ],
4803     * ];
4804     * ```
4805     *
4806     * You can also pass an array of hosts to send purges too. This is useful when
4807     * you have several multicast groups or unicast address that should receive a
4808     * given purge.  Multiple hosts support was introduced in MediaWiki 1.22.
4809     *
4810     * **Example of sending purges to multiple hosts:**
4811     *
4812     * ```
4813     * $wgHTCPRouting = [
4814     *     '' => [
4815     *         // Purges to text caches using multicast
4816     *         [ 'host' => '239.128.0.114', 'port' => '4827' ],
4817     *         // Purges to a hardcoded list of caches
4818     *         [ 'host' => '10.88.66.1', 'port' => '4827' ],
4819     *         [ 'host' => '10.88.66.2', 'port' => '4827' ],
4820     *         [ 'host' => '10.88.66.3', 'port' => '4827' ],
4821     *     ],
4822     * ];
4823     * ```
4824     *
4825     * @since 1.22
4826     * @see self::HTCPMulticastTTL
4827     */
4828    public const HTCPRouting = [
4829        'default' => [],
4830        'type' => 'map',
4831    ];
4832
4833    /**
4834     * HTCP multicast TTL.
4835     *
4836     * @see self::HTCPRouting
4837     */
4838    public const HTCPMulticastTTL = [
4839        'default' => 1,
4840    ];
4841
4842    /**
4843     * Should forwarded Private IPs be accepted?
4844     */
4845    public const UsePrivateIPs = [
4846        'default' => false,
4847    ];
4848
4849    /**
4850     * Set this to false if MediaWiki is behind a CDN that re-orders query
4851     * parameters on incoming requests.
4852     *
4853     * MediaWiki sets a large 'Cache-Control: s-maxage=' directive on page
4854     * views only if the request URL matches one of the normal CDN URL forms.
4855     * When 'CdnMatchParameterOrder' is false, the matching algorithm ignores
4856     * the order of URL parameters.
4857     *
4858     * @since 1.39
4859     */
4860    public const CdnMatchParameterOrder = [
4861        'default' => true,
4862    ];
4863
4864    // endregion -- end of HTTP proxy settings
4865
4866    /***************************************************************************/
4867    // region   Language, regional and character encoding settings
4868    /** @name   Language, regional and character encoding settings */
4869
4870    /**
4871     * Site language code. See includes/Languages/Data/Names.php for languages
4872     * supported by MediaWiki out of the box. Not all languages listed there have
4873     * translations, see languages/messages/ for the list of languages with some
4874     * localisation.
4875     *
4876     * Warning: Don't use any of MediaWiki's deprecated language codes listed in
4877     * LanguageCode::getDeprecatedCodeMapping or $wgDummyLanguageCodes, like "no"
4878     * for Norwegian (use "nb" instead). If you do, things will break unexpectedly.
4879     *
4880     * This defines the default interface language for all users, but users can
4881     * change it in their preferences.
4882     *
4883     * This also defines the language of pages in the wiki. The content is wrapped
4884     * in a html element with lang=XX attribute. This behavior can be overridden
4885     * via hooks, see Title::getPageLanguage.
4886     */
4887    public const LanguageCode = [
4888        'default' => 'en',
4889    ];
4890
4891    /**
4892     * Some languages need different word forms, usually for different cases.
4893     *
4894     * Used in Language::convertGrammar().
4895     *
4896     * **Example:**
4897     *
4898     * ```
4899     * $wgGrammarForms['en']['genitive']['car'] = 'car\'s';
4900     * ```
4901     */
4902    public const GrammarForms = [
4903        'default' => [],
4904        'type' => 'map',
4905    ];
4906
4907    /**
4908     * Treat language links as magic connectors, not inline links
4909     */
4910    public const InterwikiMagic = [
4911        'default' => true,
4912    ];
4913
4914    /**
4915     * Hide interlanguage links from the sidebar
4916     */
4917    public const HideInterlanguageLinks = [
4918        'default' => false,
4919    ];
4920
4921    /**
4922     * List of additional interwiki prefixes that should be treated as
4923     * interlanguage links (i.e. placed in the sidebar).
4924     *
4925     * Notes:
4926     * - This will not do anything unless the prefixes are defined in the interwiki
4927     *   map.
4928     * - The display text for these custom interlanguage links will be fetched from
4929     *   the system message "interlanguage-link-xyz" where xyz is the prefix in
4930     *   this array.
4931     * - A friendly name for each site, used for tooltip text, may optionally be
4932     *   placed in the system message "interlanguage-link-sitename-xyz" where xyz is
4933     *   the prefix in this array.
4934     * - This should be a list of "interwiki prefixes" (ie, what appears in
4935     *   wikitext), and you probably want to add an entry to
4936     *   InterlanguageLinkCodeMap as well to specify which mediawiki internal
4937     *   (or custom) language code this prefix corresponds to, and perhaps
4938     *   then map that custom language code to a language name in
4939     *   ExtraLanguageNames.
4940     */
4941    public const ExtraInterlanguageLinkPrefixes = [
4942        'default' => [],
4943        'type' => 'list',
4944    ];
4945
4946    /**
4947     * Map of interlanguage link codes to language codes. This is useful to override
4948     * what is shown as the language name when the interwiki code does not match it
4949     * exactly
4950     *
4951     * @since 1.35
4952     */
4953    public const InterlanguageLinkCodeMap = [
4954        'default' => [],
4955        'type' => 'map',
4956    ];
4957
4958    /**
4959     * List of language names or overrides for default names in Names.php
4960     */
4961    public const ExtraLanguageNames = [
4962        'default' => [],
4963        'type' => 'map',
4964    ];
4965
4966    /**
4967     * List of mappings from one language code to another.
4968     *
4969     * This array makes the codes not appear as a selectable language on the
4970     * installer.
4971     *
4972     * In Setup.php, the variable $wgDummyLanguageCodes is created by combining
4973     * these codes with a list of "deprecated" codes, which are mostly leftovers
4974     * from renames or other legacy things, and the internal codes 'qqq' and 'qqx'.
4975     * If a mapping in $wgExtraLanguageCodes collide with a built-in mapping, the
4976     * value in $wgExtraLanguageCodes will be used.
4977     *
4978     * @since 1.29
4979     */
4980    public const ExtraLanguageCodes = [
4981        'default' => [
4982            'bh' => 'bho',
4983            'no' => 'nb',
4984            'simple' => 'en',
4985        ],
4986        'type' => 'map',
4987    ];
4988
4989    /**
4990     * Functionally the same as $wgExtraLanguageCodes, but deprecated. Instead of
4991     * appending values to this array, append them to $wgExtraLanguageCodes.
4992     *
4993     * @note Since 1.29, this should not be set directly in LocalSettings,
4994     *       ExtraLanguageCodes should be set instead. However, DummyLanguageCodes
4995     *       will be initialized and can be read internally.
4996     */
4997    public const DummyLanguageCodes = [
4998        'default' => [],
4999        'type' => 'map',
5000    ];
5001
5002    /**
5003     * Set this to always convert certain Unicode sequences to modern ones
5004     * regardless of the content language. This has a small performance
5005     * impact.
5006     *
5007     * @since 1.17
5008     */
5009    public const AllUnicodeFixes = [
5010        'default' => false,
5011    ];
5012
5013    /**
5014     * Set this to eg 'ISO-8859-1' to perform character set conversion when
5015     * loading old revisions not marked with "utf-8" flag. Use this when
5016     * converting a wiki from MediaWiki 1.4 or earlier to UTF-8 without the
5017     * burdensome mass conversion of old text data.
5018     *
5019     * @note This DOES NOT touch any fields other than old_text. Titles, comments,
5020     * user names, etc still must be converted en masse in the database before
5021     * continuing as a UTF-8 wiki.
5022     */
5023    public const LegacyEncoding = [
5024        'default' => false,
5025    ];
5026
5027    /**
5028     * Enable dates like 'May 12' instead of '12 May', if the default date format
5029     * is 'dmy or mdy'.
5030     */
5031    public const AmericanDates = [
5032        'default' => false,
5033    ];
5034
5035    /**
5036     * For Hindi and Arabic use local numerals instead of Western style (0-9)
5037     * numerals in interface.
5038     */
5039    public const TranslateNumerals = [
5040        'default' => true,
5041    ];
5042
5043    /**
5044     * Translation using MediaWiki: namespace.
5045     *
5046     * Interface messages will be loaded from the database.
5047     */
5048    public const UseDatabaseMessages = [
5049        'default' => true,
5050    ];
5051
5052    /**
5053     * Maximum entry size in the message cache, in bytes
5054     */
5055    public const MaxMsgCacheEntrySize = [
5056        'default' => 10000,
5057    ];
5058
5059    /**
5060     * Whether to enable language variant conversion.
5061     */
5062    public const DisableLangConversion = [
5063        'default' => false,
5064    ];
5065
5066    /**
5067     * Whether to enable language variant conversion for links.
5068     * Note that this option is slightly misnamed.
5069     */
5070    public const DisableTitleConversion = [
5071        'default' => false,
5072    ];
5073
5074    /**
5075     * Default variant code. If false, the default will be the static default
5076     * variant of the language.
5077     */
5078    public const DefaultLanguageVariant = [
5079        'default' => false,
5080    ];
5081
5082    /**
5083     * Whether to enable the pig Latin variant of English (en-x-piglatin),
5084     * used to ease variant development work.
5085     */
5086    public const UsePigLatinVariant = [
5087        'default' => false,
5088    ];
5089
5090    /**
5091     * Disabled variants array of language variant conversion.
5092     *
5093     * **Example:**
5094     *
5095     * ```
5096     * $wgDisabledVariants[] = 'zh-mo';
5097     * $wgDisabledVariants[] = 'zh-my';
5098     * ```
5099     */
5100    public const DisabledVariants = [
5101        'default' => [],
5102        'type' => 'map',
5103    ];
5104
5105    /**
5106     * Like $wgArticlePath, but on multi-variant wikis, this provides a
5107     * path format that describes which parts of the URL contain the
5108     * language variant.
5109     *
5110     * **Example:**
5111     *
5112     * ```
5113     * $wgLanguageCode = 'sr';
5114     * $wgVariantArticlePath = '/$2/$1';
5115     * $wgArticlePath = '/wiki/$1';
5116     * ```
5117     *
5118     * A link to /wiki/ would be redirected to /sr/Главна_страна
5119     *
5120     * It is important that $wgArticlePath not overlap with possible values
5121     * of $wgVariantArticlePath.
5122     */
5123    public const VariantArticlePath = [
5124        'default' => false,
5125    ];
5126
5127    /**
5128     * Whether to enable the 'x-xss' language code, used for development.
5129     *
5130     * When enabled, the language code 'x-xss' (e.g. via ?uselang=x-xss) can
5131     * be used to test correct message escaping at scale, to prevent
5132     * cross-site scripting. In this "language", every message becomes an HTML
5133     * snippet which attempts to alert the message key. Well-written code will
5134     * correctly escape all of these messages. If any alerts are actually
5135     * fired in the browser, the message is not being escaped correctly;
5136     * either the offending code should be fixed, or the message should be
5137     * added to {@link self::RawHtmlMessages}.
5138     *
5139     * @see https://www.mediawiki.org/wiki/Special:MyLanguage/Cross-site_scripting
5140     * @since 1.41
5141     */
5142    public const UseXssLanguage = [
5143        'default' => false,
5144    ];
5145
5146    /**
5147     * Show a bar of language selection links in the user login and user
5148     * registration forms; edit the "loginlanguagelinks" message to
5149     * customise these.
5150     */
5151    public const LoginLanguageSelector = [
5152        'default' => false,
5153    ];
5154
5155    /**
5156     * When translating messages with wfMessage(), it is not always clear what
5157     * should be considered UI messages and what should be content messages.
5158     *
5159     * For example, for the English Wikipedia, there should be only one 'mainpage',
5160     * so when getting the link for 'mainpage', we should treat it as site content
5161     * and call ->inContentLanguage()->text(), but for rendering the text of the
5162     * link, we call ->text(). The code behaves this way by default. However,
5163     * sites like the Wikimedia Commons do offer different versions of 'mainpage'
5164     * and the like for different languages. This array provides a way to override
5165     * the default behavior.
5166     *
5167     * **Example:**
5168     * To allow language-specific main page and community
5169     * portal:
5170     *
5171     * ```
5172     * $wgForceUIMsgAsContentMsg = [ 'mainpage', 'portal-url' ];
5173     * ```
5174     */
5175    public const ForceUIMsgAsContentMsg = [
5176        'default' => [],
5177        'type' => 'map',
5178    ];
5179
5180    /**
5181     * List of messages which might contain raw HTML.
5182     *
5183     * Extensions should add their insecure raw HTML messages to extension.json.
5184     * The list is used for access control:
5185     * changing messages listed here will require editsitecss and editsitejs rights.
5186     *
5187     * Message names must be given with underscores rather than spaces and with lowercase first
5188     * letter.
5189     *
5190     * @since 1.32
5191     */
5192    public const RawHtmlMessages = [
5193        'default' => [],
5194        'type' => 'list',
5195        'items' => [ 'type' => 'string', ],
5196    ];
5197
5198    /**
5199     * Fake out the timezone that the server thinks it's in. This will be used for
5200     * date display and not for what's stored in the DB. Leave to null to retain
5201     * your server's OS-based timezone value.
5202     *
5203     * This variable is currently used only for signature formatting and for local
5204     * time/date parser variables ({{LOCALTIME}} etc.)
5205     *
5206     * Timezones can be translated by editing MediaWiki messages of type
5207     * timezone-nameinlowercase like timezone-utc.
5208     *
5209     * A list of usable timezones can found at:
5210     * https://www.php.net/manual/en/timezones.php
5211     *
5212     * **Examples:**
5213     *
5214     * ```
5215     * $wgLocaltimezone = 'UTC';
5216     * $wgLocaltimezone = 'GMT';
5217     * $wgLocaltimezone = 'PST8PDT';
5218     * $wgLocaltimezone = 'Europe/Sweden';
5219     * $wgLocaltimezone = 'CET';
5220     * ```
5221     */
5222    public const Localtimezone = [
5223        'dynamicDefault' => true,
5224    ];
5225
5226    public static function getDefaultLocaltimezone(): string {
5227        // This defaults to the `date.timezone` value of the PHP INI option. If this option is not set,
5228        // it falls back to UTC.
5229        $localtimezone = date_default_timezone_get();
5230        if ( !$localtimezone ) {
5231            // Make doubly sure we have a valid time zone, even if date_default_timezone_get()
5232            // returned garbage.
5233            $localtimezone = 'UTC';
5234        }
5235
5236        return $localtimezone;
5237    }
5238
5239    /**
5240     * Set an offset from UTC in minutes to use for the default timezone setting
5241     * for anonymous users and new user accounts.
5242     *
5243     * This setting is used for most date/time displays in the software, and is
5244     * overridable in user preferences. It is *not* used for signature timestamps.
5245     *
5246     * By default, this will be set to match $wgLocaltimezone.
5247     */
5248    public const LocalTZoffset = [
5249        'dynamicDefault' => [ 'use' => [ 'Localtimezone' ] ]
5250    ];
5251
5252    public static function getDefaultLocalTZoffset( ?string $localtimezone ): int {
5253        // NOTE: Extra fallback, in case $localtimezone is ''.
5254        //       Many existing LocalSettings files have $wgLocaltimezone = ''
5255        //       in them, erroneously generated by the installer.
5256        $localtimezone = $localtimezone ?: self::getDefaultLocaltimezone();
5257
5258        try {
5259            $timezone = new DateTimeZone( $localtimezone );
5260        } catch ( \Exception $e ) {
5261            throw new ConfigException(
5262                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",
5263                    $localtimezone,
5264                    "wgLocaltimezone",
5265                    $e->getMessage() ),
5266            );
5267        }
5268
5269        $offset = $timezone->getOffset( new DateTime() );
5270
5271        return (int)( $offset / 60 );
5272    }
5273
5274    /**
5275     * Map of Unicode characters for which capitalization is overridden in
5276     * Language::ucfirst. The characters should be
5277     * represented as char_to_convert => conversion_override. See T219279 for details
5278     * on why this is useful during php version transitions.
5279     *
5280     * @since 1.34
5281     */
5282    public const OverrideUcfirstCharacters = [
5283        'default' => [],
5284        'type' => 'map',
5285    ];
5286
5287    // endregion -- End of language/charset settings
5288
5289    /***************************************************************************/
5290    // region   Output format and skin settings
5291    /** @name   Output format and skin settings */
5292
5293    /**
5294     * The default Content-Type header.
5295     */
5296    public const MimeType = [
5297        'default' => 'text/html',
5298    ];
5299
5300    /**
5301     * Defines the value of the version attribute in the &lt;html&gt; tag, if any.
5302     *
5303     * If your wiki uses RDFa, set it to the correct value for RDFa+HTML5.
5304     * Correct current values are 'HTML+RDFa 1.0' or 'XHTML+RDFa 1.0'.
5305     * See also https://www.w3.org/TR/rdfa-in-html/#document-conformance
5306     *
5307     * @since 1.16
5308     */
5309    public const Html5Version = [
5310        'default' => null,
5311    ];
5312
5313    /**
5314     * Whether to label the store-to-database-and-show-to-others button in the editor
5315     * as "Save page"/"Save changes" if false (the default) or, if true, instead as
5316     * "Publish page"/"Publish changes".
5317     *
5318     * @since 1.28
5319     */
5320    public const EditSubmitButtonLabelPublish = [
5321        'default' => false,
5322    ];
5323
5324    /**
5325     * Permit other namespaces in addition to the w3.org default.
5326     *
5327     * Use the prefix for the key and the namespace for the value.
5328     *
5329     * **Example:**
5330     *
5331     * ```
5332     * $wgXhtmlNamespaces['svg'] = 'http://www.w3.org/2000/svg';
5333     * ```
5334     *
5335     * Normally we wouldn't have to define this in the root "<html>"
5336     * element, but IE needs it there in some circumstances.
5337     *
5338     * This is ignored if $wgMimeType is set to a non-XML MIME type.
5339     */
5340    public const XhtmlNamespaces = [
5341        'default' => [],
5342        'type' => 'map',
5343    ];
5344
5345    /**
5346     * Site notice shown at the top of each page
5347     *
5348     * MediaWiki:Sitenotice page, which will override this. You can also
5349     * provide a separate message for logged-out users using the
5350     * MediaWiki:Anonnotice page.
5351     */
5352    public const SiteNotice = [
5353        'default' => '',
5354    ];
5355
5356    /**
5357     * Override the ability of certain browsers to attempt to autodetect dataformats in pages.
5358     *
5359     * This is a default feature of many mobile browsers, but can have a lot of false positives,
5360     * where for instance, year ranges are confused with phone numbers.
5361     * The default of this setting is to disable telephone number data detection.
5362     * Set BrowserFormatDetection to false to fallback to the browser defaults.
5363     *
5364     * @since 1.37
5365     * @see https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html
5366     */
5367    public const BrowserFormatDetection = [
5368        'default' => 'telephone=no',
5369        'type' => 'string',
5370    ];
5371
5372    /**
5373     * An array of open graph tags which should be added by all skins.
5374     *
5375     * Accepted values are "og:site_name", "og:title", "og:type" and "twitter:card".
5376     * Since some of these fields can be provided by extensions it defaults to an empty array.
5377     *
5378     * @since 1.36
5379     */
5380    public const SkinMetaTags = [
5381        'default' => [],
5382        'type' => 'map',
5383    ];
5384
5385    /**
5386     * Default skin, for new users and anonymous visitors. Registered users may
5387     * change this to any one of the other available skins in their preferences.
5388     */
5389    public const DefaultSkin = [
5390        'default' => 'vector-2022',
5391    ];
5392
5393    /**
5394     * Fallback skin used when the skin defined by $wgDefaultSkin can't be found.
5395     *
5396     * @since 1.24
5397     */
5398    public const FallbackSkin = [
5399        'default' => 'fallback',
5400    ];
5401
5402    /**
5403     * Specify the names of skins that should not be presented in the list of
5404     * available skins in user preferences.
5405     *
5406     * NOTE: This does not uninstall the skin, and it will still be accessible
5407     * via the `useskin` query parameter. To uninstall a skin, remove its inclusion
5408     * from LocalSettings.php.
5409     *
5410     * @see \SkinFactory::getAllowedSkins
5411     */
5412    public const SkipSkins = [
5413        'default' => [],
5414        'type' => 'map',
5415    ];
5416
5417    /**
5418     * Disable output compression (enabled by default if zlib is available)
5419     */
5420    public const DisableOutputCompression = [
5421        'default' => false,
5422    ];
5423
5424    /**
5425     * How should section IDs be encoded?
5426     * This array can contain 1 or 2 elements, each of them can be one of:
5427     * - 'html5'  is modern HTML5 style encoding with minimal escaping. Displays Unicode
5428     *            characters in most browsers' address bars.
5429     *
5430     * - 'legacy' is old MediaWiki-style encoding, e.g. 啤酒 turns into .E5.95.A4.E9.85.92
5431     *
5432     * The first element of this array specifies the primary mode of escaping IDs. This
5433     * is what users will see when they e.g. follow an [[#internal link]] to a section of
5434     * a page.
5435     *
5436     * The optional second element defines a fallback mode, useful for migrations.
5437     * If present, it will direct MediaWiki to add empty <span>s to every section with its
5438     * id attribute set to fallback encoded title so that links using the previous encoding
5439     * would still work.
5440     *
5441     * Example: you want to migrate your wiki from 'legacy' to 'html5'
5442     *
5443     * On the first step, set this variable to [ 'legacy', 'html5' ]. After a while, when
5444     * all caches (parser, HTTP, etc.) contain only pages generated with this setting,
5445     * flip the value to [ 'html5', 'legacy' ]. This will result in all internal links being
5446     * generated in the new encoding while old links (both external and cached internal) will
5447     * still work. After a long time, you might want to ditch backwards compatibility and
5448     * set it to [ 'html5' ]. After all, pages get edited, breaking incoming links no matter which
5449     * fragment mode is used.
5450     *
5451     * @since 1.30
5452     */
5453    public const FragmentMode = [
5454        'default' => [ 'html5', 'legacy', ],
5455        'type' => 'list',
5456    ];
5457
5458    /**
5459     * Which ID escaping mode should be used for external interwiki links? See documentation
5460     * for $wgFragmentMode above for details of each mode. Because you can't control external sites,
5461     * this setting should probably always be 'legacy', unless every wiki you link to has converted
5462     * to 'html5'.
5463     *
5464     * @since 1.30
5465     */
5466    public const ExternalInterwikiFragmentMode = [
5467        'default' => 'legacy',
5468    ];
5469
5470    /**
5471     * Abstract list of footer icons for skins in place of old copyrightico and poweredbyico code
5472     * You can add new icons to the built in copyright or poweredby, or you can create
5473     * a new block. Though note that you may need to add some custom css to get good styling
5474     * of new blocks in monobook. vector and modern should work without any special css.
5475     *
5476     * $wgFooterIcons itself is a key/value array.
5477     * The key is the name of a block that the icons will be wrapped in. The final id varies
5478     * by skin; Monobook and Vector will turn poweredby into f-poweredbyico while Modern
5479     * turns it into mw_poweredby.
5480     * The value is either key/value array of icons or a string.
5481     * In the key/value array the key may or may not be used by the skin but it can
5482     * be used to find the icon and unset it or change the icon if needed.
5483     * This is useful for disabling icons that are set by extensions.
5484     * The value should be either a string or an array. If it is a string it will be output
5485     * directly as html, however some skins may choose to ignore it. An array is the preferred
5486     * format for the icon, the following keys are used:
5487     * - src: An absolute url to the image to use for the icon, this is recommended
5488     *        but not required, however some skins will ignore icons without an image
5489     * - srcset: optional additional-resolution images; see HTML5 specs
5490     * - url: The url to use in the a element around the text or icon, if not set an a element will
5491     *        not be outputted
5492     * - alt: This is the text form of the icon, it will be displayed without an image in
5493     *        skins like Modern or if src is not set, and will otherwise be used as
5494     *        the alt="" for the image. This key is required.
5495     * - width and height: If the icon specified by src is not of the standard size
5496     *                     you can specify the size of image to use with these keys.
5497     *                     Otherwise they will default to the standard 88x31.
5498     *
5499     * @todo Reformat documentation.
5500     */
5501    public const FooterIcons = [
5502        'default' => [
5503            "copyright" => [
5504                "copyright" => [], // placeholder for the built in copyright icon
5505            ],
5506            "poweredby" => [
5507                "mediawiki" => [
5508                    // Defaults to point at
5509                    // "$wgResourceBasePath/resources/assets/poweredby_mediawiki_88x31.png"
5510                    // plus srcset for 2x resolution variant.
5511                    "src" => null,
5512                    "url" => "https://www.mediawiki.org/",
5513                    "alt" => "Powered by MediaWiki",
5514                    "lang" => "en",
5515                ]
5516            ],
5517        ],
5518        'type' => 'map',
5519    ];
5520
5521    /**
5522     * Enable sharing links to sections. Next to edit section link.
5523     *
5524     * Wider roll out on Wikimedia blocked on T431514
5525     *
5526     * @unstable
5527     */
5528    public const EnableSectionShare = [
5529        'default' => false,
5530    ];
5531
5532    /**
5533     * Login / create account link behavior when it's possible for anonymous users
5534     * to create an account.
5535     *
5536     * - true = use a combined login / create account link
5537     * - false = split login and create account into two separate links
5538     */
5539    public const UseCombinedLoginLink = [
5540        'default' => false,
5541    ];
5542
5543    /**
5544     * Display user edit counts in various prominent places.
5545     */
5546    public const Edititis = [
5547        'default' => false,
5548    ];
5549
5550    /**
5551     * Some web hosts attempt to rewrite all responses with a 404 (not found)
5552     * status code, mangling or hiding MediaWiki's output. If you are using such a
5553     * host, you should start looking for a better one. While you're doing that,
5554     * set this to false to convert some of MediaWiki's 404 responses to 200 so
5555     * that the generated error pages can be seen.
5556     *
5557     * In cases where for technical reasons it is more important for MediaWiki to
5558     * send the correct status code than for the body to be transmitted intact,
5559     * this configuration variable is ignored.
5560     */
5561    public const Send404Code = [
5562        'default' => true,
5563    ];
5564
5565    /**
5566     * The $wgShowRollbackEditCount variable is used to show how many edits can be rolled back.
5567     *
5568     * The numeric value of the variable controls how many edits MediaWiki will look back to
5569     * determine whether a rollback is allowed (by checking that they are all from the same author).
5570     * If the value is false or 0, the edits are not counted. Disabling this will prevent MediaWiki
5571     * from hiding some useless rollback links.
5572     *
5573     * @since 1.20
5574     */
5575    public const ShowRollbackEditCount = [
5576        'default' => 10,
5577    ];
5578
5579    /**
5580     * Output a <link rel="canonical"> tag on every page indicating the canonical
5581     * server which should be used, i.e. $wgServer or $wgCanonicalServer. Since
5582     * detection of the current server is unreliable, the link is sent
5583     * unconditionally.
5584     */
5585    public const EnableCanonicalServerLink = [
5586        'default' => false,
5587    ];
5588
5589    /**
5590     * List of interwiki logos overrides.
5591     * This is used by the sister project sidebar. This list accept a key equal to the
5592     * interwiki ID (as defined in the interwiki links), and accept a Codex icon name
5593     * (https://doc.wikimedia.org/codex/latest/icons/all-icons.html) or a base URL for
5594     * the given interwiki.
5595     *
5596     * Example :
5597     * $wgInterwikiLogoOverride = [
5598     *     'c' => 'logoWikimediaCommons',
5599     *     'wikit' => 'https://mySpecialWiki.com'
5600     * ];
5601     */
5602    public const InterwikiLogoOverride = [
5603        'default' => [],
5604        'type' => 'list',
5605        'items' => [ 'type' => 'string', ],
5606    ];
5607
5608    // endregion -- End of output format settings
5609
5610    /***************************************************************************/
5611    // region   ResourceLoader settings
5612    /** @name   ResourceLoader settings */
5613
5614    /**
5615     * Formerly a workaround for a security vulnerability caused by installation
5616     * of Flash as a browser extension.
5617     *
5618     * @since 1.25
5619     * @deprecated since 1.39
5620     */
5621    public const MangleFlashPolicy = [
5622        'default' => true,
5623        'obsolete' => 'Since 1.39; no longer has any effect.',
5624        'description' => 'Has been emitting warnings since 1.39 (LTS). ' .
5625            'Can be removed completely in 1.44, assuming 1.43 is an LTS release.'
5626    ];
5627
5628    /**
5629     * Define extra client-side modules to be registered with ResourceLoader.
5630     *
5631     * @note It is recommended to define modules using the `ResourceModule` attribute
5632     * in `extension.json` or `skin.json` when possible (instead of via PHP global variables).
5633     *
5634     * Registration is internally handled by ResourceLoader::register.
5635     *
5636     * ## Available modules
5637     *
5638     * Modules that ship with %MediaWiki core are registered via
5639     * resources/Resources.php. For a full list with documentation, see:
5640     * [ResourceLoader/Core_modules](https://www.mediawiki.org/wiki/ResourceLoader/Core_modules).
5641     *
5642     * ## Options
5643     *
5644     * - class `{string}`:
5645     *   By default a module is assumed to bundle file resources
5646     *   as handled by the MediaWiki\ResourceLoader\FileModule class. Use this option
5647     *   to use a different implementation of MediaWiki\ResourceLoader\Module instead.
5648     *
5649     *   Default: `\MediaWiki\ResourceLoader\FileModule`
5650     *
5651     * - factory `{string}`:
5652     *   Override the instantiation of the MediaWiki\ResourceLoader\Module
5653     *   class using a PHP callback. This allows dependency injection to be used.
5654     *   This option cannot be combined with the `class` option.
5655     *
5656     *   Since: MW 1.30
5657     *
5658     * - dependencies `{string[]|string}`:
5659     *   Modules that must be executed before this module.
5660     *   Module name string or list of module name strings.
5661     *
5662     *   Default: `[]`
5663     *
5664     * - deprecated `{boolean|string}`:
5665     *   Whether the module is deprecated and usage is discouraged.
5666     *   Set to boolean true, or a string to include in the warning message.
5667     *
5668     *   Default: `false`
5669     *
5670     * - group `{string}`:
5671     *   Optional request group to override which modules may be downloaded
5672     *   together in an HTTP batch request. By default, any two modules may be
5673     *   loaded together in the same batch request. Set this option to a
5674     *   descriptive string to give the module its own HTTP request. To allow
5675     *   other modules to join this new request, give those the same request group.
5676     *
5677     *   Use this option with caution. The default behaviour is well-tuned already,
5678     *   and setting this often does more harm than good. For more about request
5679     *   balancing optimisations, see
5680     *   [ResourceLoader/Architecture#Balance](https://www.mediawiki.org/wiki/ResourceLoader/Architecture#Balance).
5681     *
5682     * - skipFunction `{string}`:
5683     *   Allow this module to be satisfied as dependency without actually loading
5684     *   or executing scripts from the server, if the specified JavaScript function
5685     *   returns true.
5686     *
5687     *   Use this to provide polyfills that are natively available in newer browsers.
5688     *   Specify the relative path to a JavaScript file containing a top-level return
5689     *   statement. The contents of the file should not contain any wrapping function,
5690     *   it will be wrapped by %ResourceLoader in an anonymous function and invoked
5691     *   when the module is considered for loading.
5692     *
5693     * ## FileModule options
5694     *
5695     * - localBasePath `{string}`:
5696     *   Base file path to prepend to relative file paths specified in other options.
5697     *
5698     *   Default: `$IP`
5699     *
5700     * - remoteBasePath `{string}`:
5701     *   Base URL path to prepend to relative file paths specified in other options.
5702     *   This is used to form URLs for files, such as when referencing images in
5703     *   stylesheets, or in debug mode to serve JavaScript files directly.
5704     *
5705     *   Default: @ref $wgResourceBasePath (which defaults to @ref $wgScriptPath)
5706     *
5707     * - remoteExtPath `{string}`:
5708     *   Shortcut for `remoteBasePath` that is relative to $wgExtensionAssetsPath.
5709     *   Use this when defining modules from an extension, so as to avoid hardcoding
5710     *   the script path of the %MediaWiki install or the location of the extensions
5711     *   directory.
5712     *
5713     *   This option is mutually exclusive with `remoteBasePath`.
5714     *
5715     * - remoteSkinPath `{string}`: Like `remoteExtPath`, but relative to $wgStylePath.
5716     *
5717     * - styles `{string[]|string|array<string,array>}`:
5718     *   Styles to always include in the module.
5719     *   %File path or list of file paths, relative to `localBasePath`.
5720     *   The stylesheet can be automatically wrapped in a `@media` query by specifying
5721     *   the file path as the key in an object (instead of the value), with the value
5722     *   specifying a `media` query.
5723     *
5724     *   See @ref wgResourceModules-example-stylesheet "Stylesheet examples" below.
5725     *
5726     *   See also @ref $wgResourceModuleSkinStyles.
5727     *
5728     *   Extended options:
5729     *
5730     *   - skinStyles `{string[]|string}`: Styles to include in specific skin contexts.
5731     *     Array keyed is by skin name with file path or list of file paths as value,
5732     *     relative to `localBasePath`.
5733     *
5734     *   Default: `[]`
5735     *
5736     * - noflip `{boolean}`:
5737     *   By default, CSSJanus will be used automatically to perform LTR-to-RTL flipping
5738     *   when loaded in a right-to-left (RTL) interface language context.
5739     *   Use this option to skip CSSJanus LTR-to-RTL flipping for this module, for example
5740     *   when registering an external library that already handles RTL styles.
5741     *
5742     *   Default: `false`
5743     *
5744     * - packageFiles `{string[]|array[]}`
5745     *   Specify script files and (virtual) data files to include in the module.
5746     *   Each internal JavaScript file retains its own local module scope and its
5747     *   private exports can be accessed separately by other client-side code in the
5748     *   same module, via the local `require()` function.
5749     *
5750     *   Modules that use package files should export any public API methods using
5751     *   `module.exports`.
5752     *
5753     *   See examples at
5754     *     [ResourceLoader/Package_files](https://www.mediawiki.org/wiki/ResourceLoader/Package_files)
5755     *     on mediawiki.org.
5756     *
5757     *   The `packageFiles` feature cannot be combined with legacy scripts that use
5758     *   the `scripts` option, including its extended variants `languageScripts`,
5759     *   `skinScripts`, and `debugScripts`.
5760     *
5761     *   Since: MW 1.33
5762     *
5763     *   Default: `[]`
5764     *
5765     * - scripts `{string[]|string|array[]}`:
5766     *   Scripts to always include in the module.
5767     *   %File path or list of file paths, relative to `localBasePath`.
5768     *
5769     *   These files are concatenated blindly and executed as a single client-side script.
5770     *   Modules using this option are sometimes referred to as "legacy scripts" to
5771     *   distinguish them from those that use the `packageFiles` option.
5772     *
5773     *   Modules that use legacy scripts usually attach any public APIs they have
5774     *   to the `mw` global variable. If a module contains just one file, it is also
5775     *   supported to use the newer `module.exports` mechanism, though if the module
5776     *   contains more than one legacy script, it is considered unsafe and unsupported
5777     *   to use this mechanism (use `packageFiles` instead). See also
5778     *   [Coding
5779     *     conventions/JavaScript](https://www.mediawiki.org/wiki/Manual:Coding_conventions/JavaScript#Exporting).
5780     *
5781     *   Since MW 1.41, an element of `scripts` may be an array in the same format as
5782     *   packageFiles, giving a callback to call for content generation.
5783     *
5784     *   Default: `[]`
5785     *
5786     *   Extended options, concatenated in this order:
5787     *
5788     *   - languageScripts `{string[]|string|array[]}`: Scripts to include in specific
5789     *     language contexts. Array is keyed by language code with file path or list of
5790     *     file path.
5791     *   - skinScripts `{string[]|string|array[]}`: Scripts to include in specific skin contexts.
5792     *     Array keyed is by skin name with file path or list of file paths.
5793     *   - debugScripts `{string[]|string|array[]}`: Scripts to include in debug contexts.
5794     *     %File path or list of file paths.
5795     *
5796     * - messages `{string[]}`
5797     *   Localisation messages to bundle with this module, for client-side use
5798     *   via `mw.msg()` and `mw.message()`. List of message keys.
5799     *
5800     *   Default: `[]`
5801     *
5802     * - templates `{string[]}`
5803     *   List of template files to be loaded for client-side usage via `mw.templates`.
5804     *
5805     *   Default: `[]`
5806     *
5807     * - es6 `{boolean}`:
5808     *   Since: MW 1.36; ignored since MW 1.41.
5809     *
5810     *   Default: `true`
5811     *
5812     *  - skipStructureTest `{boolean}`:
5813     *   Whether to skip ResourcesTest::testRespond(). Since MW 1.42.
5814     *
5815     *   Default: `false`.
5816     *
5817     * ## Examples
5818     *
5819     * **Example: Using an alternate subclass**
5820     *
5821     * ```
5822     * $wgResourceModules['ext.myExtension'] = [
5823     *   'class' => \MediaWiki\ResourceLoader\WikiModule::class,
5824     * ];
5825     * ```
5826     *
5827     * **Example: Deprecated module**
5828     *
5829     * ```
5830     * $wgResourceModules['ext.myExtension'] = [
5831     *   'deprecated' => 'You should use ext.myExtension2 instead',
5832     * ];
5833     * ```
5834     *
5835     * **Example: Base paths in extension.json**
5836     *
5837     * ```
5838     * "ext.myExtension": {
5839     *   "localBasePath": "modules/ext.MyExtension",
5840     *   "remoteExtPath": "MyExtension/modules/ext.MyExtension"
5841     * }
5842     * ```
5843     *
5844     * **Example: Base paths in core with PHP**
5845     *
5846     * ```
5847     * $wgResourceModules['mediawiki.example'] = [
5848     *   'localBasePath' => "$IP/resources/src/mediawiki.example",
5849     *   'remoteBasePath' => "$wgResourceBasePath/resources/src/mediawiki.example",
5850     * ];
5851     * ```
5852     *
5853     * **Example: Define a skip function**
5854     *
5855     * ```
5856     * $wgResourceModules['ext.myExtension.SomeWebAPI'] = [
5857     *   'skipFunction' => 'skip-SomeWebAPI.js',
5858     * ];
5859     * ```
5860     *
5861     * **Example: Contents of skip function file**
5862     *
5863     * ```
5864     * return typeof SomeWebAPI === 'function' && SomeWebAPI.prototype.duckMethod;
5865     * ```
5866     * @anchor wgResourceModules-example-stylesheet
5867     *
5868     * **Example: Stylesheets**
5869     *
5870     * ```
5871     * $wgResourceModules['example'] = [
5872     *   'styles' => [
5873     *     'foo.css',
5874     *     'bar.css',
5875     *   ],
5876     * ];
5877     * $wgResourceModules['example.media'] = [
5878     *   'styles' => [
5879     *     'foo.css' => [ 'media' => 'print' ],
5880     * ];
5881     * $wgResourceModules['example.mixed'] = [
5882     *   'styles' => [
5883     *     'foo.css',
5884     *     'bar.css' => [ 'media' => 'print' ],
5885     *   ],
5886     * ];
5887     * ```
5888     *
5889     * **Example: Package files**
5890     *
5891     * ```
5892     * "ext.myExtension": {
5893     *     "localBasePath": "modules/ext.MyExtension",
5894     *     "remoteExtPath": "MyExtension/modules/ext.MyExtension",
5895     *     "packageFiles": [
5896     *       "index.js",
5897     *       "utils.js",
5898     *       "data.json"
5899     *     ]
5900     *   }
5901     * }
5902     * ```
5903     *
5904     * **Example: Legacy scripts**
5905     *
5906     * ```
5907     * $wgResourceModules['ext.myExtension'] = [
5908     *   'scripts' => [
5909     *     'modules/ext.myExtension/utils.js',
5910     *     'modules/ext.myExtension/myExtension.js',
5911     *   ],
5912     *   'languageScripts' => [
5913     *     'bs' => 'modules/ext.myExtension/languages/bs.js',
5914     *     'fi' => 'modules/ext.myExtension/languages/fi.js',
5915     *   ],
5916     *   'skinScripts' => [
5917     *     'default' => 'modules/ext.myExtension/skin-default.js',
5918     *   ],
5919     *   'debugScripts' => [
5920     *     'modules/ext.myExtension/debug.js',
5921     *   ],
5922     * ];
5923     * ```
5924     *
5925     * **Example: Template files**
5926     *
5927     * ```
5928     * $wgResourceModules['ext.myExtension'] = [
5929     *   'templates' => [
5930     *     'templates/template.html',
5931     *     'templates/template2.html',
5932     *   ],
5933     * ];
5934     * ```
5935     * @since 1.17
5936     */
5937    public const ResourceModules = [
5938        'default' => [],
5939        'type' => 'map',
5940    ];
5941
5942    /**
5943     * Add extra skin-specific styles to a resource module.
5944     *
5945     * These are automatically added by ResourceLoader to the 'skinStyles' list of
5946     * the existing module. The 'styles' list cannot be modified or disabled.
5947     *
5948     * For example, below a module "bar" is defined and skin Foo provides additional
5949     * styles for it:
5950     *
5951     * **Example:**
5952     *
5953     * ```
5954     * $wgResourceModules['bar'] = [
5955     *   'scripts' => 'resources/bar/bar.js',
5956     *   'styles' => 'resources/bar/main.css',
5957     * ];
5958     *
5959     * $wgResourceModuleSkinStyles['foo'] = [
5960     *   'bar' => 'skins/Foo/styles/bar.css',
5961     * ];
5962     * ```
5963     *
5964     * This is effectively equivalent to:
5965     *
5966     * **Equivalent:**
5967     *
5968     * ```
5969     * $wgResourceModules['bar'] = [
5970     *   'scripts' => 'resources/bar/bar.js',
5971     *   'styles' => 'resources/bar/main.css',
5972     *   'skinStyles' => [
5973     *     'foo' => skins/Foo/styles/bar.css',
5974     *   ],
5975     * ];
5976     * ```
5977     *
5978     * If the module already defines its own entry in `skinStyles` for a given skin, then
5979     * $wgResourceModuleSkinStyles is ignored.
5980     *
5981     * If a module defines a `skinStyles['default']` the skin may want to extend that instead
5982     * of replacing it. This can be done using the `+` prefix.
5983     *
5984     * **Example:**
5985     *
5986     * ```
5987     * $wgResourceModules['bar'] = [
5988     *   'scripts' => 'resources/bar/bar.js',
5989     *   'styles' => 'resources/bar/basic.css',
5990     *   'skinStyles' => [
5991     *    'default' => 'resources/bar/additional.css',
5992     *   ],
5993     * ];
5994     * // Note the '+' character:
5995     * $wgResourceModuleSkinStyles['foo'] = [
5996     *   '+bar' => 'skins/Foo/styles/bar.css',
5997     * ];
5998     * ```
5999     *
6000     * This is effectively equivalent to:
6001     *
6002     * **Equivalent:**
6003     *
6004     * ```
6005     * $wgResourceModules['bar'] = [
6006     *   'scripts' => 'resources/bar/bar.js',
6007     *   'styles' => 'resources/bar/basic.css',
6008     *   'skinStyles' => [
6009     *     'default' => 'resources/bar/additional.css',
6010     *     'foo' => [
6011     *       'resources/bar/additional.css',
6012     *       'skins/Foo/styles/bar.css',
6013     *     ],
6014     *   ],
6015     * ];
6016     * ```
6017     *
6018     * In other words, as a module author, use the `styles` list for stylesheets that may not be
6019     * disabled by a skin. To provide default styles that may be extended or replaced,
6020     * use `skinStyles['default']`.
6021     *
6022     * As with $wgResourceModules, always set the localBasePath and remoteBasePath
6023     * keys (or one of remoteExtPath/remoteSkinPath).
6024     *
6025     * **Example:**
6026     *
6027     * ```
6028     * $wgResourceModuleSkinStyles['foo'] = [
6029     *   'bar' => 'bar.css',
6030     *   'quux' => 'quux.css',
6031     *   'remoteSkinPath' => 'Foo/styles',
6032     *   'localBasePath' => __DIR__ . '/styles',
6033     * ];
6034     * ```
6035     */
6036    public const ResourceModuleSkinStyles = [
6037        'default' => [],
6038        'type' => 'map',
6039    ];
6040
6041    /**
6042     * Extensions should register foreign module sources here. 'local' is a
6043     * built-in source that is not in this array, but defined by
6044     * ResourceLoader::__construct() so that it cannot be unset.
6045     *
6046     * **Example:**
6047     *
6048     * ```
6049     * $wgResourceLoaderSources['foo'] = 'http://example.org/w/load.php';
6050     * ```
6051     */
6052    public const ResourceLoaderSources = [
6053        'default' => [],
6054        'type' => 'map',
6055    ];
6056
6057    /**
6058     * The default 'remoteBasePath' value for instances of MediaWiki\ResourceLoader\FileModule.
6059     *
6060     * Defaults to $wgScriptPath.
6061     */
6062    public const ResourceBasePath = [
6063        'default' => null,
6064        'dynamicDefault' => [ 'use' => [ 'ScriptPath' ] ]
6065    ];
6066
6067    /**
6068     * @param mixed $scriptPath Value of ScriptPath
6069     * @return string
6070     */
6071    public static function getDefaultResourceBasePath( $scriptPath ): string {
6072        return $scriptPath;
6073    }
6074
6075    /**
6076     * Override how long a CDN or browser may cache a ResourceLoader HTTP response.
6077     *
6078     * Maximum time in seconds. Used for the `max-age` and `s-maxage` Cache-Control headers.
6079     *
6080     * Valid keys:
6081     *   - versioned
6082     *   - unversioned
6083     *
6084     * @see \MediaWiki\ResourceLoader\ResourceLoader::__construct
6085     * @since 1.35
6086     */
6087    public const ResourceLoaderMaxage = [
6088        'default' => [],
6089        'type' => 'map',
6090    ];
6091
6092    /**
6093     * The default debug mode (on/off) for of ResourceLoader requests.
6094     *
6095     * This will still be overridden when the debug URL parameter is used.
6096     */
6097    public const ResourceLoaderDebug = [
6098        'default' => false,
6099    ];
6100
6101    /**
6102     * ResourceLoader will not generate URLs whose query string is more than
6103     * this many characters long, and will instead use multiple requests with
6104     * shorter query strings. Using multiple requests may degrade performance,
6105     * but may be needed based on the query string limit supported by your web
6106     * server and/or your user's web browsers.
6107     *
6108     * Default: `2000`.
6109     *
6110     * @see \MediaWiki\ResourceLoader\StartUpModule::getMaxQueryLength
6111     * @since 1.17
6112     */
6113    public const ResourceLoaderMaxQueryLength = [
6114        'default' => false,
6115        'type' => 'integer|false',
6116    ];
6117
6118    /**
6119     * Validate JavaScript code loaded from wiki pages.
6120     *
6121     * If a syntax error is found, the script is replaced with a warning
6122     * logged to the browser console. This ensures errors are found early and
6123     * consistently (independent of the editor's own browser), and prevents
6124     * breaking other modules loaded in the same batch from load.php.
6125     *
6126     * @see \MediaWiki\ResourceLoader\Module::validateScriptFile
6127     */
6128    public const ResourceLoaderValidateJS = [
6129        'default' => true,
6130    ];
6131
6132    /**
6133     * When enabled, execution of JavaScript modules is profiled client-side.
6134     *
6135     * Instrumentation happens in mw.loader.profiler.
6136     * Use `mw.inspect('time')` from the browser console to display the data.
6137     *
6138     * @since 1.32
6139     */
6140    public const ResourceLoaderEnableJSProfiler = [
6141        'default' => false,
6142    ];
6143
6144    /**
6145     * Whether ResourceLoader should attempt to persist modules in localStorage on
6146     * browsers that support the Web Storage API.
6147     */
6148    public const ResourceLoaderStorageEnabled = [
6149        'default' => true,
6150    ];
6151
6152    /**
6153     * Cache version for client-side ResourceLoader module storage. You can trigger
6154     * invalidation of the contents of the module store by incrementing this value.
6155     *
6156     * @since 1.23
6157     */
6158    public const ResourceLoaderStorageVersion = [
6159        'default' => 1,
6160    ];
6161
6162    /**
6163     * Whether to include a SourceMap header in ResourceLoader responses
6164     * for JavaScript modules.
6165     *
6166     * @since 1.41
6167     */
6168    public const ResourceLoaderEnableSourceMapLinks = [
6169        'default' => true,
6170    ];
6171
6172    /**
6173     * Whether to allow site-wide CSS (MediaWiki:Common.css and friends) on
6174     * restricted pages like Special:UserLogin or Special:Preferences where
6175     * JavaScript is disabled for security reasons. As it is possible to
6176     * execute JavaScript through CSS, setting this to true opens up a
6177     * potential security hole. Some sites may "skin" their wiki by using
6178     * site-wide CSS, causing restricted pages to look unstyled and different
6179     * from the rest of the site.
6180     *
6181     * @since 1.25
6182     */
6183    public const AllowSiteCSSOnRestrictedPages = [
6184        'default' => false,
6185    ];
6186
6187    /**
6188     * Whether to use the development version of Vue.js. This should be disabled
6189     * for production installations. For development installations, enabling this
6190     * provides useful additional warnings and checks.
6191     *
6192     * Even when this is disabled, using ResourceLoader's debug mode (?debug=true)
6193     * will cause the development version to be loaded.
6194     *
6195     * @since 1.35
6196     */
6197    public const VueDevelopmentMode = [
6198        'default' => false,
6199    ];
6200
6201    /**
6202     * If this is set, MediaWiki will look for Codex files in this directory
6203     * instead of in resources/lib/codex/ and friends.
6204     *
6205     * To use a local development version of Codex, set this to the full file
6206     * path of the root directory of a local clone of the Codex repository, and
6207     * run `npm run build-all` in the Codex root directory. Rerun this command
6208     * after making any changes.
6209     *
6210     * This should be disabled for production installations.
6211     *
6212     * @since 1.43
6213     */
6214    public const CodexDevelopmentDir = [
6215        'default' => null,
6216    ];
6217
6218    // endregion -- End of ResourceLoader settings
6219
6220    /***************************************************************************/
6221    // region   Page titles and redirects
6222    /** @name   Page titles and redirects */
6223
6224    /**
6225     * Name of the project namespace. If left set to false, $wgSitename will be
6226     * used instead.
6227     */
6228    public const MetaNamespace = [
6229        'default' => false,
6230        'dynamicDefault' => [ 'use' => [ 'Sitename' ] ]
6231    ];
6232
6233    /**
6234     * @param mixed $sitename Value of Sitename
6235     * @return string
6236     */
6237    public static function getDefaultMetaNamespace( $sitename ): string {
6238        return str_replace( ' ', '_', $sitename );
6239    }
6240
6241    /**
6242     * Name of the project talk namespace.
6243     *
6244     * Normally you can ignore this and it will be something like
6245     * $wgMetaNamespace . "_talk". In some languages, you may want to set this
6246     * manually for grammatical reasons.
6247     */
6248    public const MetaNamespaceTalk = [
6249        'default' => false,
6250    ];
6251
6252    /**
6253     * Canonical namespace names.
6254     *
6255     * Must not be changed directly in configuration or by extensions, use $wgExtraNamespaces
6256     * instead.
6257     */
6258    public const CanonicalNamespaceNames = [
6259        'default' => NamespaceInfo::CANONICAL_NAMES,
6260        'type' => 'map',
6261    ];
6262
6263    /**
6264     * Additional namespaces. If the namespaces defined in Language.php and
6265     * Namespace.php are insufficient, you can create new ones here, for example,
6266     * to import Help files in other languages. You can also override the namespace
6267     * names of existing namespaces. Extensions should use the CanonicalNamespaces
6268     * hook or extension.json.
6269     *
6270     * @warning Once you delete a namespace, the pages in that namespace will
6271     * no longer be accessible. If you rename it, then you can access them through
6272     * the new namespace name.
6273     *
6274     * Custom namespaces should start at 100 to avoid conflicting with standard
6275     * namespaces, and should always follow the even/odd main/talk pattern.
6276     *
6277     * **Example:**
6278     *
6279     * ```
6280     * $wgExtraNamespaces = [
6281     *    100 => "Hilfe",
6282     *    101 => "Hilfe_Diskussion",
6283     *    102 => "Aide",
6284     *    103 => "Discussion_Aide"
6285     * ];
6286     * ```
6287     * @todo Add a note about maintenance/namespaceDupes.php
6288     */
6289    public const ExtraNamespaces = [
6290        'default' => [],
6291        'type' => 'map',
6292    ];
6293
6294    /**
6295     * Same as above, but for namespaces with gender distinction.
6296     *
6297     * Note: the default form for the namespace should also be set
6298     * using $wgExtraNamespaces for the same index.
6299     *
6300     * @since 1.18
6301     */
6302    public const ExtraGenderNamespaces = [
6303        'default' => [],
6304        'type' => 'map',
6305    ];
6306
6307    /**
6308     * Define extra namespace aliases.
6309     *
6310     * These are alternate names for the primary localised namespace names, which
6311     * are defined by $wgExtraNamespaces and the language file. If a page is
6312     * requested with such a prefix, the request will be redirected to the primary
6313     * name.
6314     *
6315     * Set this to a map from namespace names to IDs.
6316     *
6317     * **Example:**
6318     *
6319     * ```
6320     * $wgNamespaceAliases = [
6321     *     'Wikipedian' => NS_USER,
6322     *     'Help' => 100,
6323     * ];
6324     * ```
6325     *
6326     * @see \MediaWiki\Language\Language::getNamespaceAliases for accessing the full list of aliases,
6327     * including those defined by other means.
6328     */
6329    public const NamespaceAliases = [
6330        'default' => [],
6331        'type' => 'map',
6332    ];
6333
6334    /**
6335     * Allowed title characters -- regex character class
6336     * Don't change this unless you know what you're doing
6337     *
6338     * Problematic punctuation:
6339     *   -  []}|#     Are needed for link syntax, never enable these
6340     *   -  <>        Causes problems with HTML escaping, don't use
6341     *   -  %         Enabled by default, minor problems with path to query rewrite rules, see below
6342     *   -  +         Enabled by default, but doesn't work with path to query rewrite rules,
6343     *                corrupted by apache
6344     *   -  ?         Enabled by default, but doesn't work with path to PATH_INFO rewrites
6345     *
6346     * All three of these punctuation problems can be avoided by using an alias,
6347     * instead of a rewrite rule of either variety.
6348     *
6349     * The problem with % is that when using a path to query rewrite rule, URLs are
6350     * double-unescaped: once by Apache's path conversion code, and again by PHP. So
6351     * %253F, for example, becomes "?". Our code does not double-escape to compensate
6352     * for this, indeed double escaping would break if the double-escaped title was
6353     * passed in the query string rather than the path. This is a minor security issue
6354     * because articles can be created such that they are hard to view or edit.
6355     *
6356     * In some rare cases you may wish to remove + for compatibility with old links.
6357     * @deprecated since 1.41; use Extension:TitleBlacklist or (soon)
6358     * Extension:AbuseFilter to customize this set.
6359     */
6360    public const LegalTitleChars = [
6361        'default' => ' %!"$&\'()*,\\-.\\/0-9:;=?@A-Z\\\\^_`a-z~\\x80-\\xFF+',
6362        'deprecated' => 'since 1.41; use Extension:TitleBlacklist to customize',
6363    ];
6364
6365    /**
6366     * Set this to false to avoid forcing the first letter of links to capitals.
6367     *
6368     * @warning may break links! This makes links COMPLETELY case-sensitive. Links
6369     * appearing with a capital at the beginning of a sentence will *not* go to the
6370     * same place as links in the middle of a sentence using a lowercase initial.
6371     */
6372    public const CapitalLinks = [
6373        'default' => true,
6374    ];
6375
6376    /**
6377     * @since 1.16 - This can now be set per-namespace. Some special namespaces (such as Special,
6378     *     see NamespaceInfo::ALWAYS_CAPITALIZED_NAMESPACES for the full list) must be true by
6379     *     default (and setting them has no effect), due to various things that require them to be
6380     *     so. Also, since Talk namespaces need to directly mirror their associated content
6381     *     namespaces, the values for those are ignored in favor of the subject namespace's
6382     *     setting. Setting for NS_MEDIA is taken automatically from NS_FILE.
6383     *
6384     * **Example:**
6385     *
6386     * ```
6387     * $wgCapitalLinkOverrides[ NS_FILE ] = false;
6388     * ```
6389     */
6390    public const CapitalLinkOverrides = [
6391        'default' => [],
6392        'type' => 'map',
6393    ];
6394
6395    /**
6396     * Which namespaces should support subpages?
6397     * See Language.php for a list of namespaces.
6398     */
6399    public const NamespacesWithSubpages = [
6400        'default' => [
6401            NS_TALK => true,
6402            NS_USER => true,
6403            NS_USER_TALK => true,
6404            NS_PROJECT => true,
6405            NS_PROJECT_TALK => true,
6406            NS_FILE_TALK => true,
6407            NS_MEDIAWIKI => true,
6408            NS_MEDIAWIKI_TALK => true,
6409            NS_TEMPLATE => true,
6410            NS_TEMPLATE_TALK => true,
6411            NS_HELP => true,
6412            NS_HELP_TALK => true,
6413            NS_CATEGORY_TALK => true
6414        ],
6415        'type' => 'map',
6416    ];
6417
6418    /**
6419     * Namespaces to have auto-summary disabled for edits.
6420     * See Language.php for a list of namespaces.
6421     *
6422     * For example, namespaces with limited access can be added to avoid page contents
6423     * being leaked in edit summaries.
6424     *
6425     * @since 1.46
6426     */
6427    public const NamespacesWithoutAutoSummaries = [
6428        'default' => [],
6429        'type' => 'list',
6430    ];
6431
6432    /**
6433     * Array of namespaces which can be deemed to contain valid "content", as far
6434     * as the site statistics are concerned. Useful if additional namespaces also
6435     * contain "content" which should be considered when generating a count of the
6436     * number of articles in the wiki.
6437     */
6438    public const ContentNamespaces = [
6439        'default' => [ NS_MAIN ],
6440        'type' => 'list',
6441    ];
6442
6443    /**
6444     * Optional array of namespaces which should be excluded from Special:ShortPages.
6445     *
6446     * Only pages inside $wgContentNamespaces but not $wgShortPagesNamespaceExclusions will
6447     * be shown on that page.
6448     *
6449     * @since 1.37; previously $wgShortPagesNamespaceBlacklist
6450     */
6451    public const ShortPagesNamespaceExclusions = [
6452        'default' => [],
6453        'type' => 'list',
6454    ];
6455
6456    /**
6457     * Array of namespaces, in addition to the talk namespaces, where signatures
6458     * (~~~~) are likely to be used. This determines whether to display the
6459     * Signature button on the edit toolbar, and may also be used by extensions.
6460     *
6461     * For example, "traditional" style wikis, where content and discussion are
6462     * intermixed, could place NS_MAIN and NS_PROJECT namespaces in this array.
6463     */
6464    public const ExtraSignatureNamespaces = [
6465        'default' => [],
6466        'type' => 'list',
6467    ];
6468
6469    /**
6470     * Array of invalid page redirect targets.
6471     *
6472     * Attempting to create a redirect to any of the pages in this array
6473     * will make the redirect fail.
6474     * Userlogout is hard-coded, so it does not need to be listed here.
6475     * (T12569) Disallow Mypage and Mytalk as well.
6476     *
6477     * As of now, this only checks special pages. Redirects to pages in
6478     * other namespaces cannot be invalidated by this variable.
6479     */
6480    public const InvalidRedirectTargets = [
6481        'default' => [ 'Filepath', 'Mypage', 'Mytalk', 'Redirect', 'Mylog' ],
6482        'type' => 'list',
6483    ];
6484
6485    /**
6486     * Disable redirects to special pages and interwiki redirects, which use a 302
6487     * and have no "redirected from" link.
6488     *
6489     * @note This is only for articles with #REDIRECT in them. URL's containing a
6490     * local interwiki prefix (or a non-canonical special page name) are still hard
6491     * redirected regardless of this setting.
6492     */
6493    public const DisableHardRedirects = [
6494        'default' => false,
6495    ];
6496
6497    /**
6498     * Fix double redirects after a page move.
6499     *
6500     * Tends to conflict with page move vandalism, use only on a private wiki.
6501     */
6502    public const FixDoubleRedirects = [
6503        'default' => false,
6504    ];
6505
6506    // endregion -- End of title and interwiki settings
6507
6508    /***************************************************************************/
6509    // region   Interwiki links and sites
6510    /** @name   Interwiki links and sites */
6511
6512    /**
6513     * Array for local interwiki values, for each of the interwiki prefixes that point to
6514     * the current wiki.
6515     *
6516     * Note, recent changes feeds use only the first entry in this array. See $wgRCFeeds.
6517     */
6518    public const LocalInterwikis = [
6519        'default' => [],
6520        'type' => 'list',
6521    ];
6522
6523    /**
6524     * Expiry time for cache of interwiki table
6525     */
6526    public const InterwikiExpiry = [
6527        'default' => 10800,
6528    ];
6529
6530    /**
6531     * Interwiki cache as an associative array.
6532     *
6533     * When set, the InterwikiLookup service will not use the built-in `interwiki` database table,
6534     * but instead use this static array as its source.
6535     *
6536     * This cache data structure can be generated by the `dumpInterwiki.php` maintenance
6537     * script (which lives in the WikimediaMaintenance repository) and has key
6538     * formats such as the following:
6539     *
6540     *  - dbname:key - a simple key (e.g. enwiki:meta)
6541     *  - _sitename:key - site-scope key (e.g. wiktionary:meta)
6542     *  - __global:key - global-scope key (e.g. __global:meta)
6543     *  - __sites:dbname - site mapping (e.g. __sites:enwiki)
6544     *
6545     * Sites mapping just specifies site name, other keys provide "local url"
6546     * data layout.
6547     *
6548     * @see \MediaWiki\Interwiki\ClassicInterwikiLookup
6549     */
6550    public const InterwikiCache = [
6551        'default' => false,
6552        'type' => 'false|map',
6553        'mergeStrategy' => 'replace',
6554    ];
6555
6556    /**
6557     * Specify number of domains to check for messages.
6558     *
6559     * - 1: Just wiki(db)-level
6560     * - 2: wiki and global levels
6561     * - 3: site levels
6562     */
6563    public const InterwikiScopes = [
6564        'default' => 3,
6565    ];
6566
6567    /**
6568     * Fallback site, if unable to resolve from cache
6569     */
6570    public const InterwikiFallbackSite = [
6571        'default' => 'wiki',
6572    ];
6573
6574    /**
6575     * If local interwikis are set up which allow redirects,
6576     * set this regexp to restrict URLs which will be displayed
6577     * as 'redirected from' links.
6578     *
6579     * **Example:**
6580     * It might look something like this:
6581     *
6582     * ```
6583     * $wgRedirectSources = '!^https?://[a-z-]+\.wikipedia\.org/!';
6584     * ```
6585     *
6586     * Leave at false to avoid displaying any incoming redirect markers.
6587     * This does not affect intra-wiki redirects, which don't change
6588     * the URL.
6589     */
6590    public const RedirectSources = [
6591        'default' => false,
6592    ];
6593
6594    /**
6595     * Register handlers for specific types of sites.
6596     *
6597     * @since 1.21
6598     */
6599    public const SiteTypes = [
6600        'default' => [ 'mediawiki' => MediaWikiSite::class, ],
6601        'type' => 'map',
6602    ];
6603
6604    // endregion -- Interwiki links and sites
6605
6606    /***************************************************************************/
6607    // region   Parser settings
6608    /** @name   Parser settings
6609     *  These settings configure the transformation from wikitext to HTML.
6610     */
6611
6612    /**
6613     * Maximum indent level of toc.
6614     */
6615    public const MaxTocLevel = [
6616        'default' => 999,
6617    ];
6618
6619    /**
6620     * A complexity limit on template expansion: the maximum number of nodes visited
6621     * by PPFrame::expand()
6622     */
6623    public const MaxPPNodeCount = [
6624        'default' => 1_000_000,
6625    ];
6626
6627    /**
6628     * Maximum recursion depth for templates within templates.
6629     *
6630     * The current parser adds two levels to the PHP call stack for each template,
6631     * and xdebug limits the call stack to 256 by default. So this should hopefully
6632     * stop the parser before it hits the xdebug limit.
6633     */
6634    public const MaxTemplateDepth = [
6635        'default' => 100,
6636    ];
6637
6638    /**
6639     * @see self::MaxTemplateDepth
6640     */
6641    public const MaxPPExpandDepth = [
6642        'default' => 100,
6643    ];
6644
6645    /**
6646     * URL schemes that should be recognized as valid by UrlUtils::parse().
6647     *
6648     * Scheme names must be in lowercase.
6649     *
6650     * WARNING: Do not add 'file:' to this or internal file links will be broken.
6651     * Instead, if you want to support file links, add 'file://'. The same applies
6652     * to any other protocols with the same name as a namespace. See task T46011 for
6653     * more information.
6654     *
6655     * @see \MediaWiki\Utils\UrlUtils::parse()
6656     */
6657    public const UrlProtocols = [
6658        'default' => [
6659            'bitcoin:', 'ftp://', 'ftps://', 'geo:', 'git://', 'gopher://', 'http://',
6660            'https://', 'irc://', 'ircs://', 'magnet:', 'mailto:', 'matrix:', 'mms://',
6661            'news:', 'nntp://', 'redis://', 'sftp://', 'sip:', 'sips:', 'sms:',
6662            'ssh://', 'svn://', 'tel:', 'telnet://', 'urn:', 'wikipedia://', 'worldwind://',
6663            'xmpp:', '//',
6664        ],
6665        'type' => 'list',
6666    ];
6667
6668    /**
6669     * If true, removes (by substituting) templates in signatures.
6670     */
6671    public const CleanSignatures = [
6672        'default' => true,
6673    ];
6674
6675    /**
6676     * Whether to allow inline image pointing to other websites
6677     */
6678    public const AllowExternalImages = [
6679        'default' => false,
6680    ];
6681
6682    /**
6683     * If the above is false, you can specify an exception here. Image URLs
6684     * that start with this string are then rendered, while all others are not.
6685     *
6686     * You can use this to set up a trusted, simple repository of images.
6687     * You may also specify an array of strings to allow multiple sites
6688     *
6689     * **Examples:**
6690     *
6691     * ```
6692     * $wgAllowExternalImagesFrom = 'http://127.0.0.1/';
6693     * $wgAllowExternalImagesFrom = [ 'http://127.0.0.1/', 'http://example.com' ];
6694     * ```
6695     */
6696    public const AllowExternalImagesFrom = [
6697        'default' => '',
6698    ];
6699
6700    /**
6701     * If $wgAllowExternalImages is false, you can allow an on-wiki
6702     * allow list of regular expression fragments to match the image URL
6703     * against. If the image matches one of the regular expression fragments,
6704     * the image will be displayed.
6705     *
6706     * Set this to true to enable the on-wiki allow list (MediaWiki:External image whitelist)
6707     * Or false to disable it
6708     *
6709     * @since 1.14
6710     */
6711    public const EnableImageWhitelist = [
6712        'default' => false,
6713    ];
6714
6715    /**
6716     * Configuration for HTML postprocessing tool. Set this to a configuration
6717     * array to enable an external tool. By default, we now use the RemexHtml
6718     * library; historically, other postprocessors were used.
6719     *
6720     * Setting this to null will use default settings.
6721     *
6722     * Keys include:
6723     *  - treeMutationTrace: a boolean to turn on Remex tracing
6724     *  - serializerTrace: a boolean to turn on Remex tracing
6725     *  - mungerTrace: a boolean to turn on Remex tracing
6726     *  - pwrap: whether <p> wrapping should be done (default true)
6727     *
6728     * See includes/tidy/RemexDriver.php for detail on configuration.
6729     *
6730     * Overriding the default configuration is strongly discouraged in
6731     * production.
6732     */
6733    public const TidyConfig = [
6734        'default' => [],
6735        'type' => 'map',
6736    ];
6737
6738    /**
6739     * Default Parsoid configuration.
6740     *
6741     * Overriding the default configuration is strongly discouraged in
6742     * production.
6743     *
6744     * @since 1.39
6745     */
6746    public const ParsoidSettings = [
6747        'default' => [
6748            'useSelser' => true,
6749        ],
6750        'type' => 'map',
6751    ];
6752
6753    /**
6754     * If set, Parsoid's HTML output for parser functions will be different
6755     * from Parsoid HTML spec 2.x.x and lets us experiment with a better
6756     * output that might be rolled out in a future 3.x Parsoid HTML version.
6757     * Parsoid will start generating this output for wikifunctions parser function
6758     * whenever that code is rolled out to production and will let us experiment
6759     * with this new format and tweak it now. This also lets Parsoid developers
6760     * experiment with it locally.
6761     *
6762     * This is an experimental flag and might be removed without notice.
6763     *
6764     * @unstable EXPERIMENTAL
6765     */
6766    public const ParsoidExperimentalParserFunctionOutput = [
6767        'default' => false,
6768        'type' => 'boolean',
6769    ];
6770
6771    /**
6772     * Allow raw, unchecked HTML in "<html>...</html>" sections.
6773     *
6774     * THIS IS VERY DANGEROUS on a publicly editable site, so USE $wgGroupPermissions
6775     * TO RESTRICT EDITING to only those that you trust
6776     */
6777    public const RawHtml = [
6778        'default' => false,
6779    ];
6780
6781    /**
6782     * Set a default target for external links, e.g. _blank to pop up a new window.
6783     *
6784     * For some very old browsers this could represent a security risk
6785     * (T427561) but this has not been the case for modern browsers since
6786     * ~2019-2021.
6787     */
6788    public const ExternalLinkTarget = [
6789        'default' => false,
6790    ];
6791
6792    /**
6793     * If true, external URL links in wiki text will be given the
6794     * rel="nofollow" attribute as a hint to search engines that
6795     * they should not be followed for ranking purposes as they
6796     * are user-supplied and thus subject to spamming.
6797     */
6798    public const NoFollowLinks = [
6799        'default' => true,
6800    ];
6801
6802    /**
6803     * Namespaces in which $wgNoFollowLinks doesn't apply.
6804     *
6805     * See Language.php for a list of namespaces.
6806     */
6807    public const NoFollowNsExceptions = [
6808        'default' => [],
6809        'type' => 'list',
6810    ];
6811
6812    /**
6813     * If this is set to an array of domains, external links to these domain names
6814     * (or any subdomains) will not be set to rel="nofollow" regardless of the
6815     * value of $wgNoFollowLinks.  For instance:
6816     *
6817     * $wgNoFollowDomainExceptions = [ 'en.wikipedia.org', 'wiktionary.org', 'mediawiki.org' ];
6818     *
6819     * This would add rel="nofollow" to links to de.wikipedia.org, but not
6820     * en.wikipedia.org, wiktionary.org, en.wiktionary.org, us.en.wikipedia.org,
6821     * etc.
6822     *
6823     * Defaults to mediawiki.org for the links included in the software by default.
6824     */
6825    public const NoFollowDomainExceptions = [
6826        'default' => [ 'mediawiki.org', ],
6827        'type' => 'list',
6828    ];
6829
6830    /**
6831     * By default MediaWiki does not register links pointing to same server in
6832     * externallinks dataset, use this value to override:
6833     */
6834    public const RegisterInternalExternals = [
6835        'default' => false,
6836    ];
6837
6838    /**
6839     * List of domains that will be ignored in being tracked into externallinks table.
6840     *
6841     * Subdomains will be also ignored. So 'wikipedia.org' means 'fa.wikipedia.org'
6842     * will be also ignored.
6843     */
6844    public const ExternalLinksIgnoreDomains = [
6845        'default' => [],
6846        'type' => 'array',
6847    ];
6848
6849    /**
6850     * Allow DISPLAYTITLE to change title display
6851     */
6852    public const AllowDisplayTitle = [
6853        'default' => true,
6854    ];
6855
6856    /**
6857     * For consistency, restrict DISPLAYTITLE to text that normalizes to the same
6858     * canonical DB key. Also disallow some inline CSS rules like display: none;
6859     * which can cause the text to be hidden or unselectable.
6860     */
6861    public const RestrictDisplayTitle = [
6862        'default' => true,
6863    ];
6864
6865    /**
6866     * Maximum number of calls per parse to expensive parser functions such as
6867     * PAGESINCATEGORY.
6868     */
6869    public const ExpensiveParserFunctionLimit = [
6870        'default' => 100,
6871    ];
6872
6873    /**
6874     * Preprocessor caching threshold
6875     * Setting it to 'false' will disable the preprocessor cache.
6876     */
6877    public const PreprocessorCacheThreshold = [
6878        'default' => 1000,
6879    ];
6880
6881    /**
6882     * Enable interwiki transcluding.  Only when iw_trans=1 in the interwiki table.
6883     */
6884    public const EnableScaryTranscluding = [
6885        'default' => false,
6886    ];
6887
6888    /**
6889     * Expiry time for transcluded templates cached in object cache.
6890     *
6891     * Only used $wgEnableInterwikiTranscluding is set to true.
6892     */
6893    public const TranscludeCacheExpiry = [
6894        'default' => 3600,
6895    ];
6896
6897    /**
6898     * Enable the magic links feature of automatically turning ISBN xxx,
6899     * PMID xxx, RFC xxx into links
6900     *
6901     * @since 1.28
6902     */
6903    public const EnableMagicLinks = [
6904        'default' => [
6905            'ISBN' => false,
6906            'PMID' => false,
6907            'RFC' => false,
6908        ],
6909        'type' => 'map',
6910    ];
6911
6912    /**
6913     * Set this to true to allow the {{USERLANGUAGE}} magic word to return the
6914     * actual user language. If it is false, {{USERLANGUAGE}} will return the
6915     * page language. Setting this to true is discouraged since the page
6916     * language should typically be used in the content area. Accessing the user
6917     * language using this feature reduces the efficiency of the parser cache.
6918     *
6919     * @since 1.43
6920     */
6921    public const ParserEnableUserLanguage = [
6922        'default' => false,
6923    ];
6924
6925    // endregion -- end of parser settings
6926
6927    /***************************************************************************/
6928    // region   Statistics and content analysis
6929    /** @name   Statistics and content analysis */
6930
6931    /**
6932     * Method used to determine if a page in a content namespace should be counted
6933     * as a valid article.
6934     *
6935     * Redirect pages will never be counted as valid articles.
6936     *
6937     * This variable can have the following values:
6938     * - 'any': all pages as considered as valid articles
6939     * - 'link': the page must contain a [[wiki link]] to be considered valid
6940     *
6941     * See also See https://www.mediawiki.org/wiki/Manual:Article_count
6942     *
6943     * Retroactively changing this variable will not affect the existing count,
6944     * to update it, you will need to run the maintenance/updateArticleCount.php
6945     * script.
6946     */
6947    public const ArticleCountMethod = [
6948        'default' => 'link',
6949    ];
6950
6951    /**
6952     * How many days user must be idle before they are considered inactive. Will affect
6953     * the number shown on Special:Statistics, Special:ActiveUsers, and the
6954     * {{NUMBEROFACTIVEUSERS}} magic word in wikitext.
6955     *
6956     * You might want to leave this as the default value, to provide comparable
6957     * numbers between different wikis.
6958     */
6959    public const ActiveUserDays = [
6960        'default' => 30,
6961    ];
6962
6963    /**
6964     * The following variables define 3 user experience levels:
6965     *
6966     * - newcomer: has not yet reached the 'learner' level
6967     *
6968     * - learner: has at least $wgLearnerEdits and has been
6969     *            a member for $wgLearnerMemberSince days
6970     *            but has not yet reached the 'experienced' level.
6971     *
6972     * - experienced: has at least $wgExperiencedUserEdits edits and
6973     *                has been a member for $wgExperiencedUserMemberSince days.
6974     */
6975    public const LearnerEdits = [
6976        'default' => 10,
6977    ];
6978
6979    /**
6980     * Number of days the user must exist before becoming a learner.
6981     *
6982     * @see self::LearnerEdits
6983     */
6984    public const LearnerMemberSince = [
6985        'default' => 4,
6986    ];
6987
6988    /**
6989     * Number of edits the user must have before becoming "experienced".
6990     *
6991     * @see self::LearnerEdits
6992     */
6993    public const ExperiencedUserEdits = [
6994        'default' => 500,
6995    ];
6996
6997    /**
6998     * Number of days the user must exist before becoming "experienced".
6999     *
7000     * @see self::LearnerEdits
7001     */
7002    public const ExperiencedUserMemberSince = [
7003        'default' => 30,
7004    ];
7005
7006    /**
7007     * Maximum number of revisions of a page that will be checked against every new edit
7008     * made to determine whether the edit was a manual revert.
7009     *
7010     * Computational time required increases roughly linearly with this configuration
7011     * variable.
7012     *
7013     * Larger values will let you detect very deep reverts, but at the same time can give
7014     * unexpected results (such as marking large amounts of edits as reverts) and may slow
7015     * down the wiki slightly when saving new edits.
7016     *
7017     * Setting this to 0 will disable the manual revert detection feature entirely.
7018     *
7019     * See this document for a discussion on this topic:
7020     * https://meta.wikimedia.org/wiki/Research:Revert
7021     *
7022     * @since 1.36
7023     */
7024    public const ManualRevertSearchRadius = [
7025        'default' => 15,
7026        'type' => 'integer',
7027    ];
7028
7029    /**
7030     * Maximum depth (revision count) of reverts that will have their reverted edits marked
7031     * with the mw-reverted change tag. Reverts deeper than that will not have any edits
7032     * marked as reverted at all.
7033     *
7034     * Large values can lead to lots of revisions being marked as "reverted", which may appear
7035     * confusing to users.
7036     *
7037     * Setting this to 0 will disable the reverted tag entirely.
7038     *
7039     * @since 1.36
7040     */
7041    public const RevertedTagMaxDepth = [
7042        'default' => 15,
7043        'type' => 'integer',
7044    ];
7045
7046    // endregion -- End of statistics and content analysis
7047
7048    /***************************************************************************/
7049    // region   User accounts, authentication
7050    /** @name   User accounts, authentication */
7051
7052    /**
7053     * Central ID lookup providers
7054     * Key is the provider ID, value is a specification for ObjectFactory
7055     *
7056     * @since 1.27
7057     */
7058    public const CentralIdLookupProviders = [
7059        'default' => [
7060            'local' => [
7061                'class' => LocalIdLookup::class,
7062                'services' => [
7063                    'MainConfig',
7064                    'DBLoadBalancerFactory',
7065                    'HideUserUtils',
7066                ]
7067            ]
7068        ],
7069        'type' => 'map',
7070    ];
7071
7072    /**
7073     * Central ID lookup provider to use by default
7074     */
7075    public const CentralIdLookupProvider = [
7076        'default' => 'local',
7077        'type' => 'string',
7078    ];
7079
7080    /**
7081     * User registration timestamp provider classes
7082     * @since 1.41
7083     */
7084    public const UserRegistrationProviders = [
7085        'default' => [
7086            LocalUserRegistrationProvider::TYPE => [
7087                'class' => LocalUserRegistrationProvider::class,
7088                'services' => [
7089                    'ConnectionProvider',
7090                ],
7091            ],
7092        ],
7093        'type' => 'map',
7094    ];
7095
7096    /**
7097     * Password policy for the wiki.
7098     *
7099     * Structured as
7100     * ```
7101     * [
7102     *     'policies' => [ <group> => [ <policy> => <settings>, ... ], ... ],
7103     *     'checks' => [ <policy> => <callback>, ... ],
7104     * ]
7105     * ```
7106     * where <group> is a user group, <policy> is a password policy name
7107     * (arbitrary string) defined in the 'checks' part, <callback> is the
7108     * PHP callable implementing the policy check, <settings> is an array
7109     * of options with the following keys:
7110     * - value: (number, boolean or null) the value to pass to the callback
7111     * - forceChange: (boolean, default false) if the password is invalid, do
7112     *   not let the user log in without changing the password
7113     * - suggestChangeOnLogin: (boolean, default false) if true and the password is
7114     *   invalid, suggest a password change if logging in. If all the failing policies
7115     *   that apply to the user have this set to false, the password change
7116     *   screen will not be shown. 'forceChange' takes precedence over
7117     *   'suggestChangeOnLogin' if they are both present.
7118     * As a shorthand for [ 'value' => <value> ], simply <value> can be written.
7119     * When multiple password policies are defined for a user, the settings
7120     * arrays are merged, and for fields which are set in both arrays, the
7121     * larger value (as understood by PHP's 'max' method) is taken.
7122     *
7123     * A user's effective policy is the superset of all policy statements
7124     * from the policies for the groups where the user is a member. If more
7125     * than one group policy include the same policy statement, the value is
7126     * the max() of the values. Note true > false. The 'default' policy group
7127     * is required, and serves as the minimum policy for all users.
7128     *
7129     * Callbacks receive three arguments: the policy value, the User object
7130     * and the password; and must return a StatusValue. A non-good status
7131     * means the password will not be accepted for new accounts, and existing
7132     * accounts will be prompted for password change or barred from logging in
7133     * (depending on whether the status is a fatal or merely error/warning).
7134     *
7135     * The checks supported by core are:
7136     * - MinimalPasswordLength - Minimum length a user can set.
7137     * - MinimumPasswordLengthToLogin - Passwords shorter than this will
7138     *    not be allowed to login, or offered a chance to reset their password
7139     *    as part of the login workflow, regardless if it is correct.
7140     * - MaximalPasswordLength - maximum length password a user is allowed
7141     *    to attempt. Prevents DoS attacks with pbkdf2.
7142     * - PasswordCannotBeSubstringInUsername - Password cannot be a substring
7143     *    (contained within) the username.
7144     * - PasswordCannotMatchDefaults - Username/password combination cannot
7145     *    match a list of default passwords used by MediaWiki in the past.
7146     * - PasswordNotInCommonList - Password not in best practices list of
7147     *    100,000 commonly used passwords. Due to the size of the list this
7148     *    is a probabilistic test.
7149     *
7150     * If you add custom checks, for Special:PasswordPolicies to display them correctly,
7151     * every check should have a corresponding passwordpolicies-policy-<check> message,
7152     * and every settings field other than 'value' should have a corresponding
7153     * passwordpolicies-policyflag-<flag> message (<check> and <flag> are in lowercase).
7154     * The check message receives the policy value as a parameter.
7155     *
7156     * @since 1.26
7157     * @see \MediaWiki\Password\PasswordPolicyChecks
7158     * @see \MediaWiki\User\User::checkPasswordValidity()
7159     */
7160    public const PasswordPolicy = [
7161        'default' => [
7162            'policies' => [
7163                'bureaucrat' => [
7164                    'MinimalPasswordLength' => 10,
7165                    'MinimumPasswordLengthToLogin' => 1,
7166                ],
7167                'sysop' => [
7168                    'MinimalPasswordLength' => 10,
7169                    'MinimumPasswordLengthToLogin' => 1,
7170                ],
7171                'interface-admin' => [
7172                    'MinimalPasswordLength' => 10,
7173                    'MinimumPasswordLengthToLogin' => 1,
7174                ],
7175                'bot' => [
7176                    'MinimalPasswordLength' => 10,
7177                    'MinimumPasswordLengthToLogin' => 1,
7178                ],
7179                'default' => [
7180                    'MinimalPasswordLength' => [ 'value' => 8, 'suggestChangeOnLogin' => true ],
7181                    'PasswordCannotBeSubstringInUsername' => [
7182                        'value' => true,
7183                        'suggestChangeOnLogin' => true
7184                    ],
7185                    'PasswordCannotMatchDefaults' => [ 'value' => true, 'suggestChangeOnLogin' => true ],
7186                    'MaximalPasswordLength' => [ 'value' => 4096, 'suggestChangeOnLogin' => true ],
7187                    'PasswordNotInCommonList' => [ 'value' => true, 'suggestChangeOnLogin' => true ],
7188                ],
7189            ],
7190            'checks' => [
7191                'MinimalPasswordLength' => [ PasswordPolicyChecks::class, 'checkMinimalPasswordLength' ],
7192                'MinimumPasswordLengthToLogin' => [ PasswordPolicyChecks::class, 'checkMinimumPasswordLengthToLogin' ],
7193                'PasswordCannotBeSubstringInUsername' => [ PasswordPolicyChecks::class, 'checkPasswordCannotBeSubstringInUsername' ],
7194                'PasswordCannotMatchDefaults' => [ PasswordPolicyChecks::class, 'checkPasswordCannotMatchDefaults' ],
7195                'MaximalPasswordLength' => [ PasswordPolicyChecks::class, 'checkMaximalPasswordLength' ],
7196                'PasswordNotInCommonList' => [ PasswordPolicyChecks::class, 'checkPasswordNotInCommonList' ],
7197            ],
7198        ],
7199        'type' => 'map',
7200        'mergeStrategy' => 'array_replace_recursive',
7201    ];
7202
7203    /**
7204     * Configure AuthManager
7205     *
7206     * All providers are constructed using ObjectFactory, see that for the general
7207     * structure. The array may also contain a key "sort" used to order providers:
7208     * providers are stably sorted by this value, which should be an integer
7209     * (default is 0).
7210     *
7211     * Elements are:
7212     * - preauth: Array (keys ignored) of specifications for PreAuthenticationProviders
7213     * - primaryauth: Array (keys ignored) of specifications for PrimaryAuthenticationProviders
7214     * - secondaryauth: Array (keys ignored) of specifications for SecondaryAuthenticationProviders
7215     *
7216     * @since 1.27
7217     * @note If this is null or empty, the value from $wgAuthManagerAutoConfig is
7218     * used instead. Local customization should generally set this variable from
7219     * scratch to the desired configuration. Extensions that want to
7220     * auto-configure themselves should use $wgAuthManagerAutoConfig instead.
7221     */
7222    public const AuthManagerConfig = [
7223        'default' => null,
7224        'type' => '?map',
7225    ];
7226
7227    /**
7228     * @see self::AuthManagerConfig
7229     * @since 1.27
7230     */
7231    public const AuthManagerAutoConfig = [
7232        'default' => [
7233            'preauth' => [
7234                ThrottlePreAuthenticationProvider::class => [
7235                    'class' => ThrottlePreAuthenticationProvider::class,
7236                    'sort' => 0,
7237                ],
7238                PreviouslyRenamedAccountPreAuthenticationProvider::class => [
7239                    'class' => PreviouslyRenamedAccountPreAuthenticationProvider::class,
7240                    'services' => [
7241                        'ConnectionProvider',
7242                        'UserFactory',
7243                    ],
7244                    'sort' => 0,
7245                ],
7246            ],
7247            'primaryauth' => [
7248                // TemporaryPasswordPrimaryAuthenticationProvider should come before
7249                // any other PasswordAuthenticationRequest-based
7250                // PrimaryAuthenticationProvider (or at least any that might return
7251                // FAIL rather than ABSTAIN for a wrong password), or password reset
7252                // won't work right. Do not remove this (or change the key) or
7253                // auto-configuration of other such providers in extensions will
7254                // probably auto-insert themselves in the wrong place.
7255                TemporaryPasswordPrimaryAuthenticationProvider::class => [
7256                    'class' => TemporaryPasswordPrimaryAuthenticationProvider::class,
7257                    'services' => [
7258                        'DBLoadBalancerFactory',
7259                        'UserOptionsLookup',
7260                    ],
7261                    'args' => [ [
7262                        // Fall through to LocalPasswordPrimaryAuthenticationProvider
7263                        'authoritative' => false,
7264                    ] ],
7265                    'sort' => 0,
7266                ],
7267                LocalPasswordPrimaryAuthenticationProvider::class => [
7268                    'class' => LocalPasswordPrimaryAuthenticationProvider::class,
7269                    'services' => [
7270                        'DBLoadBalancerFactory',
7271                    ],
7272                    'args' => [ [
7273                        // Last one should be authoritative, or else the user will get
7274                        // a less-than-helpful error message (something like "supplied
7275                        // authentication info not supported" rather than "wrong
7276                        // password") if it too fails.
7277                        'authoritative' => true,
7278                    ] ],
7279                    'sort' => 100,
7280                ],
7281            ],
7282            'secondaryauth' => [
7283                CheckBlocksSecondaryAuthenticationProvider::class => [
7284                    'class' => CheckBlocksSecondaryAuthenticationProvider::class,
7285                    'sort' => 0,
7286                ],
7287                ResetPasswordSecondaryAuthenticationProvider::class => [
7288                    'class' => ResetPasswordSecondaryAuthenticationProvider::class,
7289                    'sort' => 100,
7290                ],
7291                // Linking during login is experimental, enable at your own risk - T134952
7292                // MediaWiki\Auth\ConfirmLinkSecondaryAuthenticationProvider::class => [
7293                //   'class' => MediaWiki\Auth\ConfirmLinkSecondaryAuthenticationProvider::class,
7294                //   'sort' => 100,
7295                // ],
7296                EmailNotificationSecondaryAuthenticationProvider::class => [
7297                    'class' => EmailNotificationSecondaryAuthenticationProvider::class,
7298                    'services' => [
7299                        'DBLoadBalancerFactory',
7300                    ],
7301                    'sort' => 200,
7302                ],
7303            ],
7304        ],
7305        'type' => 'map',
7306        'mergeStrategy' => 'array_plus_2d',
7307    ];
7308
7309    /**
7310     * Configures RememberMe authentication request added by AuthManager. It can show a "remember
7311     * me" checkbox that, when checked, will cause it to take more time for the authenticated
7312     * session to expire. It can also be configured to always or to never extend the authentication
7313     * session.
7314     *
7315     * Valid values are listed in RememberMeAuthenticationRequest::ALLOWED_FLAGS.
7316     *
7317     * @since 1.36
7318     */
7319    public const RememberMe = [
7320        'default' => 'choose',
7321        'type' => 'string',
7322    ];
7323
7324    /**
7325     * Time frame for re-authentication.
7326     *
7327     * With only password-based authentication, you'd just ask the user to re-enter
7328     * their password to verify certain operations like changing the password or
7329     * changing the account's email address. But under AuthManager, the user might
7330     * not have a password (you might even have to redirect the browser to a
7331     * third-party service or something complex like that), you might want to have
7332     * both factors of a two-factor authentication, and so on. So, the options are:
7333     * - Incorporate the whole multi-step authentication flow within everything
7334     *   that needs to do this.
7335     * - Consider it good if they used Special:UserLogin during this session within
7336     *   the last X seconds.
7337     * - Come up with a third option.
7338     *
7339     * MediaWiki currently takes the second option. This setting configures the
7340     * "X seconds".
7341     *
7342     * This allows for configuring different time frames for different
7343     * "operations". The operations used in MediaWiki core include:
7344     * - LinkAccounts
7345     * - UnlinkAccount
7346     * - ChangeCredentials
7347     * - RemoveCredentials
7348     * - ChangeEmail
7349     *
7350     * Additional operations may be used by extensions, either explicitly by
7351     * calling AuthManager::securitySensitiveOperationStatus(),
7352     * ApiAuthManagerHelper::securitySensitiveOperation() or
7353     * SpecialPage::checkLoginSecurityLevel(), or implicitly by overriding
7354     * SpecialPage::getLoginSecurityLevel() or by subclassing
7355     * AuthManagerSpecialPage.
7356     *
7357     * The key 'default' is used if a requested operation isn't defined in the array.
7358     *
7359     * @since 1.27
7360     */
7361    public const ReauthenticateTime = [
7362        'default' => [ 'default' => 3600, ],
7363        'type' => 'map',
7364        'additionalProperties' => [ 'type' => 'integer', ],
7365    ];
7366
7367    /**
7368     * List of AuthenticationRequest class names which are not changeable through
7369     * Special:ChangeCredentials and the changeauthenticationdata 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 ChangeCredentialsBlacklist = [
7378        'default' => [
7379            TemporaryPasswordAuthenticationRequest::class,
7380        ],
7381        'type' => 'list',
7382        'items' => [ 'type' => 'string', ],
7383    ];
7384
7385    /**
7386     * List of AuthenticationRequest class names which are not removable through
7387     * Special:RemoveCredentials and the removeauthenticationdata API.
7388     *
7389     * This is only enforced on the client level; AuthManager itself (e.g.
7390     * AuthManager::allowsAuthenticationDataChange calls) is not affected.
7391     * Class names are checked for exact match (not for subclasses).
7392     *
7393     * @since 1.27
7394     */
7395    public const RemoveCredentialsBlacklist = [
7396        'default' => [
7397            PasswordAuthenticationRequest::class,
7398        ],
7399        'type' => 'list',
7400        'items' => [ 'type' => 'string', ],
7401    ];
7402
7403    /**
7404     * Specifies if users should be sent to a password-reset form on login, if their
7405     * password doesn't meet the requirements of User::isValidPassword().
7406     *
7407     * @since 1.23
7408     */
7409    public const InvalidPasswordReset = [
7410        'default' => true,
7411    ];
7412
7413    /**
7414     * Default password type to use when hashing user passwords.
7415     *
7416     * Must be set to a type defined in $wgPasswordConfig, or a type that
7417     * is registered by default in PasswordFactory.php.
7418     *
7419     * @since 1.24
7420     */
7421    public const PasswordDefault = [
7422        'default' => 'pbkdf2',
7423    ];
7424
7425    /**
7426     * Configuration for built-in password types.
7427     *
7428     * Maps the password type to an array of options:
7429     *
7430     * - class: The Password class to use.
7431     * - factory (since 1.40): A function that creates and returns a suitable Password object.
7432     *   This option is intended only for internal use; the function signature is unstable and
7433     *   subject to change in future versions.
7434     *
7435     * All other options are class-dependent.
7436     *
7437     * An advanced example:
7438     *
7439     * ```
7440     * $wgPasswordConfig['bcrypt-peppered'] = [
7441     *     'class' => EncryptedPassword::class,
7442     *     'underlying' => 'bcrypt',
7443     *     'secrets' => [
7444     *         hash( 'sha256', 'secret', true ),
7445     *     ],
7446     *     'cipher' => 'aes-256-cbc',
7447     * ];
7448     * ```
7449     *
7450     * @since 1.24
7451     */
7452    public const PasswordConfig = [
7453        'default' => [
7454            'A' => [
7455                'class' => MWOldPassword::class,
7456            ],
7457            'B' => [
7458                'class' => MWSaltedPassword::class,
7459            ],
7460            'pbkdf2-legacyA' => [
7461                'class' => LayeredParameterizedPassword::class,
7462                'types' => [
7463                    'A',
7464                    'pbkdf2',
7465                ],
7466            ],
7467            'pbkdf2-legacyB' => [
7468                'class' => LayeredParameterizedPassword::class,
7469                'types' => [
7470                    'B',
7471                    'pbkdf2',
7472                ],
7473            ],
7474            'bcrypt' => [
7475                'class' => BcryptPassword::class,
7476                'cost' => 9,
7477            ],
7478            'pbkdf2' => [
7479                'class' => Pbkdf2PasswordUsingOpenSSL::class,
7480                'algo' => 'sha512',
7481                'cost' => '30000',
7482                'length' => '64',
7483            ],
7484            'argon2' => [
7485                'class' => Argon2Password::class,
7486
7487                // Algorithm used:
7488                // * 'argon2i' is optimized against side-channel attacks
7489                // * 'argon2id' is optimized against both side-channel and GPU cracking
7490                // * 'auto' to use the best available algorithm. If you're using more than one server, be
7491                //   careful when you're mixing PHP versions because newer PHP might generate hashes that
7492                //   older versions would not understand.
7493                'algo' => 'auto',
7494
7495                // The parameters below are the same as options accepted by password_hash().
7496                // Set them to override that function's defaults.
7497                //
7498                // 'memory_cost' => PASSWORD_ARGON2_DEFAULT_MEMORY_COST,
7499                // 'time_cost' => PASSWORD_ARGON2_DEFAULT_TIME_COST,
7500                // 'threads' => PASSWORD_ARGON2_DEFAULT_THREADS,
7501            ],
7502        ],
7503        'type' => 'map',
7504    ];
7505
7506    /**
7507     * Whether to allow password resets ("enter some identifying data, and we'll send an email
7508     * with a temporary password you can use to get back into the account") identified by
7509     * various bits of data.  Setting all of these to false (or the whole variable to false)
7510     * has the effect of disabling password resets entirely
7511     */
7512    public const PasswordResetRoutes = [
7513        'default' => [
7514            'username' => true,
7515            'email' => true,
7516        ],
7517        'type' => 'map',
7518    ];
7519
7520    /**
7521     * Maximum number of Unicode characters in signature
7522     */
7523    public const MaxSigChars = [
7524        'default' => 255,
7525    ];
7526
7527    /**
7528     * Behavior of signature validation. Allowed values are:
7529     *  - 'warning' - invalid signatures cause a warning to be displayed on the preferences page,
7530     * but they are still used when signing comments; new invalid signatures can still be saved as
7531     * normal
7532     *  - 'new' - existing invalid signatures behave as above; new invalid signatures can't be
7533     * saved
7534     *  - 'disallow' - existing invalid signatures are no longer used when signing comments; new
7535     * invalid signatures can't be saved
7536     *
7537     * @since 1.35
7538     */
7539    public const SignatureValidation = [
7540        'default' => 'warning',
7541    ];
7542
7543    /**
7544     * List of lint error codes which don't cause signature validation to fail.
7545     *
7546     * @see https://www.mediawiki.org/wiki/Help:Lint_errors
7547     * @since 1.35
7548     */
7549    public const SignatureAllowedLintErrors = [
7550        'default' => [ 'obsolete-tag', ],
7551        'type' => 'list',
7552    ];
7553
7554    /**
7555     * Maximum number of bytes in username. You want to run the maintenance
7556     * script ./maintenance/checkUsernames.php once you have changed this value.
7557     */
7558    public const MaxNameChars = [
7559        'default' => 255,
7560    ];
7561
7562    /**
7563     * Array of usernames which may not be registered or logged in from
7564     * Maintenance scripts can still use these
7565     *
7566     * @see \MediaWiki\User\User::MAINTENANCE_SCRIPT_USER
7567     */
7568    public const ReservedUsernames = [
7569        'default' => [
7570            'MediaWiki default', // Default 'Main Page' and MediaWiki: message pages
7571            'Conversion script', // Used for the old Wikipedia software upgrade
7572            'Maintenance script', // Maintenance scripts which perform editing, image import script
7573            'Template namespace initialisation script', // Used in 1.2->1.3 upgrade
7574            'ScriptImporter', // Default user name used by maintenance/importSiteScripts.php
7575            'Delete page script', // Default user name used by maintenance/deleteBatch.php
7576            'Move page script', // Default user name used by maintenance/deleteBatch.php
7577            'Command line script', // Default user name used by maintenance/undelete.php
7578            'Unknown user', // Used in WikiImporter & RevisionStore for revisions with no author and in User for invalid user id
7579            'msg:double-redirect-fixer', // Automatic double redirect fix
7580            'msg:usermessage-editor', // Default user for leaving user messages
7581            'msg:proxyblocker', // For $wgProxyList and Special:Blockme (removed in 1.22)
7582            'msg:sorbs', // For $wgEnableDnsBlacklist etc.
7583            'msg:spambot_username', // Used by cleanupSpam.php
7584            'msg:autochange-username', // Used by anon category RC entries (removed in 1.44)
7585        ],
7586        'type' => 'list',
7587    ];
7588
7589    /**
7590     * Settings added to this array will override the default globals for the user
7591     * preferences used by anonymous visitors and newly created accounts.
7592     *
7593     * For instance, to disable editing on double clicks:
7594     * $wgDefaultUserOptions ['editondblclick'] = 0;
7595     *
7596     * To save storage space, no user_properties row will be stored for users with the
7597     * default setting for a given option, even if the user manually selects that option.
7598     * This means that a change to the defaults will change the setting for all users who
7599     * have been using the default setting; there is no way for users to opt out of this.
7600     * $wgConditionalUserOptions can be used to change the default value for future users
7601     * only.
7602     *
7603     * @see self::ConditionalUserOptions
7604     */
7605    public const DefaultUserOptions = [
7606        'default' =>
7607            // This array should be sorted by key
7608            [
7609                'ccmeonemails' => 0,
7610                'date' => 'default',
7611                'diffonly' => 0,
7612                'diff-type' => 'table',
7613                'disablemail' => 0,
7614                'editfont' => 'monospace',
7615                'editondblclick' => 0,
7616                'editrecovery' => 0,
7617                'editsectiononrightclick' => 0,
7618                'email-allow-new-users' => 1,
7619                'enotifminoredits' => 0,
7620                'enotifrevealaddr' => 0,
7621                'enotifusertalkpages' => 1,
7622                'enotifwatchlistpages' => 1,
7623                'extendwatchlist' => 1,
7624                'fancysig' => 0,
7625                'forceeditsummary' => 0,
7626                'forcesafemode' => 0,
7627                'gender' => 'unknown',
7628                'hidecategorization' => 1,
7629                'hideminor' => 0,
7630                'hidepatrolled' => 0,
7631                'imagesize' => 2,
7632                'minordefault' => 0,
7633                'newpageshidepatrolled' => 0,
7634                'nickname' => '',
7635                'norollbackdiff' => 0,
7636                'prefershttps' => 1,
7637                'previewonfirst' => 0,
7638                'previewontop' => 1,
7639                'pst-cssjs' => 1,
7640                'rcdays' => 7,
7641                'rcenhancedfilters-disable' => 0,
7642                'rclimit' => 50,
7643                'requireemail' => 0,
7644                'search-match-redirect' => true,
7645                'search-special-page' => 'Search',
7646                'search-thumbnail-extra-namespaces' => true,
7647                'searchlimit' => 20,
7648                'showhiddencats' => 0,
7649                'shownumberswatching' => 1,
7650                'showrollbackconfirmation' => 0,
7651                'skin' => false,
7652                'skin-responsive' => 1,
7653                'thumbsize' => 5,
7654                'underline' => 2,
7655                'useeditwarning' => 1,
7656                'uselivepreview' => 0,
7657                'usenewrc' => 1,
7658                'watchcreations' => 1,
7659                'watchcreations-expiry' => 'infinite',
7660                'watchdefault' => 1,
7661                'watchdefault-expiry' => 'infinite',
7662                'watchdeletion' => 0,
7663                'watchlistdays' => 7,
7664                'watchlisthideanons' => 0,
7665                'watchlisthidebots' => 0,
7666                'watchlisthidecategorization' => 1,
7667                'watchlisthideliu' => 0,
7668                'watchlisthideminor' => 0,
7669                'watchlisthideown' => 0,
7670                'watchlisthidepatrolled' => 0,
7671                'watchlistreloadautomatically' => 0,
7672                'watchlistunwatchlinks' => 0,
7673                'watchmoves' => 0,
7674                'watchrollback' => 0,
7675                'watchuploads' => 1,
7676                'watchrollback-expiry' => 'infinite',
7677                'watchstar-expiry' => 'infinite',
7678                'wlenhancedfilters-disable' => 0,
7679                'wllimit' => 250,
7680            ],
7681        'type' => 'map',
7682    ];
7683
7684    /**
7685     * Conditional defaults for user options
7686     *
7687     * Map of user options to conditional defaults descriptors, which is an array
7688     * of conditional cases [ VALUE, CONDITION1, CONDITION2, ... ], where VALUE is the default value for
7689     * all users that meet ALL conditions, and each CONDITION is either a:
7690     *     (a) a CUDCOND_* constant (when condition does not take any arguments), or
7691     *     (b) an array [ CUDCOND_*, argument1, argument1, ... ] (when chosen condition takes at
7692     *         least one argument).
7693     *
7694     * When `null` is used as the VALUE, it is interpreted as "no conditional default for this
7695     * condition". In other words, `null` and $wgDefaultUserOptions['user-option'] can be used
7696     * interchangeably as the VALUE.
7697     *
7698     * All conditions are evaluated in order. When no condition matches.
7699     * $wgDefaultUserOptions is used instead.
7700     *
7701     * Example of valid configuration:
7702     *   $wgConditionalUserOptions['user-option'] = [
7703     *       [ 'registered in 2024', [ CUDCOND_AFTER, '20240101000000' ] ]
7704     *   ];
7705     *
7706     * List of valid conditions:
7707     *   * CUDCOND_AFTER: user registered after given timestamp (args: string $timestamp)
7708     *   * CUDCOND_ANON: allows specifying a default for anonymous (logged-out, non-temporary) users
7709     *   * CUDCOND_NAMED: allows specifying a default for named (registered, non-temporary) users
7710     *   * CUDCOND_USERGROUP: users with a specific user group
7711     *
7712     * @since 1.42
7713     * @see self::DefaultUserOptions
7714     */
7715    public const ConditionalUserOptions = [
7716        'default' => [],
7717        'type' => 'map',
7718    ];
7719
7720    /**
7721     * An array of preferences to not show for the user
7722     */
7723    public const HiddenPrefs = [
7724        'default' => [],
7725        'type' => 'list',
7726    ];
7727
7728    /**
7729     * Maximum number of userjs preferences allowed for each user
7730     */
7731    public const UserJsPrefLimit = [
7732        'default' => 100,
7733        'type' => 'int',
7734    ];
7735
7736    /**
7737     * Characters to prevent during new account creations.
7738     *
7739     * This is used in a regular expression character class during
7740     * registration (regex metacharacters like / are escaped).
7741     */
7742    public const InvalidUsernameCharacters = [
7743        'default' => '@:>=',
7744    ];
7745
7746    /**
7747     * Character used as a delimiter when testing for interwiki userrights
7748     * (In Special:UserRights, it is possible to modify users on different
7749     * databases if the delimiter is used, e.g. "Someuser@enwiki").
7750     *
7751     * It is recommended that you have this delimiter in
7752     * $wgInvalidUsernameCharacters above, or you will not be able to
7753     * modify the user rights of those users via Special:UserRights
7754     */
7755    public const UserrightsInterwikiDelimiter = [
7756        'default' => '@',
7757    ];
7758
7759    /**
7760     * This is to let user authenticate using https when they come from http.
7761     *
7762     * Based on an idea by George Herbert on wikitech-l:
7763     * https://lists.wikimedia.org/pipermail/wikitech-l/2010-October/050039.html
7764     *
7765     * @since 1.17
7766     */
7767    public const SecureLogin = [
7768        'default' => false,
7769    ];
7770
7771    /**
7772     * Versioning for authentication tokens.
7773     *
7774     * If non-null, this is combined with the user's secret (the user_token field
7775     * in the DB) to generate the token cookie. Changing this will invalidate all
7776     * active sessions (i.e. it will log everyone out).
7777     *
7778     * @since 1.27
7779     */
7780    public const AuthenticationTokenVersion = [
7781        'default' => null,
7782        'type' => '?string',
7783    ];
7784
7785    /**
7786     * MediaWiki\Session\SessionProvider configuration.
7787     *
7788     * Values are ObjectFactory specifications for the SessionProviders to be
7789     * used. Keys in the array are ignored; the class name is conventionally
7790     * used as the key to avoid collisions. Order is not significant.
7791     *
7792     * @since 1.27
7793     */
7794    public const SessionProviders = [
7795        'type' => 'map',
7796        'default' => [
7797            \MediaWiki\Session\CookieSessionProvider::class => [
7798                'class' => \MediaWiki\Session\CookieSessionProvider::class,
7799                'args' => [ [
7800                    'priority' => 30,
7801                ] ],
7802                'services' => [
7803                    'JwtCodec',
7804                    'UrlUtils',
7805                ],
7806            ],
7807            \MediaWiki\Session\BotPasswordSessionProvider::class => [
7808                'class' => \MediaWiki\Session\BotPasswordSessionProvider::class,
7809                'args' => [ [
7810                    'priority' => 75,
7811                ] ],
7812                'services' => [
7813                    'GrantsInfo'
7814                ],
7815            ],
7816        ],
7817    ];
7818
7819    /**
7820     * Configuration for automatic creation of temporary accounts on page save.
7821     * This can be enabled to avoid exposing the IP addresses of casual editors who
7822     * do not explicitly create an account.
7823     *
7824     * @warning This is EXPERIMENTAL, enabling may break extensions.
7825     *
7826     * An associative array with the following keys:
7827     *
7828     *   - known: (bool) Whether auto-creation is known about. Set this to 'true' if
7829     *     temp accounts have been created on this wiki already. This setting allows
7830     *     temp users to be recognized even if auto-creation is currently disabled.
7831     *     If auto-creation is enabled via the 'enabled' property, then 'known' is
7832     *     overridden to true.
7833     *   - enabled: (bool) Whether auto-creation is enabled. If changing this
7834     *     value from 'true' to 'false', you should also set 'known' to true, so
7835     *     that relevant code can continue to identify temporary accounts as
7836     *     visually and conceptually distinct from anonymous accounts and named accounts.
7837     *     Note that temporary account auto-creation is only actually enabled if
7838     *     `*` group has the `createaccount` or `autocreateaccount` right.
7839     *   - actions: (array) A list of actions for which the feature is enabled.
7840     *     Currently only "edit" is supported.
7841     *   - genPattern: (string) The pattern used when generating new usernames.
7842     *     This should have "$1" indicating the place where the serial string will
7843     *     be substituted.
7844     *   - matchPattern: (string|string[]|null) The pattern used when determining whether a
7845     *     username is a temporary user. This affects the rights of the user
7846     *     and also prevents explicit creation of users with matching names.
7847     *     This is ignored if "enabled" is false. If the value is null, the
7848     *     the genPattern value is used as the matchPattern.
7849     *   - reservedPattern: (string) A pattern used to determine whether a
7850     *     username should be denied for explicit creation, in addition to
7851     *     matchPattern. This is used even if "enabled" is false.
7852     *   - serialProvider: (array) Configuration for generation of unique integer
7853     *     indexes which are used to make temporary usernames.
7854     *       - type: (string) May be "local" to allocate indexes using the local
7855     *         database. If the CentralAuth extension is enabled, it may be
7856     *         "centralauth". Extensions may plug in additional types using the
7857     *         TempUserSerialProviders attribute.
7858     *       - numShards (int, default 1): A small integer. This can be set to a
7859     *         value greater than 1 to avoid acquiring a global lock when
7860     *         allocating IDs, at the expense of making the IDs be non-monotonic.
7861     *       - useYear: (bool) Restart at 1 each time the year changes (in UTC).
7862     *         To avoid naming conflicts, the year is included in the name after
7863     *         the prefix, in the form 'YYYY-'.
7864     *   - serialMapping: (array) Configuration for mapping integer indexes to strings
7865     *     to substitute into genPattern.
7866     *       - type: (string) May be
7867     *         - "readable-numeric" to use ASCII decimal numbers broken up with hyphens
7868     *         - "plain-numeric" to use ASCII decimal numbers
7869     *         - "localized-numeric" to use numbers localized using a specific language
7870     *         - "filtered-radix" to use numbers in an arbitrary base between 2 and 36,
7871     *           with an optional list of "bad" IDs to skip over.
7872     *         - "scramble": to use ASCII decimal numbers that are short but
7873     *           non-consecutive.
7874     *       - language: (string) With "localized-numeric", the language code
7875     *       - radix: (int) With "filtered-radix", the base
7876     *       - badIndexes: (array) With "filtered-radix", an array with the bad unmapped
7877     *         indexes in the values. The integers must be sorted and the list
7878     *         must never change after the indexes have been allocated. The keys must
7879     *         be zero-based array indexes.
7880     *       - uppercase: (bool) With "filtered-radix", whether to use uppercase
7881     *         letters, default false.
7882     *       - offset: (int) With "plain-numeric" and "readable-numeric", a constant to add to the
7883     *         stored index.
7884     *    - expireAfterDays: (int|null, default 90) If not null, how many days should the temporary
7885     *      accounts expire? You should run expireTemporaryAccounts.php periodically to expire
7886     *      temporary accounts. Otherwise they are expired when they try to edit.
7887     *    - notifyBeforeExpirationDays: (int|null, default 10) If not null, how many days before the
7888     *      expiration of a temporary account should it be notified that their account is to be expired.
7889     *
7890     * @unstable EXPERIMENTAL
7891     * @since 1.39
7892     */
7893    public const AutoCreateTempUser = [
7894        'properties' => [
7895            'known' => [ 'type' => 'bool', 'default' => false ],
7896            'enabled' => [ 'type' => 'bool', 'default' => false ],
7897            'actions' => [ 'type' => 'list', 'default' => [ 'edit' ] ],
7898            'genPattern' => [ 'type' => 'string', 'default' => '~$1' ],
7899            'matchPattern' => [ 'type' => 'string|array|null', 'default' => null ],
7900            'reservedPattern' => [ 'type' => 'string|null', 'default' => '~$1' ],
7901            'serialProvider' => [ 'type' => 'object', 'default' => [ 'type' => 'local', 'useYear' => true ] ],
7902            'serialMapping' => [ 'type' => 'object', 'default' => [ 'type' => 'readable-numeric' ] ],
7903            'expireAfterDays' => [ 'type' => 'int|null', 'default' => 90 ],
7904            'notifyBeforeExpirationDays' => [ 'type' => 'int|null', 'default' => 10 ],
7905        ],
7906        'type' => 'object',
7907    ];
7908
7909    // endregion -- end user accounts
7910
7911    /***************************************************************************/
7912    // region   User rights, access control and monitoring
7913    /** @name   User rights, access control and monitoring */
7914
7915    /** List of IP addresses or CIDR ranges that are exempt from autoblocks. */
7916    public const AutoblockExemptions = [
7917        'default' => [],
7918        'type' => 'array',
7919    ];
7920
7921    /**
7922     * Number of seconds before autoblock entries expire. Default 86400 = 1 day.
7923     */
7924    public const AutoblockExpiry = [
7925        'default' => 86400,
7926    ];
7927
7928    /**
7929     * Set this to true to allow blocked users to edit their own user talk page.
7930     *
7931     * This only applies to sitewide blocks. Partial blocks always allow users to
7932     * edit their own user talk page unless otherwise specified in the block
7933     * restrictions.
7934     */
7935    public const BlockAllowsUTEdit = [
7936        'default' => true,
7937    ];
7938
7939    /**
7940     * Limits on the possible sizes of range blocks.
7941     *
7942     * CIDR notation is hard to understand, it's easy to mistakenly assume that a
7943     * /1 is a small range and a /31 is a large range. For IPv4, setting a limit of
7944     * half the number of bits avoids such errors, and allows entire ISPs to be
7945     * blocked using a small number of range blocks.
7946     *
7947     * For IPv6, RFC 3177 recommends that a /48 be allocated to every residential
7948     * customer, so range blocks larger than /64 (half the number of bits) will
7949     * plainly be required. RFC 4692 implies that a very large ISP may be
7950     * allocated a /19 if a generous HD-Ratio of 0.8 is used, so we will use that
7951     * as our limit. As of 2012, blocking the whole world would require a /4 range.
7952     */
7953    public const BlockCIDRLimit = [
7954        'default' => [
7955            'IPv4' => 16,
7956            'IPv6' => 19,
7957        ],
7958        'type' => 'map',
7959    ];
7960
7961    /**
7962     * If true, sitewide blocked users will not be allowed to login. (Direct
7963     * blocks only; IP blocks are ignored.) This can be used to remove users'
7964     * read access on a private wiki.
7965     */
7966    public const BlockDisablesLogin = [
7967        'default' => false,
7968    ];
7969
7970    /**
7971     * If this is false, the number of blocks of a given target is limited to only 1.
7972     *
7973     * @since 1.42
7974     */
7975    public const EnableMultiBlocks = [
7976        'default' => false,
7977        'type' => 'boolean',
7978    ];
7979
7980    /**
7981     * Pages anonymous user may see, set as an array of pages titles.
7982     *
7983     * **Example:**
7984     *
7985     * ```
7986     * $wgWhitelistRead = [ "Main Page", "Wikipedia:Help" ];
7987     * ```
7988     *
7989     * Special:Userlogin and Special:ChangePassword are always allowed.
7990     *
7991     * @note This will only work if $wgGroupPermissions['*']['read'] is false --
7992     * see below. Otherwise, ALL pages are accessible, regardless of this setting.
7993     * @note Also that this will only protect _pages in the wiki_. Uploaded files
7994     * will remain readable. You can use img_auth.php to protect uploaded files,
7995     * see https://www.mediawiki.org/wiki/Manual:Image_Authorization
7996     * @note Extensions should not modify this, but use the TitleReadWhitelist
7997     * hook instead.
7998     */
7999    public const WhitelistRead = [
8000        'default' => false,
8001    ];
8002
8003    /**
8004     * Pages anonymous user may see, set as an array of regular expressions.
8005     *
8006     * This function will match the regexp against the title name, which
8007     * is without underscore.
8008     *
8009     * **Example:**
8010     * To whitelist [[Main Page]]:
8011     *
8012     * ```
8013     * $wgWhitelistReadRegexp = [ "/Main Page/" ];
8014     * ```
8015     * @note Unless ^ and/or $ is specified, a regular expression might match
8016     * pages not intended to be allowed.  The above example will also
8017     * allow a page named 'Security Main Page'.
8018     *
8019     * **Example:**
8020     * To allow reading any page starting with 'User' regardless of the case:
8021     *
8022     * ```
8023     * $wgWhitelistReadRegexp = [ "@^UsEr.*@i" ];
8024     * ```
8025     *
8026     * Will allow both [[User is banned]] and [[User:JohnDoe]]
8027     * @note This will only work if $wgGroupPermissions['*']['read'] is false --
8028     * see below. Otherwise, ALL pages are accessible, regardless of this setting.
8029     */
8030    public const WhitelistReadRegexp = [
8031        'default' => false,
8032    ];
8033
8034    /**
8035     * Should editors be required to have a validated e-mail
8036     * address before being allowed to edit?
8037     */
8038    public const EmailConfirmToEdit = [
8039        'default' => false,
8040    ];
8041
8042    /**
8043     * Should MediaWiki attempt to protect user's privacy when doing redirects?
8044     * Keep this true if access counts to articles are made public.
8045     */
8046    public const HideIdentifiableRedirects = [
8047        'default' => true,
8048    ];
8049
8050    /**
8051     * Permission keys given to users in each group.
8052     *
8053     * This is an array where the keys are all groups and each value is an
8054     * array of the format (right => boolean).
8055     *
8056     * The second format is used to support per-namespace permissions.
8057     * Note that this feature does not fully work for all permission types.
8058     *
8059     * All users are implicitly in the '*' group including anonymous visitors;
8060     * logged-in users are all implicitly in the 'user' group. These will be
8061     * combined with the permissions of all groups that a given user is listed
8062     * in the user_groups table.
8063     *
8064     * Note: Don't set $wgGroupPermissions = []; unless you know what you're
8065     * doing! This will wipe all permissions, and may mean that your users are
8066     * unable to perform certain essential tasks or access new functionality
8067     * when new permissions are introduced and default grants established.
8068     *
8069     * Functionality to make pages inaccessible has not been extensively tested
8070     * for security. Use at your own risk!
8071     *
8072     * This replaces $wgWhitelistAccount and $wgWhitelistEdit
8073     */
8074    public const GroupPermissions = [
8075        'type' => 'map',
8076        'additionalProperties' => [
8077            'type' => 'map',
8078            'additionalProperties' => [ 'type' => 'boolean', ],
8079        ],
8080        'mergeStrategy' => 'array_plus_2d',
8081        'default' => [
8082            '*' => [
8083                'createaccount' => true,
8084                'autocreateaccount' => true,
8085                'read' => true,
8086                'edit' => true,
8087                'createpage' => true,
8088                'createtalk' => true,
8089                'viewmyprivateinfo' => true,
8090                'editmyprivateinfo' => true,
8091                'editmyoptions' => true,
8092            ],
8093            'user' => [
8094                'move' => true,
8095                'move-subpages' => true,
8096                'move-rootuserpages' => true,
8097                'move-categorypages' => true,
8098                'movefile' => true,
8099                'read' => true,
8100                'edit' => true,
8101                'createpage' => true,
8102                'createtalk' => true,
8103                'upload' => true,
8104                'reupload' => true,
8105                'reupload-shared' => true,
8106                'minoredit' => true,
8107                'editmyusercss' => true,
8108                'editmyuserjson' => true,
8109                'editmyuserjs' => true,
8110                'editmyuserjsredirect' => true,
8111                'sendemail' => true,
8112                'applychangetags' => true,
8113                'changetags' => true,
8114                'viewmywatchlist' => true,
8115                'editmywatchlist' => true,
8116                'createwithcontentmodel' => true,
8117                'logout' => true,
8118            ],
8119            'autoconfirmed' => [
8120                'autoconfirmed' => true,
8121                'editsemiprotected' => true,
8122            ],
8123            'bot' => [
8124                'bot' => true,
8125                'autoconfirmed' => true,
8126                'editsemiprotected' => true,
8127                'nominornewtalk' => true,
8128                'autopatrol' => true,
8129                'suppressredirect' => true,
8130                'apihighlimits' => true,
8131            ],
8132            'sysop' => [
8133                'block' => true,
8134                'createaccount' => true,
8135                'createpreviouslyrenamedaccount' => true,
8136                'delete' => true,
8137                'bigdelete' => true,
8138                'deletedhistory' => true,
8139                'deletedtext' => true,
8140                'undelete' => true,
8141                'editcontentmodel' => true,
8142                'editinterface' => true,
8143                'editsitejson' => true,
8144                'edituserjson' => true,
8145                'import' => true,
8146                'importupload' => true,
8147                'move' => true,
8148                'move-subpages' => true,
8149                'move-rootuserpages' => true,
8150                'move-categorypages' => true,
8151                'patrol' => true,
8152                'autopatrol' => true,
8153                'protect' => true,
8154                'editprotected' => true,
8155                'rollback' => true,
8156                'upload' => true,
8157                'reupload' => true,
8158                'reupload-shared' => true,
8159                'unwatchedpages' => true,
8160                'autoconfirmed' => true,
8161                'editsemiprotected' => true,
8162                'ipblock-exempt' => true,
8163                'blockemail' => true,
8164                'markbotedits' => true,
8165                'apihighlimits' => true,
8166                'browsearchive' => true,
8167                'noratelimit' => true,
8168                'movefile' => true,
8169                'unblockself' => true,
8170                'suppressredirect' => true,
8171                'mergehistory' => true,
8172                'managechangetags' => true,
8173                'deletechangetags' => true,
8174            ],
8175            'interface-admin' => [
8176                'editinterface' => true,
8177                'editsitecss' => true,
8178                'editsitejson' => true,
8179                'editsitejs' => true,
8180                'editusercss' => true,
8181                'edituserjson' => true,
8182                'edituserjs' => true,
8183            ],
8184            'bureaucrat' => [
8185                'userrights' => true,
8186                'noratelimit' => true,
8187                'renameuser' => true,
8188            ],
8189            'suppress' => [
8190                'hideuser' => true,
8191                'suppressrevision' => true,
8192                'viewsuppressed' => true,
8193                'suppressionlog' => true,
8194                'deleterevision' => true,
8195                'deletelogentry' => true,
8196            ],
8197        ],
8198    ];
8199
8200    /**
8201     * List of groups which should be considered privileged (user accounts
8202     * belonging in these groups can be abused in dangerous ways).
8203     * This is used for some security checks, mainly logging.
8204     * @since 1.41
8205     * @see \MediaWiki\User\UserGroupManager::getUserPrivilegedGroups()
8206     */
8207    public const PrivilegedGroups = [
8208        'default' => [
8209            'bureaucrat',
8210            'interface-admin',
8211            'suppress',
8212            'sysop',
8213        ],
8214        'type' => 'list',
8215    ];
8216
8217    /**
8218     * Permission keys revoked from users in each group.
8219     *
8220     * This acts the same way as $wgGroupPermissions above, except that
8221     * if the user is in a group here, the permission will be removed from them.
8222     *
8223     * Improperly setting this could mean that your users will be unable to perform
8224     * certain essential tasks, so use at your own risk!
8225     */
8226    public const RevokePermissions = [
8227        'default' => [],
8228        'type' => 'map',
8229        'mergeStrategy' => 'array_plus_2d',
8230    ];
8231
8232    /**
8233     * Groups that should inherit permissions from another group
8234     *
8235     * This allows defining a group that inherits its permissions
8236     * from another group without having to copy all the permission
8237     * grants over. For example, if you wanted a manual "confirmed"
8238     * group that had the same permissions as "autoconfirmed":
8239     *
8240     * ```
8241     * $wgGroupInheritsPermissions['confirmed'] = 'autoconfirmed';
8242     * ```
8243     *
8244     * Recursive inheritance is currently not supported. In the above
8245     * example, confirmed will only gain the permissions explicitly
8246     * granted (or revoked) from autoconfirmed, not any permissions
8247     * that autoconfirmed might inherit.
8248     *
8249     * @since 1.38
8250     */
8251    public const GroupInheritsPermissions = [
8252        'default' => [],
8253        'type' => 'map',
8254        'additionalProperties' => [ 'type' => 'string', ],
8255    ];
8256
8257    /**
8258     * Implicit groups, aren't shown on Special:Listusers or somewhere else
8259     */
8260    public const ImplicitGroups = [
8261        'default' => [ '*', 'user', 'autoconfirmed' ],
8262        'type' => 'list',
8263    ];
8264
8265    /**
8266     * A map of group names that the user is in, to group names that those users
8267     * are allowed to add or revoke.
8268     *
8269     * Setting the list of groups to add or revoke to true is equivalent to "any
8270     * group".
8271     *
8272     * **Example:**
8273     * To allow sysops to add themselves to the "bot" group:
8274     *
8275     * ```
8276     * $wgGroupsAddToSelf = [ 'sysop' => [ 'bot' ] ];
8277     * ```
8278     *
8279     * **Example:**
8280     * Implicit groups may be used for the source group, for instance:
8281     *
8282     * ```
8283     * $wgGroupsRemoveFromSelf = [ '*' => true ];
8284     * ```
8285     *
8286     * This allows users in the '*' group (i.e. any user) to remove themselves from
8287     * any group that they happen to be in.
8288     */
8289    public const GroupsAddToSelf = [
8290        'default' => [],
8291        'type' => 'map',
8292    ];
8293
8294    /**
8295     * @see self::GroupsAddToSelf
8296     */
8297    public const GroupsRemoveFromSelf = [
8298        'default' => [],
8299        'type' => 'map',
8300    ];
8301
8302    /**
8303     * A map of group names to the conditions under which the group can be granted.
8304     * The requirements are specified in the same way as for autopromotion.
8305     *
8306     * If `canBeIgnored` is set to true, these restrictions can be bypassed by users
8307     * who have the `ignore-restricted-groups` permission.
8308     *
8309     * If either of the `memberConditions` or `updaterConditions` keys are omitted,
8310     * they default to an empty array (i.e. no conditions). The default value for
8311     * `canBeIgnored` is false.
8312     *
8313     * ```
8314     * $wgRestrictedGroups = [
8315     *     'sysop' => [
8316     *         'memberConditions' => [ APCOND_EDITCOUNT, 1000 ],
8317     *         'updaterConditions' => [ !, APCOND_ISBOT ],
8318     *         'canBeIgnored' => false,
8319     *     ]
8320     * ]
8321     * ```
8322     */
8323    public const RestrictedGroups = [
8324        'default' => [],
8325        'type' => 'map',
8326    ];
8327
8328    /**
8329     * A list of user requirement conditions, which are considered private and therefore
8330     * shouldn't be used in computations before they are really needed. This helps to reduce
8331     * visibility of protected information about users.
8332     *
8333     * Using this setting does not fully prevent other users from inferring what is the result
8334     * of condition computation. For instance, a user rights log entry can still reveal that
8335     * the restrictions for the relevant group must have been satisfied.
8336     *
8337     * An example use of this setting is the Special:UserRights form, where all conditions
8338     * are evaluated on submission, but on viewing only the non-private ones are used.
8339     */
8340    public const UserRequirementsPrivateConditions = [
8341        'default' => [],
8342        'type' => 'list',
8343    ];
8344
8345    /**
8346     * Set of available actions that can be restricted via action=protect
8347     * You probably shouldn't change this.
8348     *
8349     * Translated through restriction-* messages.
8350     * RestrictionStore::listApplicableRestrictionTypes() will remove restrictions that are not
8351     * applicable to a specific title (create and upload)
8352     */
8353    public const RestrictionTypes = [
8354        'default' => [ 'create', 'edit', 'move', 'upload' ],
8355        'type' => 'list',
8356    ];
8357
8358    /**
8359     * Rights which can be required for each protection level (via action=protect)
8360     *
8361     * You can add a new protection level that requires a specific
8362     * permission by manipulating this array. The ordering of elements
8363     * dictates the order on the protection form's lists.
8364     *
8365     *   - '' will be ignored (i.e. unprotected)
8366     *   - 'autoconfirmed' is quietly rewritten to 'editsemiprotected' for backwards compatibility
8367     *   - 'sysop' is quietly rewritten to 'editprotected' for backwards compatibility
8368     */
8369    public const RestrictionLevels = [
8370        'default' => [ '', 'autoconfirmed', 'sysop' ],
8371        'type' => 'list',
8372    ];
8373
8374    /**
8375     * Restriction levels that can be used with cascading protection
8376     *
8377     * A page can only be protected with cascading protection if the
8378     * requested restriction level is included in this array.
8379     *
8380     * 'autoconfirmed' is quietly rewritten to 'editsemiprotected' for backwards compatibility.
8381     * 'sysop' is quietly rewritten to 'editprotected' for backwards compatibility.
8382     */
8383    public const CascadingRestrictionLevels = [
8384        'default' => [ 'sysop', ],
8385        'type' => 'list',
8386    ];
8387
8388    /**
8389     * Restriction levels that should be considered "semiprotected"
8390     *
8391     * Certain places in the interface recognize a dichotomy between "protected"
8392     * and "semiprotected", without further distinguishing the specific levels. In
8393     * general, if anyone can be eligible to edit a protection level merely by
8394     * reaching some condition in $wgAutopromote, it should probably be considered
8395     * "semiprotected".
8396     *
8397     * 'autoconfirmed' is quietly rewritten to 'editsemiprotected' for backwards compatibility.
8398     * 'sysop' is not changed, since it really shouldn't be here.
8399     */
8400    public const SemiprotectedRestrictionLevels = [
8401        'default' => [ 'autoconfirmed', ],
8402        'type' => 'list',
8403    ];
8404
8405    /**
8406     * Set the minimum permissions required to edit pages in each
8407     * namespace.  If you list more than one permission, a user must
8408     * have all of them to edit pages in that namespace.
8409     *
8410     * @note NS_MEDIAWIKI is implicitly restricted to 'editinterface'.
8411     */
8412    public const NamespaceProtection = [
8413        'default' => [],
8414        'type' => 'map',
8415    ];
8416
8417    /**
8418     * Whether to restrict editing user pages to the page owner and users with
8419     * the 'editalluserpages' right.
8420     */
8421    public const RestrictUserPageEditing = [
8422        'default' => false,
8423        'type' => 'boolean',
8424    ];
8425
8426    /**
8427     * Pages in namespaces in this array can not be used as templates.
8428     *
8429     * Elements MUST be numeric namespace ids, you can safely use the MediaWiki
8430     * namespaces constants (NS_USER, NS_MAIN...).
8431     *
8432     * Among other things, this may be useful to enforce read-restrictions
8433     * which may otherwise be bypassed by using the template mechanism.
8434     */
8435    public const NonincludableNamespaces = [
8436        'default' => [],
8437        'type' => 'map',
8438    ];
8439
8440    /**
8441     * Number of seconds an account is required to age before it's given the
8442     * implicit 'autoconfirm' group membership. This can be used to limit
8443     * privileges of new accounts.
8444     *
8445     * Accounts created by earlier versions of the software may not have a
8446     * recorded creation date, and will always be considered to pass the age test.
8447     *
8448     * When left at 0, all registered accounts will pass.
8449     *
8450     * **Example:**
8451     * Set automatic confirmation to 10 minutes (which is 600 seconds):
8452     *
8453     * ```
8454     * $wgAutoConfirmAge = 600;     // ten minutes
8455     * ```
8456     *
8457     * Set age to one day:
8458     *
8459     * ```
8460     * $wgAutoConfirmAge = 3600*24; // one day
8461     * ```
8462     */
8463    public const AutoConfirmAge = [
8464        'default' => 0,
8465    ];
8466
8467    /**
8468     * Number of edits an account requires before it is autoconfirmed.
8469     *
8470     * Passing both this AND the time requirement is needed. Example:
8471     *
8472     * **Example:**
8473     *
8474     * ```
8475     * $wgAutoConfirmCount = 50;
8476     * ```
8477     */
8478    public const AutoConfirmCount = [
8479        'default' => 0,
8480    ];
8481
8482    /**
8483     * Array containing the conditions of automatic promotion of a user to specific groups.
8484     *
8485     * The basic syntax for `$wgAutopromote` is:
8486     *
8487     *     $wgAutopromote = [
8488     *         'groupname' => cond,
8489     *         'group2' => cond2,
8490     *     ];
8491     *
8492     * A `cond` may be:
8493     *  - a single condition without arguments:
8494     *      Note that Autopromote wraps a single non-array value into an array
8495     *      e.g. `APCOND_EMAILCONFIRMED` OR
8496     *           [ `APCOND_EMAILCONFIRMED` ]
8497     *  - a single condition with arguments:
8498     *      e.g. `[ APCOND_EDITCOUNT, 100 ]`
8499     *  - a set of conditions:
8500     *      e.g. `[ 'operand', cond1, cond2, ... ]`
8501     *
8502     * When constructing a set of conditions, the following conditions are available:
8503     *  - `&` (**AND**):
8504     *      promote if user matches **ALL** conditions
8505     *  - `|` (**OR**):
8506     *      promote if user matches **ANY** condition
8507     *  - `^` (**XOR**):
8508     *      promote if user matches **ONLY ONE OF THE CONDITIONS**
8509     *  - `!` (**NOT**):
8510     *      promote if user matces **NO** condition
8511     *  - [ APCOND_EMAILCONFIRMED ]:
8512     *      true if user has a confirmed e-mail
8513     *  - [ APCOND_EDITCOUNT, number of edits (if null or missing $wgAutoConfirmCount will be used)]:
8514     *      true if user has the at least the number of edits as the passed parameter
8515     *  - [ APCOND_AGE, seconds since registration (if null or missing $wgAutoConfirmAge will be used)]:
8516     *      true if the length of time since the user created their account
8517     *      is at least the same length of time as the passed parameter
8518     *  - [ APCOND_AGE_FROM_EDIT, seconds since first edit ]:
8519     *      true if the length of time since the user made their first edit
8520     *      is at least the same length of time as the passed parameter
8521     *  - [ APCOND_INGROUPS, group1, group2, ... ]:
8522     *      true if the user is a member of each of the passed groups
8523     *  - [ APCOND_ISIP, ip ]:
8524     *      true if the user has the passed IP address
8525     *  - [ APCOND_IPINRANGE, range ]:
8526     *      true if the user has an IP address in the range of the passed parameter
8527     *  - [ APCOND_BLOCKED ]:
8528     *      true if the user is sitewide blocked
8529     *  - [ APCOND_ISBOT ]:
8530     *      true if the user is a bot
8531     *  - similar constructs can be defined by extensions
8532     *
8533     * The sets of conditions are evaluated recursively, so you can use nested sets of conditions
8534     * linked by operands.
8535     *
8536     * Note that if $wgEmailAuthentication is disabled, APCOND_EMAILCONFIRMED will be true for any
8537     * user who has provided an e-mail address.
8538     */
8539    public const Autopromote = [
8540        'default' => [
8541            'autoconfirmed' => [ '&',
8542                [ APCOND_EDITCOUNT, null ], // NOTE: null means $wgAutoConfirmCount
8543                [ APCOND_AGE, null ], // NOTE: null means AutoConfirmAge
8544            ],
8545        ],
8546        'type' => 'map',
8547    ];
8548
8549    /**
8550     * Automatically add a usergroup to any user who matches certain conditions.
8551     *
8552     * Does not add the user to the group again if it has been removed.
8553     * Also, does not remove the group if the user no longer meets the criteria.
8554     *
8555     * The format is:
8556     *
8557     * ```
8558     * [ event => criteria, ... ]
8559     * ```
8560     *
8561     * The only recognised value for event is 'onEdit' (when the user edits).
8562     *
8563     * Criteria has the same format as $wgAutopromote
8564     *
8565     * @see self::Autopromote
8566     * @since 1.18
8567     */
8568    public const AutopromoteOnce = [
8569        'default' => [ 'onEdit' => [], ],
8570        'type' => 'map',
8571    ];
8572
8573    /**
8574     * Put user rights log entries for autopromotion in recent changes?
8575     *
8576     * @since 1.18
8577     */
8578    public const AutopromoteOnceLogInRC = [
8579        'default' => true,
8580    ];
8581
8582    /**
8583     * Defines a denylist of group names. One-shot autopromotions into these groups will not cause a
8584     * RecentChanges entry to be inserted even if AutopromoteOnceLogInRC is set, as long as they are the
8585     * only new groups the user was autopromoted to.
8586     *
8587     * @since 1.44
8588     */
8589    public const AutopromoteOnceRCExcludedGroups = [
8590        'default' => [],
8591        'type' => 'array',
8592    ];
8593
8594    /**
8595     * $wgAddGroups and $wgRemoveGroups can be used to give finer control over who
8596     * can assign which groups at Special:Userrights.
8597     *
8598     * **Example:**
8599     * Bureaucrats can add any group:
8600     *
8601     * ```
8602     * $wgAddGroups['bureaucrat'] = true;
8603     * ```
8604     *
8605     * Bureaucrats can only remove bots and sysops:
8606     *
8607     * ```
8608     * $wgRemoveGroups['bureaucrat'] = [ 'bot', 'sysop' ];
8609     * ```
8610     *
8611     * Sysops can make bots:
8612     *
8613     * ```
8614     * $wgAddGroups['sysop'] = [ 'bot' ];
8615     * ```
8616     *
8617     * Sysops can disable other sysops in an emergency, and disable bots:
8618     *
8619     * ```
8620     * $wgRemoveGroups['sysop'] = [ 'sysop', 'bot' ];
8621     * ```
8622     */
8623    public const AddGroups = [
8624        'default' => [],
8625        'type' => 'map',
8626        'mergeStrategy' => 'array_merge_recursive',
8627    ];
8628
8629    /**
8630     * @see self::AddGroups
8631     */
8632    public const RemoveGroups = [
8633        'default' => [],
8634        'type' => 'map',
8635        'mergeStrategy' => 'array_merge_recursive',
8636    ];
8637
8638    /**
8639     * A list of available rights, in addition to the ones defined by the core.
8640     * Rights in this list are denied unless explicitly granted, typically
8641     * using GroupPermissions.
8642     *
8643     * For extensions only.
8644     *
8645     * @see self::GroupPermissions
8646     * @see self::ImplicitRights
8647     */
8648    public const AvailableRights = [
8649        'default' => [],
8650        'type' => 'list',
8651        'items' => [ 'type' => 'string', ],
8652    ];
8653
8654    /**
8655     * A list of implicit rights, in addition to the ones defined by the core.
8656     * Rights in this list are granted implicitly to all users, but rate limits
8657     * may apply to them.
8658     *
8659     * Extensions that define rate limits should add the corresponding right to
8660     * either ImplicitRights or AvailableRights, depending on whether the right
8661     * should be granted to everyone.
8662     *
8663     * @since 1.41
8664     * @see self::RateLimits
8665     * @see self::AvailableRights
8666     */
8667    public const ImplicitRights = [
8668        'default' => [],
8669        'type' => 'list',
8670        'items' => [ 'type' => 'string', ]
8671    ];
8672
8673    /**
8674     * Optional to restrict deletion of pages with higher revision counts
8675     * to users with the 'bigdelete' permission. (Default given to sysops.)
8676     */
8677    public const DeleteRevisionsLimit = [
8678        'default' => 0,
8679    ];
8680
8681    /**
8682     * Page deletions with > this number of revisions will use the job queue.
8683     *
8684     * Revisions will be archived in batches of (at most) this size, one batch per job.
8685     */
8686    public const DeleteRevisionsBatchSize = [
8687        'default' => 1000,
8688    ];
8689
8690    /**
8691     * The maximum number of edits a user can have and
8692     * can still be hidden by users with the hideuser permission.
8693     *
8694     * This is limited for performance reason.
8695     * Set to false to disable the limit.
8696     *
8697     * @since 1.23
8698     */
8699    public const HideUserContribLimit = [
8700        'default' => 1000,
8701    ];
8702
8703    /**
8704     * Number of accounts each IP address may create per specified period(s).
8705     *
8706     * **Example:**
8707     *
8708     * ```
8709     * $wgAccountCreationThrottle = [
8710     *  // no more than 100 per month
8711     *  [
8712     *   'count' => 100,
8713     *   'seconds' => 30*86400,
8714     *  ],
8715     *  // no more than 10 per day
8716     *  [
8717     *   'count' => 10,
8718     *   'seconds' => 86400,
8719     *  ],
8720     * ];
8721     * ```
8722     *
8723     * @note For backwards compatibility reasons, this may also be given as a single
8724     *       integer, representing the number of account creations per day.
8725     * @see self::TempAccountCreationThrottle for the temporary accounts version of
8726     *       this throttle
8727     * @warning Requires $wgMainCacheType to be enabled
8728     */
8729    public const AccountCreationThrottle = [
8730        'default' => [ [
8731            'count' => 0,
8732            'seconds' => 86400,
8733        ] ],
8734        'type' => 'int|list',
8735    ];
8736
8737    /**
8738     * Number of temporary accounts each IP address may create per specified period(s).
8739     *
8740     * **Example:**
8741     *
8742     * ```
8743     * $wgTempAccountCreationThrottle = [
8744     *  // no more than 100 per month
8745     *  [
8746     *   'count' => 100,
8747     *   'seconds' => 30*86400,
8748     *  ],
8749     *  // no more than 6 per day
8750     *  [
8751     *   'count' => 6,
8752     *   'seconds' => 86400,
8753     *  ],
8754     * ];
8755     * ```
8756     *
8757     * @see self::AccountCreationThrottle for the regular account version of this throttle.
8758     * @warning Requires $wgMainCacheType to be enabled
8759     *
8760     * @since 1.42
8761     */
8762    public const TempAccountCreationThrottle = [
8763        'default' => [
8764            [
8765                'count' => 1,
8766                'seconds' => 600,
8767            ],
8768            [
8769                'count' => 6,
8770                'seconds' => 86400,
8771            ]
8772        ],
8773        'type' => 'list',
8774    ];
8775
8776    /**
8777     * Number of temporary accounts usernames each IP address may acquire per specified period(s).
8778     *
8779     * This should be set to a higher value than TempAccountCreationThrottle.
8780     *
8781     * On editing, we first attempt to acquire a temp username before proceeding with saving an edit
8782     * and potentially creating a temp account if the edit save is successful.
8783     *
8784     * Some edits may fail (due to core or extensions denying an edit); this throttle ensures that
8785     * there are limits to the number of temporary account names that can be acquired and stored in
8786     * the database.
8787     *
8788     * **Example:**
8789     *
8790     * ```
8791     * $wgTempAccountNameAcquisitionThrottle = [
8792     *  // no more than 100 per month
8793     *  [
8794     *   'count' => 100,
8795     *   'seconds' => 30*86400,
8796     *  ],
8797     *  // no more than 60 per day
8798     *  [
8799     *   'count' => 60,
8800     *   'seconds' => 86400,
8801     *  ],
8802     * ];
8803     * ```
8804     *
8805     * @see self::TempAccountCreationThrottle Make sure that TempAccountNameAcquisitionThrottle is greater than or
8806     *   equal to TempAccountCreationThrottle
8807     * @warning Requires $wgMainCacheType to be enabled
8808     *
8809     * @since 1.42
8810     */
8811    public const TempAccountNameAcquisitionThrottle = [
8812        'default' => [ [
8813            'count' => 60,
8814            'seconds' => 86400,
8815        ] ],
8816        'type' => 'list',
8817    ];
8818
8819    /**
8820     * Edits matching these regular expressions in body text
8821     * will be recognised as spam and rejected automatically.
8822     *
8823     * There's no administrator override on-wiki, so be careful what you set. :)
8824     * May be an array of regexes or a single string for backwards compatibility.
8825     *
8826     * @see https://en.wikipedia.org/wiki/Regular_expression
8827     * @note Each regex needs a beginning/end delimiter, eg: # or /
8828     */
8829    public const SpamRegex = [
8830        'default' => [],
8831        'type' => 'list',
8832    ];
8833
8834    /**
8835     * Same as SpamRegex except for edit summaries
8836     */
8837    public const SummarySpamRegex = [
8838        'default' => [],
8839        'type' => 'list',
8840    ];
8841
8842    /**
8843     * Whether to use DNS blacklists in $wgDnsBlacklistUrls to check for open
8844     * proxies
8845     *
8846     * @since 1.16
8847     */
8848    public const EnableDnsBlacklist = [
8849        'default' => false,
8850    ];
8851
8852    /**
8853     * List of DNS blacklists to use, if $wgEnableDnsBlacklist is true.
8854     *
8855     * This is an array of either a URL or an array with the URL and a key (should
8856     * the blacklist require a key).
8857     *
8858     * **Example:**
8859     *
8860     * ```
8861     * $wgDnsBlacklistUrls = [
8862     *   // String containing URL
8863     *   'http.dnsbl.sorbs.net.',
8864     *   // Array with URL and key, for services that require a key
8865     *   [ 'dnsbl.httpbl.net.', 'mykey' ],
8866     *   // Array with just the URL. While this works, it is recommended that you
8867     *   // just use a string as shown above
8868     *   [ 'opm.tornevall.org.' ]
8869     * ];
8870     * ```
8871     *
8872     * @note You should end the domain name with a . to avoid searching your
8873     * eventual domain search suffixes.
8874     * @since 1.16
8875     */
8876    public const DnsBlacklistUrls = [
8877        'default' => [],
8878        'type' => 'list',
8879    ];
8880
8881    /**
8882     * List of banned IP addresses.
8883     *
8884     * This can have the following formats:
8885     * - An array of addresses
8886     * - A string, in which case this is the path to a file
8887     *   containing the list of IP addresses, one per line
8888     */
8889    public const ProxyList = [
8890        'default' => [],
8891        'type' => 'string|list',
8892    ];
8893
8894    /**
8895     * Proxy whitelist, list of addresses that are assumed to be non-proxy despite
8896     * what the other methods might say.
8897     */
8898    public const ProxyWhitelist = [
8899        'default' => [],
8900        'type' => 'list',
8901    ];
8902
8903    /**
8904     * IP ranges that should be considered soft-blocked (anon-only, account
8905     * creation allowed). The intent is to use this to prevent anonymous edits from
8906     * shared resources such as Wikimedia Labs.
8907     *
8908     * @since 1.29
8909     */
8910    public const SoftBlockRanges = [
8911        'default' => [],
8912        'type' => 'list',
8913        'items' => [ 'type' => 'string', ],
8914    ];
8915
8916    /**
8917     * Whether to look at the X-Forwarded-For header's list of (potentially spoofed)
8918     * IPs and apply IP blocks to them. This allows for IP blocks to work with correctly-configured
8919     * (transparent) proxies without needing to block the proxies themselves.
8920     */
8921    public const ApplyIpBlocksToXff = [
8922        'default' => false,
8923    ];
8924
8925    /**
8926     * Simple rate limiter options to brake edit floods.
8927     *
8928     * Maximum number actions allowed in the given number of seconds; after that
8929     * the violating client receives HTTP 500 error pages until the period
8930     * elapses.
8931     *
8932     * **Example:**
8933     * Limits per configured per action and then type of users.
8934     *
8935     * ```
8936     * $wgRateLimits = [
8937     *     'edit' => [
8938     *         'anon' => [ x, y ], // any and all anonymous edits (aggregate)
8939     *         'user' => [ x, y ], // each logged-in user
8940     *         'user-global' => [ x, y ], // per username, across all sites (assumes names are
8941     * global)
8942     *         'newbie' => [ x, y ], // each new autoconfirmed accounts; overrides 'user'
8943     *         'ip' => [ x, y ], // each anon and recent account, across all sites
8944     *         'subnet' => [ x, y ], // ... within a /24 subnet in IPv4 or /64 in IPv6
8945     *         'ip-all' => [ x, y ], // per ip, across all sites
8946     *         'subnet-all' => [ x, y ], // ... within a /24 subnet in IPv4 or /64 in IPv6
8947     *         'groupName' => [ x, y ], // by group membership
8948     *     ]
8949     * ];
8950     * ```
8951     *
8952     * **Normally, the 'noratelimit' right allows a user to bypass any rate**
8953     * limit checks. This can be disabled on a per-action basis by setting the
8954     * special '&can-bypass' key to false in that action's configuration.
8955     *
8956     * ```
8957     * $wgRateLimits = [
8958     *     'some-action' => [
8959     *         '&can-bypass' => false,
8960     *         'user' => [ x, y ],
8961     * ];
8962     * ```
8963     *
8964     * @see self::ImplicitRights
8965     * @warning Requires that $wgMainCacheType is set to something persistent
8966     */
8967    public const RateLimits = [
8968        'default' => [
8969            // Page edits
8970            'edit' => [
8971                'ip' => [ 8, 60 ],
8972                'newbie' => [ 8, 60 ],
8973                'user' => [ 90, 60 ],
8974            ],
8975            // Page moves
8976            'move' => [
8977                'newbie' => [ 2, 120 ],
8978                'user' => [ 8, 60 ],
8979            ],
8980            // File uploads
8981            'upload' => [
8982                'ip' => [ 8, 60 ],
8983                'newbie' => [ 8, 60 ],
8984            ],
8985            // Page rollbacks
8986            'rollback' => [
8987                'user' => [ 10, 60 ],
8988                'newbie' => [ 5, 120 ]
8989            ],
8990            // Triggering password resets emails
8991            'mailpassword' => [
8992                'ip' => [ 5, 3600 ],
8993            ],
8994            // Emailing other users using MediaWiki
8995            'sendemail' => [
8996                'ip' => [ 5, 86400 ],
8997                'newbie' => [ 5, 86400 ],
8998                'user' => [ 20, 86400 ],
8999            ],
9000            'changeemail' => [
9001                'ip-all' => [ 10, 3600 ],
9002                'user' => [ 4, 86400 ]
9003            ],
9004            // since 1.33 - rate limit email confirmations
9005            'confirmemail' => [
9006                'ip-all' => [ 10, 3600 ],
9007                'user' => [ 4, 86400 ]
9008            ],
9009            // Purging pages
9010            'purge' => [
9011                'ip' => [ 30, 60 ],
9012                'user' => [ 30, 60 ],
9013            ],
9014            // Purges of link tables
9015            'linkpurge' => [
9016                'ip' => [ 30, 60 ],
9017                'user' => [ 30, 60 ],
9018            ],
9019            // Files rendered via thumb.php or thumb_handler.php
9020            'renderfile' => [
9021                'ip' => [ 700, 30 ],
9022                'user' => [ 700, 30 ],
9023            ],
9024            // Same as above but for non-standard thumbnails
9025            'renderfile-nonstandard' => [
9026                'ip' => [ 70, 30 ],
9027                'user' => [ 70, 30 ],
9028            ],
9029            // Stashing edits into cache before save
9030            'stashedit' => [
9031                'ip' => [ 30, 60 ],
9032                'newbie' => [ 30, 60 ],
9033            ],
9034            // Stash base HTML for VE edits
9035            'stashbasehtml' => [
9036                'ip' => [ 5, 60 ],
9037                'newbie' => [ 5, 60 ],
9038            ],
9039            // Adding or removing change tags
9040            'changetags' => [
9041                'ip' => [ 8, 60 ],
9042                'newbie' => [ 8, 60 ],
9043            ],
9044            // Changing the content model of a page
9045            'editcontentmodel' => [
9046                'newbie' => [ 2, 120 ],
9047                'user' => [ 8, 60 ],
9048            ],
9049        ],
9050        'type' => 'map',
9051        'mergeStrategy' => 'array_plus_2d',
9052    ];
9053
9054    /**
9055     * Array of IPs / CIDR ranges which should be excluded from rate limits.
9056     *
9057     * This may be useful for allowing NAT gateways for conferences, etc.
9058     */
9059    public const RateLimitsExcludedIPs = [
9060        'default' => [],
9061        'type' => 'list',
9062    ];
9063
9064    /**
9065     * Log IP addresses in the recentchanges table; can be accessed only by
9066     * extensions (e.g. CheckUser) or a DB admin
9067     * Used for retroactive autoblocks
9068     */
9069    public const PutIPinRC = [
9070        'default' => true,
9071    ];
9072
9073    /**
9074     * Integer defining default number of entries to show on
9075     * special pages which are query-pages such as Special:Whatlinkshere.
9076     */
9077    public const QueryPageDefaultLimit = [
9078        'default' => 50,
9079    ];
9080
9081    /**
9082     * Configuration for external query sources.
9083     *
9084     * This allows system administrators to off-load expensive QueryPage subclasses
9085     * to alternative query sources by fetching results over HTTP.
9086     * For example, you might periodically run your own version of a query via Hadoop,
9087     * and serve the result as a JSON file from a static HTTP server (T309738).
9088     *
9089     * While your external source will likely be a static file serving cached
9090     * results, MediaWiki will treat this external source as drop-in replacement
9091     * for the database, not as replacement for the cache.
9092     *
9093     * This means if you enable $wgMiserMode, your external service does not
9094     * require high-availability and high-traffic support because you still benefit
9095     * from persistent cache (in the querycache table) and offline pull (via
9096     * maintenance/updateSpecialPages.php, instead of a live user request).
9097     *
9098     * **Example:**
9099     *
9100     * ```php
9101     * $wgExternalQuerySources = [
9102     *     'Mostlinkedtemplates' => [
9103     *         'enabled' => true,
9104     *         'url' => 'https://example.org/data/Mostlinkedtemplates.json',
9105     *         'timeout' => 10, // seconds, optional
9106     *     ]
9107     * ];
9108     * ```
9109     *
9110     * @since 1.45
9111     */
9112    public const ExternalQuerySources = [
9113        'default' => [],
9114        'type' => 'map',
9115        'additionalProperties' => [
9116            'type' => 'object',
9117            'properties' => [
9118                'enabled' => [
9119                    'type' => 'boolean',
9120                    'default' => false,
9121                ],
9122                'url' => [
9123                    'type' => 'string',
9124                    'format' => 'uri',
9125                ],
9126                'timeout' => [
9127                    'type' => 'integer',
9128                    'default' => 10,
9129                ],
9130            ],
9131            'required' => [ 'enabled', 'url' ],
9132            'additionalProperties' => false,
9133        ],
9134    ];
9135
9136    /**
9137     * Limit password attempts to X attempts per Y seconds per IP per account.
9138     *
9139     * Value is an array of arrays. Each sub-array must have a key for count
9140     * (ie count of how many attempts before throttle) and a key for seconds.
9141     * If the key 'allIPs' (case sensitive) is present, then the limit is
9142     * just per account instead of per IP per account.
9143     *
9144     * @since 1.27 allIps support and multiple limits added in 1.27. Prior
9145     * to 1.27 this only supported having a single throttle.
9146     * @warning Requires $wgMainCacheType to be enabled
9147     */
9148    public const PasswordAttemptThrottle = [
9149        'default' => [
9150            // Short term limit
9151            [ 'count' => 5, 'seconds' => 300 ],
9152            // Long term limit. We need to balance the risk
9153            // of somebody using this as a DoS attack to lock someone
9154            // out of their account, and someone doing a brute force attack.
9155            [ 'count' => 150, 'seconds' => 60 * 60 * 48 ],
9156        ],
9157        'type' => 'list',
9158    ];
9159
9160    /**
9161     * Users authorize consumers (like Apps) to act on their behalf but only with
9162     * a subset of the user's normal account rights (signed off on by the user).
9163     * The possible rights to grant to a consumer are bundled into groups called
9164     * "grants". Each grant defines some rights it lets consumers inherit from the
9165     * account they may act on behalf of. Note that a user granting a right does
9166     * nothing if that user does not actually have that right to begin with.
9167     *
9168     * @since 1.27
9169     */
9170    public const GrantPermissions = [
9171        'default' => [
9172            'basic' => [
9173                'autocreateaccount' => true,
9174                'autoconfirmed' => true,
9175                'autopatrol' => true,
9176                'editsemiprotected' => true,
9177                'ipblock-exempt' => true,
9178                'nominornewtalk' => true,
9179                'patrolmarks' => true,
9180                'read' => true,
9181                'unwatchedpages' => true,
9182            ],
9183            'highvolume' => [
9184                'bot' => true,
9185                'apihighlimits' => true,
9186                'noratelimit' => true,
9187                'markbotedits' => true,
9188            ],
9189            'import' => [
9190                'import' => true,
9191                'importupload' => true,
9192            ],
9193            'editpage' => [
9194                'edit' => true,
9195                'minoredit' => true,
9196                'applychangetags' => true,
9197                'changetags' => true,
9198                'editcontentmodel' => true,
9199                'createwithcontentmodel' => true,
9200                'pagelang' => true,
9201            ],
9202            'editprotected' => [
9203                'edit' => true,
9204                'minoredit' => true,
9205                'applychangetags' => true,
9206                'changetags' => true,
9207                'editcontentmodel' => true,
9208                'createwithcontentmodel' => true,
9209                'editprotected' => true,
9210            ],
9211            'editmycssjs' => [
9212                'edit' => true,
9213                'minoredit' => true,
9214                'applychangetags' => true,
9215                'changetags' => true,
9216                'editcontentmodel' => true,
9217                'createwithcontentmodel' => true,
9218                'editmyusercss' => true,
9219                'editmyuserjson' => true,
9220                'editmyuserjs' => true,
9221            ],
9222            'editmyoptions' => [
9223                'editmyoptions' => true,
9224                'editmyuserjson' => true,
9225            ],
9226            'editinterface' => [
9227                'edit' => true,
9228                'minoredit' => true,
9229                'applychangetags' => true,
9230                'changetags' => true,
9231                'editcontentmodel' => true,
9232                'createwithcontentmodel' => true,
9233                'editinterface' => true,
9234                'edituserjson' => true,
9235                'editsitejson' => true,
9236            ],
9237            'editsiteconfig' => [
9238                'edit' => true,
9239                'minoredit' => true,
9240                'applychangetags' => true,
9241                'changetags' => true,
9242                'editcontentmodel' => true,
9243                'createwithcontentmodel' => true,
9244                'editinterface' => true,
9245                'edituserjson' => true,
9246                'editsitejson' => true,
9247                'editusercss' => true,
9248                'edituserjs' => true,
9249                'editsitecss' => true,
9250                'editsitejs' => true,
9251            ],
9252            'createeditmovepage' => [
9253                'edit' => true,
9254                'minoredit' => true,
9255                'applychangetags' => true,
9256                'changetags' => true,
9257                'editcontentmodel' => true,
9258                'createwithcontentmodel' => true,
9259                'createpage' => true,
9260                'createtalk' => true,
9261                'delete-redirect' => true,
9262                'move' => true,
9263                'move-rootuserpages' => true,
9264                'move-subpages' => true,
9265                'move-categorypages' => true,
9266                'suppressredirect' => true,
9267            ],
9268            'uploadfile' => [
9269                'upload' => true,
9270                'reupload-own' => true,
9271            ],
9272            'uploadeditmovefile' => [
9273                'upload' => true,
9274                'reupload-own' => true,
9275                'reupload' => true,
9276                'reupload-shared' => true,
9277                'upload_by_url' => true,
9278                'movefile' => true,
9279                'suppressredirect' => true,
9280            ],
9281            'patrol' => [
9282                'patrol' => true,
9283            ],
9284            'rollback' => [
9285                'rollback' => true,
9286            ],
9287            'blockusers' => [
9288                'block' => true,
9289                'blockemail' => true,
9290            ],
9291            'viewdeleted' => [
9292                'browsearchive' => true,
9293                'deletedhistory' => true,
9294                'deletedtext' => true,
9295            ],
9296            'viewrestrictedlogs' => [
9297                'suppressionlog' => true,
9298            ],
9299            'delete' => [
9300                'edit' => true,
9301                'minoredit' => true,
9302                'applychangetags' => true,
9303                'changetags' => true,
9304                'editcontentmodel' => true,
9305                'createwithcontentmodel' => true,
9306                'browsearchive' => true,
9307                'deletedhistory' => true,
9308                'deletedtext' => true,
9309                'delete' => true,
9310                'bigdelete' => true,
9311                'deletelogentry' => true,
9312                'deleterevision' => true,
9313                'undelete' => true,
9314            ],
9315            'oversight' => [
9316                'suppressrevision' => true,
9317                'viewsuppressed' => true,
9318            ],
9319            'protect' => [
9320                'edit' => true,
9321                'minoredit' => true,
9322                'applychangetags' => true,
9323                'changetags' => true,
9324                'editcontentmodel' => true,
9325                'createwithcontentmodel' => true,
9326                'editprotected' => true,
9327                'protect' => true,
9328            ],
9329            'viewmywatchlist' => [
9330                'viewmywatchlist' => true,
9331            ],
9332            'editmywatchlist' => [
9333                'editmywatchlist' => true,
9334            ],
9335            'sendemail' => [
9336                'sendemail' => true,
9337            ],
9338            'createaccount' => [
9339                'createaccount' => true,
9340            ],
9341            'privateinfo' => [
9342                'viewmyprivateinfo' => true,
9343            ],
9344            'mergehistory' => [
9345                'mergehistory' => true,
9346            ],
9347            'managesessions' => [
9348                'logout' => true,
9349            ],
9350        ],
9351        'type' => 'map',
9352        'mergeStrategy' => 'array_plus_2d',
9353        'additionalProperties' => [
9354            'type' => 'map',
9355            'additionalProperties' => [ 'type' => 'boolean', ],
9356        ],
9357    ];
9358
9359    /**
9360     * Grant groups are used on some user interfaces to display conceptually
9361     * similar grants together.
9362     *
9363     * This configuration value should usually be set by extensions, not
9364     * site administrators.
9365     *
9366     * @see self::GrantPermissions
9367     * @since 1.27
9368     */
9369    public const GrantPermissionGroups = [
9370        'default' =>
9371            [
9372                // Hidden grants are implicitly present
9373                'basic'               => 'hidden',
9374
9375                'editpage'            => 'page-interaction',
9376                'createeditmovepage'  => 'page-interaction',
9377                'editprotected'       => 'page-interaction',
9378                'patrol'              => 'page-interaction',
9379
9380                'uploadfile'          => 'file-interaction',
9381                'uploadeditmovefile'  => 'file-interaction',
9382
9383                'sendemail'           => 'email',
9384
9385                'viewmywatchlist'     => 'watchlist-interaction',
9386                'editviewmywatchlist' => 'watchlist-interaction',
9387
9388                'editmycssjs'         => 'customization',
9389                'editmyoptions'       => 'customization',
9390
9391                'editinterface'       => 'administration',
9392                'editsiteconfig'      => 'administration',
9393                'rollback'            => 'administration',
9394                'blockusers'          => 'administration',
9395                'delete'              => 'administration',
9396                'viewdeleted'         => 'administration',
9397                'viewrestrictedlogs'  => 'administration',
9398                'protect'             => 'administration',
9399                'oversight'           => 'administration',
9400                'createaccount'       => 'administration',
9401                'mergehistory'        => 'administration',
9402                'import'              => 'administration',
9403
9404                'highvolume'          => 'high-volume',
9405
9406                'privateinfo'         => 'private-information',
9407                'managesessions'      => 'private-information',
9408            ],
9409        'type' => 'map',
9410        'additionalProperties' => [ 'type' => 'string', ],
9411    ];
9412
9413    /**
9414     * Group grants by risk level. Keys are grant names (i.e. keys from GrantPermissions),
9415     * values are GrantsInfo::RISK_* constants.
9416     *
9417     * Note that this classification is only informative; merely applying 'security' or 'internal'
9418     * to a grant won't prevent it from being available. It's used to give guidance to users
9419     * in various interfaces about the riskiness of the various grants.
9420     *
9421     * @since 1.42
9422     */
9423    public const GrantRiskGroups = [
9424        'default' => [
9425            'basic'               => GrantsInfo::RISK_LOW,
9426            'editpage'            => GrantsInfo::RISK_LOW,
9427            'createeditmovepage'  => GrantsInfo::RISK_LOW,
9428            'editprotected'       => GrantsInfo::RISK_VANDALISM,
9429            'patrol'              => GrantsInfo::RISK_LOW,
9430            'uploadfile'          => GrantsInfo::RISK_LOW,
9431            'uploadeditmovefile'  => GrantsInfo::RISK_LOW,
9432            'sendemail'           => GrantsInfo::RISK_SECURITY,
9433            'viewmywatchlist'     => GrantsInfo::RISK_LOW,
9434            'editviewmywatchlist' => GrantsInfo::RISK_LOW,
9435            'editmycssjs'         => GrantsInfo::RISK_SECURITY,
9436            'editmyoptions'       => GrantsInfo::RISK_SECURITY,
9437            'editinterface'       => GrantsInfo::RISK_VANDALISM,
9438            'editsiteconfig'      => GrantsInfo::RISK_SECURITY,
9439            'rollback'            => GrantsInfo::RISK_LOW,
9440            'blockusers'          => GrantsInfo::RISK_VANDALISM,
9441            'delete'              => GrantsInfo::RISK_VANDALISM,
9442            'viewdeleted'         => GrantsInfo::RISK_VANDALISM,
9443            'viewrestrictedlogs'  => GrantsInfo::RISK_SECURITY,
9444            'protect'             => GrantsInfo::RISK_VANDALISM,
9445            'oversight'           => GrantsInfo::RISK_SECURITY,
9446            'createaccount'       => GrantsInfo::RISK_LOW,
9447            'mergehistory'        => GrantsInfo::RISK_VANDALISM,
9448            'import'              => GrantsInfo::RISK_SECURITY,
9449            'highvolume'          => GrantsInfo::RISK_LOW,
9450            'privateinfo'         => GrantsInfo::RISK_LOW,
9451        ],
9452        'type' => 'map',
9453    ];
9454
9455    /**
9456     * @since 1.27
9457     */
9458    public const EnableBotPasswords = [
9459        'default' => true,
9460        'type' => 'boolean',
9461    ];
9462
9463    /**
9464     * Cluster for the bot_passwords table
9465     *
9466     * @since 1.27
9467     * @deprecated since 1.42 Use $wgVirtualDomainsMapping instead.
9468     */
9469    public const BotPasswordsCluster = [
9470        'default' => false,
9471        'type' => 'string|false',
9472    ];
9473
9474    /**
9475     * Database name for the bot_passwords table
9476     *
9477     * To use a database with a table prefix, set this variable to
9478     * "{$database}-{$prefix}".
9479     *
9480     * @since 1.27
9481     * @deprecated since 1.42 Use $wgVirtualDomainsMapping instead.
9482     */
9483    public const BotPasswordsDatabase = [
9484        'default' => false,
9485        'type' => 'string|false',
9486    ];
9487
9488    /**
9489     * Maximum number of bot passwords a user can create.
9490     *
9491     * @since 1.46
9492     */
9493    public const BotPasswordsLimit = [
9494        'default' => 100,
9495        'type' => 'int',
9496    ];
9497
9498    // endregion -- end of user rights settings
9499
9500    /***************************************************************************/
9501    // region   Security
9502    /** @name   Security */
9503
9504    /**
9505     * This should always be customised in LocalSettings.php
9506     */
9507    public const SecretKey = [
9508        'default' => false,
9509    ];
9510
9511    /**
9512     * RSA private key for issuing JWTs, as a PEM string.
9513     * Experimental, will probably be replaced by something more flexible.
9514     * @since 1.45
9515     * @see RsaJwtCodec
9516     */
9517    public const JwtPrivateKey = [
9518        'default' => false,
9519    ];
9520
9521    /**
9522     * RSA private key for verifying JWTs, as a PEM string.
9523     * Experimental, will probably be replaced by something more flexible.
9524     * @since 1.45
9525     * @see RsaJwtCodec
9526     */
9527    public const JwtPublicKey = [
9528        'default' => false,
9529    ];
9530
9531    /**
9532     * Allow user Javascript page?
9533     * This enables a lot of neat customizations, but may
9534     * increase security risk to users and server load.
9535     */
9536    public const AllowUserJs = [
9537        'default' => false,
9538    ];
9539
9540    /**
9541     * Which actions require reauthentication.
9542     * This is a map where the keys are rights, and the values are "operations".
9543     * If multiple rights map to the same operation, then reauthenticating for one of those rights
9544     * also grants the others.
9545     */
9546    public const ReauthenticateForActions = [
9547        'default' => [
9548            'edituserjs' => 'edituserjscss',
9549            'editusercss' => 'edituserjscss',
9550            'editsitejs' => 'editsitejscss',
9551            'editsitecss' => 'editsitejscss'
9552        ],
9553        'type' => 'map',
9554    ];
9555
9556    /**
9557     * Allow user Cascading Style Sheets (CSS)?
9558     * This enables a lot of neat customizations, but may
9559     * increase security risk to users and server load.
9560     */
9561    public const AllowUserCss = [
9562        'default' => false,
9563    ];
9564
9565    /**
9566     * Allow style-related user-preferences?
9567     *
9568     * This controls whether the `editfont` and `underline` preferences
9569     * are available to users.
9570     */
9571    public const AllowUserCssPrefs = [
9572        'default' => true,
9573    ];
9574
9575    /**
9576     * Use the site's Javascript page?
9577     */
9578    public const UseSiteJs = [
9579        'default' => true,
9580    ];
9581
9582    /**
9583     * Use the site's Cascading Style Sheets (CSS)?
9584     */
9585    public const UseSiteCss = [
9586        'default' => true,
9587    ];
9588
9589    /**
9590     * Break out of framesets. This can be used to prevent clickjacking attacks,
9591     * or to prevent external sites from framing your site with ads.
9592     */
9593    public const BreakFrames = [
9594        'default' => false,
9595    ];
9596
9597    /**
9598     * The X-Frame-Options header to send on pages sensitive to clickjacking
9599     * attacks, such as edit pages. This prevents those pages from being displayed
9600     * in a frame or iframe. The options are:
9601     *
9602     *   - 'DENY': Do not allow framing. This is recommended for most wikis.
9603     *
9604     *   - 'SAMEORIGIN': Allow framing by pages on the same domain. This can be used
9605     *         to allow framing within a trusted domain. This is insecure if there
9606     *         is a page on the same domain which allows framing of arbitrary URLs.
9607     *
9608     *   - false: Allow all framing. This opens up the wiki to XSS attacks and thus
9609     *         full compromise of local user accounts. Private wikis behind a
9610     *         corporate firewall are especially vulnerable. This is not
9611     *         recommended.
9612     *
9613     * For extra safety, set $wgBreakFrames = true, to prevent framing on all pages,
9614     * not just edit pages.
9615     */
9616    public const EditPageFrameOptions = [
9617        'default' => 'DENY',
9618    ];
9619
9620    /**
9621     * Disallow framing of API pages directly, by setting the X-Frame-Options
9622     * header. Since the API returns CSRF tokens, allowing the results to be
9623     * framed can compromise your user's account security.
9624     *
9625     * Options are:
9626     *   - 'DENY': Do not allow framing. This is recommended for most wikis.
9627     *   - 'SAMEORIGIN': Allow framing by pages on the same domain.
9628     *   - false: Allow all framing.
9629     * Note: $wgBreakFrames will override this for human formatted API output.
9630     */
9631    public const ApiFrameOptions = [
9632        'default' => 'DENY',
9633    ];
9634
9635    /**
9636     * Controls Content-Security-Policy header
9637     *
9638     * @warning May cause slowness on Windows due to slow random number generator.
9639     *
9640     * @unstable EXPERIMENTAL
9641     * @since 1.32
9642     * @see https://www.w3.org/TR/CSP2/
9643     */
9644    public const CSPHeader = [
9645        'default' => false,
9646        'type' => 'false|object',
9647    ];
9648
9649    /**
9650     * Controls Content-Security-Policy-Report-Only header
9651     *
9652     * @since 1.32
9653     */
9654    public const CSPReportOnlyHeader = [
9655        'default' => false,
9656        'type' => 'false|object',
9657    ];
9658
9659    /**
9660     * Controls the report-uri directive within a content security policy
9661     *
9662     * @since 1.47
9663     */
9664    public const CSPUseReportURIDirective = [
9665        'default' => false,
9666        'type' => 'false|object',
9667    ];
9668
9669    /**
9670     * List of urls which appear often to be triggering CSP reports
9671     * but do not appear to be caused by actual content, but by client
9672     * software inserting scripts (i.e. Ad-Ware).
9673     *
9674     * List based on results from Wikimedia logs.
9675     *
9676     * @since 1.28
9677     */
9678    public const CSPFalsePositiveUrls = [
9679        'default' => [
9680            'https://3hub.co' => true,
9681            'https://morepro.info' => true,
9682            'https://p.ato.mx' => true,
9683            'https://s.ato.mx' => true,
9684            'https://adserver.adtech.de' => true,
9685            'https://ums.adtechus.com' => true,
9686            'https://cas.criteo.com' => true,
9687            'https://cat.nl.eu.criteo.com' => true,
9688            'https://atpixel.alephd.com' => true,
9689            'https://rtb.metrigo.com' => true,
9690            'https://d5p.de17a.com' => true,
9691            'https://ad.lkqd.net/vpaid/vpaid.js' => true,
9692            'https://ad.lkqd.net/vpaid/vpaid.js?fusion=1.0' => true,
9693            'https://t.lkqd.net/t' => true,
9694            'chrome-extension' => true,
9695        ],
9696        'type' => 'map',
9697    ];
9698
9699    /**
9700     * Allow anonymous cross origin requests to the REST API.
9701     *
9702     * This should be disabled for intranet sites (sites behind a firewall).
9703     *
9704     * @since 1.36
9705     */
9706    public const AllowCrossOrigin = [
9707        'default' => false,
9708        'type' => 'boolean',
9709    ];
9710
9711    /**
9712     * Allows authenticated cross-origin requests to the REST API with session cookies.
9713     *
9714     * With this option enabled, any origin specified in $wgCrossSiteAJAXdomains may send session
9715     * cookies for authorization in the REST API.
9716     *
9717     * There is a performance impact by enabling this option. Therefore, it should be left disabled
9718     * for most wikis and clients should instead use OAuth to make cross-origin authenticated
9719     * requests.
9720     *
9721     * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials
9722     * @since 1.36
9723     */
9724    public const RestAllowCrossOriginCookieAuth = [
9725        'default' => false,
9726        'type' => 'boolean',
9727    ];
9728
9729    /**
9730     * Secret for session storage.
9731     *
9732     * This should be set in LocalSettings.php, otherwise $wgSecretKey will
9733     * be used.
9734     *
9735     * @since 1.27
9736     */
9737    public const SessionSecret = [
9738        'default' => false,
9739    ];
9740
9741    // endregion -- end of security
9742
9743    /***************************************************************************/
9744    // region   Cookie settings
9745    /** @name   Cookie settings */
9746
9747    /**
9748     * Default cookie lifetime, in seconds. Setting to 0 makes all cookies session-only.
9749     */
9750    public const CookieExpiration = [
9751        'default' => 30 * 86400,
9752    ];
9753
9754    /**
9755     * Default login cookie lifetime, in seconds.
9756     *
9757     * If $wgExtendLoginCookieExpiration is set to null, we use $wgCookieExpiration to
9758     * calculate the cookie lifetime instead. As with $wgCookieExpiration, 0 will make
9759     * login cookies session-only.
9760     */
9761    public const ExtendedLoginCookieExpiration = [
9762        'default' => 180 * 86400,
9763    ];
9764
9765    /**
9766     * JWT session cookie expiration, in seconds. Used both for cookie expiry and for
9767     * the expiry field inside the JWT object.
9768     *
9769     * @since 1.45
9770     * @see self::UseSessionCookieJwt
9771     */
9772    public const SessionCookieJwtExpiration = [
9773        'default' => 4 * 3600,
9774    ];
9775
9776    /**
9777     * Set to set an explicit domain on the login cookies eg, "justthis.domain.org"
9778     * or ".any.subdomain.net"
9779     */
9780    public const CookieDomain = [
9781        'default' => '',
9782    ];
9783
9784    /**
9785     * Set this variable if you want to restrict cookies to a certain path within
9786     * the domain specified by $wgCookieDomain.
9787     */
9788    public const CookiePath = [
9789        'default' => '/',
9790    ];
9791
9792    /**
9793     * Whether the "secure" flag should be set on the cookie. This can be:
9794     *   - true:      Set secure flag
9795     *   - false:     Don't set secure flag
9796     *   - "detect":  Set the secure flag if $wgServer is set to an HTTPS URL,
9797     *                or if $wgForceHTTPS is true.
9798     *
9799     * If $wgForceHTTPS is true, session cookies will be secure regardless of this
9800     * setting. However, other cookies will still be affected.
9801     */
9802    public const CookieSecure = [
9803        'default' => 'detect',
9804        'dynamicDefault' => [ 'use' => [ 'ForceHTTPS' ] ]
9805    ];
9806
9807    public static function getDefaultCookieSecure( bool $forceHTTPS ): bool {
9808        return $forceHTTPS || ( WebRequest::detectProtocol() === 'https' );
9809    }
9810
9811    /**
9812     * Cookies generated by MediaWiki have names starting with this prefix. Set it
9813     * to a string to use a custom prefix. Setting it to false causes the database
9814     * name to be used as a prefix.
9815     */
9816    public const CookiePrefix = [
9817        'default' => false,
9818        'dynamicDefault' => [
9819            'use' => [ 'SharedDB', 'SharedPrefix', 'SharedTables', 'DBname', 'DBprefix' ]
9820        ],
9821    ];
9822
9823    public static function getDefaultCookiePrefix(
9824        ?string $sharedDB, ?string $sharedPrefix, array $sharedTables, string $dbName, string $dbPrefix
9825    ): string {
9826        if ( $sharedDB && in_array( 'user', $sharedTables ) ) {
9827            return $sharedDB . ( $sharedPrefix ? "_$sharedPrefix" : '' );
9828        }
9829        return $dbName . ( $dbPrefix ? "_$dbPrefix" : '' );
9830    }
9831
9832    /**
9833     * Set authentication cookies to HttpOnly to prevent access by JavaScript,
9834     * in browsers that support this feature. This can mitigates some classes of
9835     * XSS attack.
9836     */
9837    public const CookieHttpOnly = [
9838        'default' => true,
9839    ];
9840
9841    /**
9842     * The SameSite cookie attribute used for login cookies. This can be "Lax",
9843     * "Strict", "None" or empty/null to omit the attribute.
9844     *
9845     * This only applies to login cookies, since the correct value for other
9846     * cookies depends on what kind of cookie it is.
9847     *
9848     * @since 1.35
9849     */
9850    public const CookieSameSite = [
9851        'default' => null,
9852        'type' => '?string',
9853    ];
9854
9855    /**
9856     * A list of cookies that vary the cache (for use by extensions)
9857     */
9858    public const CacheVaryCookies = [
9859        'default' => [],
9860        'type' => 'list',
9861    ];
9862
9863    /**
9864     * Override to customise the session name
9865     */
9866    public const SessionName = [
9867        'default' => false,
9868    ];
9869
9870    /**
9871     * Whether to set a cookie when a user is autoblocked. Doing so means that a blocked user, even
9872     * after logging out and moving to a new IP address, will still be blocked. This cookie will
9873     * contain an authentication code if $wgSecretKey is set, or otherwise will just be the block
9874     * ID (in which case there is a possibility of an attacker discovering the names of revdeleted
9875     * users, so it is best to use this in conjunction with $wgSecretKey being set).
9876     */
9877    public const CookieSetOnAutoblock = [
9878        'default' => true,
9879    ];
9880
9881    /**
9882     * Whether to set a cookie when a logged-out user is blocked. Doing so means that a blocked
9883     * user, even after moving to a new IP address, will still be blocked. This cookie will contain
9884     * an authentication code if $wgSecretKey is set, or otherwise will just be the block ID (in
9885     * which case there is a possibility of an attacker discovering the names of revdeleted users,
9886     * so it is best to use this in conjunction with $wgSecretKey being set).
9887     */
9888    public const CookieSetOnIpBlock = [
9889        'default' => true,
9890    ];
9891
9892    // endregion -- end of cookie settings
9893
9894    /***************************************************************************/
9895    // region   Profiling, testing and debugging
9896    /** @name   Profiling, testing and debugging */
9897    // See $wgProfiler for how to enable profiling.
9898
9899    /**
9900     * Enable verbose debug logging for all channels and log levels.
9901     *
9902     * See https://www.mediawiki.org/wiki/How_to_debug
9903     *
9904     * For static requests, this enables all channels and warning-level and
9905     * above only. Use $wgDebugRawPage to make those verbose as well.
9906     *
9907     * The debug log file should be not be web-accessible if it is used in
9908     * a production environment, as may contain private data.
9909     */
9910    public const DebugLogFile = [
9911        'default' => '',
9912    ];
9913
9914    /**
9915     * Prefix for debug log lines
9916     */
9917    public const DebugLogPrefix = [
9918        'default' => '',
9919    ];
9920
9921    /**
9922     * If true, instead of redirecting, show a page with a link to the redirect
9923     * destination. This allows for the inspection of PHP error messages, and easy
9924     * resubmission of form data. For developer use only.
9925     */
9926    public const DebugRedirects = [
9927        'default' => false,
9928    ];
9929
9930    /**
9931     * If true, debug logging is also enabled for load.php and action=raw requests.
9932     *
9933     * By default, $wgDebugLogFile enables all channels and warning-level and
9934     * above for static requests.
9935     *
9936     * This ensures that the debug log is likely a chronological record of
9937     * of specific web request you are debugging, instead of overlapping with
9938     * messages from static requests, which would make it unclear which message
9939     * originated from what request.
9940     *
9941     * Also, during development this can make browsing and JavaScript testing
9942     * considerably slower (T85805).
9943     */
9944    public const DebugRawPage = [
9945        'default' => false,
9946    ];
9947
9948    /**
9949     * Send debug data to an HTML comment in the output.
9950     *
9951     * This may occasionally be useful when supporting a non-technical end-user.
9952     * It's more secure than exposing the debug log file to the web, since the
9953     * output only contains private data for the current user. But it's not ideal
9954     * for development use since data is lost on fatal errors and redirects.
9955     */
9956    public const DebugComments = [
9957        'default' => false,
9958    ];
9959
9960    /**
9961     * Write SQL queries to the debug log.
9962     *
9963     * This setting is only used $wgLBFactoryConf['class'] is set to
9964     * '\Wikimedia\Rdbms\LBFactorySimple'; otherwise the DBO_DEBUG flag must be set in
9965     * the 'flags' option of the database connection to achieve the same functionality.
9966     */
9967    public const DebugDumpSql = [
9968        'default' => false,
9969    ];
9970
9971    /**
9972     * Performance expectations for DB usage
9973     *
9974     * @since 1.26
9975     */
9976    public const TrxProfilerLimits = [
9977        'default' => [
9978            // HTTP GET/HEAD requests.
9979            // Primary queries should not happen on GET requests
9980            'GET' => [
9981                'masterConns' => 0,
9982                'writes' => 0,
9983                'readQueryTime' => 5,
9984                'readQueryRows' => 10000
9985            ],
9986            // HTTP POST requests.
9987            // Primary reads and writes will happen for a subset of these.
9988            'POST' => [
9989                'readQueryTime' => 5,
9990                'writeQueryTime' => 1,
9991                'readQueryRows' => 100_000,
9992                'maxAffected' => 1000
9993            ],
9994            'POST-nonwrite' => [
9995                'writes' => 0,
9996                'readQueryTime' => 5,
9997                'readQueryRows' => 10000
9998            ],
9999            // Deferred updates that run after HTTP response is sent for GET requests
10000            'PostSend-GET' => [
10001                'readQueryTime' => 5,
10002                'writeQueryTime' => 1,
10003                'readQueryRows' => 10000,
10004                'maxAffected' => 1000,
10005                // Log primary queries under the post-send entry point as they are discouraged
10006                'masterConns' => 0,
10007                'writes' => 0,
10008            ],
10009            // Deferred updates that run after HTTP response is sent for POST requests
10010            'PostSend-POST' => [
10011                'readQueryTime' => 5,
10012                'writeQueryTime' => 1,
10013                'readQueryRows' => 100_000,
10014                'maxAffected' => 1000
10015            ],
10016            // Background job runner
10017            'JobRunner' => [
10018                'readQueryTime' => 30,
10019                'writeQueryTime' => 5,
10020                'readQueryRows' => 100_000,
10021                'maxAffected' => 500 // ballpark of $wgUpdateRowsPerQuery
10022            ],
10023            // Command-line scripts
10024            'Maintenance' => [
10025                'writeQueryTime' => 5,
10026                'maxAffected' => 1000
10027            ]
10028        ],
10029        'type' => 'map',
10030    ];
10031
10032    /**
10033     * Map of string log group names to log destinations.
10034     *
10035     * If set, wfDebugLog() output for that group will go to that file instead
10036     * of the regular $wgDebugLogFile. Useful for enabling selective logging
10037     * in production.
10038     *
10039     * Log destinations may be one of the following:
10040     * - false to completely remove from the output, including from $wgDebugLogFile.
10041     * - string values specifying a filename or URI.
10042     * - associative array with keys:
10043     *   - 'destination' desired filename or URI.
10044     *   - 'sample' an integer value, specifying a sampling factor (optional)
10045     *   - 'level' A \Psr\Log\LogLevel constant, indicating the minimum level
10046     *             to log (optional, since 1.25)
10047     *
10048     * **Example:**
10049     *
10050     * ```
10051     * $wgDebugLogGroups['redis'] = '/var/log/mediawiki/redis.log';
10052     * ```
10053     *
10054     * **Advanced example:**
10055     *
10056     * ```
10057     * $wgDebugLogGroups['memcached'] = [
10058     *     'destination' => '/var/log/mediawiki/memcached.log',
10059     *     'sample' => 1000,  // log 1 message out of every 1,000.
10060     *     'level' => \Psr\Log\LogLevel::WARNING
10061     * ];
10062     * ```
10063     */
10064    public const DebugLogGroups = [
10065        'default' => [],
10066        'type' => 'map',
10067    ];
10068
10069    /**
10070     * Default service provider for creating Psr\Log\LoggerInterface instances.
10071     *
10072     * The value should be an array suitable for use with
10073     * ObjectFactory::getObjectFromSpec(). The created object is expected to
10074     * implement the MediaWiki\Logger\Spi interface. See ObjectFactory for additional
10075     * details.
10076     *
10077     * Alternately the MediaWiki\Logger\LoggerFactory::registerProvider method can
10078     * be called to inject an MediaWiki\Logger\Spi instance into the LoggerFactory
10079     * and bypass the use of this configuration variable entirely.
10080     *
10081     * **To completely disable logging:**
10082     *
10083     * ```
10084     * $wgMWLoggerDefaultSpi = [ 'class' => \MediaWiki\Logger\NullSpi::class ];
10085     * ```
10086     *
10087     * @since 1.25
10088     * @see \MwLogger
10089     */
10090    public const MWLoggerDefaultSpi = [
10091        'default' => [ 'class' => 'MediaWiki\\Logger\\LegacySpi', ],
10092        'mergeStrategy' => 'replace',
10093        'type' => 'map',
10094    ];
10095
10096    /**
10097     * Display debug data at the bottom of the main content area.
10098     *
10099     * Useful for developers and technical users trying to working on a closed wiki.
10100     */
10101    public const ShowDebug = [
10102        'default' => false,
10103    ];
10104
10105    /**
10106     * Show the contents of $wgHooks in Special:Version
10107     */
10108    public const SpecialVersionShowHooks = [
10109        'default' => false,
10110    ];
10111
10112    /**
10113     * Show exception message and stack trace when printing details about uncaught exceptions
10114     * in web response output.
10115     *
10116     * This may reveal private information in error messages or function parameters.
10117     * If set to false, only the exception type or class name will be exposed.
10118     */
10119    public const ShowExceptionDetails = [
10120        'default' => false,
10121    ];
10122
10123    /**
10124     * If true, send the exception backtrace to the error log
10125     */
10126    public const LogExceptionBacktrace = [
10127        'default' => true,
10128    ];
10129
10130    /**
10131     * If true, the MediaWiki error handler passes errors/warnings to the default error handler
10132     * after logging them.
10133     */
10134    public const PropagateErrors = [
10135        'default' => true,
10136    ];
10137
10138    /**
10139     * Expose backend server host names through the API and various HTML comments
10140     */
10141    public const ShowHostnames = [
10142        'default' => false,
10143    ];
10144
10145    /**
10146     * Override server hostname detection with a hardcoded value.
10147     *
10148     * Should be a string, default false.
10149     *
10150     * @since 1.20
10151     */
10152    public const OverrideHostname = [
10153        'default' => false,
10154    ];
10155
10156    /**
10157     * If set to true MediaWiki will throw notices for some possible error
10158     * conditions and for deprecated functions.
10159     */
10160    public const DevelopmentWarnings = [
10161        'default' => false,
10162    ];
10163
10164    /**
10165     * Release limitation to wfDeprecated warnings, if set to a release number
10166     * development warnings will not be generated for deprecations added in releases
10167     * after the limit.
10168     */
10169    public const DeprecationReleaseLimit = [
10170        'default' => false,
10171    ];
10172
10173    /**
10174     * Profiler configuration.
10175     *
10176     * To use a profiler, set $wgProfiler in LocalSettings.php.
10177     *
10178     * Options:
10179     *
10180     * - 'class' (`string`): The Profiler subclass to use.
10181     *   Default: ProfilerStub.
10182     * - 'sampling' (`integer`): Only enable the profiler on one in this many requests.
10183     *   For requests that are not in the sampling,
10184     *   the 'class' option will be replaced with ProfilerStub.
10185     *   Default: `1`.
10186     * - 'threshold' (`float`): Only process the recorded data if the total elapsed
10187     *   time for a request is more than this number of seconds.
10188     *   Default: `0.0`.
10189     * - 'output' (`string|string[]`):  ProfilerOutput subclass or subclasess to use.
10190     *   Default: `[]`.
10191     *
10192     * The options array is passed in its entirety to the specified
10193     * Profiler `class`. Check individual Profiler subclasses for additional
10194     * options that may be available.
10195     *
10196     * Profiler subclasses available in MediaWiki core:
10197     *
10198     * - ProfilerXhprof: Based on XHProf or Tideways-XHProf.
10199     * - ProfilerExcimer: Based on Excimer.
10200     * - ProfilerSectionOnly
10201     *
10202     * Profiler output classes available in MediaWiki:
10203     *
10204     * - ProfilerOutputText: outputs profiling data in the web page body as
10205     *   a comment.  You can make the profiling data in HTML render visibly
10206     *   instead by setting the 'visible' configuration flag.
10207     *
10208     * - ProfilerOutputStats: outputs profiling data in a format as configured
10209     *   by $wgStatsFormat. It expects that $wgStatsTarget is set.
10210     *
10211     * - ProfilerOutputDump: outputs dump files that are compatible
10212     *   with the XHProf gui. It expects that `$wgProfiler['outputDir']`
10213     *   is set as well.
10214     *
10215     * Examples:
10216     *
10217     * ```
10218     * $wgProfiler = [
10219     *   'class' => ProfilerXhprof::class,
10220     *   'output' => ProfilerOutputText::class,
10221     * ];
10222     * ```
10223     *
10224     * ```
10225     * $wgProfiler = [
10226     *   'class' => ProfilerXhprof::class,
10227     *   'output' => [ ProfilerOutputText::class ],
10228     *   'sampling' => 50, // one in every 50 requests
10229     * ];
10230     * ```
10231     *
10232     * For performance, the profiler is always disabled for CLI scripts as they
10233     * could be long running and the data would accumulate. Use the `--profiler`
10234     * parameter of maintenance scripts to override this.
10235     *
10236     * @since 1.17.0
10237     */
10238    public const Profiler = [
10239        'default' => [],
10240        'type' => 'map',
10241        'mergeStrategy' => 'replace',
10242    ];
10243
10244    /**
10245     * Destination of statsd metrics.
10246     *
10247     * A host or host:port of a statsd server. Port defaults to 8125.
10248     *
10249     * If not set, statsd metrics will not be collected.
10250     *
10251     * @see MediaWiki::emitBufferedStats()
10252     * @since 1.25
10253     */
10254    public const StatsdServer = [
10255        'default' => false,
10256    ];
10257
10258    /**
10259     * Prefix for metric names sent to $wgStatsdServer.
10260     *
10261     * @see \MediaWiki\MediaWikiServices::getInstance()->getStatsdDataFactory
10262     * @see \Wikimedia\Stats\BufferingStatsdDataFactory
10263     * @since 1.25
10264     */
10265    public const StatsdMetricPrefix = [
10266        'default' => 'MediaWiki',
10267    ];
10268
10269    /**
10270     * Stats output target URI e.g. udp://127.0.0.1:8125
10271     *
10272     * If null, metrics will not be sent.
10273     * Note: this only affects metrics instantiated by the StatsFactory service
10274     *
10275     * @since 1.38
10276     */
10277    public const StatsTarget = [
10278        'default' => null,
10279        'type' => '?string',
10280    ];
10281
10282    /**
10283     * Stats output format
10284     *
10285     * If null, metrics will not be rendered nor sent.
10286     * Note: this only affects metrics instantiated by the StatsFactory service
10287     *
10288     * @see \Wikimedia\Stats\OutputFormats::SUPPORTED_FORMATS
10289     * @since 1.41
10290     */
10291    public const StatsFormat = [
10292        'default' => null,
10293        'type' => '?string',
10294    ];
10295
10296    /**
10297     * Stats service name prefix
10298     *
10299     * Required.  Must not be zero-length.
10300     * Defaults to: 'mediawiki'
10301     * Note: this only affects metrics instantiated by the StatsFactory service
10302     *
10303     * @since 1.41
10304     */
10305    public const StatsPrefix = [
10306        'default' => 'mediawiki',
10307        'type' => 'string',
10308    ];
10309
10310    /**
10311     * Configuration for OpenTelemetry instrumentation, or `null` to disable it.
10312     * Possible keys:
10313     * - `samplingProbability`: probability in % of sampling a trace for which no sampling decision has been
10314     * taken yet. Must be between 0 and 100.
10315     * - `serviceName`: name of the service being instrumented.
10316     * - `endpoint`: URL of the OpenTelemetry collector to send trace data to.
10317     * This has to be an endpoint accepting OTLP data over HTTP (not gRPC).
10318     *
10319     * An example config to send data to a local OpenTelemetry or Jaeger collector instance:
10320     * ```
10321     * $wgOpenTelemetryConfig = [
10322     *  'samplingProbability' => 0.1,
10323     *  'serviceName' => 'mediawiki-local',
10324     *  'endpoint' => 'http://127.0.0.1:4318/v1/traces',
10325     * ];
10326     * ```
10327     * @since 1.43
10328     */
10329    public const OpenTelemetryConfig = [
10330        'default' => null,
10331        'type' => 'map|null'
10332    ];
10333
10334    /**
10335     * InfoAction retrieves a list of transclusion links (both to and from).
10336     *
10337     * This number puts a limit on that query in the case of highly transcluded
10338     * templates.
10339     */
10340    public const PageInfoTransclusionLimit = [
10341        'default' => 50,
10342    ];
10343
10344    /**
10345     * Allow running of QUnit tests via [[Special:JavaScriptTest]].
10346     */
10347    public const EnableJavaScriptTest = [
10348        'default' => false,
10349    ];
10350
10351    /**
10352     * Overwrite the caching key prefix with custom value.
10353     *
10354     * @since 1.19
10355     */
10356    public const CachePrefix = [
10357        'default' => false,
10358    ];
10359
10360    /**
10361     * Display the new debugging toolbar. This also enables profiling on database
10362     * queries and other useful output.
10363     *
10364     * Will be ignored if $wgUseFileCache or $wgUseCdn is enabled.
10365     *
10366     * @since 1.19
10367     */
10368    public const DebugToolbar = [
10369        'default' => false,
10370    ];
10371
10372    /**
10373     * Fraction of HTTP errors received by mw.Api to log client-side using mw.errorLogger.logError().
10374     * Additional setup is required to record these logs somewhere.
10375     *
10376     * Currently only logs HTTP 429 errors, but this may be extended in the future.
10377     *
10378     * @since 1.46
10379     */
10380    public const ApiClientErrorSampleRate = [
10381        'default' => 1.0,
10382    ];
10383
10384    // endregion -- end of profiling, testing and debugging
10385
10386    /***************************************************************************/
10387    // region   Search
10388    /** @name   Search */
10389
10390    /**
10391     * Set this to true to disable the full text search feature.
10392     */
10393    public const DisableTextSearch = [
10394        'default' => false,
10395    ];
10396
10397    /**
10398     * Set to true to have nicer highlighted text in search results,
10399     * by default off due to execution overhead
10400     */
10401    public const AdvancedSearchHighlighting = [
10402        'default' => false,
10403    ];
10404
10405    /**
10406     * Regexp to match word boundaries, defaults for non-CJK languages
10407     * should be empty for CJK since the words are not separate
10408     */
10409    public const SearchHighlightBoundaries = [
10410        'default' => '[\\p{Z}\\p{P}\\p{C}]',
10411    ];
10412
10413    /**
10414     * Templates for OpenSearch suggestions, defaults to API action=opensearch
10415     *
10416     * Sites with heavy load would typically have these point to a custom
10417     * PHP wrapper to avoid firing up mediawiki for every keystroke
10418     *
10419     * Placeholders: {searchTerms}
10420     */
10421    public const OpenSearchTemplates = [
10422        'default' => [
10423            'application/x-suggestions+json' => false,
10424            'application/x-suggestions+xml' => false,
10425        ],
10426        'type' => 'map',
10427    ];
10428
10429    /**
10430     * This was previously a used to force empty responses from ApiOpenSearch
10431     * with the 'suggest' parameter set.
10432     *
10433     * @deprecated since 1.35 No longer used
10434     */
10435    public const EnableOpenSearchSuggest = [
10436        'default' => true,
10437        'obsolete' => 'Since 1.35, no longer used',
10438        'description' => 'Has been emitting warnings since 1.39 (LTS). ' .
10439            'Can be removed completely in 1.44, assuming 1.43 is an LTS release.'
10440    ];
10441
10442    /**
10443     * Integer defining default number of entries to show on
10444     * OpenSearch call.
10445     */
10446    public const OpenSearchDefaultLimit = [
10447        'default' => 10,
10448    ];
10449
10450    /**
10451     * Minimum length of extract in <Description>. Actual extracts will last until the end of
10452     * sentence.
10453     */
10454    public const OpenSearchDescriptionLength = [
10455        'default' => 100,
10456    ];
10457
10458    /**
10459     * Expiry time for search suggestion responses
10460     */
10461    public const SearchSuggestCacheExpiry = [
10462        'default' => 1200,
10463    ];
10464
10465    /**
10466     * If you've disabled search semi-permanently, this also disables updates to the
10467     * table. If you ever re-enable, be sure to rebuild the search table.
10468     */
10469    public const DisableSearchUpdate = [
10470        'default' => false,
10471    ];
10472
10473    /**
10474     * List of namespaces which are searched by default.
10475     *
10476     * **Example:**
10477     *
10478     * ```
10479     * $wgNamespacesToBeSearchedDefault[NS_MAIN] = true;
10480     * $wgNamespacesToBeSearchedDefault[NS_PROJECT] = true;
10481     * ```
10482     */
10483    public const NamespacesToBeSearchedDefault = [
10484        'default' => [ NS_MAIN => true, ],
10485        'type' => 'map',
10486    ];
10487
10488    /**
10489     * Disable the internal MySQL-based search, to allow it to be
10490     * implemented by an extension instead.
10491     */
10492    public const DisableInternalSearch = [
10493        'default' => false,
10494    ];
10495
10496    /**
10497     * Set this to a URL to forward search requests to some external location.
10498     *
10499     * If the URL includes '$1', this will be replaced with the URL-encoded
10500     * search term. Before using this, $wgDisableTextSearch must be set to true.
10501     *
10502     * **Example:**
10503     * To forward to Google you'd have something like:
10504     *
10505     * ```
10506     * $wgSearchForwardUrl =
10507     * 'https://www.google.com/search?q=$1' .
10508     * '&domains=https://example.com' .
10509     * '&sitesearch=https://example.com' .
10510     * '&ie=utf-8&oe=utf-8';
10511     * ```
10512     */
10513    public const SearchForwardUrl = [
10514        'default' => null,
10515    ];
10516
10517    /**
10518     * Array of namespaces to generate a Google sitemap for when the
10519     * maintenance/generateSitemap.php script is run. If this is false, the API
10520     * will consult NamespaceRobotPolicies, whereas the maintenance script will
10521     * produce a sitemap for all namespaces.
10522     */
10523    public const SitemapNamespaces = [
10524        'default' => false,
10525        'type' => 'false|list',
10526    ];
10527
10528    /**
10529     * @deprecated since 1.45 and ignored
10530     */
10531    public const SitemapNamespacesPriorities = [
10532        'deprecated' => 'since 1.45 and ignored',
10533        'default' => false,
10534        'type' => 'false|map',
10535    ];
10536
10537    /**
10538     * Configuration for the sitemaps REST API endpoint /rest.php/site/v1/sitemap/0
10539     *
10540     * To use this API, set `$wgSitemapApiConfig['enabled'] = true` and then add
10541     * to robots.txt something like:
10542     *
10543     *   Sitemap: http://www.example.org/w/rest.php/site/v1/sitemap/0
10544     *
10545     * Search engines like Google will then use the sitemap to efficiently
10546     * discover pages on your site.
10547     *
10548     * If you have more than 500M pages (sitemapsPerIndex × pagesPerSitemap)
10549     * you can list multiple sitemaps in robots.txt, incrementing the number in
10550     * the index URL.
10551     *
10552     * An associative array with the following keys:
10553     *  - enabled: Whether to deliver sitemaps.
10554     *    Default: false.
10555     *  - sitemapsPerIndex: The maximum number of sitemap files to link to from
10556     *    each index file. This must be 50,000 or less to comply with the
10557     *    protocol.
10558     *    Default: 50,000.
10559     *  - pagesPerSitemap: The maximum number of URLs to link to from each
10560     *    sitemap file. This must be 50,000 or less to comply with the protocol.
10561     *    It might take a few seconds to render a sitemap with 50,000 URLs.
10562     *    Default: 10,000.
10563     *  - expiry: The cache expiry time in seconds.
10564     *    Default: 3600 (1 hour).
10565     *
10566     * @see https://www.sitemaps.org/protocol.html
10567     * @see \MediaWiki\Rest\Handler\SitemapHandlerBase
10568     * @since 1.45
10569     */
10570    public const SitemapApiConfig = [
10571        'default' => [],
10572        'type' => 'object',
10573        'additionalProperties' => [
10574            'enabled' => [ 'type' => 'bool' ],
10575            'sitemapsPerIndex' => [ 'type' => 'int' ],
10576            'pagesPerSitemap' => [ 'type' => 'int' ],
10577            'expiry' => [ 'type' => 'int' ],
10578        ]
10579    ];
10580
10581    /**
10582     * Options for Special:Search completion widget form created by SearchFormWidget class.
10583     *
10584     * Settings that can be used:
10585     * - showDescriptions: true/false - whether to show opensearch description results
10586     * - performSearchOnClick:  true/false - whether to perform search on click
10587     * See also TitleWidget.js UI widget.
10588     *
10589     * @since 1.34
10590     */
10591    public const SpecialSearchFormOptions = [
10592        'default' => [],
10593        'type' => 'map',
10594    ];
10595
10596    /**
10597     * Set true to allow logged-in users to set a preference whether or not matches in
10598     * search results should force redirection to that page. If false, the preference is
10599     * not exposed and cannot be altered from site default. To change your site's default
10600     * preference, set via $wgDefaultUserOptions['search-match-redirect'].
10601     *
10602     * @since 1.35
10603     */
10604    public const SearchMatchRedirectPreference = [
10605        'default' => false,
10606        'type' => 'boolean',
10607    ];
10608
10609    /**
10610     * Controls whether zero-result search queries with suggestions should display results for
10611     * these suggestions.
10612     *
10613     * @since 1.26
10614     */
10615    public const SearchRunSuggestedQuery = [
10616        'default' => true,
10617        'type' => 'boolean',
10618    ];
10619
10620    // endregion -- end of search settings
10621
10622    /***************************************************************************/
10623    // region   Edit user interface
10624    /** @name   Edit user interface */
10625
10626    /**
10627     * Path to the GNU diff3 utility. If the file doesn't exist, edit conflicts will
10628     * fall back to the old behavior (no merging).
10629     */
10630    public const Diff3 = [
10631        'default' => '/usr/bin/diff3',
10632    ];
10633
10634    /**
10635     * Path to the GNU diff utility.
10636     */
10637    public const Diff = [
10638        'default' => '/usr/bin/diff',
10639    ];
10640
10641    /**
10642     * Which namespaces have special treatment where they should be preview-on-open
10643     * Internally only Category: pages apply, but using this extensions (e.g. Semantic MediaWiki)
10644     * can specify namespaces of pages they have special treatment for
10645     */
10646    public const PreviewOnOpenNamespaces = [
10647        'default' => [
10648            NS_CATEGORY => true
10649        ],
10650        'type' => 'map',
10651    ];
10652
10653    /**
10654     * Enable the UniversalEditButton for browsers that support it
10655     * (currently only Firefox with an extension)
10656     * See http://universaleditbutton.org for more background information
10657     */
10658    public const UniversalEditButton = [
10659        'default' => true,
10660    ];
10661
10662    /**
10663     * If user doesn't specify any edit summary when making a an edit, MediaWiki
10664     * will try to automatically create one. This feature can be disabled by set-
10665     * ting this variable false.
10666     */
10667    public const UseAutomaticEditSummaries = [
10668        'default' => true,
10669    ];
10670
10671    // endregion -- end edit UI
10672
10673    /***************************************************************************/
10674    // region   Maintenance
10675    /** @name   Maintenance */
10676    // See also $wgSiteNotice
10677
10678    /**
10679     * For colorized maintenance script output, is your terminal background dark ?
10680     */
10681    public const CommandLineDarkBg = [
10682        'default' => false,
10683    ];
10684
10685    /**
10686     * Set this to a string to put the wiki into read-only mode. The text will be
10687     * used as an explanation to users.
10688     *
10689     * This prevents most write operations via the web interface. Cache updates may
10690     * still be possible. To prevent database writes completely, use the read_only
10691     * option in MySQL.
10692     */
10693    public const ReadOnly = [
10694        'default' => null,
10695    ];
10696
10697    /**
10698     * Set this to true to put the wiki watchlists into read-only mode.
10699     *
10700     * @since 1.31
10701     */
10702    public const ReadOnlyWatchedItemStore = [
10703        'default' => false,
10704        'type' => 'boolean',
10705    ];
10706
10707    /**
10708     * If this lock file exists (size > 0), the wiki will be forced into read-only mode.
10709     *
10710     * Its contents will be shown to users as part of the read-only warning
10711     * message.
10712     *
10713     * Will default to "{$wgUploadDirectory}/lock_yBgMBwiR" in Setup.php
10714     */
10715    public const ReadOnlyFile = [
10716        'default' => false,
10717        'dynamicDefault' => [ 'use' => [ 'UploadDirectory' ] ]
10718    ];
10719
10720    /**
10721     * @param mixed $uploadDirectory Value of UploadDirectory
10722     * @return string
10723     */
10724    public static function getDefaultReadOnlyFile( $uploadDirectory ): string {
10725        return "$uploadDirectory/lock_yBgMBwiR";
10726    }
10727
10728    /**
10729     * When you run the web-based upgrade utility, it will tell you what to set
10730     * this to in order to authorize the upgrade process. It will subsequently be
10731     * used as a password, to authorize further upgrades.
10732     *
10733     * For security, do not set this to a guessable string. Use the value supplied
10734     * by the install/upgrade process. To cause the upgrader to generate a new key,
10735     * delete the old key from LocalSettings.php.
10736     */
10737    public const UpgradeKey = [
10738        'default' => false,
10739    ];
10740
10741    /**
10742     * Fully specified path to git binary
10743     */
10744    public const GitBin = [
10745        'default' => '/usr/bin/git',
10746    ];
10747
10748    /**
10749     * Map GIT repository URLs to viewer URLs to provide links in Special:Version
10750     *
10751     * Key is a pattern passed to preg_match() and preg_replace(),
10752     * without the delimiters (which are #) and must match the whole URL.
10753     * The value is the replacement for the key (it can contain $1, etc.)
10754     * %h will be replaced by the short SHA-1 (7 first chars) and %H by the
10755     * full SHA-1 of the HEAD revision.
10756     * %r will be replaced with a URL-encoded version of $1.
10757     * %R will be replaced with $1 and no URL-encoding
10758     *
10759     * @since 1.20
10760     */
10761    public const GitRepositoryViewers = [
10762        'default' => [
10763            'https://(?:[a-z0-9_]+@)?gerrit\.wikimedia\.org/r/(?:p/)?(.*)' => 'https://gerrit.wikimedia.org/g/%R/+/%H',
10764            'ssh://(?:[a-z0-9_]+@)?gerrit\.wikimedia\.org:29418/(.*)' => 'https://gerrit.wikimedia.org/g/%R/+/%H',
10765            'https://github\.com/(.*?)(\.git)?' => 'https://github.com/$1/commit/%H',
10766            'git@github\.com:(.*?)(\.git)?' => 'https://github.com/$1/commit/%H',
10767        ],
10768        'type' => 'map',
10769    ];
10770
10771    /**
10772     * Initial content to create when installing a wiki. An array of page info
10773     * arrays. Each must contain at least one of:
10774     *   - title: The title to create (string)
10775     *   - titlemsg: The name of a message to read the title from
10776     *
10777     * And one of:
10778     *   - text: The text to write to the page (string)
10779     *   - textmsg: The name of a message to read the page contents from
10780     *
10781     * The text may contain
10782     *   - {{InstallerOption:<name>}}: This will be replaced with the named option value
10783     *   - {{InstallerConfig:<name>}}: This will be replaced with the named config value
10784     *
10785     * @see \InstallPreConfigured
10786     * @since 1.44
10787     */
10788    public const InstallerInitialPages = [
10789        'default' => [
10790            [
10791                'titlemsg' => 'mainpage',
10792                'text' => "{{subst:int:mainpagetext}}\n\n{{subst:int:mainpagedocfooter}}",
10793            ]
10794        ],
10795        'type' => 'list'
10796    ];
10797
10798    // endregion -- End of maintenance
10799
10800    /***************************************************************************/
10801    // region   Recent changes, new pages, watchlist and history
10802    /** @name   Recent changes, new pages, watchlist and history */
10803
10804    /**
10805     * Recentchanges items are periodically purged; entries older than this many
10806     * seconds will go.
10807     *
10808     * Default: 90 days = about three months
10809     */
10810    public const RCMaxAge = [
10811        'default' => 90 * 24 * 3600,
10812    ];
10813
10814    /**
10815     * Page watchers inactive for more than this many seconds are considered inactive.
10816     *
10817     * Used mainly by action=info. Default: 180 days = about six months.
10818     *
10819     * @since 1.26
10820     */
10821    public const WatchersMaxAge = [
10822        'default' => 180 * 24 * 3600,
10823    ];
10824
10825    /**
10826     * If active watchers (per above) are this number or less, do not disclose it.
10827     *
10828     * Left to 1, prevents unprivileged users from knowing for sure that there are 0.
10829     * Set to -1 if you want to always complement watchers count with this info.
10830     *
10831     * @since 1.26
10832     */
10833    public const UnwatchedPageSecret = [
10834        'default' => 1,
10835    ];
10836
10837    /**
10838     * Filter $wgRCLinkDays by $wgRCMaxAge to avoid showing links for numbers
10839     * higher than what will be stored. Note that this is disabled by default
10840     * because we sometimes do have RC data which is beyond the limit for some
10841     * reason, and some users may use the high numbers to display that data which
10842     * is still there.
10843     */
10844    public const RCFilterByAge = [
10845        'default' => false,
10846    ];
10847
10848    /**
10849     * List of Limits options to list in the Special:Recentchanges and
10850     * Special:Recentchangeslinked pages.
10851     */
10852    public const RCLinkLimits = [
10853        'default' => [ 50, 100, 250, 500 ],
10854        'type' => 'list',
10855    ];
10856
10857    /**
10858     * List of Days options to list in the Special:Recentchanges and
10859     * Special:Recentchangeslinked pages.
10860     *
10861     * @see \MediaWiki\SpecialPage\ChangesListSpecialPage::getLinkDays
10862     */
10863    public const RCLinkDays = [
10864        'default' => [ 1, 3, 7, 14, 30 ],
10865        'type' => 'list',
10866    ];
10867
10868    /**
10869     * Configuration for feeds to which notifications about recent changes will be sent.
10870     *
10871     * The following feed classes are available by default:
10872     * - 'UDPRCFeedEngine' - sends recent changes over UDP to the specified server.
10873     * - 'RedisPubSubFeedEngine' - send recent changes to Redis.
10874     *
10875     * Only 'class' or 'uri' is required. If 'uri' is set instead of 'class', then
10876     * RecentChange::getEngine() is used to determine the class. All options are
10877     * passed to the constructor.
10878     *
10879     * Common options:
10880     * - 'class' -- The class to use for this feed (must implement RCFeed).
10881     * - 'omit_bots' -- Exclude bot edits from the feed. (default: false)
10882     * - 'omit_anon' -- Exclude anonymous edits from the feed. (default: false)
10883     * - 'omit_user' -- Exclude edits by registered users from the feed. (default: false)
10884     * - 'omit_minor' -- Exclude minor edits from the feed. (default: false)
10885     * - 'omit_patrolled' -- Exclude patrolled edits from the feed. (default: false)
10886     *
10887     * FormattedRCFeed-specific options:
10888     * - 'uri' -- [required] The address to which the messages are sent.
10889     * - 'formatter' -- [required] The class (implementing RCFeedFormatter) which will
10890     *   produce the text to send. This can also be an object of the class.
10891     *   Formatters available by default: JSONRCFeedFormatter, XMLRCFeedFormatter,
10892     *   IRCColourfulRCFeedFormatter.
10893     *
10894     * IRCColourfulRCFeedFormatter-specific options:
10895     * - 'add_interwiki_prefix' -- whether the titles should be prefixed with
10896     *   the first entry in the $wgLocalInterwikis array
10897     *
10898     * JSONRCFeedFormatter-specific options:
10899     * - 'channel' -- if set, the 'channel' parameter is also set in JSON values.
10900     *
10901     * **Examples:**
10902     *
10903     * ```
10904     * $wgRCFeeds['example'] = [
10905     *     'uri' => 'udp://localhost:1336',
10906     *     'formatter' => 'JSONRCFeedFormatter',
10907     *     'add_interwiki_prefix' => false,
10908     *     'omit_bots' => true,
10909     * ];
10910     * ```
10911     *
10912     * ```
10913     * $wgRCFeeds['example'] = [
10914     *     'uri' => 'udp://localhost:1338',
10915     *     'formatter' => 'IRCColourfulRCFeedFormatter',
10916     *     'add_interwiki_prefix' => false,
10917     *     'omit_bots' => true,
10918     * ];
10919     * ```
10920     *
10921     * ```
10922     * $wgRCFeeds['example'] = [
10923     *     'class' => ExampleRCFeed::class,
10924     * ];
10925     * ```
10926     *
10927     * @since 1.22
10928     */
10929    public const RCFeeds = [
10930        'default' => [],
10931        'type' => 'map',
10932    ];
10933
10934    /**
10935     * Treat category membership changes as a RecentChange.
10936     *
10937     * Changes are mentioned in RC for page actions as follows:
10938     * - creation: pages created with categories are mentioned
10939     * - edit: category additions/removals to existing pages are mentioned
10940     * - move: nothing is mentioned (unless templates used depend on the title)
10941     * - deletion: nothing is mentioned
10942     * - undeletion: nothing is mentioned
10943     *
10944     * @since 1.27
10945     */
10946    public const RCWatchCategoryMembership = [
10947        'default' => false,
10948    ];
10949
10950    /**
10951     * Use RC Patrolling to check for vandalism (from recent changes and watchlists)
10952     * New pages and new files are included.
10953     *
10954     * @note If you disable all patrolling features, you probably also want to
10955     * remove 'patrol' from $wgFilterLogTypes so a show/hide link isn't shown on
10956     * Special:Log.
10957     */
10958    public const UseRCPatrol = [
10959        'default' => true,
10960    ];
10961
10962    /**
10963     * Polling rate, in seconds, used by the 'live update' and 'view newest' features
10964     * of the RCFilters app on SpecialRecentChanges and Special:Watchlist.
10965     *
10966     * 0 to disable completely.
10967     */
10968    public const StructuredChangeFiltersLiveUpdatePollingRate = [
10969        'default' => 3,
10970    ];
10971
10972    /**
10973     * Use new page patrolling to check new pages on Special:Newpages
10974     *
10975     * @note If you disable all patrolling features, you probably also want to
10976     * remove 'patrol' from $wgFilterLogTypes so a show/hide link isn't shown on
10977     * Special:Log.
10978     */
10979    public const UseNPPatrol = [
10980        'default' => true,
10981    ];
10982
10983    /**
10984     * Use file patrolling to check new files on Special:Newfiles
10985     *
10986     * @note If you disable all patrolling features, you probably also want to
10987     * remove 'patrol' from $wgFilterLogTypes so a show/hide link isn't shown on
10988     * Special:Log.
10989     * @since 1.27
10990     */
10991    public const UseFilePatrol = [
10992        'default' => true,
10993    ];
10994
10995    /**
10996     * Provide syndication feeds (RSS, Atom) for, e.g., Recentchanges, Newpages
10997     */
10998    public const Feed = [
10999        'default' => true,
11000    ];
11001
11002    /**
11003     * Set maximum number of results to return in syndication feeds (RSS, Atom) for
11004     * eg Recentchanges, Newpages.
11005     */
11006    public const FeedLimit = [
11007        'default' => 50,
11008    ];
11009
11010    /**
11011     * _Minimum_ timeout for cached Recentchanges feed, in seconds.
11012     *
11013     * A cached version will continue to be served out even if changes
11014     * are made, until this many seconds runs out since the last render.
11015     *
11016     * If set to 0, feed caching is disabled. Use this for debugging only;
11017     * feed generation can be pretty slow with diffs.
11018     */
11019    public const FeedCacheTimeout = [
11020        'default' => 60,
11021    ];
11022
11023    /**
11024     * When generating Recentchanges RSS/Atom feed, diffs will not be generated for
11025     * pages larger than this size.
11026     */
11027    public const FeedDiffCutoff = [
11028        'default' => 32768,
11029    ];
11030
11031    /**
11032     * Override the site's default RSS/ATOM feed for recentchanges that appears on
11033     * every page. Some sites might have a different feed they'd like to promote
11034     * instead of the RC feed (maybe like a "Recent New Articles" or "Breaking news" one).
11035     *
11036     * Should be a format as key (either 'rss' or 'atom') and an URL to the feed
11037     * as value.
11038     *
11039     * **Example:**
11040     * Configure the 'atom' feed to https://example.com/somefeed.xml
11041     *
11042     * ```
11043     * $wgSiteFeed['atom'] = "https://example.com/somefeed.xml";
11044     * ```
11045     */
11046    public const OverrideSiteFeed = [
11047        'default' => [],
11048        'type' => 'map',
11049    ];
11050
11051    /**
11052     * Available feeds objects.
11053     *
11054     * Should probably only be defined when a page is syndicated ie when
11055     * $wgOut->isSyndicated() is true.
11056     */
11057    public const FeedClasses = [
11058        'default' => [
11059            'rss' => \MediaWiki\Feed\RSSFeed::class,
11060            'atom' => \MediaWiki\Feed\AtomFeed::class,
11061        ],
11062        'type' => 'map',
11063    ];
11064
11065    /**
11066     * Which feed types should we provide by default?  This can include 'rss',
11067     * 'atom', neither, or both.
11068     */
11069    public const AdvertisedFeedTypes = [
11070        'default' => [ 'atom', ],
11071        'type' => 'list',
11072    ];
11073
11074    /**
11075     * Show watching users in recent changes, watchlist and page history views
11076     */
11077    public const RCShowWatchingUsers = [
11078        'default' => false,
11079    ];
11080
11081    /**
11082     * Show the amount of changed characters in recent changes
11083     */
11084    public const RCShowChangedSize = [
11085        'default' => true,
11086    ];
11087
11088    /**
11089     * If the difference between the character counts of the text
11090     * before and after the edit is below that value, the value will be
11091     * highlighted on the RC page.
11092     */
11093    public const RCChangedSizeThreshold = [
11094        'default' => 500,
11095    ];
11096
11097    /**
11098     * Show "Updated (since my last visit)" marker in RC view, watchlist and history
11099     * view for watched pages with new changes
11100     */
11101    public const ShowUpdatedMarker = [
11102        'default' => true,
11103    ];
11104
11105    /**
11106     * Disable links to talk pages of anonymous users (IPs) in listings on special
11107     * pages like page history, Special:Recentchanges, etc.
11108     */
11109    public const DisableAnonTalk = [
11110        'default' => false,
11111    ];
11112
11113    /**
11114     * Allow filtering by change tag in recentchanges, history, etc
11115     * Has no effect if no tags are defined.
11116     */
11117    public const UseTagFilter = [
11118        'default' => true,
11119    ];
11120
11121    /**
11122     * List of core tags to enable.
11123     *
11124     * @since 1.31
11125     * @since 1.36 Added 'mw-manual-revert' and 'mw-reverted'
11126     * @see \MediaWiki\ChangeTags\ChangeTags::TAG_CONTENT_MODEL_CHANGE
11127     * @see \MediaWiki\ChangeTags\ChangeTags::TAG_NEW_REDIRECT
11128     * @see \MediaWiki\ChangeTags\ChangeTags::TAG_REMOVED_REDIRECT
11129     * @see \MediaWiki\ChangeTags\ChangeTags::TAG_CHANGED_REDIRECT_TARGET
11130     * @see \MediaWiki\ChangeTags\ChangeTags::TAG_BLANK
11131     * @see \MediaWiki\ChangeTags\ChangeTags::TAG_REPLACE
11132     * @see \MediaWiki\ChangeTags\ChangeTags::TAG_RECREATE
11133     * @see \MediaWiki\ChangeTags\ChangeTags::TAG_ROLLBACK
11134     * @see \MediaWiki\ChangeTags\ChangeTags::TAG_UNDO
11135     * @see \MediaWiki\ChangeTags\ChangeTags::TAG_MANUAL_REVERT
11136     * @see \MediaWiki\ChangeTags\ChangeTags::TAG_REVERTED
11137     * @see \MediaWiki\ChangeTags\ChangeTags::TAG_SERVER_SIDE_UPLOAD
11138     * @see \MediaWiki\ChangeTags\ChangeTags::TAG_IPBLOCK_APPEAL
11139     */
11140    public const SoftwareTags = [
11141        'default' => [
11142            'mw-contentmodelchange' => true,
11143            'mw-new-redirect' => true,
11144            'mw-removed-redirect' => true,
11145            'mw-changed-redirect-target' => true,
11146            'mw-blank' => true,
11147            'mw-replace' => true,
11148            'mw-recreated' => true,
11149            'mw-rollback' => true,
11150            'mw-undo' => true,
11151            'mw-manual-revert' => true,
11152            'mw-reverted' => true,
11153            'mw-server-side-upload' => true,
11154            'mw-ipblock-appeal' => true,
11155            'mw-edited-other-users-js' => true,
11156            'mw-edited-other-users-css' => true,
11157        ],
11158        'type' => 'map',
11159        'additionalProperties' => [ 'type' => 'boolean', ],
11160    ];
11161
11162    /**
11163     * Maps a rights-restricted change tag name to the right(s) that can view it.
11164     * The rights can either be a single right or list of rights that can view the tag.
11165     *
11166     * Tags are private if they are prefixed with `mw-private-` (as defined at
11167     * {@link ChangeTagsStore::PRIVATE_TAG_PREFIX}). Tags without this prefix that are listed here remain public,
11168     * and any tag with `mw-private-` without a definition here is visible to no-one.
11169     *
11170     * Extensions can add entries via the {@link ListRestrictedTagsHook} hook.
11171     *
11172     * @since 1.47
11173     */
11174    public const RestrictedTagViewRights = [
11175        'default' => [],
11176        'type' => 'map',
11177    ];
11178
11179    /**
11180     * If set to an integer, pages that are watched by this many users or more
11181     * will not require the unwatchedpages permission to view the number of
11182     * watchers.
11183     *
11184     * @since 1.21
11185     */
11186    public const UnwatchedPageThreshold = [
11187        'default' => false,
11188    ];
11189
11190    /**
11191     * Flags (letter symbols) shown in recent changes and watchlist to indicate
11192     * certain types of edits.
11193     *
11194     * To register a new one:
11195     *
11196     * ```
11197     * $wgRecentChangesFlags['flag'] => [
11198     *   // message for the letter displayed next to rows on changes lists
11199     *   'letter' => 'letter-msg',
11200     *   // message for the tooltip of the letter
11201     *   'title' => 'tooltip-msg',
11202     *   // optional (defaults to 'tooltip-msg'), message to use in the legend box
11203     *   'legend' => 'legend-msg',
11204     *   // optional (defaults to 'flag'), CSS class to put on changes lists rows
11205     *   'class' => 'css-class',
11206     *   // optional (defaults to 'any'), how top-level flag is determined.  'any'
11207     *   // will set the top-level flag if any line contains the flag, 'all' will
11208     *   // only be set if all lines contain the flag.
11209     *   'grouping' => 'any',
11210     * ];
11211     * ```
11212     *
11213     * @since 1.22
11214     */
11215    public const RecentChangesFlags = [
11216        'default' => [
11217            'newpage' => [
11218                'letter' => 'newpageletter',
11219                'title' => 'recentchanges-label-newpage',
11220                'legend' => 'recentchanges-legend-newpage',
11221                'grouping' => 'any',
11222            ],
11223            'minor' => [
11224                'letter' => 'minoreditletter',
11225                'title' => 'recentchanges-label-minor',
11226                'legend' => 'recentchanges-legend-minor',
11227                'class' => 'minoredit',
11228                'grouping' => 'all',
11229            ],
11230            'bot' => [
11231                'letter' => 'boteditletter',
11232                'title' => 'recentchanges-label-bot',
11233                'legend' => 'recentchanges-legend-bot',
11234                'class' => 'botedit',
11235                'grouping' => 'all',
11236            ],
11237            'unpatrolled' => [
11238                'letter' => 'unpatrolledletter',
11239                'title' => 'recentchanges-label-unpatrolled',
11240                'legend' => 'recentchanges-legend-unpatrolled',
11241                'grouping' => 'any',
11242            ],
11243        ],
11244        'type' => 'map',
11245    ];
11246
11247    /**
11248     * Whether to enable the watchlist expiry feature.
11249     *
11250     * @since 1.35
11251     */
11252    public const WatchlistExpiry = [
11253        'default' => false,
11254        'type' => 'boolean',
11255    ];
11256
11257    /**
11258     * Whether to enable the watchstar popover.
11259     *
11260     * @since 1.47
11261     */
11262    public const EnableWatchstarPopover = [
11263        'default' => false,
11264        'type' => 'boolean',
11265    ];
11266
11267    /**
11268     * Whether to enable the watchlist labels feature.
11269     *
11270     * @since 1.46
11271     */
11272    public const EnableWatchlistLabels = [
11273        'default' => false,
11274        'type' => 'boolean',
11275    ];
11276
11277    /**
11278     * Maximum number of labels a user can create for their watchlist.
11279     *
11280     * @since 1.46
11281     */
11282    public const WatchlistLabelsMaxPerUser = [
11283        'default' => 100,
11284        'type' => 'integer',
11285    ];
11286
11287    /**
11288     * Chance of expired watchlist items being purged on any page edit.
11289     *
11290     * Only has effect if $wgWatchlistExpiry is true.
11291     *
11292     * If this is zero, expired watchlist items will not be removed
11293     * and the purgeExpiredWatchlistItems.php maintenance script should be run periodically.
11294     *
11295     * @since 1.35
11296     */
11297    public const WatchlistPurgeRate = [
11298        'default' => 0.1,
11299        'type' => 'float',
11300    ];
11301
11302    /**
11303     * Relative maximum duration for watchlist expiries, as accepted by strtotime().
11304     *
11305     * This relates to finite watchlist expiries only. Pages can be watched indefinitely
11306     * regardless of what this is set to.
11307     *
11308     * This is used to ensure the watchlist_expiry table doesn't grow to be too big.
11309     *
11310     * Only has effect if $wgWatchlistExpiry is true.
11311     *
11312     * Set to null to allow expiries of any duration.
11313     *
11314     * @since 1.35
11315     */
11316    public const WatchlistExpiryMaxDuration = [
11317        'default' => '1 year',
11318        'type' => '?string',
11319    ];
11320
11321    /**
11322     * Allow Watchlist and RecentChangesLinked queries to be partitioned by
11323     * rc_timestamp. This may help with performance. (T403798)
11324     *
11325     * @since 1.45
11326     */
11327    public const EnableChangesListQueryPartitioning = [
11328        'default' => false,
11329        'type' => 'bool',
11330    ];
11331
11332    // endregion -- end RC/watchlist
11333
11334    /***************************************************************************/
11335    // region   Copyright and credits settings
11336    /** @name   Copyright and credits settings */
11337
11338    /**
11339     * Override for copyright metadata.
11340     *
11341     * This is the name of the page containing information about the wiki's copyright status,
11342     * which will be added as a link in the footer if it is specified. It overrides
11343     * $wgRightsUrl if both are specified.
11344     */
11345    public const RightsPage = [
11346        'default' => null,
11347    ];
11348
11349    /**
11350     * Set this to specify an external URL containing details about the content license used on your
11351     * wiki.
11352     *
11353     * If $wgRightsPage is set then this setting is ignored.
11354     */
11355    public const RightsUrl = [
11356        'default' => null,
11357    ];
11358
11359    /**
11360     * If either $wgRightsUrl or $wgRightsPage is specified then this variable gives the text for
11361     * the link. Otherwise, it will be treated as raw HTML.
11362     *
11363     * If using $wgRightsUrl then this value must be specified. If using $wgRightsPage then the
11364     * name
11365     * of the page will also be used as the link text if this variable is not set.
11366     */
11367    public const RightsText = [
11368        'default' => null,
11369    ];
11370
11371    /**
11372     * Override for copyright metadata.
11373     */
11374    public const RightsIcon = [
11375        'default' => null,
11376    ];
11377
11378    /**
11379     * Set this to true if you want detailed copyright information forms on Upload.
11380     * See T430254 for deprecation.
11381     */
11382    public const UseCopyrightUpload = [
11383        'default' => false,
11384        'deprecated' => 'since 1.47 This feature is being removed.'
11385    ];
11386
11387    /**
11388     * Set this to the number of authors that you want to be credited below an
11389     * article text. Set it to zero to hide the attribution block, and a negative
11390     * number (like -1) to show all authors. Note that this will require 2-3 extra
11391     * database hits, which can have a not insignificant impact on performance for
11392     * large wikis.
11393     */
11394    public const MaxCredits = [
11395        'default' => 0,
11396    ];
11397
11398    /**
11399     * If there are more than $wgMaxCredits authors, show $wgMaxCredits of them.
11400     *
11401     * Otherwise, link to a separate credits page.
11402     */
11403    public const ShowCreditsIfMax = [
11404        'default' => true,
11405    ];
11406
11407    // endregion -- end of copyright and credits settings
11408
11409    /***************************************************************************/
11410    // region   Import / Export
11411    /** @name   Import / Export */
11412
11413    /**
11414     * List of interwiki prefixes for wikis we'll accept as sources for
11415     * Special:Import and API action=import. Since complete page history can be
11416     * imported, these should be 'trusted'.
11417     *
11418     * This can either be a regular array, or an associative map specifying
11419     * subprojects on the interwiki map of the target wiki, or a mix of the two,
11420     * e.g.
11421     *
11422     * ```
11423     * $wgImportSources = [
11424     *     'wikipedia' => [ 'cs', 'en', 'fr', 'zh' ],
11425     *     'wikispecies',
11426     *     'wikia' => [ 'animanga', 'brickipedia', 'desserts' ],
11427     * ];
11428     * ```
11429     *
11430     * If you have a very complex import sources setup, you can lazy-load it using
11431     * the ImportSources hook.
11432     *
11433     * If a user has the 'import' permission but not the 'importupload' permission,
11434     * they will only be able to run imports through this transwiki interface.
11435     */
11436    public const ImportSources = [
11437        'default' => [],
11438        'type' => 'map',
11439    ];
11440
11441    /**
11442     * Optional default target namespace for interwiki imports.
11443     *
11444     * Can use this to create an incoming "transwiki"-style queue.
11445     * Set to numeric key, not the name.
11446     *
11447     * Users may override this in the Special:Import dialog.
11448     */
11449    public const ImportTargetNamespace = [
11450        'default' => null,
11451    ];
11452
11453    /**
11454     * If set to false, disables the full-history option on Special:Export.
11455     *
11456     * This is currently poorly optimized for long edit histories, so is
11457     * disabled on Wikimedia's sites.
11458     */
11459    public const ExportAllowHistory = [
11460        'default' => true,
11461    ];
11462
11463    /**
11464     * If set nonzero, Special:Export requests for history of pages with
11465     * more revisions than this will be rejected. On some big sites things
11466     * could get bogged down by very very long pages.
11467     */
11468    public const ExportMaxHistory = [
11469        'default' => 0,
11470    ];
11471
11472    /**
11473     * Return distinct author list (when not returning full history)
11474     */
11475    public const ExportAllowListContributors = [
11476        'default' => false,
11477    ];
11478
11479    /**
11480     * If non-zero, Special:Export accepts a "pagelink-depth" parameter
11481     * up to this specified level, which will cause it to include all
11482     * pages linked to from the pages you specify. Since this number
11483     * can become *really really large* and could easily break your wiki,
11484     * it's disabled by default for now.
11485     *
11486     * @warning There's a HARD CODED limit of 5 levels of recursion to prevent a
11487     * crazy-big export from being done by someone setting the depth number too
11488     * high. In other words, last resort safety net.
11489     */
11490    public const ExportMaxLinkDepth = [
11491        'default' => 0,
11492    ];
11493
11494    /**
11495     * Whether to allow the "export all pages in namespace" option
11496     */
11497    public const ExportFromNamespaces = [
11498        'default' => false,
11499    ];
11500
11501    /**
11502     * Whether to allow exporting the entire wiki into a single file
11503     */
11504    public const ExportAllowAll = [
11505        'default' => false,
11506    ];
11507
11508    /**
11509     * Maximum number of pages returned by the GetPagesFromCategory and
11510     * GetPagesFromNamespace functions.
11511     *
11512     * @since 1.27
11513     */
11514    public const ExportPagelistLimit = [
11515        'default' => 5000,
11516    ];
11517
11518    /**
11519     * The schema to use by default when generating XML dumps. This allows sites to control
11520     * explicitly when to make breaking changes to their export and dump format.
11521     */
11522    public const XmlDumpSchemaVersion = [
11523        'default' => XML_DUMP_SCHEMA_VERSION_11,
11524    ];
11525
11526    // endregion -- end of import/export
11527
11528    /***************************************************************************/
11529    // region   Wiki Farm
11530    /** @name   Wiki Farm */
11531
11532    /**
11533     * A directory that contains site-specific configuration files.
11534     *
11535     * Setting this will enable multi-tenant ("wiki farm") mode, causing
11536     * site-specific settings to be loaded based on information from the web request.
11537     *
11538     * @unstable EXPERIMENTAL
11539     * @since 1.38
11540     */
11541    public const WikiFarmSettingsDirectory = [
11542        'default' => null
11543    ];
11544
11545    /**
11546     * The file extension to be used when looking up site-specific settings files in
11547     * $wgWikiFarmSettingsDirectory, such as 'json' or 'yaml'.
11548     *
11549     * @unstable EXPERIMENTAL
11550     * @since 1.38
11551     */
11552    public const WikiFarmSettingsExtension = [
11553        'default' => 'yaml'
11554    ];
11555
11556    // endregion -- End Wiki Farm
11557
11558    /***************************************************************************/
11559    // region   Extensions
11560    /** @name   Extensions */
11561
11562    /**
11563     * A list of callback functions which are called once MediaWiki is fully
11564     * initialised
11565     */
11566    public const ExtensionFunctions = [
11567        'default' => [],
11568        'type' => 'list',
11569    ];
11570
11571    /**
11572     * Extension messages files.
11573     *
11574     * Associative array mapping extension name to the filename where messages can be
11575     * found. The file should contain variable assignments. Any of the variables
11576     * present in languages/messages/MessagesEn.php may be defined, but the most common
11577     * ones are $namespaceNames and $namespaceAliases for namespaces, $specialPageAliases
11578     * for special page names and $magicWords for magic words.
11579     *
11580     * Variables defined in extensions will override conflicting variables defined
11581     * in the core.
11582     *
11583     * Before MediaWiki 1.23, this variable was most commonly used to define messages,
11584     * but since the introduction of $wgMessageDirs in that version, that is discouraged;
11585     * instead, store messages in JSON format and use $wgMessagesDirs. For setting other
11586     * variables than $messages, $wgExtensionMessagesFiles should still be used. Use a
11587     * DIFFERENT key, because any entry having a key that also exists in $wgMessagesDirs
11588     * will be ignored.
11589     *
11590     * Extensions using the JSON message format can preserve backward compatibility with
11591     * earlier versions of MediaWiki by using a compatibility shim, such as one generated
11592     * by the generateJsonI18n.php maintenance script, listing it under the SAME key
11593     * as for the $wgMessagesDirs entry.
11594     *
11595     * **Example:**
11596     *
11597     * ```
11598     * $wgExtensionMessagesFiles['ConfirmEdit'] = __DIR__.'/ConfirmEdit.i18n.php';
11599     * ```
11600     */
11601    public const ExtensionMessagesFiles = [
11602        'default' => [],
11603        'type' => 'map',
11604    ];
11605
11606    /**
11607     * Extension messages directories.
11608     *
11609     * Associative array mapping extension name to the path of the directory where message files can
11610     * be found. The message files are expected to be JSON files named for their language code, e.g.
11611     * en.json, de.json, etc. Extensions with messages in multiple places may specify an array of
11612     * message directories.
11613     *
11614     * Message directories in core should be added to LocalisationCache::getMessagesDirs()
11615     *
11616     * **Simple example:**
11617     *
11618     * ```
11619     * $wgMessagesDirs['Example'] = __DIR__ . '/i18n';
11620     * ```
11621     *
11622     * **Complex example:**
11623     *
11624     * ```
11625     * $wgMessagesDirs['Example'] = [
11626     *     __DIR__ . '/lib/ve/i18n',
11627     *     __DIR__ . '/lib/ooui/i18n',
11628     *     __DIR__ . '/i18n',
11629     * ]
11630     * ```
11631     *
11632     * @since 1.23
11633     */
11634    public const MessagesDirs = [
11635        'default' => [],
11636        'type' => 'map',
11637    ];
11638
11639    /**
11640     * Message directories containing JSON files for localisation of special page aliases.
11641     *
11642     * Associative array mapping extension name to the directory where configurations can be
11643     * found. The directory is expected to contain JSON files corresponding to each language code.
11644     *
11645     * Variables defined in extensions will override conflicting variables defined
11646     * in the core. We recommend using this configuration to set variables that require localisation:
11647     * special page aliases, and in the future namespace aliases and magic words.
11648     *
11649     * **Simple example**: extension.json
11650     * ```
11651     * "TranslationAliasesDirs": {
11652     *   "TranslationNotificationsAlias": "i18n/aliases"
11653     * }
11654     * ```
11655     * **Complex example**: extension.json
11656     *  ```
11657     *  "TranslationAliasesDirs": {
11658     *    "TranslationNotificationsAlias": [ "i18n/special-page-aliases", "i18n/magic-words", "i18n/namespaces" ]
11659     *  }
11660     *  ```
11661     *
11662     * @unstable EXPERIMENTAL
11663     * @since 1.42
11664     */
11665    public const TranslationAliasesDirs = [
11666        'default' => [],
11667        'type' => 'map',
11668    ];
11669
11670    /**
11671     * Array of files with list(s) of extension entry points to be used in
11672     * maintenance/mergeMessageFileList.php
11673     *
11674     * @since 1.22
11675     */
11676    public const ExtensionEntryPointListFiles = [
11677        'default' => [],
11678        'type' => 'map',
11679    ];
11680
11681    /**
11682     * Whether to include the NewPP limit report as a HTML comment
11683     */
11684    public const EnableParserLimitReporting = [
11685        'default' => true,
11686    ];
11687
11688    /**
11689     * List of valid skin names
11690     *
11691     * The key should be the name in all lower case.
11692     *
11693     * As of 1.35, the value should be a an array in the form of the ObjectFactory specification.
11694     *
11695     * For example for 'foobarskin' where the PHP class is 'MediaWiki\Skins\FooBar\FooBarSkin' set:
11696     *
11697     * **skin.json Example:**
11698     *
11699     * ```
11700     * "ValidSkinNames": {
11701     *    "foobarskin": {
11702     *        "displayname": "FooBarSkin",
11703     *        "class": "MediaWiki\\Skins\\FooBar\\FooBarSkin"
11704     *    }
11705     * }
11706     * ```
11707     *
11708     * Historically, the value was a properly cased name for the skin (and is still currently
11709     * supported). This value will be prefixed with "Skin" to create the class name of the
11710     * skin to load. Use SkinFactory::getInstalledSkins() as an accessor if you wish to have access to the
11711     * full list.
11712     */
11713    public const ValidSkinNames = [
11714        'default' => [],
11715        'type' => 'map',
11716    ];
11717
11718    /**
11719     * Special page list. This is an associative array mapping the (canonical) names of
11720     * special pages to either a class name or a ObjectFactory spec to be instantiated, or a callback to use for
11721     * creating the special page object. In all cases, the result must be an instance of SpecialPage.
11722     */
11723    public const SpecialPages = [
11724        'default' => [],
11725        'type' => 'map',
11726    ];
11727
11728    /**
11729     * Obsolete switch that controlled legacy case-insensitive classloading.
11730     *
11731     * Case-insensitive classloading was needed for loading data that had
11732     * been serialized by PHP 4 with the class names converted to lowercase.
11733     * It is no longer necessary since 1.31; the lowercase forms in question
11734     * are now listed in autoload.php (T166759).
11735     *
11736     * @deprecated since 1.35
11737     */
11738    public const AutoloadAttemptLowercase = [
11739        'default' => false,
11740        'obsolete' => 'Since 1.40; no longer has any effect.',
11741        'description' => 'Has been emitting warnings since 1.39 (LTS). ' .
11742            'Can be removed completely in 1.44, assuming 1.43 is an LTS release.'
11743    ];
11744
11745    /**
11746     * Add information about an installed extension, keyed by its type.
11747     *
11748     * This is for use from LocalSettings.php and legacy PHP-entrypoint
11749     * extensions. In general, extensions should (only) declare this
11750     * information in their extension.json file.
11751     *
11752     * The 'name', 'path' and 'author' keys are required.
11753     *
11754     * ```
11755     * $wgExtensionCredits['other'][] = [
11756     *     'path' => __FILE__,
11757     *     'name' => 'Example extension',
11758     *     'namemsg' => 'exampleextension-name',
11759     *     'author' => [
11760     *         'Foo Barstein',
11761     *     ],
11762     *     'version' => '0.0.1',
11763     *     'url' => 'https://example.org/example-extension/',
11764     *     'descriptionmsg' => 'exampleextension-desc',
11765     *     'license-name' => 'GPL-2.0-or-later',
11766     * ];
11767     * ```
11768     *
11769     * The extensions are listed on Special:Version. This page also looks for a file
11770     * named COPYING or LICENSE (optional .txt extension) and provides a link to
11771     * view said file. When the 'license-name' key is specified, this file is
11772     * interpreted as wikitext.
11773     *
11774     * - $type: One of 'specialpage', 'parserhook', 'wikifamily', 'variable', 'media',
11775     *    'antispam', 'skin', 'api', or 'other', or any additional types as specified
11776     *    through the ExtensionTypes hook as used in
11777     *    SpecialVersion::getExtensionTypes().
11778     *
11779     * - name: Name of extension as an inline string instead of localizable message.
11780     *    Do not omit this even if 'namemsg' is provided, as it is used to override
11781     *    the path Special:Version uses to find extension's license info, and is
11782     *    required for backwards-compatibility with MediaWiki 1.23 and older.
11783     *
11784     * - namemsg (since MW 1.24): A message key for a message containing the
11785     *    extension's name, if the name is localizable. (For example, skin names
11786     *    usually are.)
11787     *
11788     * - author: A string or an array of strings. Authors can be linked using
11789     *    the regular wikitext link syntax. To have an internationalized version of
11790     *    "and others" show, add an element "...". This element can also be linked,
11791     *    for instance "[https://example ...]".
11792     *
11793     * - descriptionmsg: A message key or an array with message key and parameters:
11794     *    `'descriptionmsg' => 'exampleextension-desc',`
11795     *
11796     * - description: Description of extension as an inline string instead of
11797     *    localizable message (omit in favour of 'descriptionmsg').
11798     *
11799     * - license-name: Short name of the license (used as label for the link), such
11800     *   as "GPL-2.0-or-later" or "MIT" (https://spdx.org/licenses/ for a list of identifiers).
11801     *
11802     * @see \MediaWiki\Specials\SpecialVersion::getCredits
11803     */
11804    public const ExtensionCredits = [
11805        'default' => [],
11806        'type' => 'map',
11807    ];
11808
11809    /**
11810     * Global list of hooks.
11811     *
11812     * The key is one of the events made available by MediaWiki, you can find
11813     * a description for most of them in their respective hook interfaces. For
11814     * overview of the hook system see docs/Hooks.md. The array is used internally
11815     * by HookContainer::run().
11816     *
11817     * The value can be one of:
11818     *
11819     * - A function name: `$wgHooks['event_name'][] = $function;`
11820     *
11821     * - A function with some data: `$wgHooks['event_name'][] = [ $function, $data ];`
11822     *
11823     *
11824     * - A an object method: `$wgHooks['event_name'][] = [ $object, 'method' ];`
11825     *
11826     * - A closure:
11827     * ```
11828     * $wgHooks['event_name'][] = function ( $hookParam ) {
11829     *     // Handler code goes here.
11830     * };
11831     * ```
11832     *
11833     * @warning You should always append to an event array or you will end up
11834     * deleting a previous registered hook.
11835     * @warning Hook handlers should be registered at file scope. Registering
11836     * handlers after file scope can lead to unexpected results due to caching.
11837     */
11838    public const Hooks = [
11839        'default' => [],
11840        'type' => 'map',
11841        'mergeStrategy' => 'array_merge_recursive',
11842    ];
11843
11844    /**
11845     * List of service wiring files to be loaded by the default instance of MediaWikiServices. Each
11846     * file listed here is expected to return an associative array mapping service names to
11847     * instantiator functions. Extensions may add wiring files to define their own services.
11848     * However, this cannot be used to replace existing services - use the MediaWikiServices hook
11849     * for that.
11850     *
11851     * @note the default wiring file will be added automatically by Setup.php
11852     * @see \MediaWiki\MediaWikiServices
11853     * @see \Wikimedia\Services\ServiceContainer::loadWiringFiles() for details on loading
11854     *   service instantiator functions.
11855     * @see docs/Injection.md for an overview of dependency
11856     *   injection in MediaWiki.
11857     */
11858    public const ServiceWiringFiles = [
11859        'default' => [],
11860        'type' => 'list',
11861    ];
11862
11863    /**
11864     * Maps jobs to their handlers; extensions
11865     * can add to this to provide custom jobs.
11866     *
11867     * Since 1.40, job handlers can be specified as object specs
11868     * for use with ObjectFactory, using an array, a plain class name,
11869     * or a callback.
11870     *
11871     * @note The constructor signature of job classes has to follow one of two patterns:
11872     * Either it takes a parameter array as the first argument, followed by any services it
11873     * needs to have injected: ( array $params, ... ).
11874     * Or it takes a PageReference as the first parameter, followed by the parameter array,
11875     * followed by any services: ( PageReference $page, array $params, ... ).
11876     * In order to signal to the JobFactory that the $page parameter should be omitted from
11877     * the constructor arguments, the job class has to be a subclass of GenericParameterJob,
11878     * or the object specification for the job has to set the 'needsPage' key to false.
11879     * If a callback is used, its signature follows the same rules.
11880     */
11881    public const JobClasses = [
11882        'default' => [
11883            'deletePage' => DeletePageJob::class,
11884            'refreshLinks' => RefreshLinksJob::class,
11885            'deleteLinks' => DeleteLinksJob::class,
11886            'htmlCacheUpdate' => HTMLCacheUpdateJob::class,
11887            'sendMail' => [
11888                'class' => EmaillingJob::class,
11889                'services' => [
11890                    0 => 'Emailer'
11891                ]
11892            ],
11893            'enotifNotify' => [
11894                'class' => RecentChangeNotifyJob::class,
11895                'services' => [
11896                    'RecentChangeLookup',
11897                ],
11898            ],
11899            'fixDoubleRedirect' => [
11900                'class' => DoubleRedirectJob::class,
11901                'services' => [
11902                    'RevisionLookup',
11903                    'MagicWordFactory',
11904                    'WikiPageFactory',
11905                ],
11906                // This job requires a title
11907                'needsPage' => true,
11908            ],
11909            'AssembleUploadChunks' => AssembleUploadChunksJob::class,
11910            'PublishStashedFile' => PublishStashedFileJob::class,
11911            'ThumbnailRender' => ThumbnailRenderJob::class,
11912            'UploadFromUrl' => UploadFromUrlJob::class,
11913            'recentChangesUpdate' => RecentChangesUpdateJob::class,
11914            'refreshLinksPrioritized' => RefreshLinksJob::class,
11915            'refreshLinksDynamic' => RefreshLinksJob::class,
11916            'activityUpdateJob' => ActivityUpdateJob::class,
11917            'categoryMembershipChange' => [
11918                'class' => CategoryMembershipChangeJob::class,
11919                'services' => [
11920                    'RecentChangeFactory',
11921                ],
11922            ],
11923            'CategoryCountUpdateJob' => [
11924                'class' => CategoryCountUpdateJob::class,
11925                'services' => [
11926                    'ConnectionProvider',
11927                    'NamespaceInfo',
11928                ],
11929            ],
11930            'clearUserWatchlist' => ClearUserWatchlistJob::class,
11931            'watchlistExpiry' => WatchlistExpiryJob::class,
11932            'cdnPurge' => CdnPurgeJob::class,
11933            'userGroupExpiry' => UserGroupExpiryJob::class,
11934            'clearWatchlistNotifications' => ClearWatchlistNotificationsJob::class,
11935            'userOptionsUpdate' => UserOptionsUpdateJob::class,
11936            'revertedTagUpdate' => RevertedTagUpdateJob::class,
11937            'null' => NullJob::class,
11938            'userEditCountInit' => UserEditCountInitJob::class,
11939            'parsoidCachePrewarm' => [
11940                'class' => ParsoidCachePrewarmJob::class,
11941                'services' => [
11942                    'ParserOutputAccess',
11943                    'PageStore',
11944                    'RevisionLookup',
11945                    'ParsoidSiteConfig',
11946                ],
11947                // tell the JobFactory not to include the $page parameter in the constructor call
11948                'needsPage' => false
11949            ],
11950            'renameUserTable' => [
11951                'class' => RenameUserTableJob::class,
11952                'services' => [
11953                    'MainConfig',
11954                    'DBLoadBalancerFactory'
11955                ]
11956            ],
11957            'renameUserDerived' => [
11958                'class' => RenameUserDerivedJob::class,
11959                'services' => [
11960                    'RenameUserFactory',
11961                    'UserFactory'
11962                ]
11963            ],
11964            // 'renameUser' is a alias for backward compatibility
11965            // it should be removed in the future releases
11966            'renameUser' => [
11967                'class' => RenameUserTableJob::class,
11968                'services' => [
11969                    'MainConfig',
11970                    'DBLoadBalancerFactory'
11971                ]
11972            ],
11973        ],
11974        'type' => 'map',
11975    ];
11976
11977    /**
11978     * Jobs that must be explicitly requested, i.e. aren't run by job runners unless
11979     * special flags are set. The values here are keys of $wgJobClasses.
11980     *
11981     * These can be:
11982     * - Very long-running jobs.
11983     * - Jobs that you would never want to run as part of a page rendering request.
11984     * - Jobs that you want to run on specialized machines ( like transcoding, or a particular
11985     *   machine on your cluster has 'outside' web access you could restrict uploadFromUrl )
11986     * These settings should be global to all wikis.
11987     */
11988    public const JobTypesExcludedFromDefaultQueue = [
11989        'default' => [ 'AssembleUploadChunks', 'PublishStashedFile', 'UploadFromUrl' ],
11990        'type' => 'list',
11991    ];
11992
11993    /**
11994     * Map of job types to how many job "work items" should be run per second
11995     * on each job runner process. The meaning of "work items" varies per job,
11996     * but typically would be something like "pages to update". A single job
11997     * may have a variable number of work items, as is the case with batch jobs.
11998     *
11999     * This is used by runJobs.php and not jobs run via $wgJobRunRate.
12000     * These settings should be global to all wikis.
12001     */
12002    public const JobBackoffThrottling = [
12003        'default' => [],
12004        'type' => 'map',
12005        'additionalProperties' => [ 'type' => 'float', ],
12006    ];
12007
12008    /**
12009     * Map of job types to configuration arrays.
12010     *
12011     * This determines which queue class and storage system is used for each job type.
12012     * Job types that do not have explicit configuration will use the 'default' config.
12013     * These settings should be global to all wikis.
12014     */
12015    public const JobTypeConf = [
12016        'default' => [
12017            'default' => [
12018                'class' => JobQueueDB::class,
12019                'order' => 'random',
12020                'claimTTL' => 3600
12021            ],
12022        ],
12023        'additionalProperties' => [
12024            'type' => 'object',
12025            'properties' => [
12026                'class' => [ 'type' => 'string' ],
12027                'order' => [ 'type' => 'string' ],
12028                'claimTTL' => [ 'type' => 'int' ]
12029            ],
12030        ],
12031        'type' => 'map',
12032    ];
12033
12034    /**
12035     * Whether to include the number of jobs that are queued
12036     * for the API's maxlag parameter.
12037     *
12038     * The total number of jobs will be divided by this to get an
12039     * estimated second of maxlag. Typically bots backoff at maxlag=5,
12040     * so setting this to the max number of jobs that should be in your
12041     * queue divided by 5 should have the effect of stopping bots once
12042     * that limit is hit.
12043     *
12044     * @since 1.29
12045     */
12046    public const JobQueueIncludeInMaxLagFactor = [
12047        'default' => false,
12048    ];
12049
12050    /**
12051     * Additional functions to be performed with updateSpecialPages.
12052     *
12053     * Expensive Querypages are already updated.
12054     */
12055    public const SpecialPageCacheUpdates = [
12056        'default' => [
12057            'Statistics' => [ SiteStatsUpdate::class, 'cacheUpdate' ]
12058        ],
12059        'type' => 'map',
12060    ];
12061
12062    /**
12063     * Page property link table invalidation lists. When a page property
12064     * changes, this may require other link tables to be updated (eg
12065     * adding __HIDDENCAT__ means the hiddencat tracking category will
12066     * have been added, so the categorylinks table needs to be rebuilt).
12067     *
12068     * This array can be added to by extensions.
12069     */
12070    public const PagePropLinkInvalidations = [
12071        'default' => [ 'hiddencat' => 'categorylinks', ],
12072        'type' => 'map',
12073    ];
12074
12075    // endregion -- End extensions
12076
12077    /***************************************************************************/
12078    // region   Categories
12079    /** @name   Categories */
12080
12081    /**
12082     * On category pages, show thumbnail gallery for images belonging to that
12083     * category instead of listing them as articles.
12084     */
12085    public const CategoryMagicGallery = [
12086        'default' => true,
12087    ];
12088
12089    /**
12090     * Paging limit for categories
12091     */
12092    public const CategoryPagingLimit = [
12093        'default' => 200,
12094    ];
12095
12096    /**
12097     * Specify how category names should be sorted, when listed on a category page.
12098     *
12099     * A sorting scheme is also known as a collation.
12100     *
12101     * Available values are:
12102     *
12103     *   - uppercase: Converts the category name to upper case, and sorts by that.
12104     *
12105     *   - identity: Does no conversion. Sorts by binary value of the string.
12106     *
12107     *   - uca-default: Provides access to the Unicode Collation Algorithm with
12108     *     the default element table. This is a compromise collation which sorts
12109     *     all languages in a mediocre way. However, it is better than "uppercase".
12110     *
12111     * To use the uca-default collation, you must have PHP's intl extension
12112     * installed. See https://www.php.net/manual/en/intl.setup.php . The details of the
12113     * resulting collation will depend on the version of ICU installed on the
12114     * server.
12115     *
12116     * After you change this, you must run maintenance/updateCollation.php to fix
12117     * the sort keys in the database.
12118     *
12119     * Extensions can define there own collations by subclassing Collation
12120     * and using the Collation::factory hook.
12121     */
12122    public const CategoryCollation = [
12123        'default' => 'uppercase',
12124    ];
12125
12126    /**
12127     * Additional category collations to store during LinksUpdate. This can be used
12128     * to perform online migration of categories from one collation to another. An
12129     * array of associative arrays each having the following keys:
12130     *
12131     * - table: (string) The table name
12132     * - collation: (string) The collation to use for cl_sortkey
12133     * - fakeCollation: (string) The collation name to insert into cl_collation
12134     *
12135     * @since 1.38
12136     */
12137    public const TempCategoryCollations = [
12138        'default' => [],
12139        'type' => 'list',
12140    ];
12141
12142    /**
12143     * Whether to sort categories in OutputPage for display.
12144     *
12145     * The value of CategoryCollation is used for sorting.
12146     *
12147     * @unstable EXPERIMENTAL This feature is used for Parsoid development,
12148     * but its future as a core feature will depend on community uptake.
12149     */
12150    public const SortedCategories = [
12151        'default' => false,
12152        'type' => 'boolean',
12153    ];
12154
12155    /**
12156     * Array holding default tracking category names.
12157     *
12158     * Array contains the system messages for each tracking category.
12159     * Tracking categories allow pages with certain characteristics to be tracked.
12160     * It works by adding any such page to a category automatically.
12161     *
12162     * A message with the suffix '-desc' should be added as a description message
12163     * to have extra information on Special:TrackingCategories.
12164     *
12165     * @deprecated since 1.25 Extensions should now register tracking categories using
12166     * the new extension registration system.
12167     * @since 1.23
12168     */
12169    public const TrackingCategories = [
12170        'default' => [],
12171        'type' => 'list',
12172        'deprecated' => 'since 1.25 Extensions should now register tracking categories using ' .
12173            'the new extension registration system.',
12174    ];
12175
12176    // endregion -- End categories
12177
12178    /***************************************************************************/
12179    // region   Logging
12180    /** @name   Logging */
12181
12182    /**
12183     * The logging system has two levels: an event type, which describes the
12184     * general category and can be viewed as a named subset of all logs; and
12185     * an action, which is a specific kind of event that can exist in that
12186     * log type.
12187     *
12188     * Note that code should call LogPage::validTypes() to get a list of valid
12189     * log types instead of checking the global variable.
12190     */
12191    public const LogTypes = [
12192        'default' => [
12193            '',
12194            'block',
12195            'protect',
12196            'rights',
12197            'delete',
12198            'upload',
12199            'move',
12200            'import',
12201            'interwiki',
12202            'patrol',
12203            'merge',
12204            'suppress',
12205            'tag',
12206            'managetags',
12207            'contentmodel',
12208            'renameuser',
12209        ],
12210        'type' => 'list',
12211    ];
12212
12213    /**
12214     * This restricts log access to those who have a certain right
12215     * Users without this will not see it in the option menu and can not view it
12216     * Restricted logs are not added to recent changes
12217     * Logs should remain non-transcludable
12218     * Format: logtype => permissiontype
12219     */
12220    public const LogRestrictions = [
12221        'default' => [ 'suppress' => 'suppressionlog', ],
12222        'type' => 'map',
12223    ];
12224
12225    /**
12226     * Show/hide links on Special:Log will be shown for these log types.
12227     *
12228     * This is associative array of log type => boolean "hide by default"
12229     *
12230     * See $wgLogTypes for a list of available log types.
12231     *
12232     * **Example:**
12233     *
12234     * `$wgFilterLogTypes = [ 'move' => true, 'import' => false ];`
12235     *
12236     * Will display show/hide links for the move and import logs. Move logs will be
12237     * hidden by default unless the link is clicked. Import logs will be shown by
12238     * default, and hidden when the link is clicked.
12239     *
12240     * A message of the form logeventslist-[type]-log should be added, and will be
12241     * used for the link text.
12242     */
12243    public const FilterLogTypes = [
12244        'default' => [
12245            'patrol' => true,
12246            'tag' => true,
12247            'newusers' => false,
12248        ],
12249        'type' => 'map',
12250    ];
12251
12252    /**
12253     * Lists the message key string for each log type. The localized messages
12254     * will be listed in the user interface.
12255     *
12256     * Extensions with custom log types may add to this array.
12257     *
12258     * @since 1.19, if you follow the naming convention log-name-TYPE,
12259     * where TYPE is your log type, you don't need to use this array.
12260     */
12261    public const LogNames = [
12262        'default' => [
12263            '' => 'all-logs-page',
12264            'block' => 'blocklogpage',
12265            'protect' => 'protectlogpage',
12266            'rights' => 'rightslog',
12267            'delete' => 'dellogpage',
12268            'upload' => 'uploadlogpage',
12269            'move' => 'movelogpage',
12270            'import' => 'importlogpage',
12271            'patrol' => 'patrol-log-page',
12272            'merge' => 'mergelog',
12273            'suppress' => 'suppressionlog',
12274        ],
12275        'type' => 'map',
12276    ];
12277
12278    /**
12279     * Lists the message key string for descriptive text to be shown at the
12280     * top of each log type.
12281     *
12282     * Extensions with custom log types may add to this array.
12283     *
12284     * @since 1.19, if you follow the naming convention log-description-TYPE,
12285     * where TYPE is your log type, yoy don't need to use this array.
12286     */
12287    public const LogHeaders = [
12288        'default' => [
12289            '' => 'alllogstext',
12290            'block' => 'blocklogtext',
12291            'delete' => 'dellogpagetext',
12292            'import' => 'importlogpagetext',
12293            'merge' => 'mergelogpagetext',
12294            'move' => 'movelogpagetext',
12295            'patrol' => 'patrol-log-header',
12296            'protect' => 'protectlogtext',
12297            'rights' => 'rightslogtext',
12298            'suppress' => 'suppressionlogtext',
12299            'upload' => 'uploadlogpagetext',
12300        ],
12301        'type' => 'map',
12302    ];
12303
12304    /**
12305     * Maps log actions to message keys, for formatting log entries of each type
12306     * and action when displaying logs to the user.
12307     * The array keys are composed as "$type/$action".
12308     *
12309     * Extensions with custom log types may add to this array.
12310     */
12311    public const LogActions = [
12312        'default' => [],
12313        'type' => 'map',
12314    ];
12315
12316    /**
12317     * The same as above, but here values are class names or ObjectFactory specifications,
12318     * not messages. The specification must resolve to a LogFormatter subclass,
12319     * and will receive the LogEntry object as its first constructor argument.
12320     * The type can be specified as '*' (e.g. 'block/*') to handle all types.
12321     *
12322     * @see \MediaWiki\Logging\LogPage::actionText
12323     * @see \MediaWiki\Logging\LogFormatter
12324     */
12325    public const LogActionsHandlers = [
12326        'default' => [
12327            'block/block' => [
12328                'class' => BlockLogFormatter::class,
12329                'services' => [
12330                    'TitleParser',
12331                    'NamespaceInfo',
12332                ]
12333            ],
12334            'block/reblock' => [
12335                'class' => BlockLogFormatter::class,
12336                'services' => [
12337                    'TitleParser',
12338                    'NamespaceInfo',
12339                ]
12340            ],
12341            'block/unblock' => [
12342                'class' => BlockLogFormatter::class,
12343                'services' => [
12344                    'TitleParser',
12345                    'NamespaceInfo',
12346                ]
12347            ],
12348            'contentmodel/change' => ContentModelLogFormatter::class,
12349            'contentmodel/new' => ContentModelLogFormatter::class,
12350            'delete/delete' => DeleteLogFormatter::class,
12351            'delete/delete_redir' => DeleteLogFormatter::class,
12352            'delete/delete_redir2' => DeleteLogFormatter::class,
12353            'delete/event' => DeleteLogFormatter::class,
12354            'delete/restore' => DeleteLogFormatter::class,
12355            'delete/revision' => DeleteLogFormatter::class,
12356            'import/interwiki' => ImportLogFormatter::class,
12357            'import/upload' => ImportLogFormatter::class,
12358            'interwiki/iw_add' => InterwikiLogFormatter::class,
12359            'interwiki/iw_delete' => InterwikiLogFormatter::class,
12360            'interwiki/iw_edit' => InterwikiLogFormatter::class,
12361            'managetags/activate' => LogFormatter::class,
12362            'managetags/create' => LogFormatter::class,
12363            'managetags/deactivate' => LogFormatter::class,
12364            'managetags/delete' => LogFormatter::class,
12365            'merge/merge' => [
12366                'class' => MergeLogFormatter::class,
12367                'services' => [
12368                    'TitleParser',
12369                ]
12370            ],
12371            'merge/merge-into' => [
12372                'class' => MergeLogFormatter::class,
12373                'services' => [
12374                    'TitleParser',
12375                ]
12376            ],
12377            'move/move' => [
12378                'class' => MoveLogFormatter::class,
12379                'services' => [
12380                    'TitleParser',
12381                ]
12382            ],
12383            'move/move_redir' => [
12384                'class' => MoveLogFormatter::class,
12385                'services' => [
12386                    'TitleParser',
12387                ]
12388            ],
12389            'patrol/patrol' => PatrolLogFormatter::class,
12390            'patrol/autopatrol' => PatrolLogFormatter::class,
12391            'protect/modify' => [
12392                'class' => ProtectLogFormatter::class,
12393                'services' => [
12394                    'TitleParser',
12395                ]
12396            ],
12397            'protect/move_prot' => [
12398                'class' => ProtectLogFormatter::class,
12399                'services' => [
12400                    'TitleParser',
12401                ]
12402            ],
12403            'protect/protect' => [
12404                'class' => ProtectLogFormatter::class,
12405                'services' => [
12406                    'TitleParser',
12407                ]
12408            ],
12409            'protect/unprotect' => [
12410                'class' => ProtectLogFormatter::class,
12411                'services' => [
12412                    'TitleParser',
12413                ]
12414            ],
12415            'renameuser/renameuser' => [
12416                'class' => RenameuserLogFormatter::class,
12417                'services' => [
12418                    'TitleParser',
12419                ]
12420            ],
12421            'rights/autopromote' => RightsLogFormatter::class,
12422            'rights/rights' => RightsLogFormatter::class,
12423            'suppress/block' => [
12424                'class' => BlockLogFormatter::class,
12425                'services' => [
12426                    'TitleParser',
12427                    'NamespaceInfo',
12428                ]
12429            ],
12430            'suppress/delete' => DeleteLogFormatter::class,
12431            'suppress/event' => DeleteLogFormatter::class,
12432            'suppress/reblock' => [
12433                'class' => BlockLogFormatter::class,
12434                'services' => [
12435                    'TitleParser',
12436                    'NamespaceInfo',
12437                ]
12438            ],
12439            'suppress/revision' => DeleteLogFormatter::class,
12440            'tag/update' => TagLogFormatter::class,
12441            'upload/overwrite' => UploadLogFormatter::class,
12442            'upload/revert' => UploadLogFormatter::class,
12443            'upload/upload' => UploadLogFormatter::class,
12444        ],
12445        'type' => 'map',
12446    ];
12447
12448    /**
12449     * List of log types that can be filtered by action types
12450     *
12451     * To each action is associated the list of log_action
12452     * subtypes to search for, usually one, but not necessarily so
12453     * Extensions may append to this array
12454     *
12455     * @since 1.27
12456     */
12457    public const ActionFilteredLogs = [
12458        'default' => [
12459            'block' => [
12460                'block' => [ 'block' ],
12461                'reblock' => [ 'reblock' ],
12462                'unblock' => [ 'unblock' ],
12463            ],
12464            'contentmodel' => [
12465                'change' => [ 'change' ],
12466                'new' => [ 'new' ],
12467            ],
12468            'delete' => [
12469                'delete' => [ 'delete' ],
12470                'delete_redir' => [ 'delete_redir', 'delete_redir2' ],
12471                'restore' => [ 'restore' ],
12472                'event' => [ 'event' ],
12473                'revision' => [ 'revision' ],
12474            ],
12475            'import' => [
12476                'interwiki' => [ 'interwiki' ],
12477                'upload' => [ 'upload' ],
12478            ],
12479            'managetags' => [
12480                'create' => [ 'create' ],
12481                'delete' => [ 'delete' ],
12482                'activate' => [ 'activate' ],
12483                'deactivate' => [ 'deactivate' ],
12484            ],
12485            'move' => [
12486                'move' => [ 'move' ],
12487                'move_redir' => [ 'move_redir' ],
12488            ],
12489            'newusers' => [
12490                'create' => [ 'create', 'newusers' ],
12491                'create2' => [ 'create2' ],
12492                'autocreate' => [ 'autocreate' ],
12493                'byemail' => [ 'byemail' ],
12494            ],
12495            'protect' => [
12496                'protect' => [ 'protect' ],
12497                'modify' => [ 'modify' ],
12498                'unprotect' => [ 'unprotect' ],
12499                'move_prot' => [ 'move_prot' ],
12500            ],
12501            'rights' => [
12502                'rights' => [ 'rights' ],
12503                'autopromote' => [ 'autopromote' ],
12504            ],
12505            'suppress' => [
12506                'event' => [ 'event' ],
12507                'revision' => [ 'revision' ],
12508                'delete' => [ 'delete' ],
12509                'block' => [ 'block' ],
12510                'reblock' => [ 'reblock' ],
12511            ],
12512            'upload' => [
12513                'upload' => [ 'upload' ],
12514                'overwrite' => [ 'overwrite' ],
12515                'revert' => [ 'revert' ],
12516            ],
12517        ],
12518        'type' => 'map',
12519    ];
12520
12521    /**
12522     * Maintain a log of newusers at Special:Log/newusers?
12523     */
12524    public const NewUserLog = [
12525        'default' => true,
12526    ];
12527
12528    /**
12529     * Maintain a log of page creations at Special:Log/create?
12530     *
12531     * @since 1.32
12532     */
12533    public const PageCreationLog = [
12534        'default' => true,
12535    ];
12536
12537    // endregion -- end logging
12538
12539    /***************************************************************************/
12540    // region   Special pages (general and miscellaneous)
12541    /** @name   Special pages (general and miscellaneous) */
12542
12543    /**
12544     * Allow special page inclusions such as {{Special:Allpages}}
12545     */
12546    public const AllowSpecialInclusion = [
12547        'default' => true,
12548    ];
12549
12550    /**
12551     * Set this to an array of special page names to prevent
12552     * maintenance/updateSpecialPages.php from updating those pages.
12553     *
12554     * Mapping each special page name to a run mode like 'periodical' if a cronjob is set up.
12555     */
12556    public const DisableQueryPageUpdate = [
12557        'default' => false,
12558    ];
12559
12560    /**
12561     * On Special:Unusedimages, consider images "used", if they are put
12562     * into a category. Default (false) is not to count those as used.
12563     */
12564    public const CountCategorizedImagesAsUsed = [
12565        'default' => false,
12566    ];
12567
12568    /**
12569     * Maximum number of links to a redirect page listed on
12570     * Special:Whatlinkshere/RedirectDestination
12571     */
12572    public const MaxRedirectLinksRetrieved = [
12573        'default' => 500,
12574    ];
12575
12576    /**
12577     * Shortest CIDR limits that can be checked in any individual range check
12578     * at Special:Contributions.
12579     *
12580     * @since 1.30
12581     */
12582    public const RangeContributionsCIDRLimit = [
12583        'default' => [
12584            'IPv4' => 16,
12585            'IPv6' => 32,
12586        ],
12587        'type' => 'map',
12588        'additionalProperties' => [ 'type' => 'integer', ],
12589    ];
12590
12591    // endregion -- end special pages
12592
12593    /***************************************************************************/
12594    // region   Actions
12595    /** @name   Actions */
12596
12597    /**
12598     * Map of allowed values for the "title=foo&action=<action>" parameter.
12599     * to the corresponding handler code.
12600     * See ActionFactory for the syntax. Core defaults are in ActionFactory::CORE_ACTIONS,
12601     * anything here overrides that.
12602     */
12603    public const Actions = [
12604        'default' => [],
12605        'type' => 'map',
12606    ];
12607
12608    // endregion -- end actions
12609
12610    /***************************************************************************/
12611    // region   Robot (search engine crawler) policy
12612    /** @name   Robot (search engine crawler) policy */
12613    // See also $wgNoFollowLinks.
12614
12615    /**
12616     * Default robot policy.  The default policy is to encourage indexing and fol-
12617     * lowing of links.  It may be overridden on a per-namespace and/or per-page
12618     * basis.
12619     */
12620    public const DefaultRobotPolicy = [
12621        'default' => 'index,follow',
12622    ];
12623
12624    /**
12625     * Robot policies per namespaces. The default policy is given above, the array
12626     * is made of namespace constants as defined in includes/Defines.php.  You can-
12627     * not specify a different default policy for NS_SPECIAL: it is always noindex,
12628     * nofollow.  This is because a number of special pages (e.g., ListPages) have
12629     * many permutations of options that display the same data under redundant
12630     * URLs, so search engine spiders risk getting lost in a maze of twisty special
12631     * pages, all alike, and never reaching your actual content.
12632     *
12633     * **Example:**
12634     *
12635     * ```
12636     * $wgNamespaceRobotPolicies = [ NS_TALK => 'noindex' ];
12637     * ```
12638     */
12639    public const NamespaceRobotPolicies = [
12640        'default' => [],
12641        'type' => 'map',
12642    ];
12643
12644    /**
12645     * Robot policies per article. These override the per-namespace robot policies.
12646     *
12647     * Must be in the form of an array where the key part is a properly canonicalised
12648     * text form title and the value is a robot policy.
12649     *
12650     * **Example:**
12651     *
12652     * ```
12653     * $wgArticleRobotPolicies = [
12654     *         'Main Page' => 'noindex,follow',
12655     *         'User:Bob' => 'index,follow',
12656     * ];
12657     * ```
12658     *
12659     * **Example that DOES NOT WORK because the names are not canonical text**
12660     * forms:
12661     *
12662     * ```
12663     * $wgArticleRobotPolicies = [
12664     *   // Underscore, not space!
12665     *   'Main_Page' => 'noindex,follow',
12666     *   // "Project", not the actual project name!
12667     *   'Project:X' => 'index,follow',
12668     *   // Needs to be "Abc", not "abc" (unless $wgCapitalLinks is false for that namespace)!
12669     *   'abc' => 'noindex,nofollow'
12670     * ];
12671     * ```
12672     */
12673    public const ArticleRobotPolicies = [
12674        'default' => [],
12675        'type' => 'map',
12676    ];
12677
12678    /**
12679     * An array of namespace keys in which the __INDEX__/__NOINDEX__ magic words
12680     * will not function, so users can't decide whether pages in that namespace are
12681     * indexed by search engines.  If set to null, default to $wgContentNamespaces.
12682     *
12683     * **Example:**
12684     *
12685     * ```
12686     * $wgExemptFromUserRobotsControl = [ NS_MAIN, NS_TALK, NS_PROJECT ];
12687     * ```
12688     */
12689    public const ExemptFromUserRobotsControl = [
12690        'default' => null,
12691        'type' => '?list',
12692    ];
12693
12694    // endregion End robot policy
12695
12696    /***************************************************************************/
12697    // region   Action API and REST API
12698    /** @name   Action API and REST API
12699     */
12700
12701    /**
12702     * WARNING: SECURITY THREAT - debug use only
12703     *
12704     * Disables many security checks in the API for debugging purposes.
12705     * This flag should never be used on the production servers, as it introduces
12706     * a number of potential security holes. Even when enabled, the validation
12707     * will still be performed, but instead of failing, API will return a warning.
12708     * Also, there will always be a warning notifying that this flag is set.
12709     * At this point, the flag allows GET requests to go through for modules
12710     * requiring POST.
12711     *
12712     * @since 1.21
12713     */
12714    public const DebugAPI = [
12715        'default' => false,
12716    ];
12717
12718    /**
12719     * API module extensions.
12720     *
12721     * Associative array mapping module name to modules specs;
12722     * Each module spec is an associative array containing at least
12723     * the 'class' key for the module's class, and optionally a
12724     * 'factory' key for the factory function to use for the module.
12725     *
12726     * That factory function will be called with two parameters,
12727     * the parent module (an instance of ApiBase, usually ApiMain)
12728     * and the name the module was registered under. The return
12729     * value must be an instance of the class given in the 'class'
12730     * field.
12731     *
12732     * For backward compatibility, the module spec may also be a
12733     * simple string containing the module's class name. In that
12734     * case, the class' constructor will be called with the parent
12735     * module and module name as parameters, as described above.
12736     *
12737     * Examples for registering API modules:
12738     *
12739     * ```
12740     * $wgAPIModules['foo'] = 'ApiFoo';
12741     * $wgAPIModules['bar'] = [
12742     *   'class' => ApiBar::class,
12743     *   'factory' => function( $main, $name ) { ... }
12744     * ];
12745     * $wgAPIModules['xyzzy'] = [
12746     *   'class' => ApiXyzzy::class,
12747     *   'factory' => [ XyzzyFactory::class, 'newApiModule' ]
12748     * ];
12749     * ```
12750     * Extension modules may override the core modules.
12751     * See ApiMain::MODULES for a list of the core modules.
12752     */
12753    public const APIModules = [
12754        'default' => [],
12755        'type' => 'map',
12756    ];
12757
12758    /**
12759     * API format module extensions.
12760     *
12761     * Associative array mapping format module name to module specs (see $wgAPIModules).
12762     * Extension modules may override the core modules.
12763     *
12764     * See ApiMain::FORMATS for a list of the core format modules.
12765     */
12766    public const APIFormatModules = [
12767        'default' => [],
12768        'type' => 'map',
12769    ];
12770
12771    /**
12772     * API Query meta module extensions.
12773     *
12774     * Associative array mapping meta module name to module specs (see $wgAPIModules).
12775     * Extension modules may override the core modules.
12776     *
12777     * See ApiQuery::QUERY_META_MODULES for a list of the core meta modules.
12778     */
12779    public const APIMetaModules = [
12780        'default' => [],
12781        'type' => 'map',
12782    ];
12783
12784    /**
12785     * API Query prop module extensions.
12786     *
12787     * Associative array mapping prop module name to module specs (see $wgAPIModules).
12788     * Extension modules may override the core modules.
12789     *
12790     * See ApiQuery::QUERY_PROP_MODULES for a list of the core prop modules.
12791     */
12792    public const APIPropModules = [
12793        'default' => [],
12794        'type' => 'map',
12795    ];
12796
12797    /**
12798     * API Query list module extensions.
12799     *
12800     * Associative array mapping list module name to module specs (see $wgAPIModules).
12801     * Extension modules may override the core modules.
12802     *
12803     * See ApiQuery::QUERY_LIST_MODULES for a list of the core list modules.
12804     */
12805    public const APIListModules = [
12806        'default' => [],
12807        'type' => 'map',
12808    ];
12809
12810    /**
12811     * Maximum amount of rows to scan in a DB query in the API
12812     * The default value is generally fine
12813     */
12814    public const APIMaxDBRows = [
12815        'default' => 5000,
12816    ];
12817
12818    /**
12819     * The maximum size (in bytes) of an API result.
12820     *
12821     * @warning Do not set this lower than $wgMaxArticleSize*1024
12822     */
12823    public const APIMaxResultSize = [
12824        'default' => 8_388_608,
12825    ];
12826
12827    /**
12828     * The maximum number of uncached diffs that can be retrieved in one API
12829     * request. Set this to 0 to disable API diffs altogether
12830     */
12831    public const APIMaxUncachedDiffs = [
12832        'default' => 1,
12833    ];
12834
12835    /**
12836     * Maximum amount of DB lag on a majority of DB replica DBs to tolerate
12837     * before forcing bots to retry any write requests via API errors.
12838     *
12839     * This should be lower than the 'max lag' value in $wgLBFactoryConf.
12840     */
12841    public const APIMaxLagThreshold = [
12842        'default' => 7,
12843    ];
12844
12845    /**
12846     * Set the timeout for the API help text cache. If set to 0, caching disabled
12847     */
12848    public const APICacheHelpTimeout = [
12849        'default' => 60 * 60,
12850    ];
12851
12852    /**
12853     * The ApiQueryQueryPages module should skip pages that are redundant to true
12854     * API queries.
12855     */
12856    public const APIUselessQueryPages = [
12857        'default' => [
12858            'MIMEsearch',
12859            'LinkSearch',
12860        ],
12861        'type' => 'list',
12862    ];
12863
12864    /**
12865     * Enable previewing licences via AJAX.
12866     */
12867    public const AjaxLicensePreview = [
12868        'default' => true,
12869    ];
12870
12871    /**
12872     * Settings for incoming cross-site AJAX requests:
12873     * Newer browsers support cross-site AJAX when the target resource allows requests
12874     * from the origin domain by the Access-Control-Allow-Origin header.
12875     *
12876     * This is currently only used by the API (requests to api.php)
12877     * $wgCrossSiteAJAXdomains can be set using a wildcard syntax:
12878     *
12879     * - '*' matches any number of characters
12880     * - '?' matches any 1 character
12881     *
12882     * **Example:**
12883     *
12884     * ```
12885     * $wgCrossSiteAJAXdomains = [
12886     *     'www.mediawiki.org',
12887     *     '*.wikipedia.org',
12888     *     '*.wikimedia.org',
12889     *     '*.wiktionary.org',
12890     * ];
12891     * ```
12892     */
12893    public const CrossSiteAJAXdomains = [
12894        'default' => [],
12895        'type' => 'map',
12896    ];
12897
12898    /**
12899     * Domains that should not be allowed to make AJAX requests,
12900     * even if they match one of the domains allowed by $wgCrossSiteAJAXdomains
12901     * Uses the same syntax as $wgCrossSiteAJAXdomains
12902     */
12903    public const CrossSiteAJAXdomainExceptions = [
12904        'default' => [],
12905        'type' => 'map',
12906    ];
12907
12908    /**
12909     * List of allowed headers for cross-origin API requests.
12910     */
12911    public const AllowedCorsHeaders = [
12912        'default' => [
12913            /* simple headers (see spec) */
12914            'Accept',
12915            'Accept-Language',
12916            'Content-Language',
12917            'Content-Type',
12918            /* non-authorable headers in XHR, which are however requested by some UAs */
12919            'Accept-Encoding',
12920            'DNT',
12921            'Origin',
12922            /* MediaWiki whitelist */
12923            'User-Agent',
12924            'Api-User-Agent',
12925            'Promise-Non-Write-API-Action',
12926            /* Allowing caching preflight requests, see T269636 */
12927            'Access-Control-Max-Age',
12928            /* OAuth 2.0, see T322944 */
12929            'Authorization',
12930        ],
12931        'type' => 'list',
12932    ];
12933
12934    /**
12935     * Additional REST API Route files.
12936     *
12937     * A common usage is to enable development/experimental endpoints only on test wikis.
12938     */
12939    public const RestAPIAdditionalRouteFiles = [
12940        'default' => [],
12941        'type' => 'list',
12942    ];
12943
12944    /**
12945     * A list of OpenAPI specs to be made available for exploration on the REST sandbox.
12946     *
12947     * This is an associative array, arbitrary spec IDs to spec descriptions.
12948     * Each spec description is an array with the following keys:
12949     * - url: the URL that will return the OpenAPI spec.
12950     * - name: the name of the API, to be shown on the REST sandbox.
12951     *   Ignored if msg is given.
12952     * - msg: a message key for the name of the API, to be shown on the REST sandbox.
12953     * - file: optional module definition file name. If supplied, information therein is used for
12954     *   name and/or url. Info supplied directly in config (via url/name/msg) takes precedence.
12955     *
12956     * @unstable Introduced in 1.43. We may want to rename or change this to
12957     * accommodate the need to list external APIs in a central discovery
12958     * document.
12959     */
12960    public const RestSandboxSpecs = [
12961        'default' => [],
12962        'type' => 'map',
12963        'additionalProperties' => [
12964            'type' => 'object',
12965            'properties' => [
12966                'url' => [ 'type' => 'string', 'format' => 'url' ],
12967                'name' => [ 'type' => 'string' ],
12968                'file' => [ 'type' => 'string' ],
12969                'msg' => [ 'type' => 'string', 'description' => 'a message key' ]
12970            ],
12971        ]
12972    ];
12973
12974    /**
12975     * The absolute base URL of the local REST API entry point on the test server.
12976     *
12977     * When set (e.g., 'https://test.wikimedia.org/w/rest.php'), the REST Sandbox
12978     * will display this sandbox server as an option for testing calls.
12979     *
12980     * @since 1.47
12981     */
12982    public const RestLocalModuleTestBaseUrl = [
12983        'default' => null,
12984        'type' => '?string',
12985    ];
12986
12987    /**
12988     * A list of REST modules, by module id, and the desired behavior mode for each.
12989     *
12990     * By default, behavior modes are determined by a module's audience designation (ex. "beta").
12991     * This variable allows assigning a different behavior mode.
12992     *
12993     * Each override is an array with a "mode" key indicating the desired behavior, as well as
12994     * any additional information used in applying that mode. For example, the "published" mode
12995     * allows an optional "group" key, indicating the group the module should belong to.
12996     *
12997     * @unstable Introduced in 1.47. We may adjust this as we refine the available overrides.
12998     */
12999    public const RestModuleOverrides = [
13000        'default' => [],
13001        'type' => 'map',
13002        'mergeStrategy' => 'array_replace_recursive',
13003        'additionalProperties' => [
13004            'type' => 'object',
13005            'properties' => [
13006                'mode' => [ 'type' => 'string' ],
13007            ],
13008            'required' => [ 'mode' ],
13009        ]
13010    ];
13011
13012    /**
13013     * A list of "external" REST modules, by module id, and the details for each.
13014     *
13015     * "External" modules are implemented outside MediaWiki and its extensions.
13016     * Listing them here allows them to appear in /discovery and the REST Sandbox.
13017     *
13018     * @unstable Introduced in 1.47. We may adjust this as we refine this functionality.
13019     */
13020    public const RestExternalModules = [
13021        'default' => [],
13022        'type' => 'map',
13023        'mergeStrategy' => 'array_replace_recursive',
13024        'additionalProperties' => [
13025            'type' => 'object',
13026            'properties' => [
13027                'info' => [
13028                    'type' => 'object',
13029                    'properties' => [
13030                        'version' => [ 'type' => 'string' ],
13031                        'title' => [ 'type' => 'string' ],
13032                        'x-i18n-title' => [ 'type' => 'string' ],
13033                        'description' => [ 'type' => 'string' ],
13034                        'x-i18n-description' => [ 'type' => 'string' ],
13035                    ],
13036                    'required' => [ 'version' ],
13037                ],
13038                'base' => [ 'type' => 'string', 'format' => 'uri' ],
13039                'spec' => [ 'type' => 'string', 'format' => 'uri' ],
13040            ],
13041            'required' => [ 'info', 'base', 'spec' ],
13042        ]
13043    ];
13044
13045    // endregion -- End AJAX and API
13046
13047    /***************************************************************************/
13048    // region   Shell and process control
13049    /** @name   Shell and process control */
13050
13051    /**
13052     * Maximum amount of virtual memory available to shell processes under linux, in KiB.
13053     */
13054    public const MaxShellMemory = [
13055        'default' => 307_200,
13056    ];
13057
13058    /**
13059     * Maximum file size created by shell processes under linux, in KiB
13060     * ImageMagick convert for example can be fairly hungry for scratch space
13061     */
13062    public const MaxShellFileSize = [
13063        'default' => 102_400,
13064    ];
13065
13066    /**
13067     * Maximum CPU time in seconds for shell processes under Linux
13068     */
13069    public const MaxShellTime = [
13070        'default' => 180,
13071    ];
13072
13073    /**
13074     * Maximum wall clock time (i.e. real time, of the kind the clock on the wall
13075     * would measure) in seconds for shell processes under Linux
13076     */
13077    public const MaxShellWallClockTime = [
13078        'default' => 180,
13079    ];
13080
13081    /**
13082     * Under Linux: a cgroup directory used to constrain memory usage of shell
13083     * commands. The directory must be writable by the user which runs MediaWiki.
13084     *
13085     * If specified, this is used instead of ulimit, which is inaccurate, and
13086     * causes malloc() to return NULL, which exposes bugs in C applications, making
13087     * them segfault or deadlock.
13088     *
13089     * A wrapper script will create a cgroup for each shell command that runs, as
13090     * a subgroup of the specified cgroup. If the memory limit is exceeded, the
13091     * kernel will send a SIGKILL signal to a process in the subgroup.
13092     *
13093     * **Example:**
13094     *
13095     * ```
13096     * mkdir -p /sys/fs/cgroup/memory/mediawiki
13097     * mkdir -m 0777 /sys/fs/cgroup/memory/mediawiki/job
13098     * echo '$wgShellCgroup = "/sys/fs/cgroup/memory/mediawiki/job";' >> LocalSettings.php
13099     * ```
13100     * The reliability of cgroup cleanup can be improved by installing a
13101     * notify_on_release script in the root cgroup, see e.g.
13102     * https://gerrit.wikimedia.org/r/#/c/40784
13103     */
13104    public const ShellCgroup = [
13105        'default' => false,
13106    ];
13107
13108    /**
13109     * Executable path of the PHP cli binary. Should be set up on install.
13110     */
13111    public const PhpCli = [
13112        'default' => '/usr/bin/php',
13113    ];
13114
13115    /**
13116     * Method to use to restrict shell commands
13117     *
13118     * Supported options:
13119     * - 'autodetect': Autodetect if any restriction methods are available
13120     * - 'firejail': Use firejail <https://firejail.wordpress.com/>
13121     * - false: Don't use any restrictions
13122     *
13123     * @note If using firejail with MediaWiki running in a home directory different
13124     * from the webserver user, firejail 0.9.44+ is required.
13125     * @since 1.31
13126     */
13127    public const ShellRestrictionMethod = [
13128        'default' => 'autodetect',
13129        'type' => 'string|false',
13130    ];
13131
13132    /**
13133     * Shell commands can be run on a remote server using Shellbox. To use this
13134     * feature, set this to the URLs mapped by the service, and also configure $wgShellboxSecretKey.
13135     *
13136     * You can also disable a certain service by setting it to false or null.
13137     *
13138     * 'default' would be the default URL if no URL is defined for that service.
13139     *
13140     * For more information about installing Shellbox, see
13141     * https://www.mediawiki.org/wiki/Shellbox
13142     *
13143     * @since 1.37
13144     */
13145    public const ShellboxUrls = [
13146        'default' => [ 'default' => null, ],
13147        'type' => 'map',
13148        'additionalProperties' => [
13149            'type' => 'string|false|null',
13150        ],
13151    ];
13152
13153    /**
13154     * The secret key for HMAC verification of Shellbox requests. Set this to
13155     * a long random string.
13156     *
13157     * @since 1.36
13158     */
13159    public const ShellboxSecretKey = [
13160        'default' => null,
13161        'type' => '?string',
13162    ];
13163
13164    /**
13165     * The POSIX-compatible shell to use when running scripts. This is used by
13166     * some media handling shell commands.
13167     *
13168     * If ShellboxUrls is configured, this path should exist on the remote side.
13169     * On Windows this should be the full path to bash.exe, not git-bash.exe.
13170     *
13171     * @since 1.42
13172     */
13173    public const ShellboxShell = [
13174        'default' => '/bin/sh',
13175        'type' => '?string',
13176    ];
13177
13178    // endregion -- end Shell and process control
13179
13180    /***************************************************************************/
13181    // region   HTTP client
13182    /** @name   HTTP client */
13183
13184    /**
13185     * Timeout for HTTP requests done internally, in seconds.
13186     *
13187     * @since 1.5
13188     */
13189    public const HTTPTimeout = [
13190        'default' => 25,
13191        'type' => 'float',
13192    ];
13193
13194    /**
13195     * Timeout for connections done internally (in seconds).
13196     *
13197     * Only supported if cURL is installed, ignored otherwise.
13198     *
13199     * @since 1.22
13200     */
13201    public const HTTPConnectTimeout = [
13202        'default' => 5.0,
13203        'type' => 'float',
13204    ];
13205
13206    /**
13207     * The maximum HTTP request timeout in seconds. If any specified or configured
13208     * request timeout is larger than this, then this value will be used instead.
13209     * Zero is interpreted as "no limit".
13210     *
13211     * @since 1.35
13212     */
13213    public const HTTPMaxTimeout = [
13214        'default' => 0,
13215        'type' => 'float',
13216    ];
13217
13218    /**
13219     * The maximum HTTP connect timeout in seconds. If any specified or configured
13220     * connect timeout is larger than this, then this value will be used instead.
13221     * Zero is interpreted as "no limit".
13222     *
13223     * @since 1.35
13224     */
13225    public const HTTPMaxConnectTimeout = [
13226        'default' => 0,
13227        'type' => 'float',
13228    ];
13229
13230    /**
13231     * Timeout for HTTP requests done internally for transwiki imports, in seconds.
13232     *
13233     * @since 1.29
13234     */
13235    public const HTTPImportTimeout = [
13236        'default' => 25,
13237    ];
13238
13239    /**
13240     * Timeout for Asynchronous (background) HTTP requests, in seconds.
13241     */
13242    public const AsyncHTTPTimeout = [
13243        'default' => 25,
13244    ];
13245
13246    /**
13247     * Proxy to use for CURL requests.
13248     */
13249    public const HTTPProxy = [
13250        'default' => '',
13251    ];
13252
13253    /**
13254     * A list of URL domains that will be routed to the proxy specified by
13255     * $wgLocalHTTPProxy.
13256     *
13257     * @since 1.25
13258     */
13259    public const LocalVirtualHosts = [
13260        'default' => [],
13261        'type' => 'map',
13262    ];
13263
13264    /**
13265     * Proxy to use for requests to domains in $wgLocalVirtualHosts
13266     *
13267     * If set to false, no reverse proxy will be used for local requests.
13268     *
13269     * @since 1.38
13270     */
13271    public const LocalHTTPProxy = [
13272        'default' => false,
13273        'type' => 'string|false',
13274    ];
13275
13276    /**
13277     * Whether to respect/honour
13278     *  - request ID provided by the incoming request via the `X-Request-Id`
13279     *  - trace context provided by the incoming request via the `tracestate` and `traceparent`
13280     *
13281     * Set to `true` if the entity sitting in front of MediaWiki sanitises external requests.
13282     *
13283     * Default: `false`.
13284     */
13285    public const AllowExternalReqID = [
13286        'default' => false,
13287    ];
13288
13289    /**
13290     * How to generate the request ID when MediaWiki generates it internally.
13291     * Must be one of: 'rand24', 'uuid4'
13292     *
13293     * Default: 'rand24'
13294     *
13295     * @since 1.46
13296     */
13297    public const GenerateReqIDFormat = [
13298        'default' => 'rand24',
13299        'type' => 'string',
13300    ];
13301
13302    // endregion -- End HTTP client
13303
13304    /***************************************************************************/
13305    // region   Job queue
13306    /** @name   Job queue */
13307
13308    /**
13309     * Number of jobs to perform per request. May be less than one in which case jobs are
13310     * performed probabilistically. If this is zero, jobs will not be done during ordinary
13311     * apache requests. In this case, maintenance/runJobs.php should be run in loop every
13312     * few seconds via a service or cron job. If using a cron job, be sure to handle the
13313     * case where the script is already running (e.g. via `/usr/bin/flock -n <lock_file>`).
13314     *
13315     * If this is set to a non-zero number, then it is highly recommended that PHP run in
13316     * fastcgi mode (php_fpm). When using a standard Apache PHP handler (mod_php), it is
13317     * recommended that output_buffering and zlib.output_compression both be set to "Off",
13318     * allowing MediaWiki to install an unlimited size output buffer on the fly. Setting
13319     * output_buffering to an integer (e.g. 4096) or enabling zlib.output_compression can
13320     * cause user-visible slowness as background tasks execute during web requests.
13321     *
13322     * Regardless of the web server engine in use, be sure to configure a sufficient number
13323     * processes/threads in order to avoid exhaustion (which will cause user-visible slowness).
13324     */
13325    public const JobRunRate = [
13326        'default' => 1,
13327    ];
13328
13329    /**
13330     * When $wgJobRunRate > 0, try to run jobs asynchronously, spawning a new process
13331     * to handle the job execution, instead of blocking the request until the job
13332     * execution finishes.
13333     *
13334     * @since 1.23
13335     */
13336    public const RunJobsAsync = [
13337        'default' => false,
13338    ];
13339
13340    /**
13341     * Number of rows to update per job
13342     */
13343    public const UpdateRowsPerJob = [
13344        'default' => 300,
13345    ];
13346
13347    /**
13348     * Number of rows to update per query
13349     */
13350    public const UpdateRowsPerQuery = [
13351        'default' => 100,
13352    ];
13353
13354    // endregion -- End job queue
13355
13356    /***************************************************************************/
13357    // region   Miscellaneous
13358    /** @name   Miscellaneous */
13359
13360    /**
13361     * Allow redirection to another page when a user logs in.
13362     *
13363     * To enable, set to a string like 'Main Page'
13364     */
13365    public const RedirectOnLogin = [
13366        'default' => null,
13367    ];
13368
13369    /**
13370     * Global configuration variable for Virtual REST Services.
13371     *
13372     * Use the 'path' key to define automatically mounted services. The value for this
13373     * key is a map of path prefixes to service configuration. The latter is an array of:
13374     *   - class : the fully qualified class name
13375     *   - options : map of arguments to the class constructor
13376     * Such services will be available to handle queries under their path from the VRS
13377     * singleton, e.g. MediaWikiServices::getInstance()->getVirtualRESTServiceClient();
13378     *
13379     * Auto-mounting example for Parsoid:
13380     *
13381     * $wgVirtualRestConfig['paths']['/parsoid/'] = [
13382     *     'class' => ParsoidVirtualRESTService::class,
13383     *     'options' => [
13384     *         'url' => 'http://localhost:8000',
13385     *         'prefix' => 'enwiki',
13386     *         'domain' => 'en.wikipedia.org'
13387     *     ]
13388     * ];
13389     *
13390     * Parameters for different services can also be declared inside the 'modules' value,
13391     * which is to be treated as an associative array. The parameters in 'global' will be
13392     * merged with service-specific ones. The result will then be passed to
13393     * VirtualRESTService::__construct() in the module.
13394     *
13395     * Example config for Parsoid:
13396     *
13397     *   $wgVirtualRestConfig['modules']['parsoid'] = [
13398     *     'url' => 'http://localhost:8000',
13399     *     'prefix' => 'enwiki',
13400     *     'domain' => 'en.wikipedia.org',
13401     *   ];
13402     *
13403     * @since 1.25
13404     */
13405    public const VirtualRestConfig = [
13406        'default' => [
13407            'paths' => [],
13408            'modules' => [],
13409            'global' => [
13410                # Timeout in seconds
13411                'timeout' => 360,
13412                # 'domain' is set to $wgCanonicalServer in Setup.php
13413                'forwardCookies' => false,
13414                'HTTPProxy' => null
13415            ]
13416        ],
13417        'mergeStrategy' => 'array_plus_2d',
13418        'type' => 'map',
13419    ];
13420
13421    /**
13422     * Mapping of event channels (or channel categories) to EventRelayer configuration.
13423     *
13424     * By setting up a PubSub system (like Kafka) and enabling a corresponding EventRelayer class
13425     * that uses it, MediaWiki can broadcast events to all subscribers. Certain features like WAN
13426     * cache purging and CDN cache purging will emit events to this system. Appropriate listeners
13427     * can subscribe to the channel and take actions based on the events. For example, a local daemon
13428     * can run on each CDN cache node and perform local purges based on the URL purge channel
13429     * events.
13430     *
13431     * Some extensions may want to use "channel categories" so that different channels can also
13432     * share the same custom relayer instance (e.g. when it's likely to be overridden). They can use
13433     * EventRelayerGroup::getRelayer() based on the category but call notify() on various different
13434     * actual channels. One reason for this would be that some systems have very different
13435     * performance vs durability needs, so one system (e.g. Kafka) may not be suitable for all
13436     * uses.
13437     *
13438     * The 'default' key is for all channels (or channel categories) without an explicit entry
13439     * here.
13440     *
13441     * @since 1.27
13442     */
13443    public const EventRelayerConfig = [
13444        'default' => [
13445            'default' => [ 'class' => EventRelayerNull::class, ],
13446        ],
13447        'type' => 'map',
13448    ];
13449
13450    /**
13451     * Share data about this installation with MediaWiki developers
13452     *
13453     * When set to true, MediaWiki will periodically ping https://www.mediawiki.org/ with basic
13454     * data about this MediaWiki instance. This data includes, for example, the type of system,
13455     * PHP version, and chosen database backend. The Wikimedia Foundation shares this data with
13456     * MediaWiki developers to help guide future development efforts.
13457     *
13458     * For details about what data is sent, see: https://www.mediawiki.org/wiki/Manual:$wgPingback
13459     *
13460     * For the pingback privacy policy, see:
13461     * https://wikimediafoundation.org/wiki/MediaWiki_Pingback_Privacy_Statement
13462     *
13463     * Aggregate pingback data is available at: https://pingback.wmcloud.org/
13464     *
13465     * @since 1.28
13466     */
13467    public const Pingback = [
13468        'default' => false,
13469        'type' => 'boolean',
13470    ];
13471
13472    /**
13473     * Origin Trials tokens.
13474     *
13475     * @since 1.33
13476     */
13477    public const OriginTrials = [
13478        'default' => [],
13479        'type' => 'list',
13480    ];
13481
13482    /**
13483     * Expiry of the endpoint definition for the Reporting API.
13484     *
13485     * @unstable EXPERIMENTAL
13486     * @since 1.34
13487     */
13488    public const ReportToExpiry = [
13489        'default' => 86400,
13490        'type' => 'integer',
13491    ];
13492
13493    /**
13494     * List of endpoints for the Reporting API.
13495     *
13496     * @unstable EXPERIMENTAL
13497     * @since 1.34
13498     */
13499    public const ReportToEndpoints = [
13500        'default' => [],
13501        'type' => 'list',
13502    ];
13503
13504    /**
13505     * List of Feature Policy Reporting types to enable.
13506     *
13507     * Each entry is turned into a Feature-Policy-Report-Only header.
13508     *
13509     * @unstable EXPERIMENTAL
13510     * @since 1.34
13511     */
13512    public const FeaturePolicyReportOnly = [
13513        'default' => [],
13514        'type' => 'list',
13515    ];
13516
13517    /**
13518     * List of preferred skins to be listed higher in Special:Preferences
13519     *
13520     * @since 1.38
13521     */
13522    public const SkinsPreferred = [
13523        'default' => [ 'vector-2022', 'vector' ],
13524        'type' => 'list',
13525    ];
13526
13527    /**
13528     * List of skins that show a link to the Special:Contribute page
13529     *
13530     * @since 1.40
13531     */
13532    public const SpecialContributeSkinsEnabled = [
13533        'default' => [],
13534        'type' => 'list',
13535    ];
13536
13537    /**
13538     * Allow redirection to another page when a user selects New Page on Special:Contribute page
13539     *
13540     */
13541    public const SpecialContributeNewPageTarget = [
13542        'default' => null,
13543        'type' => '?string',
13544    ];
13545
13546    /**
13547     * Whether to enable the client-side edit recovery feature.
13548     *
13549     * @unstable Temporary feature flag, T341844
13550     * @since 1.41
13551     */
13552    public const EnableEditRecovery = [
13553        'default' => false,
13554        'type' => 'boolean',
13555    ];
13556
13557    /**
13558     * Number of seconds to keep edit recovery data after the edit is stored.
13559     */
13560    public const EditRecoveryExpiry = [
13561        'default' => 30 * 24 * 3600,
13562        'type' => 'integer',
13563    ];
13564
13565    /**
13566     * Whether to use Codex in Special:Block form.
13567     *
13568     * @unstable Temporary feature flag, T358153
13569     * @since 1.42
13570     */
13571    public const UseCodexSpecialBlock = [
13572        'default' => false,
13573        'type' => 'boolean',
13574    ];
13575
13576    /**
13577     * Whether to display a confirmation screen during user log out.
13578     *
13579     * @unstable Temporary feature flag, T357484
13580     * @since 1.42
13581     */
13582    public const ShowLogoutConfirmation = [
13583        'default' => false,
13584        'type' => 'boolean',
13585    ];
13586
13587    /**
13588     * Whether to show indicators on a page when it is protected.
13589     *
13590     * @since 1.43
13591     */
13592    public const EnableProtectionIndicators = [
13593        'default' => true,
13594        'type' => 'boolean',
13595    ];
13596
13597    /**
13598     * OutputPipelineStages to add to the DefaultOutputPipeline.
13599     *
13600     * @unstable EXPERIMENTAL
13601     * @since 1.43
13602     */
13603    public const OutputPipelineStages = [
13604        'default' => [],
13605        'type' => 'map',
13606    ];
13607
13608    /**
13609     * Allow temporarily disabling use of certain features. Useful for
13610     * large site operators to push people to newer APIs while still
13611     * keeping the breakage short and contained.
13612     *
13613     * This should be an array, where a key is a feature name and the value
13614     * is an array of shutdown arrays, each containing the following keys:
13615     *     'start' => Shutdown start, parsed with strtotime(). (required)
13616     *     'end' => Shutdown end, parsed with strtotime(). (required)
13617     *     'percentage' => Number between 0 and 100. If set, only a certain
13618     *       percentage of requests will be blocked.
13619     *
13620     * For example:
13621     * @code
13622     * $wgFeatureShutdown = [
13623     *   'pre-1.24-tokens' => [
13624     *     [
13625     *       'start' => '2021-07-01T00:00 +00:00',
13626     *       'end' => '2021-08-01T00:00 +00:00',
13627     *       'percentage' => 50,
13628     *     ],
13629     *   ],
13630     * ];
13631     * @encdode
13632     *
13633     * @since 1.44
13634     */
13635    public const FeatureShutdown = [
13636        'default' => [],
13637        'type' => 'list',
13638    ];
13639
13640    /**
13641     * Whether Article should clone the ParserOutput before postprocessing.
13642     *
13643     * @unstable Temporary feature flag, T410923
13644     * @since 1.45
13645     */
13646    public const CloneArticleParserOutput = [
13647        'default' => true,
13648        'type' => 'boolean',
13649    ];
13650
13651    /**
13652     * Whether MediaWiki should use Leximorph handlers and providers for language
13653     * transformations and plural-rule loading.
13654     *
13655     * @unstable Temporary feature flag, T389281
13656     * @since 1.45
13657     */
13658    public const UseLeximorph = [
13659        'default' => false,
13660        'type' => 'boolean',
13661    ];
13662
13663    /**
13664     * Whether to use the post-OutputTransform cache for legacy parses
13665     *
13666     * @unstable Temporary feature flag, T348255
13667     * @since 1.46
13668     */
13669    public const UsePostprocCacheLegacy = [
13670        'default' => false,
13671        'type' => 'boolean'
13672    ];
13673
13674    /**
13675     * Whether to use the post-OutputTransform cache for Parsoid parses
13676     *
13677     * @unstable Temporary feature flag, T348255
13678     * @since 1.46
13679     */
13680    public const UsePostprocCacheParsoid = [
13681        'default' => true,
13682        'type' => 'boolean'
13683    ];
13684
13685    /**
13686     * Sample rate for collecting statistics on unsafe key values in ParserCache.
13687     * Zero disables collection; 1000 means "1 in every 1000 parses will
13688     * be sampled".
13689     *
13690     * @warning This is EXPERIMENTAL and will disappear once analysis is
13691     *  complete.
13692     * @unstable temporary statistics gathering
13693     * @since 1.46
13694     */
13695    public const ParserOptionsLogUnsafeSampleRate = [
13696        'default' => 0,
13697        'type' => 'integer'
13698    ];
13699
13700    /**
13701     * Which experimental PFragment types to return during preprocessing
13702     *
13703     * @unstable Temporary feature flag, T391624
13704     * @since 1.47
13705     */
13706    public const ReturnExperimentalPFragmentTypes = [
13707        'default' => [],
13708        'type' => 'list'
13709    ];
13710
13711    // endregion -- End Miscellaneous
13712}