Debian Codegraph @

includes/MainConfigSchema.php

raw symbols SCIP
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
12 namespace MediaWiki;
13
14 use AssembleUploadChunksJob;
15 use BlockLogFormatter;
16 use CategoryMembershipChangeJob;
17 use CdnPurgeJob;
18 use ContentModelLogFormatter;
19 use DateTime;
20 use DateTimeZone;
21 use DeleteLinksJob;
22 use DeleteLogFormatter;
23 use DeletePageJob;
24 use DoubleRedirectJob;
25 use EmaillingJob;
26 use EnotifNotifyJob;
27 use Generator;
28 use HTMLCacheUpdateJob;
29 use ImportLogFormatter;
30 use InvalidArgumentException;
31 use JobQueueDB;
32 use LocalisationCache;
33 use LocalRepo;
34 use LogFormatter;
35 use MediaWiki\Auth\CheckBlocksSecondaryAuthenticationProvider;
36 use MediaWiki\Auth\EmailNotificationSecondaryAuthenticationProvider;
37 use MediaWiki\Auth\LocalPasswordPrimaryAuthenticationProvider;
38 use MediaWiki\Auth\PasswordAuthenticationRequest;
39 use MediaWiki\Auth\ResetPasswordSecondaryAuthenticationProvider;
40 use MediaWiki\Auth\TemporaryPasswordAuthenticationRequest;
41 use MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider;
42 use MediaWiki\Auth\ThrottlePreAuthenticationProvider;
43 use MediaWiki\Config\ConfigException;
44 use MediaWiki\Content\CssContentHandler;
45 use MediaWiki\Content\FallbackContentHandler;
46 use MediaWiki\Content\JavaScriptContentHandler;
47 use MediaWiki\Content\JsonContentHandler;
48 use MediaWiki\Content\TextContentHandler;
49 use MediaWiki\Content\WikitextContentHandler;
50 use MediaWiki\Deferred\SiteStatsUpdate;
51 use MediaWiki\Password\Argon2Password;
52 use MediaWiki\Password\BcryptPassword;
53 use MediaWiki\Password\LayeredParameterizedPassword;
54 use MediaWiki\Password\MWOldPassword;
55 use MediaWiki\Password\MWSaltedPassword;
56 use MediaWiki\Password\PasswordPolicyChecks;
57 use MediaWiki\Password\Pbkdf2PasswordUsingOpenSSL;
58 use MediaWiki\Permissions\GrantsInfo;
59 use MediaWiki\RCFeed\RedisPubSubFeedEngine;
60 use MediaWiki\RCFeed\UDPRCFeedEngine;
61 use MediaWiki\RenameUser\RenameUserJob;
62 use MediaWiki\Request\WebRequest;
63 use MediaWiki\Settings\Source\JsonSchemaTrait;
64 use MediaWiki\Site\MediaWikiSite;
65 use MediaWiki\Storage\SqlBlobStore;
66 use MediaWiki\Title\NamespaceInfo;
67 use MediaWiki\User\CentralId\LocalIdLookup;
68 use MediaWiki\User\Registration\LocalUserRegistrationProvider;
69 use MediaWiki\Watchlist\ActivityUpdateJob;
70 use MediaWiki\Watchlist\ClearUserWatchlistJob;
71 use MediaWiki\Watchlist\ClearWatchlistNotificationsJob;
72 use MediaWiki\Watchlist\WatchlistExpiryJob;
73 use MergeLogFormatter;
74 use MoveLogFormatter;
75 use NullJob;
76 use ParsoidCachePrewarmJob;
77 use PatrolLogFormatter;
78 use ProtectLogFormatter;
79 use PublishStashedFileJob;
80 use RecentChangesUpdateJob;
81 use ReflectionClass;
82 use RefreshLinksJob;
83 use RenameuserLogFormatter;
84 use RevertedTagUpdateJob;
85 use RightsLogFormatter;
86 use SqlBagOStuff;
87 use TagLogFormatter;
88 use ThumbnailRenderJob;
89 use UploadFromUrlJob;
90 use UploadLogFormatter;
91 use UserEditCountInitJob;
92 use UserGroupExpiryJob;
93 use UserOptionsUpdateJob;
94 use Wikimedia\EventRelayer\EventRelayerNull;
95 use Wikimedia\ObjectCache\APCUBagOStuff;
96 use Wikimedia\ObjectCache\BagOStuff;
97 use Wikimedia\ObjectCache\EmptyBagOStuff;
98 use Wikimedia\ObjectCache\HashBagOStuff;
99 use Wikimedia\ObjectCache\MemcachedPeclBagOStuff;
100 use Wikimedia\ObjectCache\MemcachedPhpBagOStuff;
101
102 /**
103 * This class contains schema declarations for all configuration variables
104 * known to MediaWiki core. The schema definitions follow the JSON Schema
105 * specification.
106 *
107 * @see https://json-schema.org/learn/getting-started-step-by-step.html
108 * @see https://json-schema.org/understanding-json-schema/
109 *
110 * The following JSON schema keys are used by MediaWiki:
111 * - default: the configuration variable's default value.
112 * - type: identifies the allowed value type or types. In addition to JSON Schema types,
113 * PHPDoc style type definitions are supported for convenience.
114 * Note that 'array' must not be used for associative arrays.
115 * To avoid confusion, use 'list' for sequential arrays and 'map' for associative arrays
116 * with uniform values. The 'object' type should be used for structures that have a known
117 * set of meaningful properties, especially if each property may have a different kind
118 * of value.
119 * See {@link \MediaWiki\Settings\Source\JsonTypeHelper} for details.
120 *
121 * The following additional keys are used by MediaWiki:
122 * - mergeStrategy: see the {@link \MediaWiki\Settings\Config\MergeStrategy}.
123 * - dynamicDefault: Specified a callback that computes the effective default at runtime, based
124 * on the value of other config variables or on the system environment.
125 * See {@link \MediaWiki\Settings\Source\ReflectionSchemaSource}
126 * and {@link \MediaWiki\Settings\DynamicDefaultValues} for details.
127 *
128 * @note After changing this file, run maintenance/generateConfigSchema.php to update
129 * all the files derived from the information in MainConfigSchema.
130 *
131 * @since 1.39
132 */
133 class MainConfigSchema {
134 use JsonSchemaTrait;
135
136 /**
137 * Returns a generator for iterating over all config settings and their default values.
138 * The primary use of this method is to import default values into local scope.
139 * @code
140 * foreach ( MainConfigSchema::listDefaultValues( 'wg' ) as $var => $value ) {
141 * $$var = $value;
142 * }
143 * @endcode
144 *
145 * There should be no reason for application logic to do this.
146 *
147 * @note This method is relatively slow, it should not be used by
148 * performance critical code. Application logic should generally
149 * use ConfigSchema instead
150 *
151 * @param string $prefix A prefix to prepend to each setting name.
152 * Typically, this will be "wg" when constructing global
153 * variable names.
154 *
155 * @return Generator<string,mixed> $settingName => $defaultValue
156 */
157 public static function listDefaultValues( string $prefix = '' ): Generator {
158 $class = new ReflectionClass( self::class );
159 foreach ( $class->getReflectionConstants() as $const ) {
160 if ( !$const->isPublic() ) {
161 continue;
162 }
163
164 $value = $const->getValue();
165
166 if ( !is_array( $value ) ) {
167 // Just in case we end up having some other kind of constant on this class.
168 continue;
169 }
170
171 if ( isset( $value['obsolete'] ) ) {
172 continue;
173 }
174
175 $name = $const->getName();
176 yield "$prefix$name" => self::getDefaultFromJsonSchema( $value );
177 }
178 }
179
180 /**
181 * Returns the default value of the given config setting.
182 *
183 * @note This method is relatively slow, it should not be used by
184 * performance critical code. Application logic should generally
185 * use ConfigSchema instead
186 *
187 * @param string $name The config setting name.
188 *
189 * @return mixed The given config setting's default value, or null
190 * if no default value is specified in the schema.
191 */
192 public static function getDefaultValue( string $name ) {
193 $class = new ReflectionClass( self::class );
194 if ( !$class->hasConstant( $name ) ) {
195 throw new InvalidArgumentException( "Unknown setting: $name" );
196 }
197 $value = $class->getConstant( $name );
198
199 if ( !is_array( $value ) ) {
200 // Might happen if we end up having other kinds of constants on this class.
201 throw new InvalidArgumentException( "Unknown setting: $name" );
202 }
203
204 return self::getDefaultFromJsonSchema( $value );
205 }
206
207 /***************************************************************************/
208 /**
209 * Registry of factory functions to create config objects:
210 * The 'main' key must be set, and the value should be a valid
211 * callable.
212 *
213 * @since 1.23
214 */
215 public const ConfigRegistry = [
216 'default' => [
217 'main' => 'GlobalVarConfig::newInstance',
218 ],
219 'type' => 'map',
220 ];
221
222 /**
223 * Name of the site. It must be changed in LocalSettings.php
224 */
225 public const Sitename = [
226 'default' => 'MediaWiki',
227 ];
228
229 /***************************************************************************/
230 // region Server URLs and file paths
231 /** @name Server URLs and file paths
232 *
233 * In this section, a "path" is usually a host-relative URL, i.e. a URL without
234 * the host part, that starts with a slash. In most cases a full URL is also
235 * acceptable. A "directory" is a local file path.
236 *
237 * In both paths and directories, trailing slashes should not be included.
238 */
239
240 /**
241 * URL of the server.
242 *
243 * **Example:**
244 * ```
245 * $wgServer = 'http://example.com';
246 * ```
247 *
248 * This must be set in LocalSettings.php. The MediaWiki installer does this
249 * automatically since 1.18.
250 *
251 * If you want to use protocol-relative URLs on your wiki, set this to a
252 * protocol-relative URL like '//example.com' and set $wgCanonicalServer
253 * to a fully qualified URL.
254 */
255 public const Server = [
256 'default' => false,
257 ];
258
259 /**
260 * Canonical URL of the server, to use in IRC feeds and notification e-mails.
261 *
262 * Must be fully qualified, even if $wgServer is protocol-relative.
263 *
264 * Defaults to $wgServer, expanded to a fully qualified http:// URL if needed.
265 *
266 * @since 1.18
267 */
268 public const CanonicalServer = [
269 'default' => false,
270 ];
271
272 /**
273 * Server name. This is automatically computed by parsing the bare
274 * hostname out of $wgCanonicalServer. It should not be customized.
275 *
276 * @since 1.24
277 */
278 public const ServerName = [
279 'default' => false,
280 ];
281
282 /**
283 * When the wiki is running behind a proxy and this is set to true, assumes that the proxy
284 * exposes the wiki on the standard ports (443 for https and 80 for http).
285 *
286 * @since 1.26
287 */
288 public const AssumeProxiesUseDefaultProtocolPorts = [
289 'default' => true,
290 'type' => 'boolean',
291 ];
292
293 /**
294 * For installations where the canonical server is HTTP but HTTPS is optionally
295 * supported, you can specify a non-standard HTTPS port here. $wgServer should
296 * be a protocol-relative URL.
297 *
298 * If HTTPS is always used, just specify the port number in $wgServer.
299 *
300 * @see https://phabricator.wikimedia.org/T67184
301 * @since 1.24
302 */
303 public const HttpsPort = [
304 'default' => 443,
305 ];
306
307 /**
308 * If this is true, when an insecure HTTP request is received, always redirect
309 * to HTTPS. This overrides and disables the preferhttps user preference, and it
310 * overrides $wgSecureLogin.
311 *
312 * $wgServer may be either https or protocol-relative. If $wgServer starts with
313 * "http://", an exception will be thrown.
314 *
315 * If a reverse proxy or CDN is used to forward requests from HTTPS to HTTP,
316 * the request header "X-Forwarded-Proto: https" should be sent to suppress
317 * the redirect.
318 *
319 * In addition to setting this to true, for optimal security, the web server
320 * should also be configured to send Strict-Transport-Security response headers.
321 *
322 * @since 1.35
323 */
324 public const ForceHTTPS = [
325 'default' => false,
326 'type' => 'boolean',
327 ];
328
329 /**
330 * The path we should point to.
331 *
332 * It might be a virtual path in case with use apache mod_rewrite for example.
333 *
334 * This *needs* to be set correctly.
335 *
336 * Other paths will be set to defaults based on it unless they are directly
337 * set in LocalSettings.php
338 */
339 public const ScriptPath = [
340 'default' => '/wiki',
341 ];
342
343 /**
344 * Whether to support URLs like index.php/Page_title.
345 * The effective default value is determined at runtime:
346 * it will be enabled in environments where it is expected to be safe.
347 *
348 * Override this to false if $_SERVER['PATH_INFO'] contains unexpectedly
349 * incorrect garbage, or to true if it is really correct.
350 *
351 * The default $wgArticlePath will be set based on this value at runtime, but if
352 * you have customized it, having this incorrectly set to true can cause
353 * redirect loops when "pretty URLs" are used.
354 *
355 * @since 1.2.1
356 */
357 public const UsePathInfo = [
358 'dynamicDefault' => true,
359 ];
360
361 /**
362 * @return bool
363 */
364 public static function getDefaultUsePathInfo(): bool {
365 // These often break when PHP is set up in CGI mode.
366 // PATH_INFO *may* be correct if cgi.fix_pathinfo is set, but then again it may not;
367 // lighttpd converts incoming path data to lowercase on systems
368 // with case-insensitive filesystems, and there have been reports of
369 // problems on Apache as well.
370 return !str_contains( PHP_SAPI, 'cgi' ) && !str_contains( PHP_SAPI, 'apache2filter' ) &&
371 !str_contains( PHP_SAPI, 'isapi' );
372 }
373
374 /**
375 * The URL path to index.php.
376 *
377 * Defaults to "{$wgScriptPath}/index.php".
378 */
379 public const Script = [
380 'default' => false,
381 'dynamicDefault' => [ 'use' => [ 'ScriptPath' ] ]
382 ];
383
384 /**
385 * @param mixed $scriptPath Value of ScriptPath
386 * @return string
387 */
388 public static function getDefaultScript( $scriptPath ): string {
389 return "$scriptPath/index.php";
390 }
391
392 /**
393 * The URL path to load.php.
394 *
395 * Defaults to "{$wgScriptPath}/load.php".
396 *
397 * @since 1.17
398 */
399 public const LoadScript = [
400 'default' => false,
401 'dynamicDefault' => [ 'use' => [ 'ScriptPath' ] ]
402 ];
403
404 /**
405 * @param mixed $scriptPath Value of ScriptPath
406 * @return string
407 */
408 public static function getDefaultLoadScript( $scriptPath ): string {
409 return "$scriptPath/load.php";
410 }
411
412 /**
413 * The URL path to the REST API.
414 * Defaults to "{$wgScriptPath}/rest.php"
415 *
416 * @since 1.34
417 */
418 public const RestPath = [
419 'default' => false,
420 'dynamicDefault' => [ 'use' => [ 'ScriptPath' ] ]
421 ];
422
423 /**
424 * @param mixed $scriptPath Value of ScriptPath
425 * @return string
426 */
427 public static function getDefaultRestPath( $scriptPath ): string {
428 return "$scriptPath/rest.php";
429 }
430
431 /**
432 * The URL path of the skins directory.
433 *
434 * Defaults to "{$wgResourceBasePath}/skins".
435 *
436 * @since 1.3
437 */
438 public const StylePath = [
439 'default' => false,
440 'dynamicDefault' => [ 'use' => [ 'ResourceBasePath' ] ]
441 ];
442
443 /**
444 * @param mixed $resourceBasePath Value of ResourceBasePath
445 * @return string
446 */
447 public static function getDefaultStylePath( $resourceBasePath ): string {
448 return "$resourceBasePath/skins";
449 }
450
451 /**
452 * The URL path of the skins directory. Should not point to an external domain.
453 *
454 * Defaults to "{$wgScriptPath}/skins".
455 *
456 * @since 1.17
457 */
458 public const LocalStylePath = [
459 'default' => false,
460 'dynamicDefault' => [ 'use' => [ 'ScriptPath' ] ]
461 ];
462
463 /**
464 * @param mixed $scriptPath Value of ScriptPath
465 * @return string
466 */
467 public static function getDefaultLocalStylePath( $scriptPath ): string {
468 // Avoid ResourceBasePath here since that may point to a different domain (e.g. CDN)
469 return "$scriptPath/skins";
470 }
471
472 /**
473 * The URL path of the extensions directory.
474 *
475 * Defaults to "{$wgResourceBasePath}/extensions".
476 *
477 * @since 1.16
478 */
479 public const ExtensionAssetsPath = [
480 'default' => false,
481 'dynamicDefault' => [ 'use' => [ 'ResourceBasePath' ] ]
482 ];
483
484 /**
485 * @param mixed $resourceBasePath Value of ResourceBasePath
486 * @return string
487 */
488 public static function getDefaultExtensionAssetsPath( $resourceBasePath ): string {
489 return "$resourceBasePath/extensions";
490 }
491
492 /**
493 * Extensions directory in the file system.
494 *
495 * @note Set to "{$IP}/extensions" by Setup.php before loading local settings.
496 * @note this configuration variable is used to locate extensions while loading settings.
497 * @since 1.25
498 */
499 public const ExtensionDirectory = [
500 'default' => null,
501 'type' => '?string',
502 ];
503
504 /**
505 * Skins directory in the file system.
506 *
507 * @note Set to "{$IP}/skins" by Setup.php before loading local settings.
508 * @note this configuration variable is used to locate skins while loading settings.
509 * @since 1.3
510 */
511 public const StyleDirectory = [
512 'default' => null,
513 'type' => '?string',
514 ];
515
516 /**
517 * Absolute filesystem path of the root directory of the MediaWiki installation.
518 * The MW_INSTALL_PATH environment variable can be used to set this.
519 *
520 * @note Automatically set in Setup.php before loading local settings.
521 * @note Do not modify in settings files! Must remain equal to the MW_INSTALL_PATH constant
522 * defined in Setup.php.
523 * @since 1.38
524 */
525 public const BaseDirectory = [
526 'default' => null,
527 ];
528
529 /**
530 * The URL path for primary article page views. This path should contain $1,
531 * which is replaced by the article title.
532 *
533 * Defaults to "{$wgScript}/$1" or "{$wgScript}?title=$1",
534 * depending on $wgUsePathInfo.
535 */
536 public const ArticlePath = [
537 'default' => false,
538 'dynamicDefault' => [ 'use' => [ 'Script', 'UsePathInfo' ] ]
539 ];
540
541 /**
542 * @param string $script Value of Script
543 * @param mixed $usePathInfo Value of UsePathInfo
544 * @return string
545 */
546 public static function getDefaultArticlePath( string $script, $usePathInfo ): string {
547 if ( $usePathInfo ) {
548 return "$script/$1";
549 }
550 return "$script?title=$1";
551 }
552
553 /**
554 * The URL path for the images directory.
555 *
556 * Defaults to "{$wgScriptPath}/images".
557 */
558 public const UploadPath = [
559 'default' => false,
560 'dynamicDefault' => [ 'use' => [ 'ScriptPath' ] ]
561 ];
562
563 /**
564 * @param mixed $scriptPath Value of ScriptPath
565 * @return string
566 */
567 public static function getDefaultUploadPath( $scriptPath ): string {
568 return "$scriptPath/images";
569 }
570
571 /**
572 * The base path for img_auth.php. This is used to interpret the request URL
573 * for requests to img_auth.php that do not match the base upload path. If
574 * false, "{$wgScriptPath}/img_auth.php" is used.
575 *
576 * Normally, requests to img_auth.php have a REQUEST_URI which matches
577 * $wgUploadPath, and in that case, setting this should not be necessary.
578 * This variable is used in case img_auth.php is accessed via a different path
579 * than $wgUploadPath.
580 *
581 * @since 1.35
582 */
583 public const ImgAuthPath = [
584 'default' => false,
585 ];
586
587 /**
588 * The base path for thumb_handler.php. This is used to interpret the request URL
589 * for requests to thumb_handler.php that do not match the base upload path.
590 *
591 * @since 1.36
592 */
593 public const ThumbPath = [
594 'default' => false,
595 ];
596
597 /**
598 * The filesystem path of the images directory. Defaults to "{$IP}/images".
599 */
600 public const UploadDirectory = [
601 'default' => false,
602 'dynamicDefault' => [ 'use' => [ 'BaseDirectory' ] ]
603 ];
604
605 /**
606 * @param mixed $baseDirectory Value of BaseDirectory
607 * @return string
608 */
609 public static function getDefaultUploadDirectory( $baseDirectory ): string {
610 return "$baseDirectory/images";
611 }
612
613 /**
614 * Directory where the cached page will be saved.
615 *
616 * Defaults to "{$wgUploadDirectory}/cache".
617 */
618 public const FileCacheDirectory = [
619 'default' => false,
620 'dynamicDefault' => [ 'use' => [ 'UploadDirectory' ] ]
621 ];
622
623 /**
624 * @param mixed $uploadDirectory Value of UploadDirectory
625 * @return string
626 */
627 public static function getDefaultFileCacheDirectory( $uploadDirectory ): string {
628 return "$uploadDirectory/cache";
629 }
630
631 /**
632 * The URL path of the wiki logo. The logo size should be 135x135 pixels.
633 *
634 * Defaults to "$wgResourceBasePath/resources/assets/change-your-logo.svg".
635 * Developers should retrieve this logo (and other variants) using
636 * the static function MediaWiki\ResourceLoader\SkinModule::getAvailableLogos
637 * Ignored if $wgLogos is set.
638 */
639 public const Logo = [
640 'default' => false,
641 'dynamicDefault' => [ 'use' => [ 'ResourceBasePath' ] ]
642 ];
643
644 /**
645 * @param mixed $resourceBasePath Value of ResourceBasePath
646 * @return string
647 */
648 public static function getDefaultLogo( $resourceBasePath ): string {
649 return "$resourceBasePath/resources/assets/change-your-logo.svg";
650 }
651
652 /**
653 * Specification for different versions of the wiki logo.
654 *
655 * This is an array which should have the following k/v pairs:
656 * All path values can be either absolute or relative URIs
657 *
658 * The `1x` key is a path to the 1x version of square logo (should be 135x135 pixels)
659 * The `1.5x` key is a path to the 1.5x version of square logo
660 * The `2x` key is a path to the 2x version of square logo
661 * The `svg` key is a path to the svg version of square logo
662 * The `icon` key is a path to the version of the logo without wordmark and tagline
663 * The `wordmark` key may be null or an array with the following fields
664 * - `src` path to wordmark version
665 * - `1x` path to svg wordmark version (if you want to
666 * support browsers with SVG support with an SVG logo)
667 * - `width` width of the logo in pixels
668 * - `height` height of the logo in pixels
669 * The `tagline` key may be null or array with the following fields
670 * - `src` path to tagline image
671 * - `width` width of the tagline in pixels
672 * - `height` height of the tagline in pixels
673 *
674 *
675 * @par Example:
676 * @code
677 * $wgLogos = [
678 * '1x' => 'path/to/1x_version.png',
679 * '1.5x' => 'path/to/1.5x_version.png',
680 * '2x' => 'path/to/2x_version.png',
681 * 'svg' => 'path/to/svg_version.svg',
682 * 'icon' => 'path/to/icon.png',
683 * 'wordmark' => [
684 * 'src' => 'path/to/wordmark_version.png',
685 * '1x' => 'path/to/wordmark_version.svg',
686 * 'width' => 135,
687 * 'height' => 20,
688 * ],
689 * 'tagline' => [
690 * 'src' => 'path/to/tagline_version.png',
691 * 'width' => 135,
692 * 'height' => 15,
693 * ]
694 * ];
695 * @endcode
696 *
697 * Defaults to [ "1x" => $wgLogo ],
698 * or [ "1x" => "$wgResourceBasePath/resources/assets/change-your-logo.svg" ] if $wgLogo is not set.
699 * @since 1.35
700 */
701 public const Logos = [
702 'default' => false,
703 'type' => 'map|false',
704 ];
705
706 /**
707 * The URL path of the icon.
708 *
709 * @since 1.6
710 */
711 public const Favicon = [
712 'default' => '/favicon.ico',
713 ];
714
715 /**
716 * The URL path of the icon for iPhone and iPod Touch web app bookmarks.
717 *
718 * Defaults to no icon.
719 *
720 * @since 1.12
721 */
722 public const AppleTouchIcon = [
723 'default' => false,
724 ];
725
726 /**
727 * Value for the referrer policy meta tag.
728 *
729 * One or more of the values defined in the Referrer Policy specification:
730 * https://w3c.github.io/webappsec-referrer-policy/
731 * ('no-referrer', 'no-referrer-when-downgrade', 'same-origin',
732 * 'origin', 'strict-origin', 'origin-when-cross-origin',
733 * 'strict-origin-when-cross-origin', or 'unsafe-url')
734 * Setting it to false prevents the meta tag from being output
735 * (which results in falling back to the Referrer-Policy header,
736 * or 'no-referrer-when-downgrade' if that's not set either.)
737 * Setting it to an array (supported since 1.31) will create a meta tag for
738 * each value, in the reverse of the order (meaning that the first array element
739 * will be the default and the others used as fallbacks for browsers which do not
740 * understand it).
741 *
742 * @since 1.25
743 */
744 public const ReferrerPolicy = [
745 'default' => false,
746 'type' => 'list|string|false',
747 ];
748
749 /**
750 * The local filesystem path to a temporary directory. This must not be web-accessible.
751 *
752 * When this setting is set to false, its value will automatically be decided
753 * through the first call to wfTempDir(). See that method's implementation for
754 * the actual detection logic.
755 *
756 * To find the temporary path for the current wiki, developers must not use
757 * this variable directly. Use the global function wfTempDir() instead.
758 *
759 * The temporary directory is expected to be shared with other applications,
760 * including other MediaWiki instances (which might not run the same version
761 * or configuration). When storing files here, take care to avoid conflicts
762 * with other instances of MediaWiki. For example, when caching the result
763 * of a computation, the file name should incorporate the input of the
764 * computation so that it cannot be confused for the result of a similar
765 * computation by another MediaWiki instance.
766 *
767 * @see \wfTempDir()
768 * @note Default changed to false in MediaWiki 1.20.
769 */
770 public const TmpDirectory = [
771 'default' => false,
772 ];
773
774 /**
775 * If set, this URL is added to the start of $wgUploadPath to form a complete
776 * upload URL.
777 *
778 * @since 1.4
779 */
780 public const UploadBaseUrl = [
781 'default' => '',
782 ];
783
784 /**
785 * To enable remote on-demand scaling, set this to the thumbnail base URL.
786 *
787 * Full thumbnail URL will be like $wgUploadStashScalerBaseUrl/e/e6/Foo.jpg/123px-Foo.jpg
788 * where 'e6' are the first two characters of the MD5 hash of the file name.
789 *
790 * @deprecated since 1.36 Use thumbProxyUrl in $wgLocalFileRepo
791 *
792 * If $wgUploadStashScalerBaseUrl and thumbProxyUrl are both false, thumbs are
793 * rendered locally as needed.
794 * @since 1.17
795 */
796 public const UploadStashScalerBaseUrl = [
797 'default' => false,
798 'deprecated' => 'since 1.36 Use thumbProxyUrl in $wgLocalFileRepo',
799 ];
800
801 /**
802 * To set 'pretty' URL paths for actions other than
803 * plain page views, add to this array.
804 *
805 * **Example:**
806 * Set pretty URL for the edit action:
807 *
808 * ```
809 * 'edit' => "$wgScriptPath/edit/$1"
810 * ```
811 * There must be an appropriate script or rewrite rule in place to handle these URLs.
812 *
813 * @since 1.5
814 */
815 public const ActionPaths = [
816 'default' => [],
817 'type' => 'map',
818 ];
819
820 /**
821 * When enabled, the domain root will show the wiki's main page,
822 * instead of redirecting to the main page.
823 *
824 * @since 1.34
825 */
826 public const MainPageIsDomainRoot = [
827 'default' => false,
828 'type' => 'boolean',
829 ];
830
831 // endregion -- end of server URLs and file paths
832
833 /***************************************************************************/
834 // region Files and file uploads
835 /** @name Files and file uploads */
836
837 /**
838 * Allow users to upload files.
839 *
840 * Use $wgLocalFileRepo to control how and where uploads are stored.
841 * Disabled by default as for security reasons.
842 * See <https://www.mediawiki.org/wiki/Manual:Configuring_file_uploads>.
843 *
844 * @since 1.5
845 */
846 public const EnableUploads = [
847 'default' => false,
848 ];
849
850 /**
851 * The maximum age of temporary (incomplete) uploaded files
852 */
853 public const UploadStashMaxAge = [
854 'default' => 6 * 3600, // 6 hours
855 ];
856
857 /**
858 * Enable deferred upload tasks that use the job queue.
859 *
860 * Only enable this if job runners are set up for both the
861 * 'AssembleUploadChunks','PublishStashedFile' and 'UploadFromUrl' job types.
862 */
863 public const EnableAsyncUploads = [
864 'default' => false,
865 ];
866
867 /**
868 * Enable the async processing of upload by url in Special:Upload.
869 *
870 * Only works if EnableAsyncUploads is also enabled
871 */
872 public const EnableAsyncUploadsByURL = [
873 'default' => false,
874 ];
875
876 /**
877 * To disable file delete/restore temporarily
878 */
879 public const UploadMaintenance = [
880 'default' => false,
881 ];
882
883 /**
884 * Additional characters that are not allowed in filenames. They are replaced with '-' when
885 * uploading. Like $wgLegalTitleChars, this is a regexp character class.
886 *
887 * Slashes and backslashes are disallowed regardless of this setting, but included here for
888 * completeness.
889 *
890 * @deprecated since 1.41; no longer customizable
891 */
892 public const IllegalFileChars = [
893 'default' => ':\\/\\\\',
894 'deprecated' => 'since 1.41; no longer customizable',
895 ];
896
897 /**
898 * What directory to place deleted uploads in.
899 *
900 * Defaults to "{$wgUploadDirectory}/deleted".
901 */
902 public const DeletedDirectory = [
903 'default' => false,
904 'dynamicDefault' => [ 'use' => [ 'UploadDirectory' ] ]
905 ];
906
907 /**
908 * @param mixed $uploadDirectory Value of UploadDirectory
909 * @return string
910 */
911 public static function getDefaultDeletedDirectory( $uploadDirectory ): string {
912 return "$uploadDirectory/deleted";
913 }
914
915 /**
916 * Set this to true if you use img_auth and want the user to see details on why access failed.
917 */
918 public const ImgAuthDetails = [
919 'default' => false,
920 ];
921
922 /**
923 * Map of relative URL directories to match to internal mwstore:// base storage paths.
924 *
925 * For img_auth.php requests, everything after "img_auth.php/" is checked to see
926 * if starts with any of the prefixes defined here. The prefixes should not overlap.
927 * The prefix that matches has a corresponding storage path, which the rest of the URL
928 * is assumed to be relative to. The file at that path (or a 404) is send to the client.
929 *
930 * Example:
931 * $wgImgAuthUrlPathMap['/timeline/'] = 'mwstore://local-fs/timeline-render/';
932 * The above maps ".../img_auth.php/timeline/X" to "mwstore://local-fs/timeline-render/".
933 * The name "local-fs" should correspond by name to an entry in $wgFileBackends.
934 *
935 * @see self::FileBackends
936 */
937 public const ImgAuthUrlPathMap = [
938 'default' => [],
939 'type' => 'map',
940 ];
941
942 /**
943 * File repository structures
944 *
945 * $wgLocalFileRepo is a single repository structure, and $wgForeignFileRepos is
946 * an array of such structures. Each repository structure is an associative
947 * array of properties configuring the repository.
948 *
949 * Properties required for all repos:
950 * - class The class name for the repository. May come from the core or an extension.
951 * The core repository classes are FileRepo, LocalRepo, ForeignDBRepo.
952 *
953 * - name A unique name for the repository (but $wgLocalFileRepo should be 'local').
954 * The name should consist of alpha-numeric characters.
955 *
956 * Optional common properties:
957 * - backend A file backend name (see $wgFileBackends). If not specified, or
958 * if the name is not present in $wgFileBackends, an FSFileBackend
959 * will automatically be configured.
960 * - lockManager If a file backend is automatically configured, this will be lock
961 * manager name used. A lock manager named in $wgLockManagers, or one of
962 * the default lock managers "fsLockManager" or "nullLockManager". Default
963 * "fsLockManager".
964 * - favicon URL to a favicon. This is exposed via FileRepo::getInfo and
965 * ApiQueryFileRepoInfo. Originally for use by MediaViewer (T77093).
966 *
967 * For most core repos:
968 * - zones Associative array of zone names that each map to an array with:
969 * container : backend container name the zone is in
970 * directory : root path within container for the zone
971 * url : base URL to the root of the zone
972 * urlsByExt : map of file extension types to base URLs
973 * (useful for using a different cache for videos)
974 * Zones default to using "<repo name>-<zone name>" as the container name
975 * and default to using the container root as the zone's root directory.
976 * Nesting of zone locations within other zones should be avoided.
977 * - url Public zone URL. The 'zones' settings take precedence.
978 * - hashLevels The number of directory levels for hash-based division of files.
979 *
980 * Set this to 0 if you do not want MediaWiki to divide your images
981 * directory into many subdirectories.
982 *
983 * It is recommended to leave this enabled. In previous versions of
984 * MediaWiki, some users set this to false to allow images to be added to
985 * the wiki by copying them into $wgUploadDirectory and then running
986 * maintenance/rebuildImages.php to register them in the database.
987 * This is no longer supported, use maintenance/importImages.php instead.
988 *
989 * Default: 2.
990 * - deletedHashLevels
991 * Optional 'hashLevels' override for the 'deleted' zone.
992 * - thumbScriptUrl The URL for thumb.php (optional, not recommended)
993 * - transformVia404 Whether to skip media file transformation on parse and rely on a 404
994 * handler instead.
995 * - thumbProxyUrl Optional. URL of where to proxy thumb.php requests to. This is
996 * also used internally for remote thumbnailing of upload stash files.
997 * Example: http://127.0.0.1:8888/wiki/dev/thumb/
998 * - thumbProxySecret Optional value of the X-Swift-Secret header to use in requests to
999 * thumbProxyUrl
1000 * - disableLocalTransform
1001 * If present and true, local image scaling will be disabled. If attempted,
1002 * it will show an error to the user and log an error message. To avoid an
1003 * error, thumbProxyUrl must be set, as well as either transformVia404
1004 * (preferred) or thumbScriptUrl.
1005 * - initialCapital Equivalent to $wgCapitalLinks (or $wgCapitalLinkOverrides[NS_FILE],
1006 * determines whether filenames implicitly start with a capital letter.
1007 * The current implementation may give incorrect description page links
1008 * when the local $wgCapitalLinks and initialCapital are mismatched.
1009 * - pathDisclosureProtection
1010 * May be 'paranoid' to remove all parameters from error messages, 'none' to
1011 * leave the paths in unchanged, or 'simple' to replace paths with
1012 * placeholders. Default for LocalRepo is 'simple'.
1013 * - fileMode This allows wikis to set the file mode when uploading/moving files. Default
1014 * is 0644.
1015 * - directory The local filesystem directory where public files are stored. Not used for
1016 * some remote repos.
1017 * - thumbDir The base thumbnail directory. Defaults to "<directory>/thumb".
1018 * - thumbUrl The base thumbnail URL. Defaults to "<url>/thumb".
1019 * - isPrivate Set this if measures should always be taken to keep the files private.
1020 * One should not trust this to assure that the files are not web readable;
1021 * the server configuration should be done manually depending on the backend.
1022 * - useJsonMetadata Whether handler metadata should be stored in JSON format. Default: true.
1023 * - useSplitMetadata Whether handler metadata should be split up and stored in the text table.
1024 * Default: false.
1025 * - splitMetadataThreshold
1026 * If the media handler opts in, large metadata items will be split into a
1027 * separate blob in the database if the item is larger than this threshold.
1028 * Default: 1000
1029 * - updateCompatibleMetadata
1030 * When true, image metadata will be upgraded by reloading it from the original
1031 * file, if the handler indicates that it is out of date.
1032 *
1033 * By default, when purging a file or otherwise refreshing file metadata, it
1034 * is only reloaded when the metadata is invalid. Valid data originally loaded
1035 * by a current or older compatible version is left unchanged. Enable this
1036 * to also reload and upgrade metadata that was stored by an older compatible
1037 * version. See also MediaHandler::isMetadataValid, and RefreshImageMetadata.
1038 *
1039 * Default: false.
1040 *
1041 * - reserializeMetadata
1042 * If true, image metadata will be automatically rewritten to the database
1043 * if its serialization format is out of date. Default: false
1044 *
1045 * These settings describe a foreign MediaWiki installation. They are optional, and will be ignored
1046 * for local repositories:
1047 * - descBaseUrl URL of image description pages, e.g. https://en.wikipedia.org/wiki/File:
1048 * - scriptDirUrl URL of the MediaWiki installation, equivalent to $wgScriptPath, e.g.
1049 * https://en.wikipedia.org/w
1050 * - articleUrl Equivalent to $wgArticlePath, e.g. https://en.wikipedia.org/wiki/$1
1051 * - fetchDescription Fetch the text of the remote file description page and display them
1052 * on the local wiki.
1053 * - abbrvThreshold File names over this size will use the short form of thumbnail names.
1054 * Short thumbnail names only have the width, parameters, and the extension.
1055 *
1056 * ForeignDBRepo:
1057 * - dbType, dbServer, dbUser, dbPassword, dbName, dbFlags
1058 * equivalent to the corresponding member of $wgDBservers
1059 * - tablePrefix Table prefix, the foreign wiki's $wgDBprefix
1060 * - hasSharedCache Set to true if the foreign wiki's $wgMainCacheType is identical to,
1061 * and accessible from, this wiki.
1062 *
1063 * ForeignAPIRepo:
1064 * - apibase Use for the foreign API's URL
1065 * - apiThumbCacheExpiry How long to locally cache thumbs for
1066 *
1067 * If you leave $wgLocalFileRepo set to false, Setup will fill in appropriate values.
1068 * Otherwise, set $wgLocalFileRepo to a repository structure as described above.
1069 * If you set $wgUseInstantCommons to true, it will add an entry for Commons.
1070 * If you set $wgForeignFileRepos to an array of repository structures, those will
1071 * be searched after the local file repo.
1072 * Otherwise, you will only have access to local media files.
1073 *
1074 * @see \FileRepo::__construct for the default options.
1075 * @see Setup.php for an example usage and default initialization.
1076 */
1077 public const LocalFileRepo = [
1078 'default' => false,
1079 'type' => 'map|false',
1080 'dynamicDefault' => [ 'use' => [ 'UploadDirectory', 'ScriptPath', 'Favicon', 'UploadBaseUrl',
1081 'UploadPath', 'HashedUploadDirectory', 'ThumbnailScriptPath',
1082 'GenerateThumbnailOnParse', 'DeletedDirectory', 'UpdateCompatibleMetadata' ] ],
1083 ];
1084
1085 public static function getDefaultLocalFileRepo(
1086 $uploadDirectory, $scriptPath, $favicon, $uploadBaseUrl, $uploadPath,
1087 $hashedUploadDirectory, $thumbnailScriptPath, $generateThumbnailOnParse, $deletedDirectory,
1088 $updateCompatibleMetadata
1089 ) {
1090 return [
1091 'class' => LocalRepo::class,
1092 'name' => 'local',
1093 'directory' => $uploadDirectory,
1094 'scriptDirUrl' => $scriptPath,
1095 'favicon' => $favicon,
1096 'url' => $uploadBaseUrl ? $uploadBaseUrl . $uploadPath : $uploadPath,
1097 'hashLevels' => $hashedUploadDirectory ? 2 : 0,
1098 'thumbScriptUrl' => $thumbnailScriptPath,
1099 'transformVia404' => !$generateThumbnailOnParse,
1100 'deletedDir' => $deletedDirectory,
1101 'deletedHashLevels' => $hashedUploadDirectory ? 3 : 0,
1102 'updateCompatibleMetadata' => $updateCompatibleMetadata,
1103 'reserializeMetadata' => $updateCompatibleMetadata,
1104 ];
1105 }
1106
1107 /**
1108 * Enable the use of files from one or more other wikis.
1109 *
1110 * If you operate multiple wikis, you can declare a shared upload path here.
1111 * Uploads to the local wiki will NOT be stored here - See $wgLocalFileRepo
1112 * and $wgUploadDirectory for that.
1113 *
1114 * The wiki will only consider the foreign repository if no file of the given name
1115 * is found in the local repository (e.g. via `[[File:..]]` syntax).
1116 *
1117 * @since 1.11
1118 * @see self::LocalFileRepo
1119 */
1120 public const ForeignFileRepos = [
1121 'default' => [],
1122 'type' => 'list',
1123 ];
1124
1125 /**
1126 * Use Wikimedia Commons as a foreign file repository.
1127 *
1128 * This is a shortcut for adding an entry to $wgForeignFileRepos
1129 * for https://commons.wikimedia.org, using ForeignAPIRepo with the
1130 * default settings.
1131 *
1132 * @since 1.16
1133 */
1134 public const UseInstantCommons = [
1135 'default' => false,
1136 ];
1137
1138 /**
1139 * Shortcut for adding an entry to $wgForeignFileRepos.
1140 *
1141 * Uses the following variables:
1142 *
1143 * - directory: $wgSharedUploadDirectory.
1144 * - url: $wgSharedUploadPath.
1145 * - hashLevels: Based on $wgHashedSharedUploadDirectory.
1146 * - thumbScriptUrl: $wgSharedThumbnailScriptPath.
1147 * - transformVia404: Based on $wgGenerateThumbnailOnParse.
1148 * - descBaseUrl: $wgRepositoryBaseUrl.
1149 * - fetchDescription: $wgFetchCommonsDescriptions.
1150 *
1151 * If $wgSharedUploadDBname is set, it uses the ForeignDBRepo
1152 * class, with also the following variables:
1153 *
1154 * - dbName: $wgSharedUploadDBname.
1155 * - dbType: $wgDBtype.
1156 * - dbServer: $wgDBserver.
1157 * - dbUser: $wgDBuser.
1158 * - dbPassword: $wgDBpassword.
1159 * - dbFlags: Based on $wgDebugDumpSql.
1160 * - tablePrefix: $wgSharedUploadDBprefix,
1161 * - hasSharedCache: $wgCacheSharedUploads.
1162 *
1163 * @since 1.3
1164 */
1165 public const UseSharedUploads = [
1166 'default' => false,
1167 'type' => 'boolean',
1168 ];
1169
1170 /**
1171 * Shortcut for the 'directory' setting of $wgForeignFileRepos.
1172 *
1173 * Only used if $wgUseSharedUploads is enabled.
1174 *
1175 * @since 1.3
1176 */
1177 public const SharedUploadDirectory = [
1178 'default' => null,
1179 'type' => '?string',
1180 ];
1181
1182 /**
1183 * Shortcut for the 'url' setting of $wgForeignFileRepos.
1184 *
1185 * Only used if $wgUseSharedUploads is enabled.
1186 *
1187 * @since 1.3
1188 */
1189 public const SharedUploadPath = [
1190 'default' => null,
1191 'type' => '?string',
1192 ];
1193
1194 /**
1195 * Shortcut for the 'hashLevels' setting of $wgForeignFileRepos.
1196 *
1197 * Only used if $wgUseSharedUploads is enabled.
1198 *
1199 * @since 1.3
1200 */
1201 public const HashedSharedUploadDirectory = [
1202 'default' => true,
1203 'type' => 'boolean',
1204 ];
1205
1206 /**
1207 * Shortcut for the 'descBaseUrl' setting of $wgForeignFileRepos.
1208 *
1209 * Only used if $wgUseSharedUploads is enabled.
1210 *
1211 * @since 1.5
1212 */
1213 public const RepositoryBaseUrl = [
1214 'default' => 'https://commons.wikimedia.org/wiki/File:',
1215 ];
1216
1217 /**
1218 * Shortcut for the 'fetchDescription' setting of $wgForeignFileRepos.
1219 *
1220 * Only used if $wgUseSharedUploads is enabled.
1221 *
1222 * @since 1.5
1223 */
1224 public const FetchCommonsDescriptions = [
1225 'default' => false,
1226 'type' => 'boolean',
1227 ];
1228
1229 /**
1230 * Shortcut for the ForeignDBRepo 'dbName' setting in $wgForeignFileRepos.
1231 *
1232 * Set this to false if the uploads do not come from a wiki.
1233 * Only used if $wgUseSharedUploads is enabled.
1234 *
1235 * @since 1.4
1236 */
1237 public const SharedUploadDBname = [
1238 'default' => false,
1239 'type' => 'false|string',
1240 ];
1241
1242 /**
1243 * Shortcut for the ForeignDBRepo 'tablePrefix' setting in $wgForeignFileRepos.
1244 *
1245 * Only used if $wgUseSharedUploads is enabled.
1246 *
1247 * @since 1.5
1248 */
1249 public const SharedUploadDBprefix = [
1250 'default' => '',
1251 'type' => 'string',
1252 ];
1253
1254 /**
1255 * Shortcut for the ForeignDBRepo 'hasSharedCache' setting in $wgForeignFileRepos.
1256 *
1257 * Only used if $wgUseSharedUploads is enabled.
1258 *
1259 * @since 1.5
1260 */
1261 public const CacheSharedUploads = [
1262 'default' => true,
1263 'type' => 'boolean',
1264 ];
1265
1266 /**
1267 * Array of foreign file repo names (set in $wgForeignFileRepos above) that
1268 * are allowable upload targets. These wikis must have some method of
1269 * authentication (i.e. CentralAuth), and be CORS-enabled for this wiki.
1270 *
1271 * The string 'local' signifies the default local file repository.
1272 *
1273 * Example:
1274 * $wgForeignUploadTargets = [ 'shared' ];
1275 */
1276 public const ForeignUploadTargets = [
1277 'default' => [ 'local', ],
1278 'type' => 'list',
1279 ];
1280
1281 /**
1282 * Configuration for file uploads using the embeddable upload dialog
1283 * (https://www.mediawiki.org/wiki/Upload_dialog).
1284 *
1285 * This applies also to foreign uploads to this wiki (the configuration is loaded by remote
1286 * wikis using the action=query&meta=siteinfo API).
1287 *
1288 * See below for documentation of each property. None of the properties may be omitted.
1289 */
1290 public const UploadDialog = [
1291 'default' =>
1292 [
1293 'fields' =>
1294 [
1295 'description' => true,
1296 'date' => false,
1297 'categories' => false,
1298 ],
1299 'licensemessages' =>
1300 [
1301 'local' => 'generic-local',
1302 'foreign' => 'generic-foreign',
1303 ],
1304 'comment' =>
1305 [
1306 'local' => '',
1307 'foreign' => '',
1308 ],
1309 'format' =>
1310 [
1311 'filepage' => '$DESCRIPTION',
1312 'description' => '$TEXT',
1313 'ownwork' => '',
1314 'license' => '',
1315 'uncategorized' => '',
1316 ],
1317 ],
1318 'type' => 'map',
1319 ];
1320
1321 /**
1322 * File backend structure configuration.
1323 *
1324 * This is an array of file backend configuration arrays.
1325 * Each backend configuration has the following parameters:
1326 * - name : A unique name for the backend
1327 * - class : The file backend class to use
1328 * - wikiId : A unique string that identifies the wiki (container prefix)
1329 * - lockManager : The name of a lock manager (see $wgLockManagers) [optional]
1330 *
1331 * See FileBackend::__construct() for more details.
1332 * Additional parameters are specific to the file backend class used.
1333 * These settings should be global to all wikis when possible.
1334 *
1335 * FileBackendMultiWrite::__construct() is augmented with a 'template' option that
1336 * can be used in any of the values of the 'backends' array. Its value is the name of
1337 * another backend in $wgFileBackends. When set, it pre-fills the array with all of the
1338 * configuration of the named backend. Explicitly set values in the array take precedence.
1339 *
1340 * There are two particularly important aspects about each backend:
1341 * - a) Whether it is fully qualified or wiki-relative.
1342 * By default, the paths of files are relative to the current wiki,
1343 * which works via prefixing them with the current wiki ID when accessed.
1344 * Setting 'domainId' forces the backend to be fully qualified by prefixing
1345 * all paths with the specified value instead. This can be useful if
1346 * multiple wikis need to share the same data. Note that 'name' is *not*
1347 * part of any prefix and thus should not be relied upon for namespacing.
1348 * - b) Whether it is only defined for some wikis or is defined on all
1349 * wikis in the wiki farm. Defining a backend globally is useful
1350 * if multiple wikis need to share the same data.
1351 * One should be aware of these aspects when configuring a backend for use with
1352 * any basic feature or plugin. For example, suppose an extension stores data for
1353 * different wikis in different directories and sometimes needs to access data from
1354 * a foreign wiki's directory in order to render a page on given wiki. The extension
1355 * would need a fully qualified backend that is defined on all wikis in the wiki farm.
1356 */
1357 public const FileBackends = [
1358 'default' => [],
1359 'type' => 'map',
1360 ];
1361
1362 /**
1363 * List of lock manager backend configurations.
1364 *
1365 * Each backend configuration has the following parameters:
1366 * - name : A unique name for the lock manager
1367 * - class : The lock manager class to use
1368 *
1369 * See LockManager::__construct() for more details.
1370 * Additional parameters are specific to the lock manager class used.
1371 * These settings should be global to all wikis.
1372 */
1373 public const LockManagers = [
1374 'default' => [],
1375 'type' => 'list',
1376 ];
1377
1378 /**
1379 * Whether to show Exif data.
1380 * The effective default value is determined at runtime:
1381 * enabled if PHP's EXIF extension module is loaded.
1382 *
1383 * Requires PHP's Exif extension: https://www.php.net/manual/en/ref.exif.php
1384 *
1385 * @note FOR WINDOWS USERS:
1386 * To enable Exif functions, add the following line to the "Windows
1387 * extensions" section of php.ini:
1388 *
1389 * ```{.ini}
1390 * extension=extensions/php_exif.dll
1391 * ```
1392 */
1393 public const ShowEXIF = [
1394 'dynamicDefault' => [ 'callback' => [ self::class, 'getDefaultShowEXIF' ] ],
1395 ];
1396
1397 /**
1398 * @return bool
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` 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 * This is the list of preferred extensions for uploading files. Uploading files
1579 * with extensions not in this list will trigger a warning.
1580 *
1581 * @warning If you add any OpenOffice or Microsoft Office file formats here,
1582 * such as odt or doc, and untrusted users are allowed to upload files, then
1583 * your wiki will be vulnerable to cross-site request forgery (CSRF).
1584 */
1585 public const FileExtensions = [
1586 'default' => [ 'png', 'gif', 'jpg', 'jpeg', 'webp', ],
1587 'type' => 'list',
1588 ];
1589
1590 /**
1591 * Files with these extensions will never be allowed as uploads.
1592 *
1593 * An array of file extensions to prevent being uploaded. You should
1594 * append to this array if you want to prevent additional file extensions.
1595 *
1596 * @since 1.37; previously $wgFileBlacklist
1597 */
1598 public const ProhibitedFileExtensions = [
1599 'default' => [
1600 # HTML may contain cookie-stealing JavaScript and web bugs
1601 'html', 'htm', 'js', 'jsb', 'mhtml', 'mht', 'xhtml', 'xht',
1602 # PHP scripts may execute arbitrary code on the server
1603 'php', 'phtml', 'php3', 'php4', 'php5', 'phps', 'phar',
1604 # Other types that may be interpreted by some servers
1605 'shtml', 'jhtml', 'pl', 'py', 'cgi',
1606 # May contain harmful executables for Windows victims
1607 'exe', 'scr', 'dll', 'msi', 'vbs', 'bat', 'com', 'pif', 'cmd', 'vxd', 'cpl',
1608 # T341565
1609 'xml',
1610 ],
1611 'type' => 'list',
1612 ];
1613
1614 /**
1615 * Files with these MIME types will never be allowed as uploads
1616 * if $wgVerifyMimeType is enabled.
1617 *
1618 * @since 1.37; previously $wgMimeTypeBlacklist
1619 */
1620 public const MimeTypeExclusions = [
1621 'default' => [
1622 # HTML may contain cookie-stealing JavaScript and web bugs
1623 'text/html',
1624 # Similarly with JavaScript itself
1625 'application/javascript', 'text/javascript', 'text/x-javascript', 'application/x-shellscript',
1626 # PHP scripts may execute arbitrary code on the server
1627 'application/x-php', 'text/x-php',
1628 # Other types that may be interpreted by some servers
1629 'text/x-python', 'text/x-perl', 'text/x-bash', 'text/x-sh', 'text/x-csh',
1630 # Client-side hazards on Internet Explorer
1631 'text/scriptlet', 'application/x-msdownload',
1632 # Windows metafile, client-side vulnerability on some systems
1633 'application/x-msmetafile',
1634 # Files that look like java files
1635 'application/java',
1636 # XML files generally - T341565
1637 'application/xml', 'text/xml',
1638 ],
1639 'type' => 'list',
1640 ];
1641
1642 /**
1643 * This is a flag to determine whether or not to check file extensions on upload.
1644 *
1645 * @warning Setting this to false is insecure for public wikis.
1646 */
1647 public const CheckFileExtensions = [
1648 'default' => true,
1649 ];
1650
1651 /**
1652 * If this is turned off, users may override the warning for files not covered
1653 * by $wgFileExtensions.
1654 *
1655 * @warning Setting this to false is insecure for public wikis.
1656 */
1657 public const StrictFileExtensions = [
1658 'default' => true,
1659 ];
1660
1661 /**
1662 * Setting this to true will disable the upload system's checks for HTML/JavaScript.
1663 *
1664 * @warning THIS IS VERY DANGEROUS on a publicly editable site, so USE
1665 * $wgGroupPermissions TO RESTRICT UPLOADING to only those that you trust
1666 */
1667 public const DisableUploadScriptChecks = [
1668 'default' => false,
1669 ];
1670
1671 /**
1672 * Warn if uploaded files are larger than this (in bytes), or false to disable
1673 */
1674 public const UploadSizeWarning = [
1675 'default' => false,
1676 ];
1677
1678 /**
1679 * list of trusted media-types and MIME types.
1680 *
1681 * Use the MEDIATYPE_xxx constants to represent media types.
1682 * This list is used by File::isSafeFile
1683 *
1684 * Types not listed here will have a warning about unsafe content
1685 * displayed on the images description page. It would also be possible
1686 * to use this for further restrictions, like disabling direct
1687 * [[media:...]] links for non-trusted formats.
1688 */
1689 public const TrustedMediaFormats = [
1690 'default' => [
1691 MEDIATYPE_BITMAP, // all bitmap formats
1692 MEDIATYPE_AUDIO, // all audio formats
1693 MEDIATYPE_VIDEO, // all plain video formats
1694 "image/svg+xml", // svg (only needed if inline rendering of svg is not supported)
1695 "application/pdf", // PDF files
1696 # "application/x-shockwave-flash", //flash/shockwave movie
1697 ],
1698 'type' => 'list',
1699 ];
1700
1701 /**
1702 * Plugins for media file type handling.
1703 *
1704 * Each entry in the array maps a MIME type to a class name
1705 *
1706 * Core media handlers are listed in MediaHandlerFactory,
1707 * and extensions should use extension.json.
1708 */
1709 public const MediaHandlers = [
1710 'default' => [],
1711 'type' => 'map',
1712 ];
1713
1714 /**
1715 * Toggles native image lazy loading, via the "loading" attribute.
1716 *
1717 * @unstable EXPERIMENTAL
1718 * @since 1.34
1719 */
1720 public const NativeImageLazyLoading = [
1721 'default' => false,
1722 'type' => 'boolean',
1723 ];
1724
1725 /**
1726 * Media handler overrides for parser tests (they don't need to generate actual
1727 * thumbnails, so a mock will do)
1728 */
1729 public const ParserTestMediaHandlers = [
1730 'default' => [
1731 'image/jpeg' => 'MockBitmapHandler',
1732 'image/png' => 'MockBitmapHandler',
1733 'image/gif' => 'MockBitmapHandler',
1734 'image/tiff' => 'MockBitmapHandler',
1735 'image/webp' => 'MockBitmapHandler',
1736 'image/x-ms-bmp' => 'MockBitmapHandler',
1737 'image/x-bmp' => 'MockBitmapHandler',
1738 'image/x-xcf' => 'MockBitmapHandler',
1739 'image/svg+xml' => 'MockSvgHandler',
1740 'image/vnd.djvu' => 'MockDjVuHandler',
1741 ],
1742 'type' => 'map',
1743 ];
1744
1745 /**
1746 * Whether to enable server-side image thumbnailing. If false, images will
1747 * always be sent to the client in full resolution, with appropriate width= and
1748 * height= attributes on the <img> tag for the client to do its own scaling.
1749 */
1750 public const UseImageResize = [
1751 'default' => true,
1752 ];
1753
1754 /**
1755 * Resizing can be done using PHP's internal image libraries or using
1756 * ImageMagick or another third-party converter, e.g. GraphicMagick.
1757 *
1758 * These support more file formats than PHP, which only supports PNG,
1759 * GIF, JPG, XBM and WBMP.
1760 *
1761 * Use Image Magick instead of PHP builtin functions.
1762 */
1763 public const UseImageMagick = [
1764 'default' => false,
1765 ];
1766
1767 /**
1768 * The convert command shipped with ImageMagick
1769 */
1770 public const ImageMagickConvertCommand = [
1771 'default' => '/usr/bin/convert',
1772 ];
1773
1774 /**
1775 * Array of max pixel areas for interlacing per MIME type
1776 *
1777 * @since 1.27
1778 */
1779 public const MaxInterlacingAreas = [
1780 'default' => [],
1781 'type' => 'map',
1782 ];
1783
1784 /**
1785 * Sharpening parameter to ImageMagick
1786 */
1787 public const SharpenParameter = [
1788 'default' => '0x0.4',
1789 ];
1790
1791 /**
1792 * Reduction in linear dimensions below which sharpening will be enabled
1793 */
1794 public const SharpenReductionThreshold = [
1795 'default' => 0.85,
1796 ];
1797
1798 /**
1799 * Temporary directory used for ImageMagick. The directory must exist. Leave
1800 * this set to false to let ImageMagick decide for itself.
1801 */
1802 public const ImageMagickTempDir = [
1803 'default' => false,
1804 ];
1805
1806 /**
1807 * Use another resizing converter, e.g. GraphicMagick
1808 * %s will be replaced with the source path, %d with the destination
1809 * %w and %h will be replaced with the width and height.
1810 *
1811 * **Example for GraphicMagick:**
1812 *
1813 * ```
1814 * $wgCustomConvertCommand = "gm convert %s -resize %wx%h %d"
1815 * ```
1816 * Leave as false to skip this.
1817 */
1818 public const CustomConvertCommand = [
1819 'default' => false,
1820 ];
1821
1822 /**
1823 * used for lossless jpeg rotation
1824 *
1825 * @since 1.21
1826 */
1827 public const JpegTran = [
1828 'default' => '/usr/bin/jpegtran',
1829 ];
1830
1831 /**
1832 * At default setting of 'yuv420', JPEG thumbnails will use 4:2:0 chroma
1833 * subsampling to reduce file size, at the cost of possible color fringing
1834 * at sharp edges.
1835 *
1836 * See https://en.wikipedia.org/wiki/Chroma_subsampling
1837 *
1838 * Supported values:
1839 * false - use scaling system's default (same as pre-1.27 behavior)
1840 * 'yuv444' - luma and chroma at same resolution
1841 * 'yuv422' - chroma at 1/2 resolution horizontally, full vertically
1842 * 'yuv420' - chroma at 1/2 resolution in both dimensions
1843 *
1844 * This setting is currently supported only for the ImageMagick backend;
1845 * others may default to 4:2:0 or 4:4:4 or maintaining the source file's
1846 * sampling in the thumbnail.
1847 *
1848 * @since 1.27
1849 */
1850 public const JpegPixelFormat = [
1851 'default' => 'yuv420',
1852 ];
1853
1854 /**
1855 * When scaling a JPEG thumbnail, this is the quality we request
1856 * from the backend. It should be an integer between 1 and 100,
1857 * with 100 indicating 100% quality.
1858 *
1859 * @since 1.32
1860 */
1861 public const JpegQuality = [
1862 'default' => 80,
1863 ];
1864
1865 /**
1866 * Some tests and extensions use exiv2 to manipulate the Exif metadata in some
1867 * image formats.
1868 */
1869 public const Exiv2Command = [
1870 'default' => '/usr/bin/exiv2',
1871 ];
1872
1873 /**
1874 * Path to exiftool binary. Used for lossless ICC profile swapping.
1875 *
1876 * @since 1.26
1877 */
1878 public const Exiftool = [
1879 'default' => '/usr/bin/exiftool',
1880 ];
1881
1882 /**
1883 * Scalable Vector Graphics (SVG) may be uploaded as images.
1884 *
1885 * Since SVG support is not yet standard in browsers, it is
1886 * necessary to rasterize SVGs to PNG as a fallback format.
1887 *
1888 * An external program is required to perform this conversion.
1889 * If set to an array, the first item is a PHP callable and any further items
1890 * are passed as parameters after $srcPath, $dstPath, $width, $height
1891 */
1892 public const SVGConverters = [
1893 'default' => [
1894 'ImageMagick' => '$path/convert -background "#ffffff00" -thumbnail $widthx$height\\! $input PNG:$output',
1895 'sodipodi' => '$path/sodipodi -z -w $width -f $input -e $output',
1896 'inkscape' => '$path/inkscape -z -w $width -f $input -e $output',
1897 'batik' => 'java -Djava.awt.headless=true -jar $path/batik-rasterizer.jar -w $width -d $output $input',
1898 'rsvg' => '$path/rsvg-convert -w $width -h $height -o $output $input',
1899 'imgserv' => '$path/imgserv-wrapper -i svg -o png -w$width $input $output',
1900 'ImagickExt' => [ 'SvgHandler::rasterizeImagickExt', ],
1901 ],
1902 'type' => 'map',
1903 ];
1904
1905 /**
1906 * Pick a converter defined in $wgSVGConverters
1907 */
1908 public const SVGConverter = [
1909 'default' => 'ImageMagick',
1910 ];
1911
1912 /**
1913 * If not in the executable PATH, specify the SVG converter path.
1914 */
1915 public const SVGConverterPath = [
1916 'default' => '',
1917 ];
1918
1919 /**
1920 * Don't scale a SVG larger than this
1921 */
1922 public const SVGMaxSize = [
1923 'default' => 5120,
1924 ];
1925
1926 /**
1927 * Don't read SVG metadata beyond this point.
1928 *
1929 * Default is 5 MiB
1930 */
1931 public const SVGMetadataCutoff = [
1932 'default' => 1024 * 1024 * 5,
1933 ];
1934
1935 /**
1936 * Whether native rendering by the browser agent is allowed
1937 *
1938 * Default is false. Setting it to true disables all SVG conversion.
1939 * Setting to the string 'partial' will only allow native rendering
1940 * when the filesize is below SVGNativeRenderingSizeLimit and if the
1941 * file contains at most 1 language.
1942 *
1943 * @since 1.41
1944 */
1945 public const SVGNativeRendering = [
1946 'default' => false,
1947 'type' => 'string|boolean',
1948 ];
1949
1950 /**
1951 * Filesize limit for allowing SVGs to render natively by the browser agent
1952 *
1953 * Default is 50kB.
1954 *
1955 * @since 1.41
1956 */
1957 public const SVGNativeRenderingSizeLimit = [
1958 'default' => 50 * 1024,
1959 ];
1960
1961 /**
1962 * Whether thumbnails should be generated in target language (usually, same as
1963 * page language), if available.
1964 *
1965 * Currently, applies only to SVG images that use the systemLanguage attribute
1966 * to specify text language.
1967 *
1968 * @since 1.33
1969 */
1970 public const MediaInTargetLanguage = [
1971 'default' => true,
1972 ];
1973
1974 /**
1975 * The maximum number of pixels a source image can have if it is to be scaled
1976 * down by a scaler that requires the full source image to be decompressed
1977 * and stored in decompressed form, before the thumbnail is generated.
1978 *
1979 * This provides a limit on memory usage for the decompression side of the
1980 * image scaler. The limit is used when scaling PNGs with any of the
1981 * built-in image scalers, such as ImageMagick or GD. It is ignored for
1982 * JPEGs with ImageMagick, and when using the VipsScaler extension.
1983 *
1984 * If set to false, MediaWiki will not check the size of the image before
1985 * attempting to scale it. Extensions may still override this setting by
1986 * using the BitmapHandlerCheckImageArea hook.
1987 *
1988 * The default is 50 MB if decompressed to RGBA form, which corresponds to
1989 * 12.5 million pixels or 3500x3500.
1990 */
1991 public const MaxImageArea = [
1992 'default' => 12_500_000,
1993 'type' => 'string|integer|false',
1994 ];
1995
1996 /**
1997 * Force thumbnailing of animated GIFs above this size to a single
1998 * frame instead of an animated thumbnail. As of MW 1.17 this limit
1999 * is checked against the total size of all frames in the animation.
2000 *
2001 *
2002 * It probably makes sense to keep this equal to $wgMaxImageArea.
2003 */
2004 public const MaxAnimatedGifArea = [
2005 'default' => 12_500_000,
2006 ];
2007
2008 /**
2009 * Browsers don't support TIFF inline generally...
2010 * For inline display, we need to convert to PNG or JPEG.
2011 *
2012 * Note scaling should work with ImageMagick, but may not with GD scaling.
2013 *
2014 * **Example:**
2015 *
2016 * ```
2017 * // PNG is lossless, but inefficient for photos
2018 * $wgTiffThumbnailType = [ 'png', 'image/png' ];
2019 * // JPEG is good for photos, but has no transparency support. Bad for diagrams.
2020 * $wgTiffThumbnailType = [ 'jpg', 'image/jpeg' ];
2021 * ```
2022 */
2023 public const TiffThumbnailType = [
2024 'default' => [],
2025 'type' => 'list',
2026 'mergeStrategy' => 'replace',
2027 ];
2028
2029 /**
2030 * If rendered thumbnail files are older than this timestamp, they
2031 * will be rerendered on demand as if the file didn't already exist.
2032 *
2033 * Update if there is some need to force thumbs and SVG rasterizations
2034 * to rerender, such as fixes to rendering bugs.
2035 */
2036 public const ThumbnailEpoch = [
2037 'default' => '20030516000000',
2038 ];
2039
2040 /**
2041 * Certain operations are avoided if there were too many recent failures,
2042 * for example, thumbnail generation. Bump this value to invalidate all
2043 * memory of failed operations and thus allow further attempts to resume.
2044 *
2045 * This is useful when a cause for the failures has been found and fixed.
2046 */
2047 public const AttemptFailureEpoch = [
2048 'default' => 1,
2049 ];
2050
2051 /**
2052 * If set, inline scaled images will still produce "<img>" tags ready for
2053 * output instead of showing an error message.
2054 *
2055 * This may be useful if errors are transitory, especially if the site
2056 * is configured to automatically render thumbnails on request.
2057 *
2058 * On the other hand, it may obscure error conditions from debugging.
2059 * Enable the debug log or the 'thumbnail' log group to make sure errors
2060 * are logged to a file for review.
2061 */
2062 public const IgnoreImageErrors = [
2063 'default' => false,
2064 ];
2065
2066 /**
2067 * Render thumbnails while parsing wikitext.
2068 *
2069 * If set to false, then the Parser will output valid thumbnail URLs without
2070 * generating or storing the thumbnail files. This can significantly speed up
2071 * processing on the web server. The site admin needs to configure a 404 handler
2072 * in order for the URLs in question to regenerate the thumbnails in question
2073 * on-demand. This can enable concurrency and also save computing resources
2074 * as not every resolution of every image on every page is accessed between
2075 * re-parses of the article. For example, re-parses triggered by bot edits,
2076 * or cascading updates from template edits.
2077 *
2078 * If you use $wgLocalFileRepo, then you will also need to set the following:
2079 *
2080 * ```
2081 * $wgLocalFileRepo['transformVia404'] = true;
2082 * ```
2083 *
2084 * @since 1.7.0
2085 */
2086 public const GenerateThumbnailOnParse = [
2087 'default' => true,
2088 'type' => 'boolean',
2089 ];
2090
2091 /**
2092 * Show thumbnails for old images on the image description page
2093 */
2094 public const ShowArchiveThumbnails = [
2095 'default' => true,
2096 ];
2097
2098 /**
2099 * If set to true, images that contain certain the exif orientation tag will
2100 * be rotated accordingly. If set to null, try to auto-detect whether a scaler
2101 * is available that can rotate.
2102 */
2103 public const EnableAutoRotation = [
2104 'default' => null,
2105 'type' => '?boolean',
2106 ];
2107
2108 /**
2109 * Internal name of virus scanner. This serves as a key to the
2110 * $wgAntivirusSetup array. Set this to NULL to disable virus scanning. If not
2111 * null, every file uploaded will be scanned for viruses.
2112 */
2113 public const Antivirus = [
2114 'default' => null,
2115 'type' => '?string',
2116 ];
2117
2118 /**
2119 * Configuration for different virus scanners. This an associative array of
2120 * associative arrays. It contains one setup array per known scanner type.
2121 *
2122 * The entry is selected by $wgAntivirus, i.e.
2123 * valid values for $wgAntivirus are the keys defined in this array.
2124 *
2125 * The configuration array for each scanner contains the following keys:
2126 * "command", "codemap", "messagepattern":
2127 *
2128 * "command" is the full command to call the virus scanner - %f will be
2129 * replaced with the name of the file to scan. If not present, the filename
2130 * will be appended to the command. Note that this must be overwritten if the
2131 * scanner is not in the system path; in that case, please set
2132 * $wgAntivirusSetup[$wgAntivirus]['command'] to the desired command with full
2133 * path.
2134 *
2135 * "codemap" is a mapping of exit code to return codes of the detectVirus
2136 * function in SpecialUpload.
2137 * - An exit code mapped to AV_SCAN_FAILED causes the function to consider
2138 * the scan to be failed. This will pass the file if $wgAntivirusRequired
2139 * is not set.
2140 * - An exit code mapped to AV_SCAN_ABORTED causes the function to consider
2141 * the file to have an unsupported format, which is probably immune to
2142 * viruses. This causes the file to pass.
2143 * - An exit code mapped to AV_NO_VIRUS will cause the file to pass, meaning
2144 * no virus was found.
2145 * - All other codes (like AV_VIRUS_FOUND) will cause the function to report
2146 * a virus.
2147 * - You may use "*" as a key in the array to catch all exit codes not mapped otherwise.
2148 *
2149 * "messagepattern" is a perl regular expression to extract the meaningful part of the scanners
2150 * output. The relevant part should be matched as group one (\1).
2151 * If not defined or the pattern does not match, the full message is shown to the user.
2152 */
2153 public const AntivirusSetup = [
2154 'default' => [
2155 # setup for clamav
2156 'clamav' => [
2157 'command' => 'clamscan --no-summary ',
2158 'codemap' => [
2159 "0" => AV_NO_VIRUS, # no virus
2160 "1" => AV_VIRUS_FOUND, # virus found
2161 "52" => AV_SCAN_ABORTED, # unsupported file format (probably immune)
2162 "*" => AV_SCAN_FAILED, # else scan failed
2163 ],
2164 'messagepattern' => '/.*?:(.*)/sim',
2165 ],
2166 ],
2167 'type' => 'map',
2168 ];
2169
2170 /**
2171 * Determines if a failed virus scan (AV_SCAN_FAILED) will cause the file to be rejected.
2172 */
2173 public const AntivirusRequired = [
2174 'default' => true,
2175 ];
2176
2177 /**
2178 * Determines if the MIME type of uploaded files should be checked
2179 */
2180 public const VerifyMimeType = [
2181 'default' => true,
2182 ];
2183
2184 /**
2185 * Sets the MIME type definition file to use by includes/libs/mime/MimeAnalyzer.php.
2186 *
2187 * When this is set to the path of a mime.types file, MediaWiki will use this
2188 * file to map MIME types to file extensions and vice versa, in lieu of its
2189 * internal MIME map. Note that some MIME mappings are considered "baked in"
2190 * and cannot be overridden. See includes/libs/mime/MimeMapMinimal.php for a
2191 * full list.
2192 * example: $wgMimeTypeFile = '/etc/mime.types';
2193 */
2194 public const MimeTypeFile = [
2195 'default' => 'internal',
2196 ];
2197
2198 /**
2199 * Sets the MIME type info file to use by includes/libs/mime/MimeAnalyzer.php.
2200 *
2201 * Set to null to use the minimum set of built-in defaults only.
2202 */
2203 public const MimeInfoFile = [
2204 'default' => 'internal',
2205 ];
2206
2207 /**
2208 * Sets an external MIME detector program. The command must print only
2209 * the MIME type to standard output.
2210 *
2211 * The name of the file to process will be appended to the command given here.
2212 * If not set or NULL, PHP's mime_content_type function will be used.
2213 *
2214 * **Example:**
2215 *
2216 * ```
2217 * #$wgMimeDetectorCommand = "file -bi"; // use external MIME detector (Linux)
2218 * ```
2219 */
2220 public const MimeDetectorCommand = [
2221 'default' => null,
2222 'type' => '?string',
2223 ];
2224
2225 /**
2226 * Switch for trivial MIME detection. Used by thumb.php to disable all fancy
2227 * things, because only a few types of images are needed and file extensions
2228 * can be trusted.
2229 */
2230 public const TrivialMimeDetection = [
2231 'default' => false,
2232 ];
2233
2234 /**
2235 * Additional XML types we can allow via MIME-detection.
2236 *
2237 * array = [ 'rootElement' => 'associatedMimeType' ]
2238 */
2239 public const XMLMimeTypes = [
2240 'default' => [
2241 'http://www.w3.org/2000/svg:svg' => 'image/svg+xml',
2242 'svg' => 'image/svg+xml',
2243 'http://www.lysator.liu.se/~alla/dia/:diagram' => 'application/x-dia-diagram',
2244 'http://www.w3.org/1999/xhtml:html' => 'text/html',
2245 'html' => 'text/html',
2246 ],
2247 'type' => 'map',
2248 ];
2249
2250 /**
2251 * Limit images on image description pages to a user-selectable limit.
2252 *
2253 * In order to reduce disk usage, limits can only be selected from this list.
2254 * The user preference is saved as an array offset in the database, by default
2255 * the offset is set with $wgDefaultUserOptions['imagesize']. Make sure you
2256 * change it if you alter the array (see T10858).
2257 *
2258 * This list is also used by ImagePage for alternate size links.
2259 */
2260 public const ImageLimits = [
2261 'default' => [
2262 [ 320, 240 ],
2263 [ 640, 480 ],
2264 [ 800, 600 ],
2265 [ 1024, 768 ],
2266 [ 1280, 1024 ],
2267 [ 2560, 2048 ],
2268 ],
2269 'type' => 'list',
2270 ];
2271
2272 /**
2273 * Adjust thumbnails on image pages according to a user setting. In order to
2274 * reduce disk usage, the values can only be selected from a list. This is the
2275 * list of settings the user can choose from:
2276 */
2277 public const ThumbLimits = [
2278 'default' => [
2279 120,
2280 150,
2281 180,
2282 200,
2283 250,
2284 300
2285 ],
2286 'type' => 'list',
2287 ];
2288
2289 /**
2290 * Defines what namespaces thumbnails will be displayed for in Special:Search.
2291 * This is the list of namespaces for which thumbnails (or a placeholder in
2292 * the absence of a thumbnail) will be shown:
2293 */
2294 public const ThumbnailNamespaces = [
2295 'default' => [ NS_FILE ],
2296 'type' => 'list',
2297 'items' => [ 'type' => 'integer', ],
2298 ];
2299
2300 /**
2301 * Array of image widths used as steps for thumbnail sizes.
2302 *
2303 * Requested thumbnail widths are rounded up to the nearest step
2304 * The thumbnail with smallest step that has larger value than requested will be shown
2305 * but it will be downsized via HTML values.
2306 *
2307 * It increases the bandwidth to the users by serving slightly large thumbnail sizes they
2308 * have requested but it will save resources by de-duplicating thumbnail generation and storage.
2309 *
2310 * Note that these steps are "best effort" and MediaWiki might decide to use the requested size
2311 * for any reason.
2312 *
2313 * @see MediaWiki\Media\ImageHandler::getSteppedThumbWidth
2314 * @since 1.43.7
2315 */
2316 public const ThumbnailSteps = [
2317 'default' => null,
2318 'type' => '?list',
2319 ];
2320
2321 /**
2322 * Ratio of images that will use the thumbnail steps
2323 *
2324 * This is to allow for gradual roll out of thumbnail steps. It should be a number between 0 and 1.
2325 *
2326 * The precision of this value is up to 0.001, anything below that will be ignored.
2327 */
2328 public const ThumbnailStepsRatio = [
2329 'default' => null,
2330 'type' => '?float',
2331 ];
2332
2333 /**
2334 * When defined, is an array of image widths used as buckets for thumbnail generation.
2335 *
2336 * The goal is to save resources by generating thumbnails based on reference buckets instead of
2337 * always using the original. This will incur a speed gain but cause a quality loss.
2338 *
2339 * The buckets generation is chained, with each bucket generated based on the above bucket
2340 * when possible. File handlers have to opt into using that feature. For now only BitmapHandler
2341 * supports it.
2342 */
2343 public const ThumbnailBuckets = [
2344 'default' => null,
2345 'type' => '?list',
2346 ];
2347
2348 /**
2349 * When using thumbnail buckets as defined above, this sets the minimum distance to the bucket
2350 * above the requested size. The distance represents how many extra pixels of width the bucket
2351 * needs in order to be used as the reference for a given thumbnail. For example, with the
2352 * following buckets:
2353 *
2354 * $wgThumbnailBuckets = [ 128, 256, 512 ];
2355 *
2356 * and a distance of 50:
2357 *
2358 * $wgThumbnailMinimumBucketDistance = 50;
2359 *
2360 * If we want to render a thumbnail of width 220px, the 512px bucket will be used,
2361 * because 220 + 50 = 270 and the closest bucket bigger than 270px is 512.
2362 */
2363 public const ThumbnailMinimumBucketDistance = [
2364 'default' => 50,
2365 ];
2366
2367 /**
2368 * When defined, is an array of thumbnail widths to be rendered at upload time. The idea is to
2369 * prerender common thumbnail sizes, in order to avoid the necessity to render them on demand,
2370 * which has a performance impact for the first client to view a certain size.
2371 *
2372 * This obviously means that more disk space is needed per upload upfront.
2373 *
2374 * @since 1.25
2375 */
2376 public const UploadThumbnailRenderMap = [
2377 'default' => [],
2378 'type' => 'map',
2379 ];
2380
2381 /**
2382 * The method through which the thumbnails will be prerendered for the entries in
2383 * $wgUploadThumbnailRenderMap
2384 *
2385 * The method can be either "http" or "jobqueue". The former uses an http request to hit the
2386 * thumbnail's URL.
2387 * This method only works if thumbnails are configured to be rendered by a 404 handler. The
2388 * latter option uses the job queue to render the thumbnail.
2389 *
2390 * @since 1.25
2391 */
2392 public const UploadThumbnailRenderMethod = [
2393 'default' => 'jobqueue',
2394 ];
2395
2396 /**
2397 * When using the "http" $wgUploadThumbnailRenderMethod, lets one specify a custom Host HTTP
2398 * header.
2399 *
2400 * @since 1.25
2401 */
2402 public const UploadThumbnailRenderHttpCustomHost = [
2403 'default' => false,
2404 ];
2405
2406 /**
2407 * When using the "http" $wgUploadThumbnailRenderMethod, lets one specify a custom domain to
2408 * send the HTTP request to.
2409 *
2410 * @since 1.25
2411 */
2412 public const UploadThumbnailRenderHttpCustomDomain = [
2413 'default' => false,
2414 ];
2415
2416 /**
2417 * When this variable is true and JPGs use the sRGB ICC profile, swaps it for the more
2418 * lightweight
2419 * (and free) TinyRGB profile when generating thumbnails.
2420 *
2421 * @since 1.26
2422 */
2423 public const UseTinyRGBForJPGThumbnails = [
2424 'default' => false,
2425 ];
2426
2427 /**
2428 * Parameters for the "<gallery>" tag.
2429 *
2430 * Fields are:
2431 * - imagesPerRow: Default number of images per-row in the gallery. 0 -> Adapt to screensize
2432 * - imageWidth: Width of the cells containing images in galleries (in "px")
2433 * - imageHeight: Height of the cells containing images in galleries (in "px")
2434 * - captionLength: Length to truncate filename to in caption when using "showfilename".
2435 * A value of 'true' will truncate the filename to one line using CSS
2436 * and will be the behaviour after deprecation.
2437 * @deprecated since 1.28
2438 * - showBytes: Show the filesize in bytes in categories
2439 * - showDimensions: Show the dimensions (width x height) in categories
2440 * - mode: Gallery mode
2441 */
2442 public const GalleryOptions = [
2443 'default' => [],
2444 'type' => 'map',
2445 ];
2446
2447 /**
2448 * Adjust width of upright images when parameter 'upright' is used
2449 * This allows a nicer look for upright images without the need to fix the width
2450 * by hardcoded px in wiki sourcecode.
2451 */
2452 public const ThumbUpright = [
2453 'default' => 0.75,
2454 ];
2455
2456 /**
2457 * Default value for chmod-ing of new directories.
2458 */
2459 public const DirectoryMode = [
2460 'default' => 0777, // octal!
2461 ];
2462
2463 /**
2464 * Generate and use thumbnails suitable for screens with 1.5 and 2.0 pixel densities.
2465 *
2466 * This means a 320x240 use of an image on the wiki will also generate 480x360 and 640x480
2467 * thumbnails, output via the srcset attribute.
2468 */
2469 public const ResponsiveImages = [
2470 'default' => true,
2471 ];
2472
2473 /**
2474 * Add a preconnect link for browsers to a remote FileRepo host.
2475 *
2476 * This is an optional performance enhancement designed for wiki farm where
2477 * $wgForeignFileRepos or $wgLocalFileRepo is set to serve thumbnails from a
2478 * separate hostname (e.g. not local `/w/images`). The feature expects at most
2479 * a single remote hostname to be used.
2480 *
2481 * If multiple foreign repos are registered that serve images from different hostnames,
2482 * only the first will be preconnected.
2483 *
2484 * This may cause unneeded HTTP connections in browsers on wikis where a foreign repo is
2485 * enabled but where a local repo is more commonly used.
2486 *
2487 * @since 1.35
2488 */
2489 public const ImagePreconnect = [
2490 'default' => false,
2491 ];
2492
2493 /***************************************************************************/
2494 // region DJVU settings
2495 /** @name DJVU settings */
2496
2497 /**
2498 * Whether to use BoxedCommand or not.
2499 *
2500 * @unstable Temporary feature flag for T352515
2501 * @since 1.42
2502 */
2503 public const DjvuUseBoxedCommand = [
2504 'default' => false,
2505 ];
2506
2507 /**
2508 * Path of the djvudump executable
2509 * Enable this and $wgDjvuRenderer to enable djvu rendering
2510 * example: $wgDjvuDump = 'djvudump';
2511 *
2512 * If this is set, {@link self::ShellboxShell} must be set to the correct
2513 * shell path.
2514 */
2515 public const DjvuDump = [
2516 'default' => null,
2517 'type' => '?string',
2518 ];
2519
2520 /**
2521 * Path of the ddjvu DJVU renderer
2522 * Enable this and $wgDjvuDump to enable djvu rendering
2523 * example: $wgDjvuRenderer = 'ddjvu';
2524 */
2525 public const DjvuRenderer = [
2526 'default' => null,
2527 'type' => '?string',
2528 ];
2529
2530 /**
2531 * Path of the djvutxt DJVU text extraction utility
2532 * Enable this and $wgDjvuDump to enable text layer extraction from djvu files
2533 * example: $wgDjvuTxt = 'djvutxt';
2534 *
2535 * If this is set, {@link self::ShellboxShell} must be set to the correct
2536 * shell path.
2537 */
2538 public const DjvuTxt = [
2539 'default' => null,
2540 'type' => '?string',
2541 ];
2542
2543 /**
2544 * Shell command for the DJVU post processor
2545 * Default: pnmtojpeg, since ddjvu generates ppm output
2546 * Set this to false to output the ppm file directly.
2547 */
2548 public const DjvuPostProcessor = [
2549 'default' => 'pnmtojpeg',
2550 'type' => '?string',
2551 ];
2552
2553 /**
2554 * File extension for the DJVU post processor output
2555 */
2556 public const DjvuOutputExtension = [
2557 'default' => 'jpg',
2558 ];
2559
2560 // endregion -- end of DJvu
2561
2562 // endregion -- end of file uploads
2563
2564 /***************************************************************************/
2565 // region Email settings
2566 /** @name Email settings */
2567
2568 /**
2569 * Site admin email address.
2570 *
2571 * Defaults to "wikiadmin@$wgServerName" (in Setup.php).
2572 */
2573 public const EmergencyContact = [
2574 'default' => false,
2575 ];
2576
2577 /**
2578 * Sender email address for e-mail notifications.
2579 *
2580 * The address we use as sender when a user requests a password reminder,
2581 * as well as other e-mail notifications.
2582 *
2583 * Defaults to "apache@$wgServerName" (in Setup.php).
2584 */
2585 public const PasswordSender = [
2586 'default' => false,
2587 ];
2588
2589 /**
2590 * Reply-To address for e-mail notifications.
2591 *
2592 * Defaults to $wgPasswordSender (in Setup.php).
2593 */
2594 public const NoReplyAddress = [
2595 'default' => false,
2596 ];
2597
2598 /**
2599 * Set to true to enable the e-mail basic features:
2600 * Password reminders, etc. If sending e-mail on your
2601 * server doesn't work, you might want to disable this.
2602 */
2603 public const EnableEmail = [
2604 'default' => true,
2605 ];
2606
2607 /**
2608 * Set to true to enable user-to-user e-mail.
2609 *
2610 * This can potentially be abused, as it's hard to track.
2611 */
2612 public const EnableUserEmail = [
2613 'default' => true,
2614 ];
2615
2616 /**
2617 * Set to true to enable the Special Mute page. This allows users
2618 * to mute unwanted communications from other users, and is linked
2619 * to from emails originating from Special:Email.
2620 *
2621 * @since 1.34
2622 */
2623 public const EnableSpecialMute = [
2624 'default' => false,
2625 ];
2626
2627 /**
2628 * Set to true to enable user-to-user e-mail mutelist.
2629 *
2630 * @since 1.37; previously $wgEnableUserEmailBlacklist
2631 */
2632 public const EnableUserEmailMuteList = [
2633 'default' => false,
2634 ];
2635
2636 /**
2637 * If true put the sending user's email in a Reply-To header
2638 * instead of From (false). ($wgPasswordSender will be used as From.)
2639 *
2640 * Some mailers (eg SMTP) set the SMTP envelope sender to the From value,
2641 * which can cause problems with SPF validation and leak recipient addresses
2642 * when bounces are sent to the sender. In addition, DMARC restrictions
2643 * can cause emails to fail to be received when false.
2644 */
2645 public const UserEmailUseReplyTo = [
2646 'default' => true,
2647 ];
2648
2649 /**
2650 * Minimum time, in hours, which must elapse between password reminder
2651 * emails for a given account. This is to prevent abuse by mail flooding.
2652 */
2653 public const PasswordReminderResendTime = [
2654 'default' => 24,
2655 ];
2656
2657 /**
2658 * The time, in seconds, when an emailed temporary password expires.
2659 */
2660 public const NewPasswordExpiry = [
2661 'default' => 3600 * 24 * 7,
2662 ];
2663
2664 /**
2665 * The time, in seconds, when an email confirmation email expires
2666 */
2667 public const UserEmailConfirmationTokenExpiry = [
2668 'default' => 7 * 24 * 60 * 60,
2669 ];
2670
2671 /**
2672 * The number of days that a user's password is good for. After this number of days, the
2673 * user will be asked to reset their password. Set to false to disable password expiration.
2674 */
2675 public const PasswordExpirationDays = [
2676 'default' => false,
2677 ];
2678
2679 /**
2680 * If a user's password is expired, the number of seconds when they can still login,
2681 * and cancel their password change, but are sent to the password change form on each login.
2682 */
2683 public const PasswordExpireGrace = [
2684 'default' => 3600 * 24 * 7,
2685 ];
2686
2687 /**
2688 * SMTP Mode.
2689 *
2690 * For using a direct (authenticated) SMTP server connection.
2691 * Default to false or fill an array :
2692 *
2693 * ```
2694 * $wgSMTP = [
2695 * 'host' => 'SMTP domain',
2696 * 'IDHost' => 'domain for MessageID',
2697 * 'port' => '25',
2698 * 'auth' => [true|false],
2699 * 'username' => [SMTP username],
2700 * 'password' => [SMTP password],
2701 * ];
2702 * ```
2703 */
2704 public const SMTP = [
2705 'default' => false,
2706 'type' => 'false|map',
2707 ];
2708
2709 /**
2710 * Additional email parameters, will be passed as the last argument to mail() call.
2711 */
2712 public const AdditionalMailParams = [
2713 'default' => null,
2714 ];
2715
2716 /**
2717 * For parts of the system that have been updated to provide HTML email content, send
2718 * both text and HTML parts as the body of the email
2719 */
2720 public const AllowHTMLEmail = [
2721 'default' => false,
2722 ];
2723
2724 /**
2725 * Allow sending of e-mail notifications with the editor's address as sender.
2726 *
2727 * This setting depends on $wgEnotifRevealEditorAddress also being enabled.
2728 * If both are enabled, notifications for actions from users that have opted-in,
2729 * will be sent to other users with their address as "From" instead of "Reply-To".
2730 *
2731 * If disabled, or not opted-in, notifications come from $wgPasswordSender.
2732 */
2733 public const EnotifFromEditor = [
2734 'default' => false,
2735 'type' => 'boolean',
2736 ];
2737
2738 /**
2739 * Require email authentication before sending mail to an email address.
2740 *
2741 * This is highly recommended. It prevents MediaWiki from being used as an open
2742 * spam relay.
2743 */
2744 public const EmailAuthentication = [
2745 'default' => true,
2746 ];
2747
2748 /**
2749 * Allow users to enable email notification ("enotif") on watchlist changes.
2750 */
2751 public const EnotifWatchlist = [
2752 'default' => false,
2753 ];
2754
2755 /**
2756 * Allow users to enable email notification ("enotif") when someone edits their
2757 * user talk page.
2758 *
2759 * The owner of the user talk page must also have the 'enotifusertalkpages' user
2760 * preference set to true.
2761 */
2762 public const EnotifUserTalk = [
2763 'default' => false,
2764 ];
2765
2766 /**
2767 * Allow sending of e-mail notifications with the editor's address in "Reply-To".
2768 *
2769 * Note, enabling this only actually uses it in notification e-mails if the user
2770 * opted-in to this feature. This feature flag also controls visibility of the
2771 * 'enotifrevealaddr' preference, which, if users opt into, will make e-mail
2772 * notifications about their actions use their address as "Reply-To".
2773 *
2774 * To set the address as "From" instead of "Reply-To", also enable $wgEnotifFromEditor.
2775 *
2776 * If disabled, or not opted-in, notifications come from $wgPasswordSender.
2777 */
2778 public const EnotifRevealEditorAddress = [
2779 'default' => false,
2780 'type' => 'boolean',
2781 ];
2782
2783 /**
2784 * Potentially send notification mails on minor edits to pages. This is enabled
2785 * by default. If this is false, users will never be notified on minor edits.
2786 *
2787 * If it is true, editors with the 'nominornewtalk' right (typically bots) will still not
2788 * trigger notifications for minor edits they make (to any page, not just user talk).
2789 *
2790 * Finally, if the watcher/recipient has the 'enotifminoredits' user preference set to
2791 * false, they will not receive notifications for minor edits.
2792 *
2793 * User talk notifications are also affected by $wgEnotifMinorEdits, the above settings,
2794 * $wgEnotifUserTalk, and the preference described there.
2795 */
2796 public const EnotifMinorEdits = [
2797 'default' => true,
2798 ];
2799
2800 /**
2801 * Send a generic mail instead of a personalised mail for each user. This
2802 * always uses UTC as the time zone, and doesn't include the username.
2803 *
2804 * For pages with many users watching, this can significantly reduce mail load.
2805 * Has no effect when using sendmail rather than SMTP.
2806 */
2807 public const EnotifImpersonal = [
2808 'default' => false,
2809 ];
2810
2811 /**
2812 * Maximum number of users to mail at once when using impersonal mail. Should
2813 * match the limit on your mail server.
2814 */
2815 public const EnotifMaxRecips = [
2816 'default' => 500,
2817 ];
2818
2819 /**
2820 * Use real name instead of username in e-mail "from" field.
2821 */
2822 public const EnotifUseRealName = [
2823 'default' => false,
2824 ];
2825
2826 /**
2827 * Array of usernames who will be sent a notification email for every change
2828 * which occurs on a wiki. Users will not be notified of their own changes.
2829 */
2830 public const UsersNotifiedOnAllChanges = [
2831 'default' => [],
2832 'type' => 'map',
2833 ];
2834
2835 // endregion -- end of email settings
2836
2837 /***************************************************************************/
2838 // region Database settings
2839 /** @name Database settings */
2840
2841 /**
2842 * Current wiki database name
2843 *
2844 * This should only contain alphanumeric and underscore characters ([A-Za-z0-9_]+).
2845 * Spaces, quotes, backticks, dots, and hyphens are likely to be problematic.
2846 *
2847 * This is used to determine the current/local wiki ID (WikiMap::getCurrentWikiDbDomain).
2848 *
2849 * This should still be set even if $wgLBFactoryConf is configured.
2850 */
2851 public const DBname = [
2852 'default' => 'my_wiki',
2853 ];
2854
2855 /**
2856 * Current wiki database schema name
2857 *
2858 * This should only contain alphanumeric and underscore characters ([A-Za-z0-9_]+).
2859 * Spaces, quotes, backticks, dots, and hyphens are likely to be problematic.
2860 *
2861 * This is used to determine the current/local wiki ID (WikiMap::getCurrentWikiDbDomain).
2862 *
2863 * This should still be set even if $wgLBFactoryConf is configured.
2864 */
2865 public const DBmwschema = [
2866 'default' => null,
2867 'type' => '?string',
2868 ];
2869
2870 /**
2871 * Current wiki database table name prefix
2872 *
2873 * This should only contain alphanumeric and underscore characters ([A-Za-z0-9_]+).
2874 * If it's a non-empty string, then it preferably should end with an underscore.
2875 * Spaces, quotes, backticks, dots, and hyphens are especially likely to be problematic.
2876 *
2877 * This is used to determine the current/local wiki ID (WikiMap::getCurrentWikiDbDomain).
2878 *
2879 * This should still be set even if $wgLBFactoryConf is configured.
2880 */
2881 public const DBprefix = [
2882 'default' => '',
2883 ];
2884
2885 /**
2886 * Database host name or IP address
2887 */
2888 public const DBserver = [
2889 'default' => 'localhost',
2890 ];
2891
2892 /**
2893 * Database port number
2894 */
2895 public const DBport = [
2896 'default' => 5432,
2897 ];
2898
2899 /**
2900 * Database username
2901 */
2902 public const DBuser = [
2903 'default' => 'wikiuser',
2904 ];
2905
2906 /**
2907 * Database user's password
2908 */
2909 public const DBpassword = [
2910 'default' => '',
2911 ];
2912
2913 /**
2914 * Database type
2915 */
2916 public const DBtype = [
2917 'default' => 'mysql',
2918 ];
2919
2920 /**
2921 * Whether to use SSL in DB connection.
2922 *
2923 * This setting is only used if $wgLBFactoryConf['class'] is set to
2924 * '\Wikimedia\Rdbms\LBFactorySimple' and $wgDBservers is an empty array; otherwise
2925 * the 'ssl' parameter of the server array must be set to achieve the same functionality.
2926 */
2927 public const DBssl = [
2928 'default' => false,
2929 ];
2930
2931 /**
2932 * Whether to use compression in DB connection.
2933 *
2934 * This setting is only used $wgLBFactoryConf['class'] is set to
2935 * '\Wikimedia\Rdbms\LBFactorySimple' and $wgDBservers is an empty array; otherwise
2936 * the DBO_COMPRESS flag must be set in the 'flags' option of the database
2937 * connection to achieve the same functionality.
2938 */
2939 public const DBcompress = [
2940 'default' => false,
2941 ];
2942
2943 /**
2944 * Check for warnings after DB queries and throw an exception if an
2945 * unacceptable warning is detected.
2946 *
2947 * This setting is only used if $wgLBFactoryConf['class'] is set to
2948 * '\Wikimedia\Rdbms\LBFactorySimple' and $wgDBservers is an empty array.
2949 * Otherwise, the 'strictWarnings' parameter of the server array must be set
2950 * to achieve the same functionality.
2951 *
2952 * @since 1.42
2953 */
2954 public const DBStrictWarnings = [
2955 'default' => false,
2956 ];
2957
2958 /**
2959 * Separate username for maintenance tasks. Leave as null to use the default.
2960 */
2961 public const DBadminuser = [
2962 'default' => null,
2963 ];
2964
2965 /**
2966 * Separate password for maintenance tasks. Leave as null to use the default.
2967 */
2968 public const DBadminpassword = [
2969 'default' => null,
2970 ];
2971
2972 /**
2973 * Search type.
2974 *
2975 * Leave as null to select the default search engine for the
2976 * selected database type (eg SearchMySQL), or set to a class
2977 * name to override to a custom search engine.
2978 *
2979 * If the canonical name for the search engine doesn't match the class name
2980 * (because it's namespaced for example), you can add a mapping for this in
2981 * SearchMappings in extension.json.
2982 */
2983 public const SearchType = [
2984 'default' => null,
2985 ];
2986
2987 /**
2988 * Alternative search types
2989 *
2990 * Sometimes you want to support multiple search engines for testing. This
2991 * allows users to select their search engine of choice via url parameters
2992 * to Special:Search and the action=search API. If using this, there's no
2993 * need to add $wgSearchType to it, that is handled automatically.
2994 *
2995 * If the canonical name for the search engine doesn't match the class name
2996 * (because it's namespaced for example), you can add a mapping for this in
2997 * SearchMappings in extension.json.
2998 */
2999 public const SearchTypeAlternatives = [
3000 'default' => null,
3001 ];
3002
3003 /**
3004 * MySQL table options to use during installation or update
3005 */
3006 public const DBTableOptions = [
3007 'default' => 'ENGINE=InnoDB, DEFAULT CHARSET=binary',
3008 ];
3009
3010 /**
3011 * SQL Mode - default is turning off all modes, including strict, if set.
3012 *
3013 * null can be used to skip the setting for performance reasons and assume
3014 * DBA has done his best job.
3015 * String override can be used for some additional fun :-)
3016 */
3017 public const SQLMode = [
3018 'default' => '',
3019 ];
3020
3021 /**
3022 * Default group to use when getting database connections.
3023 *
3024 * Will be used as default query group in ILoadBalancer::getConnection.
3025 *
3026 * @since 1.32
3027 */
3028 public const DBDefaultGroup = [
3029 'default' => null,
3030 ];
3031
3032 /**
3033 * To override default SQLite data directory ($docroot/../data)
3034 */
3035 public const SQLiteDataDir = [
3036 'default' => '',
3037 ];
3038
3039 /**
3040 * Shared database for multiple wikis. Commonly used for storing a user table
3041 * for single sign-on. The server for this database must be the same as for the
3042 * main database.
3043 *
3044 * For backwards compatibility the shared prefix is set to the same as the local
3045 * prefix, and the user table is listed in the default list of shared tables.
3046 * The user_properties table is also added so that users will continue to have their
3047 * preferences shared (preferences were stored in the user table prior to 1.16)
3048 *
3049 * $wgSharedTables may be customized with a list of tables to share in the shared
3050 * database. However it is advised to limit what tables you do share as many of
3051 * MediaWiki's tables may have side effects if you try to share them.
3052 *
3053 * $wgSharedPrefix is the table prefix for the shared database. It defaults to
3054 * $wgDBprefix.
3055 *
3056 * $wgSharedSchema is the table schema for the shared database. It defaults to
3057 * $wgDBmwschema.
3058 */
3059 public const SharedDB = [
3060 'default' => null,
3061 ];
3062
3063 /**
3064 * @see self::SharedDB
3065 */
3066 public const SharedPrefix = [
3067 'default' => false,
3068 'dynamicDefault' => [ 'use' => [ 'DBprefix' ] ]
3069 ];
3070
3071 /**
3072 * @param mixed $dbPrefix Value of DBprefix
3073 * @return mixed
3074 */
3075 public static function getDefaultSharedPrefix( $dbPrefix ) {
3076 return $dbPrefix;
3077 }
3078
3079 /**
3080 * @see self::SharedDB
3081 * The installer will add 'actor' to this list for all new wikis.
3082 */
3083 public const SharedTables = [
3084 'default' => [
3085 'user',
3086 'user_properties',
3087 'user_autocreate_serial',
3088 ],
3089 'type' => 'list',
3090 ];
3091
3092 /**
3093 * @see self::SharedDB
3094 * @since 1.23
3095 */
3096 public const SharedSchema = [
3097 'default' => false,
3098 'dynamicDefault' => [ 'use' => [ 'DBmwschema' ] ]
3099 ];
3100
3101 /**
3102 * @param mixed $dbMwschema Value of DBmwschema
3103 * @return mixed
3104 */
3105 public static function getDefaultSharedSchema( $dbMwschema ) {
3106 return $dbMwschema;
3107 }
3108
3109 /**
3110 * Database load balancer
3111 * This is a two-dimensional array, a list of server info structures
3112 * Fields are:
3113 * - host: Host name
3114 * - dbname: Default database name
3115 * - user: DB user
3116 * - password: DB password
3117 * - type: DB type
3118 * - driver: DB driver (when there are multiple drivers)
3119 *
3120 * - load: Ratio of DB_REPLICA load, must be >=0, the sum of all loads must be >0.
3121 * If this is zero for any given server, no normal query traffic will be
3122 * sent to it. It will be excluded from lag checks in maintenance scripts.
3123 * The only way it can receive traffic is if groupLoads is used.
3124 *
3125 * - groupLoads: (optional) Array of load ratios, the key is the query group name. A query
3126 * may belong to several groups, the most specific group defined here is used.
3127 *
3128 * - flags: (optional) Bit field of properties:
3129 * - DBO_DEFAULT: Transactional-ize web requests and use autocommit otherwise
3130 * - DBO_DEBUG: Equivalent of $wgDebugDumpSql
3131 * - DBO_SSL: Use TLS connection encryption if available (deprecated)
3132 * - DBO_COMPRESS: Use protocol compression with database connections
3133 * - DBO_PERSISTENT: Enables persistent database connections
3134 *
3135 * - ssl: (optional) Boolean, whether to use TLS encryption. Overrides DBO_SSL.
3136 * - max lag: (optional) Maximum replication lag before a replica DB goes out of rotation
3137 * - is static: (optional) Set to true if the dataset is static and no replication is used.
3138 * - cliMode: (optional) Connection handles will not assume that requests are short-lived
3139 * nor that INSERT..SELECT can be rewritten into a buffered SELECT and INSERT.
3140 * This is what DBO_DEFAULT uses to determine when a web request is present.
3141 * [Default: true if MW_ENTRY_POINT is 'cli', otherwise false]
3142 *
3143 * These and any other user-defined properties will be assigned to the mLBInfo member
3144 * variable of the Database object.
3145 *
3146 * Leave at false to use the single-server variables above. If you set this
3147 * variable, the single-server variables will generally be ignored (except
3148 * perhaps in some command-line scripts).
3149 *
3150 * The first server listed in this array (with key 0) will be the primary. The
3151 * rest of the servers will be replica DBs. To prevent writes to your replica DBs due to
3152 * accidental misconfiguration or MediaWiki bugs, set read_only=1 on all your
3153 * replica DBs in my.cnf. You can set read_only mode at runtime using:
3154 *
3155 * ```
3156 * SET @@read_only=1;
3157 * ```
3158 *
3159 * Since the effect of writing to a replica DB is so damaging and difficult to clean
3160 * up, we at Wikimedia set read_only=1 in my.cnf on all our DB servers, even
3161 * our primaries, and then set read_only=0 on primaries at runtime.
3162 */
3163 public const DBservers = [
3164 'default' => false,
3165 'type' => 'false|list',
3166 ];
3167
3168 /**
3169 * Configuration for the ILBFactory service
3170 *
3171 * The "class" setting must point to a LBFactory subclass, which is also responsible
3172 * for reading $wgDBservers, $wgDBserver, etc.
3173 *
3174 * To set up a wiki farm with multiple database clusters, set the "class" to
3175 * LBFactoryMulti. See {@link Wikimedia::Rdbms::LBFactoryMulti LBFactoryMulti} docs for
3176 * information on how to configure the rest of the $wgLBFactoryConf array.
3177 */
3178 public const LBFactoryConf = [
3179 'default' => [
3180 'class' => 'Wikimedia\\Rdbms\\LBFactorySimple',
3181 ],
3182 'type' => 'map',
3183 'mergeStrategy' => 'replace',
3184 ];
3185
3186 /**
3187 * After a state-changing request is done by a client, this determines
3188 * how many seconds that client should keep using the primary datacenter.
3189 *
3190 * This avoids unexpected stale or 404 responses due to replication lag.
3191 *
3192 * This must be greater than or equal to
3193 * Wikimedia\Rdbms\ChronologyProtector::POSITION_COOKIE_TTL.
3194 *
3195 * @since 1.27
3196 */
3197 public const DataCenterUpdateStickTTL = [
3198 'default' => 10,
3199 ];
3200
3201 /**
3202 * File to log database errors to
3203 */
3204 public const DBerrorLog = [
3205 'default' => false,
3206 ];
3207
3208 /**
3209 * Timezone to use in the error log.
3210 *
3211 * Defaults to the wiki timezone ($wgLocaltimezone).
3212 *
3213 * A list of usable timezones can found at:
3214 * https://www.php.net/manual/en/timezones.php
3215 *
3216 * **Examples:**
3217 *
3218 * ```
3219 * $wgDBerrorLogTZ = 'UTC';
3220 * $wgDBerrorLogTZ = 'GMT';
3221 * $wgDBerrorLogTZ = 'PST8PDT';
3222 * $wgDBerrorLogTZ = 'Europe/Sweden';
3223 * $wgDBerrorLogTZ = 'CET';
3224 * ```
3225 *
3226 * @since 1.20
3227 */
3228 public const DBerrorLogTZ = [
3229 'default' => false,
3230 'dynamicDefault' => [ 'use' => [ 'Localtimezone' ] ]
3231 ];
3232
3233 public static function getDefaultDBerrorLogTZ( $localtimezone ) {
3234 // NOTE: Extra fallback, in case $localtimezone is ''.
3235 // Many extsing LocalSettings files have $wgLocaltimezone = ''
3236 // in them, erroneously generated by the installer.
3237 return $localtimezone ?: self::getDefaultLocaltimezone();
3238 }
3239
3240 /**
3241 * Other wikis on this site, can be administered from a single developer account.
3242 *
3243 * List of wiki DB domain IDs; the format of each ID consist of 1-3 hyphen
3244 * delimited alphanumeric components (each with no hyphens nor spaces) of any of the forms:
3245 * - "<DB NAME>-<DB SCHEMA>-<TABLE PREFIX>"
3246 * - "<DB NAME>-<TABLE PREFIX>"
3247 * - "<DB NAME>"
3248 * If hyphens appear in any of the components, then the domain ID parsing may not work
3249 * in all cases and site functionality might be affected. If the schema ($wgDBmwschema)
3250 * is left to the default "mediawiki" for all wikis, then the schema should be omitted
3251 * from these IDs.
3252 */
3253 public const LocalDatabases = [
3254 'default' => [],
3255 'type' => 'list',
3256 'items' => [ 'type' => 'string', ],
3257 ];
3258
3259 /**
3260 * If lag is higher than $wgDatabaseReplicaLagWarning, show a warning in some special
3261 * pages (like watchlist). If the lag is higher than $wgDatabaseReplicaLagCritical,
3262 * show a more obvious warning.
3263 *
3264 * @since 1.36
3265 */
3266 public const DatabaseReplicaLagWarning = [
3267 'default' => 10,
3268 ];
3269
3270 /**
3271 * @see self::DatabaseReplicaLagWarning
3272 * @since 1.36
3273 */
3274 public const DatabaseReplicaLagCritical = [
3275 'default' => 30,
3276 ];
3277
3278 /**
3279 * Max execution time for queries of several expensive special pages such as RecentChanges
3280 * in milliseconds.
3281 *
3282 * @since 1.38
3283 */
3284 public const MaxExecutionTimeForExpensiveQueries = [
3285 'default' => 0,
3286 ];
3287
3288 /**
3289 * Mapping of virtual domain to external cluster db.
3290 *
3291 * If no entry is set, the code assumes local database.
3292 * For example, for routing queries of virtual domain 'vdomain'
3293 * to 'wikishared' database in 'extension1' cluster. The config should be like this:
3294 * [ 'vdomain' => [ 'cluster' => 'extension1', 'db' => 'wikishared' ] ]
3295 *
3296 * If the database needs to be the local domain, just set the 'db' to false.
3297 *
3298 * If you want to get another db in the main cluster, just omit 'cluster'. For example:
3299 * [ 'centralauth' => [ 'db' => 'centralauth' ] ]
3300 *
3301 * @since 1.41
3302 */
3303 public const VirtualDomainsMapping = [
3304 'default' => [],
3305 'type' => 'map',
3306 ];
3307
3308 /**
3309 * Pagelinks table schema migration stage, for normalizing pl_namespace and pl_title fields.
3310 *
3311 * Use the SCHEMA_COMPAT_XXX flags. Supported values:
3312 *
3313 * - SCHEMA_COMPAT_WRITE_NEW | SCHEMA_COMPAT_READ_NEW (SCHEMA_COMPAT_NEW)
3314 *
3315 * History:
3316 * - 1.41: Added
3317 * - 1.43: Default has changed to SCHEMA_COMPAT_NEW.
3318 */
3319 public const PageLinksSchemaMigrationStage = [
3320 'default' => SCHEMA_COMPAT_NEW,
3321 'type' => 'integer',
3322 ];
3323
3324 /**
3325 * Gaps in the externallinks table for certain domains.
3326 *
3327 * If you have identified certain domains for which externallinks searches are slow,
3328 * you can use this setting to make MediaWiki skip large el_id ranges,
3329 * rather than having the database scan through them fruitlessly.
3330 *
3331 * Each key in the array is a domain name in el_to_domain_index form,
3332 * e.g. 'https://com.example.'.
3333 * The value is an array with integer keys and values,
3334 * where each entry is a range (from => to, both inclusive)
3335 * of el_id values where this domain is known to have no entries.
3336 * (Subdomains are included, i.e., configuring an entry here guarantees to MediaWiki
3337 * that there are no rows where the el_to_domain_index starts with this value.)
3338 *
3339 * History:
3340 * - 1.41: Added
3341 */
3342 public const ExternalLinksDomainGaps = [
3343 'default' => [],
3344 'type' => 'map',
3345 ];
3346
3347 // endregion -- End of DB settings
3348
3349 /***************************************************************************/
3350 // region Content handlers and storage
3351 /** @name Content handlers and storage */
3352
3353 /**
3354 * Plugins for page content model handling.
3355 *
3356 * Each entry in the array maps a model id to an ObjectFactory specification
3357 * that creates an instance of the appropriate ContentHandler subclass.
3358 *
3359 * @since 1.21
3360 */
3361 public const ContentHandlers = [
3362 'default' =>
3363 [
3364 // the usual case
3365 CONTENT_MODEL_WIKITEXT => [
3366 'class' => WikitextContentHandler::class,
3367 'services' => [
3368 'TitleFactory',
3369 'ParserFactory',
3370 'GlobalIdGenerator',
3371 'LanguageNameUtils',
3372 'LinkRenderer',
3373 'MagicWordFactory',
3374 'ParsoidParserFactory',
3375 ],
3376 ],
3377 // dumb version, no syntax highlighting
3378 CONTENT_MODEL_JAVASCRIPT => JavaScriptContentHandler::class,
3379 // simple implementation, for use by extensions, etc.
3380 CONTENT_MODEL_JSON => JsonContentHandler::class,
3381 // dumb version, no syntax highlighting
3382 CONTENT_MODEL_CSS => CssContentHandler::class,
3383 // plain text, for use by extensions, etc.
3384 CONTENT_MODEL_TEXT => TextContentHandler::class,
3385 // fallback for unknown models, from imports or extensions that were removed
3386 CONTENT_MODEL_UNKNOWN => FallbackContentHandler::class,
3387 ],
3388 'type' => 'map',
3389 ];
3390
3391 /**
3392 * Associative array mapping namespace IDs to the name of the content model pages in that
3393 * namespace should have by default (use the CONTENT_MODEL_XXX constants). If no special
3394 * content type is defined for a given namespace, pages in that namespace will use the
3395 * CONTENT_MODEL_WIKITEXT
3396 * (except for the special case of JS and CS pages).
3397 *
3398 * @note To determine the default model for a new page's main slot, or any slot in general,
3399 * use SlotRoleHandler::getDefaultModel() together with SlotRoleRegistry::getRoleHandler().
3400 * @since 1.21
3401 */
3402 public const NamespaceContentModels = [
3403 'default' => [],
3404 'type' => 'map',
3405 ];
3406
3407 /**
3408 * Determines which types of text are parsed as wikitext. This does not imply that these kinds
3409 * of texts are also rendered as wikitext, it only means that links, magic words, etc will have
3410 * the effect on the database they would have on a wikitext page.
3411 *
3412 * Note that table of contents information will be *suppressed* for all
3413 * text models in this list other than wikitext.
3414 *
3415 * @todo Make the ToC suppression configurable by the content model
3416 * (T313455), not a side effect of inclusion here.
3417 *
3418 * @todo On the long run, it would be nice to put categories etc into a separate structure,
3419 * or at least parse only the contents of comments in the scripts.
3420 * @since 1.21
3421 */
3422 public const TextModelsToParse = [
3423 'default' => [
3424 CONTENT_MODEL_WIKITEXT, // Just for completeness, wikitext will always be parsed.
3425 CONTENT_MODEL_JAVASCRIPT, // Make categories etc work, people put them into comments.
3426 CONTENT_MODEL_CSS, // Make categories etc work, people put them into comments.
3427 ],
3428 'type' => 'list',
3429 ];
3430
3431 /**
3432 * We can also compress text stored in the 'text' table. If this is set on, new
3433 * revisions will be compressed on page save if zlib support is available. Any
3434 * compressed revisions will be decompressed on load regardless of this setting,
3435 * but will not be readable at all if zlib support is not available.
3436 */
3437 public const CompressRevisions = [
3438 'default' => false,
3439 ];
3440
3441 /**
3442 * List of enabled ExternalStore protocols.
3443 *
3444 * @see \ExternalStoreAccess
3445 *
3446 * ```
3447 * $wgExternalStores = [ "DB" ];
3448 * ```
3449 */
3450 public const ExternalStores = [
3451 'default' => [],
3452 'type' => 'list',
3453 ];
3454
3455 /**
3456 * Shortcut for setting `$wgLBFactoryConf["externalClusters"]`.
3457 *
3458 * This is only applicable when using the default LBFactory
3459 * of {@link Wikimedia::Rdbms::LBFactorySimple LBFactorySimple}.
3460 * It is ignored if a different LBFactory is set, or if `externalClusters`
3461 * is already set explicitly.
3462 *
3463 * @see \ExternalStoreAccess
3464 *
3465 * **Example:**
3466 * Create a cluster named 'blobs_cluster1':
3467 *
3468 * ```
3469 * $wgExternalServers = [
3470 * 'blobs_cluster1' => <array in the same format as $wgDBservers>
3471 * ];
3472 * ```
3473 */
3474 public const ExternalServers = [
3475 'default' => [],
3476 'type' => 'map',
3477 ];
3478
3479 /**
3480 * The place to put new text blobs or false to put them in the text table
3481 * of the local wiki database.
3482 *
3483 * @see \ExternalStoreAccess
3484 *
3485 * **Example:**
3486 *
3487 * ```
3488 * $wgDefaultExternalStore = [ 'DB://cluster1', 'DB://cluster2' ];
3489 * ```
3490 */
3491 public const DefaultExternalStore = [
3492 'default' => false,
3493 'type' => 'list|false',
3494 ];
3495
3496 /**
3497 * Revision text may be cached in the main WAN cache to reduce load on external
3498 * storage servers and object extraction overhead for frequently-loaded revisions.
3499 *
3500 * Set to 0 to disable, or number of seconds before cache expiry.
3501 */
3502 public const RevisionCacheExpiry = [
3503 'default' => SqlBlobStore::DEFAULT_TTL,
3504 'type' => 'integer',
3505 ];
3506
3507 /**
3508 * Revision slots may be cached in the main WAN cache and/or the local server cache
3509 * to reduce load on the database.
3510 *
3511 * Set to 0 to disable, or number of seconds before cache expiry.
3512 */
3513 public const RevisionSlotsCacheExpiry = [
3514 'default' => [
3515 'local' => BagOStuff::TTL_HOUR,
3516 'WAN' => BagOStuff::TTL_DAY,
3517 ],
3518 'type' => 'map',
3519 ];
3520
3521 /**
3522 * Enable page language feature
3523 * Allows setting page language in database
3524 *
3525 * @since 1.24
3526 */
3527 public const PageLanguageUseDB = [
3528 'default' => false,
3529 'type' => 'boolean',
3530 ];
3531
3532 /**
3533 * Specify the difference engine to use.
3534 *
3535 * Supported values:
3536 * - 'external': Use an external diff engine, which must be specified via $wgExternalDiffEngine
3537 * - 'wikidiff2': Use the wikidiff2 PHP extension
3538 * - 'php': PHP implementations included in MediaWiki
3539 *
3540 * The default (null) is to use the first engine that's available.
3541 *
3542 * @since 1.35
3543 */
3544 public const DiffEngine = [
3545 'default' => null,
3546 'type' => '?string',
3547 ];
3548
3549 /**
3550 * Name of the external diff engine to use.
3551 */
3552 public const ExternalDiffEngine = [
3553 'default' => false,
3554 'type' => 'string|false',
3555 ];
3556
3557 /**
3558 * Options for wikidiff2:
3559 * - useMultiFormat: (bool) Whether to use wikidiff2_multi_format_diff()
3560 * if it is available. This temporarily defaults to false, during
3561 * migration to the new code. It is available in wikidiff2 1.14.0+.
3562 *
3563 * The following options are only effective if wikidiff2_multi_format_diff()
3564 * is enabled. See README.md in wikidiff2 for details:
3565 *
3566 * - numContextLines
3567 * - changeThreshold
3568 * - movedLineThreshold
3569 * - maxMovedLines
3570 * - maxWordLevelDiffComplexity
3571 * - maxSplitSize
3572 * - initialSplitThreshold
3573 * - finalSplitThreshold
3574 *
3575 * Also:
3576 * - formatOptions: An array of format-specific overrides. The key may
3577 * be "inline" or "table" and the value is an array with keys
3578 * numContextLines, changeThreshold, etc.
3579 * @since 1.41
3580 */
3581 public const Wikidiff2Options = [
3582 'default' => [],
3583 'type' => 'map'
3584 ];
3585
3586 // endregion -- end of Content handlers and storage
3587
3588 /***************************************************************************/
3589 // region Performance hacks and limits
3590 /** @name Performance hacks and limits */
3591
3592 /**
3593 * Set a limit on server request wall clock time.
3594 *
3595 * If the Excimer extension is enabled, setting this will cause an exception
3596 * to be thrown after the specified number of seconds. If the extension is
3597 * not available, set_time_limit() will be called instead.
3598 *
3599 * @since 1.36
3600 */
3601 public const RequestTimeLimit = [
3602 'default' => null,
3603 'type' => '?integer',
3604 ];
3605
3606 /**
3607 * The request time limit for "slow" write requests that should not be
3608 * interrupted due to the risk of data corruption.
3609 *
3610 * The limit will only be raised. If the pre-existing time limit is larger,
3611 * then this will have no effect.
3612 *
3613 * @since 1.26
3614 */
3615 public const TransactionalTimeLimit = [
3616 'default' => 120,
3617 ];
3618
3619 /**
3620 * The maximum time critical sections are allowed to stay open. Critical
3621 * sections are used to defer Excimer request timeouts. If Excimer is available
3622 * and this time limit is exceeded, an exception will be thrown at the next
3623 * opportunity, typically after a long-running function like a DB query returns.
3624 *
3625 * Critical sections may wrap long-running queries, and it's generally better
3626 * for the timeout to be handled a few milliseconds later when the critical
3627 * section exits, so this should be a large number.
3628 *
3629 * This limit is ignored in command-line mode.
3630 *
3631 * @since 1.36
3632 */
3633 public const CriticalSectionTimeLimit = [
3634 'default' => 180.0,
3635 'type' => 'float',
3636 ];
3637
3638 /**
3639 * Disable database-intensive features
3640 */
3641 public const MiserMode = [
3642 'default' => false,
3643 ];
3644
3645 /**
3646 * Disable all query pages if miser mode is on, not just some
3647 */
3648 public const DisableQueryPages = [
3649 'default' => false,
3650 ];
3651
3652 /**
3653 * Number of rows to cache in 'querycache' table when miser mode is on
3654 */
3655 public const QueryCacheLimit = [
3656 'default' => 1000,
3657 ];
3658
3659 /**
3660 * Number of links to a page required before it is deemed "wanted"
3661 */
3662 public const WantedPagesThreshold = [
3663 'default' => 1,
3664 ];
3665
3666 /**
3667 * Enable slow parser functions
3668 */
3669 public const AllowSlowParserFunctions = [
3670 'default' => false,
3671 ];
3672
3673 /**
3674 * Allow schema updates
3675 */
3676 public const AllowSchemaUpdates = [
3677 'default' => true,
3678 ];
3679
3680 /**
3681 * Maximum article size in kibibytes
3682 */
3683 public const MaxArticleSize = [
3684 'default' => 2048,
3685 ];
3686
3687 /**
3688 * The minimum amount of memory that MediaWiki "needs"; MediaWiki will try to
3689 * raise PHP's memory limit if it's below this amount.
3690 */
3691 public const MemoryLimit = [
3692 'default' => '50M',
3693 ];
3694
3695 /**
3696 * Configuration for processing pool control, for use in high-traffic wikis.
3697 *
3698 * An implementation is provided in the PoolCounter extension.
3699 *
3700 * This configuration array maps pool types to an associative array. The only
3701 * defined key in the associative array is "class", which gives the class name.
3702 * The remaining elements are passed through to the class as constructor
3703 * parameters.
3704 *
3705 * **Example using local redis instance:**
3706 *
3707 * ```
3708 * $wgPoolCounterConf = [ 'ArticleView' => [
3709 * 'class' => PoolCounterRedis::class,
3710 * 'timeout' => 15, // wait timeout in seconds
3711 * 'workers' => 1, // maximum number of active threads in each pool
3712 * 'maxqueue' => 5, // maximum number of total threads in each pool
3713 * 'servers' => [ '127.0.0.1' ],
3714 * 'redisConfig' => []
3715 * ] ];
3716 * ```
3717 *
3718 * **Example using C daemon from <https://gerrit.wikimedia.org/g/mediawiki/services/poolcounter>**
3719 *
3720 * ```
3721 * $wgPoolCountClientConf = [
3722 * 'servers' => [ '127.0.0.1' ],
3723 * 'timeout' => 0.5,
3724 * 'connect_timeout' => 0.01,
3725 * ];
3726 *
3727 * $wgPoolCounterConf = [ 'ArticleView' => [
3728 * 'class' => 'PoolCounter_Client',
3729 * 'timeout' => 15, // wait timeout in seconds
3730 * 'workers' => 5, // maximum number of active threads in each pool
3731 * 'maxqueue' => 50, // maximum number of total threads in each pool
3732 * ... any extension-specific options...
3733 * ] ];
3734 * ```
3735 *
3736 * @since 1.16
3737 */
3738 public const PoolCounterConf = [
3739 'default' => null,
3740 'type' => '?map',
3741 ];
3742
3743 /**
3744 * Configuration array for the PoolCounter client.
3745 *
3746 * - servers: Array of hostnames, or hostname:port. The default port is 7531.
3747 * - timeout: Connection timeout.
3748 * - connect_timeout: [Since 1.28] Alternative connection timeout. If set, it is used
3749 * instead of `timeout` and will be retried once if a connection fails
3750 * to be established. Background: https://phabricator.wikimedia.org/T105378.
3751 *
3752 * @see \MediaWiki\PoolCounter\PoolCounterClient
3753 * @since 1.16
3754 */
3755 public const PoolCountClientConf = [
3756 'default' => [
3757 'servers' => [
3758 '127.0.0.1'
3759 ],
3760 'timeout' => 0.1,
3761 ],
3762 'type' => 'map',
3763 ];
3764
3765 /**
3766 * Max time (in seconds) a user-generated transaction can spend in writes.
3767 *
3768 * If exceeded, the transaction is rolled back with an error instead of being committed.
3769 *
3770 * @since 1.27
3771 */
3772 public const MaxUserDBWriteDuration = [
3773 'default' => false,
3774 'type' => 'integer|false',
3775 ];
3776
3777 /**
3778 * Max time (in seconds) a job-generated transaction can spend in writes.
3779 *
3780 * If exceeded, the transaction is rolled back with an error instead of being committed.
3781 *
3782 * @since 1.30
3783 */
3784 public const MaxJobDBWriteDuration = [
3785 'default' => false,
3786 'type' => 'integer|false',
3787 ];
3788
3789 /**
3790 * LinkHolderArray batch size
3791 * For debugging
3792 */
3793 public const LinkHolderBatchSize = [
3794 'default' => 1000,
3795 ];
3796
3797 /**
3798 * Maximum number of pages to move at once when moving subpages with a page.
3799 */
3800 public const MaximumMovedPages = [
3801 'default' => 100,
3802 ];
3803
3804 /**
3805 * Force deferred updates to be run before sending a response to the client,
3806 * instead of attempting to run them after sending the response. Setting this
3807 * to true is useful for end-to-end testing, to ensure that the effects of a
3808 * request are visible to any subsequent requests, even if they are made
3809 * immediately after the first one. Note however that this does not ensure
3810 * that database replication is complete, nor does it execute any jobs
3811 * enqueued for later.
3812 * There should be no reason to set this in a normal production environment.
3813 *
3814 * @since 1.38
3815 */
3816 public const ForceDeferredUpdatesPreSend = [
3817 'default' => false,
3818 ];
3819
3820 /**
3821 * Whether site_stats table should have multiple rows. If set to true, in each update,
3822 * one of ten rows gets updated at random to reduce lock wait time in wikis
3823 * that have lots of concurrent edits.
3824 * It should be set to true in really large wikis with big flow of edits,
3825 * Otherwise it can cause inaccuracy in data.
3826 *
3827 * @since 1.39
3828 */
3829 public const MultiShardSiteStats = [
3830 'default' => false,
3831 'type' => 'boolean',
3832 ];
3833
3834 // endregion -- end performance hacks
3835
3836 /***************************************************************************/
3837 // region Cache settings
3838 /** @name Cache settings */
3839
3840 /**
3841 * Directory for caching data in the local filesystem. Should not be accessible
3842 * from the web.
3843 *
3844 * Note: if multiple wikis share the same localisation cache directory, they
3845 * must all have the same set of extensions. You can set a directory just for
3846 * the localisation cache using $wgLocalisationCacheConf['storeDirectory'].
3847 */
3848 public const CacheDirectory = [
3849 'default' => false,
3850 ];
3851
3852 /**
3853 * Main cache type. This should be a cache with fast access, but it may have
3854 * limited space. By default, it is disabled, since the stock database cache
3855 * is not fast enough to make it worthwhile.
3856 *
3857 * The options are:
3858 *
3859 * - CACHE_ANYTHING: Use anything, as long as it works
3860 * - CACHE_NONE: Do not cache
3861 * - CACHE_DB: Store cache objects in the DB
3862 * - CACHE_MEMCACHED: MemCached, must specify servers in $wgMemCachedServers
3863 * - CACHE_ACCEL: APC or APCu
3864 * - (other): A string may be used which identifies a cache
3865 * configuration in $wgObjectCaches.
3866 *
3867 * For a multi-datacenter setup, the underlying service should be configured
3868 * to broadcast operations by WANObjectCache using Mcrouter or Dynomite.
3869 * See @ref wanobjectcache-deployment "Deploying WANObjectCache".
3870 * To configure the `broadcastRoutingPrefix` WANObjectCache parameter,
3871 * use $wgWANObjectCache.
3872 *
3873 * @see self::MessageCacheType
3874 * @see self::ParserCacheType
3875 */
3876 public const MainCacheType = [
3877 'default' => CACHE_NONE,
3878 ];
3879
3880 /**
3881 * The cache type for storing the contents of the MediaWiki namespace. This
3882 * cache is used for a small amount of data which is expensive to regenerate.
3883 *
3884 * For available types see $wgMainCacheType.
3885 */
3886 public const MessageCacheType = [
3887 'default' => CACHE_ANYTHING,
3888 ];
3889
3890 /**
3891 * The cache type for storing page content HTML (e.g. parsed from wikitext).
3892 *
3893 * Parsing wikitext is considered an expensive operation. It is recommended
3894 * to give your parser cache plenty of storage space, such that long tail cache
3895 * hits are possible.
3896 *
3897 * The default parser cache backend (when MainCacheType is left to CACHE_NONE)
3898 * is effectively CACHE_DB (SqlBagOStuff). If you set up a main cache type
3899 * such as memcached, it is recommended to set this explicitly to CACHE_DB.
3900 *
3901 * Advice for large wiki farms:
3902 * - Consider allocating a dedicated database to ParserCache.
3903 * Register it in $wgObjectCaches and point $wgParserCacheType to it.
3904 * - Consider using MultiWriteBagOStuff to add a higher tier with Memcached
3905 * in front of the lower database tier.
3906 * - Consider setting `'purgePeriod' => 0` in the dedicated SqlBagOStuff
3907 * entry in $wgObjectCaches. This disables the automatic purging of
3908 * expired rows (which would normally happen in the background of
3909 * write requests). You can then schedule the purgeParserCache.php script
3910 * to e.g. once a day prune expired rows from the a dedicated maintenance
3911 * server.
3912 *
3913 * For available types see $wgMainCacheType.
3914 */
3915 public const ParserCacheType = [
3916 'default' => CACHE_ANYTHING,
3917 ];
3918
3919 /**
3920 * The cache backend for storing session data.
3921 *
3922 * Used by MediaWiki\Session\SessionManager. See $wgMainCacheType for available types.
3923 *
3924 * See [SessionManager Storage expectations](@ref SessionManager-storage-expectations).
3925 */
3926 public const SessionCacheType = [
3927 'default' => CACHE_ANYTHING,
3928 ];
3929
3930 /**
3931 * The cache type for storing language conversion tables,
3932 * which are used when parsing certain text and interface messages.
3933 *
3934 * For available types see $wgMainCacheType.
3935 *
3936 * @since 1.20
3937 */
3938 public const LanguageConverterCacheType = [
3939 'default' => CACHE_ANYTHING,
3940 ];
3941
3942 /**
3943 * Advanced object cache configuration.
3944 *
3945 * Use this to define the class names and constructor parameters which are used
3946 * for the various cache types. Custom cache types may be defined here and
3947 * referenced from $wgMainCacheType, $wgMessageCacheType, $wgParserCacheType,
3948 * or $wgLanguageConverterCacheType.
3949 *
3950 * The format is an associative array where the key is a cache identifier, and
3951 * the value is an associative array of parameters. One of the following
3952 * parameters specifying the class must be given:
3953 *
3954 * - class: The class name which will be used.
3955 * - factory: A callable function which will generate a suitable cache object.
3956 *
3957 * The following parameters are shared and understood by most classes:
3958 *
3959 * - loggroup: The log channel to use.
3960 *
3961 * For SqlBagOStuff, the main configured database will be used, unless one of the following
3962 * three parameters is given:
3963 *
3964 * - server: Server config map for Database::factory() that describes the database to
3965 * use for all key operations in the current region. This is overridden by "servers".
3966 * - servers: Map of tag strings to server config maps, each for Database::factory(),
3967 * describing the set of database servers on which to distribute key operations in the
3968 * current region. Data is distributed among the servers via key hashing based on the
3969 * server tags. Therefore, each tag represents a shard of the dataset. Tags are useful
3970 * for failover using cold-standby servers and for managing shards with replica servers
3971 * in multiple regions (each having different hostnames).
3972 * - cluster: The ExternalStore cluster name to use.
3973 *
3974 * SqlBagOStuff also accepts the following optional parameters:
3975 *
3976 * - dbDomain: The database name to pass to the LoadBalancer.
3977 * - multiPrimaryMode: Whether the portion of the dataset belonging to each tag/shard is
3978 * replicated among one or more regions, with one "co-primary" server in each region.
3979 * Queries are issued in a manner that provides Last-Write-Wins eventual consistency.
3980 * This option requires the "server" or "servers" options. Only MySQL, with statement
3981 * based replication (log_bin='ON' and binlog_format='STATEMENT') is supported. Also,
3982 * the `modtoken` column must exist on the `objectcache` table(s).
3983 * - purgePeriod: The average number of object cache writes in between garbage collection
3984 * operations, where expired entries are removed from the database. Or in other words,
3985 * the probability of performing a purge is one in every this number. If set to zero,
3986 * purging will never be done at runtime (for use with PurgeParserCache).
3987 * - purgeLimit: Maximum number of rows to purge at once.
3988 * - tableName: The table name to use, default is "objectcache".
3989 * - shards: The number of tables to use for data storage on each server. If greater than
3990 * 1, table names are formed in the style objectcacheNNN where NNN is the shard index,
3991 * between 0 and shards-1. The number of digits used in the suffix is the minimum number
3992 * required to hold the largest shard index. Data is distributed among the tables via
3993 * key hashing. This helps mitigate MySQL bugs 61735 and 61736.
3994 * - writeBatchSize: Default maximum number of rows to change in each query for write
3995 * operations that can be chunked into a set of smaller writes.
3996 *
3997 * For MemcachedPhpBagOStuff parameters see {@link MemcachedPhpBagOStuff::__construct}
3998 *
3999 * For MemcachedPeclBagOStuff parameters see {@link MemcachedPeclBagOStuff::__construct}
4000 *
4001 * For RedisBagOStuff parameters see {@link Wikimedia\ObjectCache\RedisBagOStuff::__construct}
4002 */
4003 public const ObjectCaches = [
4004 'default' => [
4005 CACHE_NONE => [ 'class' => EmptyBagOStuff::class, 'reportDupes' => false ],
4006 CACHE_DB => [ 'class' => SqlBagOStuff::class, 'loggroup' => 'SQLBagOStuff' ],
4007
4008 'memcached-php' => [ 'class' => MemcachedPhpBagOStuff::class, 'loggroup' => 'memcached' ],
4009 'memcached-pecl' => [ 'class' => MemcachedPeclBagOStuff::class, 'loggroup' => 'memcached' ],
4010 'hash' => [ 'class' => HashBagOStuff::class, 'reportDupes' => false ],
4011
4012 // Deprecated since 1.35.
4013 // - To configure a wg*CacheType variable to use the local server cache,
4014 // use CACHE_ACCEL instead, which will select these automatically.
4015 // - To access the object for the local server cache at run-time,
4016 // use MediaWikiServices::getLocalServerObjectCache()
4017 // instead of e.g. ObjectCache::getInstance( 'apcu' ).
4018 // - To instantiate a new one of these explicitly, do so directly
4019 // by using `new APCUBagOStuff( [ … ] )`
4020 // - To instantiate a new one of these including auto-detection and fallback,
4021 // use ObjectCache::makeLocalServerCache().
4022 'apc' => [ 'class' => APCUBagOStuff::class, 'reportDupes' => false ],
4023 'apcu' => [ 'class' => APCUBagOStuff::class, 'reportDupes' => false ],
4024 ],
4025 'type' => 'map',
4026 ];
4027
4028 /**
4029 * Extra parameters to the WANObjectCache constructor.
4030 *
4031 * See @ref wanobjectcache-deployment "Deploying WANObjectCache".
4032 *
4033 * @since 1.40
4034 */
4035 public const WANObjectCache = [
4036 'default' => [],
4037 'type' => 'map',
4038 ];
4039
4040 /**
4041 * The stash store backend for MicroStash.
4042 *
4043 * This store should be optimized for ephemeral data, and should be able to handle
4044 * a high volume of writes and reads. The dataset access scope should be across
4045 * all servers that serve the application.
4046 *
4047 * Note that the TTL of the data written to this store must be respected completely
4048 * before the data gets evicted from the store (whether the data is used or not).
4049 * The store must not evict data based on LRU or popularity before the TTL expires.
4050 *
4051 * Expectations for sysadmins:
4052 *
4053 * 1. The data written to this store is generally short-lived (seconds/minutes),
4054 * 2. This store must reliably persist and should not evict data until the TTL expires,
4055 * 3. The same store must be accessed by all application servers (i.e. no visible lag or
4056 * split reality),
4057 * 4. This store should handle a high volume of both writes and reads,
4058 * with reads completing with consistently low latencies.
4059 *
4060 * Examples users:
4061 *
4062 * - {@link MediaWiki::Permissions::RateLimiter RateLimiter} (via RStatsFactory)
4063 * - {@link Wikimedia::Rdbms::ChronologyProtector ChronologyProtector}
4064 * See also [ChronologyProtector requirements](@ref ChronologyProtector-storage-requirements),
4065 * for more detailed system administrator requirements for multi-DC operations.
4066 *
4067 * Valid options are the keys of {@link $wgObjectCaches}, e.g. CACHE_* constants.
4068 *
4069 * @see \Wikimedia\ObjectCache\BagOStuff
4070 * @since 1.42
4071 */
4072 public const MicroStashType = [
4073 'default' => CACHE_ANYTHING,
4074 'type' => 'string|int',
4075 ];
4076
4077 /**
4078 * The object store type of the main stash.
4079 *
4080 * This should be a fast storage system optimized for lightweight data, both ephemeral and
4081 * permanent, for things like counters, tokens, and blobs. The dataset access scope should
4082 * include all the application servers in all datacenters. Thus, the data must be replicated
4083 * among all datacenters. The store should have "Last Write Wins" eventual consistency. Per
4084 * https://en.wikipedia.org/wiki/PACELC_theorem, the store should act as a PA/EL distributed
4085 * system for these operations.
4086 *
4087 * The multi-datacenter strategy for MediaWiki is to have CDN route HTTP POST requests to the
4088 * primary datacenter and HTTP GET/HEAD/OPTIONS requests to the closest datacenter to the
4089 * client. The stash accepts write operations from any datacenter, but cross-datacenter
4090 * replication is asynchronous.
4091 *
4092 * Modules that use the main stash can expect race conditions to occur if a key can receive
4093 * write operations originating from multiple datacenters. To improve consistency, callers
4094 * should avoid main stash updates during non-POST requests. In any case, callers should
4095 * gracefully tolerate occasional key evictions, temporary inconsistencies among datacenters,
4096 * and violations of linearizability (e.g. during timeouts). Modules that can never handle
4097 * these kinds of anomalies should use other storage mediums.
4098 *
4099 * Valid options are the keys of {@link $wgObjectCaches}, e.g. CACHE_* constants.
4100 *
4101 * @see \Wikimedia\ObjectCache\BagOStuff
4102 * @since 1.26
4103 */
4104 public const MainStash = [
4105 'default' => CACHE_DB,
4106 ];
4107
4108 /**
4109 * Configuration for the caching related to parsoid output. The configuration contains the
4110 * following keys:
4111 *
4112 * - StashType: The type of object store to be used by the ParsoidOutputStash service,
4113 * which stores the base state of HTML based edits.
4114 * Valid options are the keys of {@link $wgObjectCaches}, e.g. CACHE_* constants.
4115 * By default, the value of the MainStash setting will be used.
4116 * This should be an object store that provides fairly solid persistence guarantees,
4117 * since losing an entry from the stash may mean that the user can't save their edit.
4118 * If null, the value of the MainStash configuration setting will be used.
4119 *
4120 * - StashDuration: The number of seconds for which an entry in the stash should be kept.
4121 * Should be long enough for users to finish editing,
4122 * since losing an entry from the stash may mean that the user can't save their edit.
4123 * This is set to one day by default.
4124 *
4125 * - WarmParsoidParserCache: Setting this to true will pre-populate the parsoid parser cache
4126 * with parsoid outputs on page edits. This speeds up loading HTML into Visual Editor.
4127 *
4128 * @since 1.39
4129 * @unstable Per MediaWiki 1.39, the structure of this configuration is still subject to
4130 * change.
4131 */
4132 public const ParsoidCacheConfig = [
4133 'type' => 'object',
4134 'properties' => [
4135 'StashType' => [ 'type' => 'int|string|null', 'default' => null ],
4136 'StashDuration' => [ 'type' => 'int', 'default' => 24 * 60 * 60 ],
4137 'WarmParsoidParserCache' => [ 'type' => 'bool', 'default' => false ],
4138 ]
4139 ];
4140
4141 /**
4142 * Sample rate for collecting statistics on Parsoid selective update.
4143 *
4144 * Zero disables collection; 1000 means "1 in every 1000 parses will
4145 * be sampled".
4146 *
4147 * @warning This is EXPERIMENTAL and will disappear once analysis is
4148 * complete.
4149 */
4150 public const ParsoidSelectiveUpdateSampleRate = [
4151 'type' => 'integer',
4152 'default' => 0,
4153 ];
4154
4155 /**
4156 * Per-namespace configuration for the ParserCache filter.
4157 *
4158 * There is one top level key for each cache name supported in ParserCacheFactory.
4159 * The per-namespace configuration is given separately for each cache.
4160 *
4161 * For each namespace, this defines a set of filter options, which are represented
4162 * as an associative array. The following keys are supported in this array:
4163 *
4164 * - minCpuTime: causes the parser cache to not save any output that took fewer
4165 * than the given number of seconds of CPU time to generate, according to
4166 * ParserOutput::getTimeProfile(). Set to 0 to always cache, or to
4167 * PHP_INT_MAX to disable caching for this namespace.
4168 *
4169 * If no filter options are defined for a given namespace, the filter options
4170 * under the "default" key will be used for pages in that namespace.
4171 *
4172 * @since 1.42
4173 */
4174 public const ParserCacheFilterConfig = [
4175 'type' => 'map',
4176 'default' => [ // default value
4177 'pcache' => [ // old parser cache
4178 'default' => [ // all namespaces
4179 // 0 means no threshold.
4180 // Use PHP_INT_MAX to disable cache.
4181 'minCpuTime' => 0
4182 ],
4183 ],
4184 'parsoid-pcache' => [ // parsoid output cache
4185 'default' => [ // all namespaces
4186 // 0 means no threshold.
4187 // Use PHP_INT_MAX to disable cache.
4188 'minCpuTime' => 0
4189 ],
4190 ],
4191 ],
4192 'additionalProperties' => [ // caches
4193 'type' => 'map',
4194 'description' => 'A map of namespace IDs to filter definitions.',
4195 'additionalProperties' => [ // namespaces
4196 'type' => 'map',
4197 'description' => 'A map of filter names to values.',
4198 'properties' => [ // filters
4199 'minCpuTime' => [ 'type' => 'float' ]
4200 ]
4201 ],
4202 ],
4203 ];
4204
4205 /**
4206 * Secret string for HMAC hashing in ChronologyProtector [optional]
4207 *
4208 * @since 1.41
4209 */
4210 public const ChronologyProtectorSecret = [
4211 'default' => '',
4212 'type' => 'string',
4213 ];
4214
4215 /**
4216 * The expiry time for the parser cache, in seconds.
4217 *
4218 * The default is 86400 (one day).
4219 */
4220 public const ParserCacheExpireTime = [
4221 'default' => 60 * 60 * 24,
4222 ];
4223
4224 /**
4225 * The expiry time for the parser cache for old revisions, in seconds.
4226 *
4227 * The default is 3600 (cache disabled).
4228 */
4229 public const OldRevisionParserCacheExpireTime = [
4230 'default' => 60 * 60,
4231 ];
4232
4233 /**
4234 * The expiry time to use for session storage, in seconds.
4235 */
4236 public const ObjectCacheSessionExpiry = [
4237 'default' => 60 * 60,
4238 ];
4239
4240 /**
4241 * Whether to use PHP session handling ($_SESSION and session_*() functions)
4242 *
4243 * If the constant MW_NO_SESSION is defined, this is forced to 'disable'.
4244 *
4245 * If the constant MW_NO_SESSION_HANDLER is defined, this is ignored and PHP
4246 * session handling will function independently of SessionHandler.
4247 * SessionHandler and PHP's session handling may attempt to override each
4248 * others' cookies.
4249 *
4250 * @since 1.27
4251 */
4252 public const PHPSessionHandling = [
4253 'default' => 'enable',
4254 'type' => 'string',
4255 ];
4256
4257 /**
4258 * Time in seconds to remember IPs for, for the purposes of logging IP changes within the
4259 * same session. This is meant more for debugging errors in the authentication system than
4260 * for detecting abuse.
4261 *
4262 * @since 1.36
4263 */
4264 public const SuspiciousIpExpiry = [
4265 'default' => false,
4266 'type' => 'integer|false',
4267 ];
4268
4269 /**
4270 * Number of internal PBKDF2 iterations to use when deriving session secrets.
4271 *
4272 * @since 1.28
4273 */
4274 public const SessionPbkdf2Iterations = [
4275 'default' => 10001,
4276 ];
4277
4278 /**
4279 * The list of MemCached servers and port numbers
4280 */
4281 public const MemCachedServers = [
4282 'default' => [ '127.0.0.1:11211', ],
4283 'type' => 'list',
4284 ];
4285
4286 /**
4287 * Use persistent connections to MemCached, which are shared across multiple
4288 * requests.
4289 */
4290 public const MemCachedPersistent = [
4291 'default' => false,
4292 ];
4293
4294 /**
4295 * Read/write timeout for MemCached server communication, in microseconds.
4296 */
4297 public const MemCachedTimeout = [
4298 'default' => 500_000,
4299 ];
4300
4301 /**
4302 * Set this to true to maintain a copy of the message cache on the local server.
4303 *
4304 * This layer of message cache is in addition to the one configured by $wgMessageCacheType.
4305 *
4306 * The local copy is put in APC. If APC is not installed, this setting does nothing.
4307 *
4308 * Note that this is about the message cache, which stores interface messages
4309 * maintained as wiki pages. This is separate from the localisation cache for interface
4310 * messages provided by the software, which is configured by $wgLocalisationCacheConf.
4311 */
4312 public const UseLocalMessageCache = [
4313 'default' => false,
4314 ];
4315
4316 /**
4317 * Instead of caching everything, only cache those messages which have
4318 * been customised in the site content language. This means that
4319 * MediaWiki:Foo/ja is ignored if MediaWiki:Foo doesn't exist.
4320 *
4321 * This option is probably only useful for translatewiki.net.
4322 */
4323 public const AdaptiveMessageCache = [
4324 'default' => false,
4325 ];
4326
4327 /**
4328 * Localisation cache configuration.
4329 *
4330 * Used by service wiring to decide how to construct the
4331 * LocalisationCache instance. Associative array with keys:
4332 *
4333 * class: The class to use for constructing the LocalisationCache object.
4334 * This may be overridden by extensions to a subclass of LocalisationCache.
4335 * Sub classes are expected to still honor the 'storeClass', 'storeDirectory'
4336 * and 'manualRecache' options where applicable.
4337 *
4338 * storeClass: Which LCStore class implementation to use. This is optional.
4339 * The default LocalisationCache class offers the 'store' option
4340 * as abstraction for this.
4341 *
4342 * store: How and where to store localisation cache data.
4343 * This option is ignored if 'storeClass' is explicitly set to a class name.
4344 * Must be one of:
4345 * - 'detect' (default): Automatically select 'files' if 'storeDirectory'
4346 * or $wgCacheDirectory is set, and fall back to 'db' otherwise.
4347 * - 'files': Store in $wgCacheDirectory as CDB files.
4348 * - 'array': Store in $wgCacheDirectory as PHP static array files.
4349 * - 'db': Store in the l10n_cache database table.
4350 *
4351 * storeDirectory: If the selected LCStore class puts its data in files, then it
4352 * will use this directory. If set to false (default), then
4353 * $wgCacheDirectory is used instead.
4354 *
4355 * manualRecache: Set this to true to disable cache updates on web requests.
4356 * Use maintenance/rebuildLocalisationCache.php instead.
4357 */
4358 public const LocalisationCacheConf = [
4359 'properties' => [
4360 'class' => [ 'type' => 'string', 'default' => LocalisationCache::class ],
4361 'store' => [ 'type' => 'string', 'default' => 'detect' ],
4362 'storeClass' => [ 'type' => 'false|string', 'default' => false ],
4363 'storeDirectory' => [ 'type' => 'false|string', 'default' => false ],
4364 'storeServer' => [ 'type' => 'object', 'default' => [] ],
4365 'forceRecache' => [ 'type' => 'bool', 'default' => false ],
4366 'manualRecache' => [ 'type' => 'bool', 'default' => false ],
4367 ],
4368 'type' => 'object',
4369 ];
4370
4371 /**
4372 * Allow client-side caching of pages
4373 */
4374 public const CachePages = [
4375 'default' => true,
4376 ];
4377
4378 /**
4379 * Set this to current time to invalidate all prior cached pages. Affects both
4380 * client-side and server-side caching.
4381 *
4382 * You can get the current date on your server by using the command:
4383 *
4384 * @verbatim date +%Y%m%d%H%M%S
4385 * @endverbatim
4386 */
4387 public const CacheEpoch = [
4388 'default' => '20030516000000',
4389 ];
4390
4391 /**
4392 * Directory where GitInfo will look for pre-computed cache files. If false,
4393 * $wgCacheDirectory/gitinfo will be used.
4394 */
4395 public const GitInfoCacheDirectory = [
4396 'default' => false,
4397 ];
4398
4399 /**
4400 * This will cache static pages for non-logged-in users to reduce
4401 * database traffic on public sites. ResourceLoader requests to default
4402 * language and skins are cached as well as single module requests.
4403 */
4404 public const UseFileCache = [
4405 'default' => false,
4406 ];
4407
4408 /**
4409 * Depth of the subdirectory hierarchy to be created under
4410 * $wgFileCacheDirectory. The subdirectories will be named based on
4411 * the MD5 hash of the title. A value of 0 means all cache files will
4412 * be put directly into the main file cache directory.
4413 */
4414 public const FileCacheDepth = [
4415 'default' => 2,
4416 ];
4417
4418 /**
4419 * Append a configured value to the parser cache and the sitenotice key so
4420 * that they can be kept separate for some class of activity.
4421 */
4422 public const RenderHashAppend = [
4423 'default' => '',
4424 ];
4425
4426 /**
4427 * If on, the sidebar navigation links are cached for users with the
4428 * current language set. This can save a touch of load on a busy site
4429 * by shaving off extra message lookups.
4430 *
4431 * However it is also fragile: changing the site configuration, or
4432 * having a variable $wgArticlePath, can produce broken links that
4433 * don't update as expected.
4434 */
4435 public const EnableSidebarCache = [
4436 'default' => false,
4437 ];
4438
4439 /**
4440 * Expiry time for the sidebar cache, in seconds
4441 */
4442 public const SidebarCacheExpiry = [
4443 'default' => 86400,
4444 ];
4445
4446 /**
4447 * When using the file cache, we can store the cached HTML gzipped to save disk
4448 * space. Pages will then also be served compressed to clients that support it.
4449 *
4450 * Requires zlib support enabled in PHP.
4451 */
4452 public const UseGzip = [
4453 'default' => false,
4454 ];
4455
4456 /**
4457 * Invalidate various caches when LocalSettings.php changes. This is equivalent
4458 * to setting $wgCacheEpoch to the modification time of LocalSettings.php, as
4459 * was previously done in the default LocalSettings.php file.
4460 *
4461 * On high-traffic wikis, this should be set to false, to avoid the need to
4462 * check the file modification time, and to avoid the performance impact of
4463 * unnecessary cache invalidations.
4464 */
4465 public const InvalidateCacheOnLocalSettingsChange = [
4466 'default' => true,
4467 ];
4468
4469 /**
4470 * When loading extensions through the extension registration system, this
4471 * can be used to invalidate the cache. A good idea would be to set this to
4472 * one file, you can just `touch` that one to invalidate the cache
4473 *
4474 * **Example:**
4475 *
4476 * ```
4477 * $wgExtensionInfoMTime = filemtime( "$IP/LocalSettings.php" );
4478 * ```
4479 *
4480 * If set to false, the mtime for each individual JSON file will be checked,
4481 * which can be slow if a large number of extensions are being loaded.
4482 */
4483 public const ExtensionInfoMTime = [
4484 'default' => false,
4485 'type' => 'integer|false',
4486 ];
4487
4488 /**
4489 * If this is set to true, phpunit will run integration tests against remote
4490 * caches defined in $wgObjectCaches.
4491 *
4492 * @since 1.38
4493 */
4494 public const EnableRemoteBagOStuffTests = [
4495 'default' => false,
4496 ];
4497
4498 // endregion -- end of cache settings
4499
4500 /***************************************************************************/
4501 // region HTTP proxy (CDN) settings
4502 /** @name HTTP proxy (CDN) settings
4503 *
4504 * Many of these settings apply to any HTTP proxy used in front of MediaWiki,
4505 * although they are sometimes still referred to as Squid settings for
4506 * historical reasons.
4507 *
4508 * Achieving a high hit ratio with an HTTP proxy requires special configuration.
4509 * See https://www.mediawiki.org/wiki/Manual:Performance_tuning#Page_view_caching
4510 * for more details.
4511 */
4512
4513 /**
4514 * Enable/disable CDN.
4515 *
4516 * See https://www.mediawiki.org/wiki/Manual:Performance_tuning#Page_view_caching
4517 *
4518 * @since 1.34 Renamed from $wgUseSquid.
4519 */
4520 public const UseCdn = [
4521 'default' => false,
4522 ];
4523
4524 /**
4525 * Add X-Forwarded-Proto to the Vary and Key headers for API requests and
4526 * RSS/Atom feeds. Use this if you have an SSL termination setup
4527 * and need to split the cache between HTTP and HTTPS for API requests,
4528 * feed requests and HTTP redirect responses in order to prevent cache
4529 * pollution. This does not affect 'normal' requests to index.php other than
4530 * HTTP redirects.
4531 */
4532 public const VaryOnXFP = [
4533 'default' => false,
4534 ];
4535
4536 /**
4537 * Internal server name as known to CDN, if different.
4538 *
4539 * **Example:**
4540 *
4541 * ```
4542 * $wgInternalServer = 'http://yourinternal.tld:8000';
4543 * ```
4544 */
4545 public const InternalServer = [
4546 'default' => false,
4547 ];
4548
4549 /**
4550 * Cache TTL for the CDN sent as s-maxage (without ESI) or
4551 * Surrogate-Control (with ESI). Without ESI, you should strip
4552 * out s-maxage in the CDN config.
4553 *
4554 * 18000 seconds = 5 hours, more cache hits with 2678400 = 31 days.
4555 *
4556 * @since 1.34 Renamed from $wgSquidMaxage
4557 */
4558 public const CdnMaxAge = [
4559 'default' => 18000,
4560 ];
4561
4562 /**
4563 * Cache timeout for the CDN when DB replica DB lag is high
4564 *
4565 * @see self::CdnMaxAge
4566 * @since 1.27
4567 */
4568 public const CdnMaxageLagged = [
4569 'default' => 30,
4570 ];
4571
4572 /**
4573 * Cache timeout when delivering a stale ParserCache response due to PoolCounter
4574 * contention.
4575 *
4576 * @since 1.35
4577 */
4578 public const CdnMaxageStale = [
4579 'default' => 10,
4580 ];
4581
4582 /**
4583 * If set, any SquidPurge call on a URL or URLs will send a second purge no less than
4584 * this many seconds later via the job queue. This requires delayed job support.
4585 *
4586 * This should be safely higher than the 'max lag' value in $wgLBFactoryConf, so that
4587 * replica DB lag does not cause page to be stuck in stales states in CDN.
4588 *
4589 * This also fixes race conditions in two-tiered CDN setups (e.g. cdn2 => cdn1 => MediaWiki).
4590 * If a purge for a URL reaches cdn2 before cdn1 and a request reaches cdn2 for that URL,
4591 * it will populate the response from the stale cdn1 value. When cdn1 gets the purge, cdn2
4592 * will still be stale. If the rebound purge delay is safely higher than the time to relay
4593 * a purge to all nodes, then the rebound purge will clear cdn2 after cdn1 was cleared.
4594 *
4595 * @since 1.27
4596 */
4597 public const CdnReboundPurgeDelay = [
4598 'default' => 0,
4599 ];
4600
4601 /**
4602 * Cache timeout for the CDN when a response is known to be wrong or incomplete (due to load)
4603 *
4604 * @see self::CdnMaxAge
4605 * @since 1.27
4606 */
4607 public const CdnMaxageSubstitute = [
4608 'default' => 60,
4609 ];
4610
4611 /**
4612 * Default maximum age for raw CSS/JS accesses
4613 *
4614 * 300 seconds = 5 minutes.
4615 */
4616 public const ForcedRawSMaxage = [
4617 'default' => 300,
4618 ];
4619
4620 /**
4621 * List of proxy servers to purge on changes; default port is 80. Use IP addresses.
4622 *
4623 * When MediaWiki is running behind a proxy, it will trust X-Forwarded-For
4624 * headers sent/modified from these proxies when obtaining the remote IP address
4625 *
4626 * For a list of trusted servers which *aren't* purged, see $wgSquidServersNoPurge.
4627 *
4628 * @since 1.34 Renamed from $wgSquidServers.
4629 */
4630 public const CdnServers = [
4631 'default' => [],
4632 'type' => 'map',
4633 ];
4634
4635 /**
4636 * As with $wgCdnServers, except these servers aren't purged on page changes;
4637 * use to set a list of trusted proxies, etc. Supports both individual IP
4638 * addresses and CIDR blocks.
4639 *
4640 * @since 1.23 Supports CIDR ranges
4641 * @since 1.34 Renamed from $wgSquidServersNoPurge
4642 */
4643 public const CdnServersNoPurge = [
4644 'default' => [],
4645 'type' => 'map',
4646 ];
4647
4648 /**
4649 * Routing configuration for HTCP multicast purging. Add elements here to
4650 * enable HTCP and determine which purges are sent where. If set to an empty
4651 * array, HTCP is disabled.
4652 *
4653 * Each key in this array is a regular expression to match against the purged
4654 * URL, or an empty string to match all URLs. The purged URL is matched against
4655 * the regexes in the order specified, and the first rule whose regex matches
4656 * is used, all remaining rules will thus be ignored.
4657 *
4658 * **Example configuration to send purges for upload.wikimedia.org to one**
4659 * multicast group and all other purges to another:
4660 *
4661 * ```
4662 * $wgHTCPRouting = [
4663 * '|^https?://upload\.wikimedia\.org|' => [
4664 * 'host' => '239.128.0.113',
4665 * 'port' => 4827,
4666 * ],
4667 * '' => [
4668 * 'host' => '239.128.0.112',
4669 * 'port' => 4827,
4670 * ],
4671 * ];
4672 * ```
4673 *
4674 * You can also pass an array of hosts to send purges too. This is useful when
4675 * you have several multicast groups or unicast address that should receive a
4676 * given purge. Multiple hosts support was introduced in MediaWiki 1.22.
4677 *
4678 * **Example of sending purges to multiple hosts:**
4679 *
4680 * ```
4681 * $wgHTCPRouting = [
4682 * '' => [
4683 * // Purges to text caches using multicast
4684 * [ 'host' => '239.128.0.114', 'port' => '4827' ],
4685 * // Purges to a hardcoded list of caches
4686 * [ 'host' => '10.88.66.1', 'port' => '4827' ],
4687 * [ 'host' => '10.88.66.2', 'port' => '4827' ],
4688 * [ 'host' => '10.88.66.3', 'port' => '4827' ],
4689 * ],
4690 * ];
4691 * ```
4692 *
4693 * @since 1.22
4694 * @see self::HTCPMulticastTTL
4695 */
4696 public const HTCPRouting = [
4697 'default' => [],
4698 'type' => 'map',
4699 ];
4700
4701 /**
4702 * HTCP multicast TTL.
4703 *
4704 * @see self::HTCPRouting
4705 */
4706 public const HTCPMulticastTTL = [
4707 'default' => 1,
4708 ];
4709
4710 /**
4711 * Should forwarded Private IPs be accepted?
4712 */
4713 public const UsePrivateIPs = [
4714 'default' => false,
4715 ];
4716
4717 /**
4718 * Set this to false if MediaWiki is behind a CDN that re-orders query
4719 * parameters on incoming requests.
4720 *
4721 * MediaWiki sets a large 'Cache-Control: s-maxage=' directive on page
4722 * views only if the request URL matches one of the normal CDN URL forms.
4723 * When 'CdnMatchParameterOrder' is false, the matching algorithm ignores
4724 * the order of URL parameters.
4725 *
4726 * @since 1.39
4727 */
4728 public const CdnMatchParameterOrder = [
4729 'default' => true,
4730 ];
4731
4732 // endregion -- end of HTTP proxy settings
4733
4734 /***************************************************************************/
4735 // region Language, regional and character encoding settings
4736 /** @name Language, regional and character encoding settings */
4737
4738 /**
4739 * Site language code. See includes/languages/data/Names.php for languages
4740 * supported by MediaWiki out of the box. Not all languages listed there have
4741 * translations, see languages/messages/ for the list of languages with some
4742 * localisation.
4743 *
4744 * Warning: Don't use any of MediaWiki's deprecated language codes listed in
4745 * LanguageCode::getDeprecatedCodeMapping or $wgDummyLanguageCodes, like "no"
4746 * for Norwegian (use "nb" instead). If you do, things will break unexpectedly.
4747 *
4748 * This defines the default interface language for all users, but users can
4749 * change it in their preferences.
4750 *
4751 * This also defines the language of pages in the wiki. The content is wrapped
4752 * in a html element with lang=XX attribute. This behavior can be overridden
4753 * via hooks, see Title::getPageLanguage.
4754 */
4755 public const LanguageCode = [
4756 'default' => 'en',
4757 ];
4758
4759 /**
4760 * Some languages need different word forms, usually for different cases.
4761 *
4762 * Used in Language::convertGrammar().
4763 *
4764 * **Example:**
4765 *
4766 * ```
4767 * $wgGrammarForms['en']['genitive']['car'] = 'car\'s';
4768 * ```
4769 */
4770 public const GrammarForms = [
4771 'default' => [],
4772 'type' => 'map',
4773 ];
4774
4775 /**
4776 * Treat language links as magic connectors, not inline links
4777 */
4778 public const InterwikiMagic = [
4779 'default' => true,
4780 ];
4781
4782 /**
4783 * Hide interlanguage links from the sidebar
4784 */
4785 public const HideInterlanguageLinks = [
4786 'default' => false,
4787 ];
4788
4789 /**
4790 * List of additional interwiki prefixes that should be treated as
4791 * interlanguage links (i.e. placed in the sidebar).
4792 *
4793 * Notes:
4794 * - This will not do anything unless the prefixes are defined in the interwiki
4795 * map.
4796 * - The display text for these custom interlanguage links will be fetched from
4797 * the system message "interlanguage-link-xyz" where xyz is the prefix in
4798 * this array.
4799 * - A friendly name for each site, used for tooltip text, may optionally be
4800 * placed in the system message "interlanguage-link-sitename-xyz" where xyz is
4801 * the prefix in this array.
4802 * - This should be a list of "interwiki prefixes" (ie, what appears in
4803 * wikitext), and you probably want to add an entry to
4804 * InterlanguageLinkCodeMap as well to specify which mediawiki internal
4805 * (or custom) language code this prefix corresponds to, and perhaps
4806 * then map that custom language code to a language name in
4807 * ExtraLanguageNames.
4808 */
4809 public const ExtraInterlanguageLinkPrefixes = [
4810 'default' => [],
4811 'type' => 'list',
4812 ];
4813
4814 /**
4815 * Map of interlanguage link codes to language codes. This is useful to override
4816 * what is shown as the language name when the interwiki code does not match it
4817 * exactly
4818 *
4819 * @since 1.35
4820 */
4821 public const InterlanguageLinkCodeMap = [
4822 'default' => [],
4823 'type' => 'map',
4824 ];
4825
4826 /**
4827 * List of language names or overrides for default names in Names.php
4828 */
4829 public const ExtraLanguageNames = [
4830 'default' => [],
4831 'type' => 'map',
4832 ];
4833
4834 /**
4835 * List of mappings from one language code to another.
4836 *
4837 * This array makes the codes not appear as a selectable language on the
4838 * installer.
4839 *
4840 * In Setup.php, the variable $wgDummyLanguageCodes is created by combining
4841 * these codes with a list of "deprecated" codes, which are mostly leftovers
4842 * from renames or other legacy things, and the internal codes 'qqq' and 'qqx'.
4843 * If a mapping in $wgExtraLanguageCodes collide with a built-in mapping, the
4844 * value in $wgExtraLanguageCodes will be used.
4845 *
4846 * @since 1.29
4847 */
4848 public const ExtraLanguageCodes = [
4849 'default' => [
4850 'bh' => 'bho',
4851 'no' => 'nb',
4852 'simple' => 'en',
4853 ],
4854 'type' => 'map',
4855 ];
4856
4857 /**
4858 * Functionally the same as $wgExtraLanguageCodes, but deprecated. Instead of
4859 * appending values to this array, append them to $wgExtraLanguageCodes.
4860 *
4861 * @note Since 1.29, this should not be set directly in LocalSettings,
4862 * ExtraLanguageCodes should be set instead. However, DummyLanguageCodes
4863 * will be initialized and can be read internally.
4864 */
4865 public const DummyLanguageCodes = [
4866 'default' => [],
4867 'type' => 'map',
4868 ];
4869
4870 /**
4871 * Set this to always convert certain Unicode sequences to modern ones
4872 * regardless of the content language. This has a small performance
4873 * impact.
4874 *
4875 * @since 1.17
4876 */
4877 public const AllUnicodeFixes = [
4878 'default' => false,
4879 ];
4880
4881 /**
4882 * Set this to eg 'ISO-8859-1' to perform character set conversion when
4883 * loading old revisions not marked with "utf-8" flag. Use this when
4884 * converting a wiki from MediaWiki 1.4 or earlier to UTF-8 without the
4885 * burdensome mass conversion of old text data.
4886 *
4887 * @note This DOES NOT touch any fields other than old_text. Titles, comments,
4888 * user names, etc still must be converted en masse in the database before
4889 * continuing as a UTF-8 wiki.
4890 */
4891 public const LegacyEncoding = [
4892 'default' => false,
4893 ];
4894
4895 /**
4896 * Enable dates like 'May 12' instead of '12 May', if the default date format
4897 * is 'dmy or mdy'.
4898 */
4899 public const AmericanDates = [
4900 'default' => false,
4901 ];
4902
4903 /**
4904 * For Hindi and Arabic use local numerals instead of Western style (0-9)
4905 * numerals in interface.
4906 */
4907 public const TranslateNumerals = [
4908 'default' => true,
4909 ];
4910
4911 /**
4912 * Translation using MediaWiki: namespace.
4913 *
4914 * Interface messages will be loaded from the database.
4915 */
4916 public const UseDatabaseMessages = [
4917 'default' => true,
4918 ];
4919
4920 /**
4921 * Maximum entry size in the message cache, in bytes
4922 */
4923 public const MaxMsgCacheEntrySize = [
4924 'default' => 10000,
4925 ];
4926
4927 /**
4928 * Whether to enable language variant conversion.
4929 */
4930 public const DisableLangConversion = [
4931 'default' => false,
4932 ];
4933
4934 /**
4935 * Whether to enable language variant conversion for links.
4936 * Note that this option is slightly misnamed.
4937 */
4938 public const DisableTitleConversion = [
4939 'default' => false,
4940 ];
4941
4942 /**
4943 * Default variant code. If false, the default will be the static default
4944 * variant of the language.
4945 */
4946 public const DefaultLanguageVariant = [
4947 'default' => false,
4948 ];
4949
4950 /**
4951 * Whether to enable the pig Latin variant of English (en-x-piglatin),
4952 * used to ease variant development work.
4953 */
4954 public const UsePigLatinVariant = [
4955 'default' => false,
4956 ];
4957
4958 /**
4959 * Disabled variants array of language variant conversion.
4960 *
4961 * **Example:**
4962 *
4963 * ```
4964 * $wgDisabledVariants[] = 'zh-mo';
4965 * $wgDisabledVariants[] = 'zh-my';
4966 * ```
4967 */
4968 public const DisabledVariants = [
4969 'default' => [],
4970 'type' => 'map',
4971 ];
4972
4973 /**
4974 * Like $wgArticlePath, but on multi-variant wikis, this provides a
4975 * path format that describes which parts of the URL contain the
4976 * language variant.
4977 *
4978 * **Example:**
4979 *
4980 * ```
4981 * $wgLanguageCode = 'sr';
4982 * $wgVariantArticlePath = '/$2/$1';
4983 * $wgArticlePath = '/wiki/$1';
4984 * ```
4985 *
4986 * A link to /wiki/ would be redirected to /sr/Главна_страна
4987 *
4988 * It is important that $wgArticlePath not overlap with possible values
4989 * of $wgVariantArticlePath.
4990 */
4991 public const VariantArticlePath = [
4992 'default' => false,
4993 ];
4994
4995 /**
4996 * Whether to enable the 'x-xss' language code, used for development.
4997 *
4998 * When enabled, the language code 'x-xss' (e.g. via ?uselang=x-xss) can
4999 * be used to test correct message escaping at scale, to prevent
5000 * cross-site scripting. In this "language", every message becomes an HTML
5001 * snippet which attempts to alert the message key. Well-written code will
5002 * correctly escape all of these messages. If any alerts are actually
5003 * fired in the browser, the message is not being escaped correctly;
5004 * either the offending code should be fixed, or the message should be
5005 * added to {@link self::RawHtmlMessages}.
5006 *
5007 * @see https://www.mediawiki.org/wiki/Special:MyLanguage/Cross-site_scripting
5008 * @since 1.41
5009 */
5010 public const UseXssLanguage = [
5011 'default' => false,
5012 ];
5013
5014 /**
5015 * Show a bar of language selection links in the user login and user
5016 * registration forms; edit the "loginlanguagelinks" message to
5017 * customise these.
5018 */
5019 public const LoginLanguageSelector = [
5020 'default' => false,
5021 ];
5022
5023 /**
5024 * When translating messages with wfMessage(), it is not always clear what
5025 * should be considered UI messages and what should be content messages.
5026 *
5027 * For example, for the English Wikipedia, there should be only one 'mainpage',
5028 * so when getting the link for 'mainpage', we should treat it as site content
5029 * and call ->inContentLanguage()->text(), but for rendering the text of the
5030 * link, we call ->text(). The code behaves this way by default. However,
5031 * sites like the Wikimedia Commons do offer different versions of 'mainpage'
5032 * and the like for different languages. This array provides a way to override
5033 * the default behavior.
5034 *
5035 * **Example:**
5036 * To allow language-specific main page and community
5037 * portal:
5038 *
5039 * ```
5040 * $wgForceUIMsgAsContentMsg = [ 'mainpage', 'portal-url' ];
5041 * ```
5042 */
5043 public const ForceUIMsgAsContentMsg = [
5044 'default' => [],
5045 'type' => 'map',
5046 ];
5047
5048 /**
5049 * List of messages which might contain raw HTML.
5050 *
5051 * Extensions should add their insecure raw HTML messages to extension.json.
5052 * The list is used for access control:
5053 * changing messages listed here will require editsitecss and editsitejs rights.
5054 *
5055 * Message names must be given with underscores rather than spaces and with lowercase first
5056 * letter.
5057 *
5058 * @since 1.32
5059 */
5060 public const RawHtmlMessages = [
5061 'default' => [
5062 'copyright',
5063 'history_copyright',
5064 'googlesearch',
5065 ],
5066 'type' => 'list',
5067 'items' => [ 'type' => 'string', ],
5068 ];
5069
5070 /**
5071 * Whether on-wiki overrides for the 'copyright' and 'history_copyright' messages, which allow raw
5072 * HTML, will be used.
5073 *
5074 * @since 1.43
5075 */
5076 public const AllowRawHtmlCopyrightMessages = [
5077 'default' => true,
5078 'type' => 'boolean',
5079 ];
5080
5081 /**
5082 * Fake out the timezone that the server thinks it's in. This will be used for
5083 * date display and not for what's stored in the DB. Leave to null to retain
5084 * your server's OS-based timezone value.
5085 *
5086 * This variable is currently used only for signature formatting and for local
5087 * time/date parser variables ({{LOCALTIME}} etc.)
5088 *
5089 * Timezones can be translated by editing MediaWiki messages of type
5090 * timezone-nameinlowercase like timezone-utc.
5091 *
5092 * A list of usable timezones can found at:
5093 * https://www.php.net/manual/en/timezones.php
5094 *
5095 * **Examples:**
5096 *
5097 * ```
5098 * $wgLocaltimezone = 'UTC';
5099 * $wgLocaltimezone = 'GMT';
5100 * $wgLocaltimezone = 'PST8PDT';
5101 * $wgLocaltimezone = 'Europe/Sweden';
5102 * $wgLocaltimezone = 'CET';
5103 * ```
5104 */
5105 public const Localtimezone = [
5106 'dynamicDefault' => true,
5107 ];
5108
5109 public static function getDefaultLocaltimezone(): string {
5110 // This defaults to the `date.timezone` value of the PHP INI option. If this option is not set,
5111 // it falls back to UTC.
5112 $localtimezone = date_default_timezone_get();
5113 if ( !$localtimezone ) {
5114 // Make doubly sure we have a valid time zone, even if date_default_timezone_get()
5115 // returned garbage.
5116 $localtimezone = 'UTC';
5117 }
5118
5119 return $localtimezone;
5120 }
5121
5122 /**
5123 * Set an offset from UTC in minutes to use for the default timezone setting
5124 * for anonymous users and new user accounts.
5125 *
5126 * This setting is used for most date/time displays in the software, and is
5127 * overridable in user preferences. It is *not* used for signature timestamps.
5128 *
5129 * By default, this will be set to match $wgLocaltimezone.
5130 */
5131 public const LocalTZoffset = [
5132 'dynamicDefault' => [ 'use' => [ 'Localtimezone' ] ]
5133 ];
5134
5135 public static function getDefaultLocalTZoffset( $localtimezone ): int {
5136 // NOTE: Extra fallback, in case $localtimezone is ''.
5137 // Many extsing LocalSettings files have $wgLocaltimezone = ''
5138 // in them, erroneously generated by the installer.
5139 $localtimezone = $localtimezone ?: self::getDefaultLocaltimezone();
5140
5141 try {
5142 $timezone = new DateTimeZone( $localtimezone );
5143 } catch ( \Exception $e ) {
5144 throw new ConfigException(
5145 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",
5146 $localtimezone,
5147 "wgLocaltimezone",
5148 $e->getMessage() ),
5149 );
5150 }
5151
5152 $offset = $timezone->getOffset( new DateTime() );
5153
5154 return (int)( $offset / 60 );
5155 }
5156
5157 /**
5158 * Map of Unicode characters for which capitalization is overridden in
5159 * Language::ucfirst. The characters should be
5160 * represented as char_to_convert => conversion_override. See T219279 for details
5161 * on why this is useful during php version transitions.
5162 *
5163 * @since 1.34
5164 */
5165 public const OverrideUcfirstCharacters = [
5166 'default' => [],
5167 'type' => 'map',
5168 ];
5169
5170 // endregion -- End of language/charset settings
5171
5172 /***************************************************************************/
5173 // region Output format and skin settings
5174 /** @name Output format and skin settings */
5175
5176 /**
5177 * The default Content-Type header.
5178 */
5179 public const MimeType = [
5180 'default' => 'text/html',
5181 ];
5182
5183 /**
5184 * Defines the value of the version attribute in the &lt;html&gt; tag, if any.
5185 *
5186 * If your wiki uses RDFa, set it to the correct value for RDFa+HTML5.
5187 * Correct current values are 'HTML+RDFa 1.0' or 'XHTML+RDFa 1.0'.
5188 * See also https://www.w3.org/TR/rdfa-in-html/#document-conformance
5189 *
5190 * @since 1.16
5191 */
5192 public const Html5Version = [
5193 'default' => null,
5194 ];
5195
5196 /**
5197 * Whether to label the store-to-database-and-show-to-others button in the editor
5198 * as "Save page"/"Save changes" if false (the default) or, if true, instead as
5199 * "Publish page"/"Publish changes".
5200 *
5201 * @since 1.28
5202 */
5203 public const EditSubmitButtonLabelPublish = [
5204 'default' => false,
5205 ];
5206
5207 /**
5208 * Permit other namespaces in addition to the w3.org default.
5209 *
5210 * Use the prefix for the key and the namespace for the value.
5211 *
5212 * **Example:**
5213 *
5214 * ```
5215 * $wgXhtmlNamespaces['svg'] = 'http://www.w3.org/2000/svg';
5216 * ```
5217 *
5218 * Normally we wouldn't have to define this in the root "<html>"
5219 * element, but IE needs it there in some circumstances.
5220 *
5221 * This is ignored if $wgMimeType is set to a non-XML MIME type.
5222 */
5223 public const XhtmlNamespaces = [
5224 'default' => [],
5225 'type' => 'map',
5226 ];
5227
5228 /**
5229 * Site notice shown at the top of each page
5230 *
5231 * MediaWiki:Sitenotice page, which will override this. You can also
5232 * provide a separate message for logged-out users using the
5233 * MediaWiki:Anonnotice page.
5234 */
5235 public const SiteNotice = [
5236 'default' => '',
5237 ];
5238
5239 /**
5240 * Override the ability of certain browsers to attempt to autodetect dataformats in pages.
5241 *
5242 * This is a default feature of many mobile browsers, but can have a lot of false positives,
5243 * where for instance, year ranges are confused with phone numbers.
5244 * The default of this setting is to disable telephone number data detection.
5245 * Set BrowserFormatDetection to false to fallback to the browser defaults.
5246 *
5247 * @since 1.37
5248 * @see https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html
5249 */
5250 public const BrowserFormatDetection = [
5251 'default' => 'telephone=no',
5252 'type' => 'string',
5253 ];
5254
5255 /**
5256 * An array of open graph tags which should be added by all skins.
5257 *
5258 * Accepted values are "og:site_name", "og:title", "og:type" and "twitter:card".
5259 * Since some of these fields can be provided by extensions it defaults to an empty array.
5260 *
5261 * @since 1.36
5262 */
5263 public const SkinMetaTags = [
5264 'default' => [],
5265 'type' => 'map',
5266 ];
5267
5268 /**
5269 * Default skin, for new users and anonymous visitors. Registered users may
5270 * change this to any one of the other available skins in their preferences.
5271 */
5272 public const DefaultSkin = [
5273 'default' => 'vector-2022',
5274 ];
5275
5276 /**
5277 * Fallback skin used when the skin defined by $wgDefaultSkin can't be found.
5278 *
5279 * @since 1.24
5280 */
5281 public const FallbackSkin = [
5282 'default' => 'fallback',
5283 ];
5284
5285 /**
5286 * Specify the names of skins that should not be presented in the list of
5287 * available skins in user preferences.
5288 *
5289 * NOTE: This does not uninstall the skin, and it will still be accessible
5290 * via the `useskin` query parameter. To uninstall a skin, remove its inclusion
5291 * from LocalSettings.php.
5292 *
5293 * @see \SkinFactory::getAllowedSkins
5294 */
5295 public const SkipSkins = [
5296 'default' => [],
5297 'type' => 'map',
5298 ];
5299
5300 /**
5301 * Disable output compression (enabled by default if zlib is available)
5302 */
5303 public const DisableOutputCompression = [
5304 'default' => false,
5305 ];
5306
5307 /**
5308 * How should section IDs be encoded?
5309 * This array can contain 1 or 2 elements, each of them can be one of:
5310 * - 'html5' is modern HTML5 style encoding with minimal escaping. Displays Unicode
5311 * characters in most browsers' address bars.
5312 *
5313 * - 'legacy' is old MediaWiki-style encoding, e.g. 啤酒 turns into .E5.95.A4.E9.85.92
5314 *
5315 * The first element of this array specifies the primary mode of escaping IDs. This
5316 * is what users will see when they e.g. follow an [[#internal link]] to a section of
5317 * a page.
5318 *
5319 * The optional second element defines a fallback mode, useful for migrations.
5320 * If present, it will direct MediaWiki to add empty <span>s to every section with its
5321 * id attribute set to fallback encoded title so that links using the previous encoding
5322 * would still work.
5323 *
5324 * Example: you want to migrate your wiki from 'legacy' to 'html5'
5325 *
5326 * On the first step, set this variable to [ 'legacy', 'html5' ]. After a while, when
5327 * all caches (parser, HTTP, etc.) contain only pages generated with this setting,
5328 * flip the value to [ 'html5', 'legacy' ]. This will result in all internal links being
5329 * generated in the new encoding while old links (both external and cached internal) will
5330 * still work. After a long time, you might want to ditch backwards compatibility and
5331 * set it to [ 'html5' ]. After all, pages get edited, breaking incoming links no matter which
5332 * fragment mode is used.
5333 *
5334 * @since 1.30
5335 */
5336 public const FragmentMode = [
5337 'default' => [ 'html5', 'legacy', ],
5338 'type' => 'list',
5339 ];
5340
5341 /**
5342 * Which ID escaping mode should be used for external interwiki links? See documentation
5343 * for $wgFragmentMode above for details of each mode. Because you can't control external sites,
5344 * this setting should probably always be 'legacy', unless every wiki you link to has converted
5345 * to 'html5'.
5346 *
5347 * @since 1.30
5348 */
5349 public const ExternalInterwikiFragmentMode = [
5350 'default' => 'legacy',
5351 ];
5352
5353 /**
5354 * Abstract list of footer icons for skins in place of old copyrightico and poweredbyico code
5355 * You can add new icons to the built in copyright or poweredby, or you can create
5356 * a new block. Though note that you may need to add some custom css to get good styling
5357 * of new blocks in monobook. vector and modern should work without any special css.
5358 *
5359 * $wgFooterIcons itself is a key/value array.
5360 * The key is the name of a block that the icons will be wrapped in. The final id varies
5361 * by skin; Monobook and Vector will turn poweredby into f-poweredbyico while Modern
5362 * turns it into mw_poweredby.
5363 * The value is either key/value array of icons or a string.
5364 * In the key/value array the key may or may not be used by the skin but it can
5365 * be used to find the icon and unset it or change the icon if needed.
5366 * This is useful for disabling icons that are set by extensions.
5367 * The value should be either a string or an array. If it is a string it will be output
5368 * directly as html, however some skins may choose to ignore it. An array is the preferred
5369 * format for the icon, the following keys are used:
5370 * - src: An absolute url to the image to use for the icon, this is recommended
5371 * but not required, however some skins will ignore icons without an image
5372 * - srcset: optional additional-resolution images; see HTML5 specs
5373 * - url: The url to use in the a element around the text or icon, if not set an a element will
5374 * not be outputted
5375 * - alt: This is the text form of the icon, it will be displayed without an image in
5376 * skins like Modern or if src is not set, and will otherwise be used as
5377 * the alt="" for the image. This key is required.
5378 * - width and height: If the icon specified by src is not of the standard size
5379 * you can specify the size of image to use with these keys.
5380 * Otherwise they will default to the standard 88x31.
5381 *
5382 * @todo Reformat documentation.
5383 */
5384 public const FooterIcons = [
5385 'default' => [
5386 "copyright" => [
5387 "copyright" => [], // placeholder for the built in copyright icon
5388 ],
5389 "poweredby" => [
5390 "mediawiki" => [
5391 // Defaults to point at
5392 // "$wgResourceBasePath/resources/assets/poweredby_mediawiki_88x31.png"
5393 // plus srcset for 1.5x, 2x resolution variants.
5394 "src" => null,
5395 "url" => "https://www.mediawiki.org/",
5396 "alt" => "Powered by MediaWiki",
5397 ]
5398 ],
5399 ],
5400 'type' => 'map',
5401 ];
5402
5403 /**
5404 * Login / create account link behavior when it's possible for anonymous users
5405 * to create an account.
5406 *
5407 * - true = use a combined login / create account link
5408 * - false = split login and create account into two separate links
5409 */
5410 public const UseCombinedLoginLink = [
5411 'default' => false,
5412 ];
5413
5414 /**
5415 * Display user edit counts in various prominent places.
5416 */
5417 public const Edititis = [
5418 'default' => false,
5419 ];
5420
5421 /**
5422 * Some web hosts attempt to rewrite all responses with a 404 (not found)
5423 * status code, mangling or hiding MediaWiki's output. If you are using such a
5424 * host, you should start looking for a better one. While you're doing that,
5425 * set this to false to convert some of MediaWiki's 404 responses to 200 so
5426 * that the generated error pages can be seen.
5427 *
5428 * In cases where for technical reasons it is more important for MediaWiki to
5429 * send the correct status code than for the body to be transmitted intact,
5430 * this configuration variable is ignored.
5431 */
5432 public const Send404Code = [
5433 'default' => true,
5434 ];
5435
5436 /**
5437 * The $wgShowRollbackEditCount variable is used to show how many edits can be rolled back.
5438 *
5439 * The numeric value of the variable controls how many edits MediaWiki will look back to
5440 * determine whether a rollback is allowed (by checking that they are all from the same author).
5441 * If the value is false or 0, the edits are not counted. Disabling this will prevent MediaWiki
5442 * from hiding some useless rollback links.
5443 *
5444 * @since 1.20
5445 */
5446 public const ShowRollbackEditCount = [
5447 'default' => 10,
5448 ];
5449
5450 /**
5451 * Output a <link rel="canonical"> tag on every page indicating the canonical
5452 * server which should be used, i.e. $wgServer or $wgCanonicalServer. Since
5453 * detection of the current server is unreliable, the link is sent
5454 * unconditionally.
5455 */
5456 public const EnableCanonicalServerLink = [
5457 'default' => false,
5458 ];
5459
5460 /**
5461 * List of interwiki logos overrides.
5462 * This is used by the sister project sidebar. This list accept a key equal to the
5463 * interwiki ID (as defined in the interwiki links), and accept a Codex icon name
5464 * (https://doc.wikimedia.org/codex/latest/icons/all-icons.html) or a base URL for
5465 * the given interwiki.
5466 *
5467 * Example :
5468 * $wgInterwikiLogoOverride = [
5469 * 'c' => 'logoWikimediaCommons',
5470 * 'wikit' => 'https://mySpecialWiki.com'
5471 * ];
5472 */
5473 public const InterwikiLogoOverride = [
5474 'default' => [],
5475 'type' => 'list',
5476 'items' => [ 'type' => 'string', ],
5477 ];
5478
5479 // endregion -- End of output format settings
5480
5481 /***************************************************************************/
5482 // region ResourceLoader settings
5483 /** @name ResourceLoader settings */
5484
5485 /**
5486 * Formerly a workaround for a security vulnerability caused by installation
5487 * of Flash as a browser extension.
5488 *
5489 * @since 1.25
5490 * @deprecated since 1.39
5491 */
5492 public const MangleFlashPolicy = [
5493 'default' => true,
5494 'obsolete' => 'Since 1.39; no longer has any effect.',
5495 'description' => 'Has been emitting warnings since 1.39 (LTS). ' .
5496 'Can be removed completely in 1.44, assuming 1.43 is an LTS release.'
5497 ];
5498
5499 /**
5500 * Define extra client-side modules to be registered with ResourceLoader.
5501 *
5502 * @note It is recommended to define modules using the `ResourceModule` attribute
5503 * in `extension.json` or `skin.json` when possible (instead of via PHP global variables).
5504 *
5505 * Registration is internally handled by ResourceLoader::register.
5506 *
5507 * ## Available modules
5508 *
5509 * Modules that ship with %MediaWiki core are registered via
5510 * resources/Resources.php. For a full list with documentation, see:
5511 * [ResourceLoader/Core_modules](https://www.mediawiki.org/wiki/ResourceLoader/Core_modules).
5512 *
5513 * ## Options
5514 *
5515 * - class `{string}`:
5516 * By default a module is assumed to bundle file resources
5517 * as handled by the MediaWiki\ResourceLoader\FileModule class. Use this option
5518 * to use a different implementation of MediaWiki\ResourceLoader\Module instead.
5519 *
5520 * Default: `\MediaWiki\ResourceLoader\FileModule`
5521 *
5522 * - factory `{string}`:
5523 * Override the instantiation of the MediaWiki\ResourceLoader\Module
5524 * class using a PHP callback. This allows dependency injection to be used.
5525 * This option cannot be combined with the `class` option.
5526 *
5527 * Since: MW 1.30
5528 *
5529 * - dependencies `{string[]|string}`:
5530 * Modules that must be executed before this module.
5531 * Module name string or list of module name strings.
5532 *
5533 * Default: `[]`
5534 *
5535 * - deprecated `{boolean|string}`:
5536 * Whether the module is deprecated and usage is discouraged.
5537 * Set to boolean true, or a string to include in the warning message.
5538 *
5539 * Default: `false`
5540 *
5541 * - group `{string}`:
5542 * Optional request group to override which modules may be downloaded
5543 * together in an HTTP batch request. By default, any two modules may be
5544 * loaded together in the same batch request. Set this option to a
5545 * descriptive string to give the module its own HTTP request. To allow
5546 * other modules to join this new request, give those the same request group.
5547 *
5548 * Use this option with caution. The default behaviour is well-tuned already,
5549 * and setting this often does more harm than good. For more about request
5550 * balancing optimisations, see
5551 * [ResourceLoader/Architecture#Balance](https://www.mediawiki.org/wiki/ResourceLoader/Architecture#Balance).
5552 *
5553 * - skipFunction `{string}`:
5554 * Allow this module to be satisfied as dependency without actually loading
5555 * or executing scripts from the server, if the specified JavaScript function
5556 * returns true.
5557 *
5558 * Use this to provide polyfills that are natively available in newer browsers.
5559 * Specify the relative path to a JavaScript file containing a top-level return
5560 * statement. The contents of the file should not contain any wrapping function,
5561 * it will be wrapped by %ResourceLoader in an anonymous function and invoked
5562 * when the module is considered for loading.
5563 *
5564 * ## FileModule options
5565 *
5566 * - localBasePath `{string}`:
5567 * Base file path to prepend to relative file paths specified in other options.
5568 *
5569 * Default: `$IP`
5570 *
5571 * - remoteBasePath `{string}`:
5572 * Base URL path to prepend to relative file paths specified in other options.
5573 * This is used to form URLs for files, such as when referencing images in
5574 * stylesheets, or in debug mode to serve JavaScript files directly.
5575 *
5576 * Default: @ref $wgResourceBasePath (which defaults to @ref $wgScriptPath)
5577 *
5578 * - remoteExtPath `{string}`:
5579 * Shortcut for `remoteBasePath` that is relative to $wgExtensionAssetsPath.
5580 * Use this when defining modules from an extension, so as to avoid hardcoding
5581 * the script path of the %MediaWiki install or the location of the extensions
5582 * directory.
5583 *
5584 * This option is mutually exclusive with `remoteBasePath`.
5585 *
5586 * - styles `{string[]|string|array<string,array>}`:
5587 * Styles to always include in the module.
5588 * %File path or list of file paths, relative to `localBasePath`.
5589 * The stylesheet can be automatically wrapped in a `@media` query by specifying
5590 * the file path as the key in an object (instead of the value), with the value
5591 * specifying a `media` query.
5592 *
5593 * See @ref wgResourceModules-example-stylesheet "Stylesheet examples" below.
5594 *
5595 * See also @ref $wgResourceModuleSkinStyles.
5596 *
5597 * Extended options:
5598 *
5599 * - skinStyles `{string[]|string}`: Styles to include in specific skin contexts.
5600 * Array keyed is by skin name with file path or list of file paths as value,
5601 * relative to `localBasePath`.
5602 *
5603 * Default: `[]`
5604 *
5605 * - noflip `{boolean}`:
5606 * By default, CSSJanus will be used automatically to perform LTR-to-RTL flipping
5607 * when loaded in a right-to-left (RTL) interface language context.
5608 * Use this option to skip CSSJanus LTR-to-RTL flipping for this module, for example
5609 * when registering an external library that already handles RTL styles.
5610 *
5611 * Default: `false`
5612 *
5613 * - packageFiles `{string[]|array[]}`
5614 * Specify script files and (virtual) data files to include in the module.
5615 * Each internal JavaScript file retains its own local module scope and its
5616 * private exports can be accessed separately by other client-side code in the
5617 * same module, via the local `require()` function.
5618 *
5619 * Modules that use package files should export any public API methods using
5620 * `module.exports`.
5621 *
5622 * See examples at
5623 * [ResourceLoader/Package_files](https://www.mediawiki.org/wiki/ResourceLoader/Package_files)
5624 * on mediawiki.org.
5625 *
5626 * The `packageFiles` feature cannot be combined with legacy scripts that use
5627 * the `scripts` option, including its extended variants `languageScripts`,
5628 * `skinScripts`, and `debugScripts`.
5629 *
5630 * Since: MW 1.33
5631 *
5632 * Default: `[]`
5633 *
5634 * - scripts `{string[]|string|array[]}`:
5635 * Scripts to always include in the module.
5636 * %File path or list of file paths, relative to `localBasePath`.
5637 *
5638 * These files are concatenated blindly and executed as a single client-side script.
5639 * Modules using this option are sometimes referred to as "legacy scripts" to
5640 * distinguish them from those that use the `packageFiles` option.
5641 *
5642 * Modules that use legacy scripts usually attach any public APIs they have
5643 * to the `mw` global variable. If a module contains just one file, it is also
5644 * supported to use the newer `module.exports` mechanism, though if the module
5645 * contains more than one legacy script, it is considered unsafe and unsupported
5646 * to use this mechanism (use `packageFiles` instead). See also
5647 * [Coding
5648 * conventions/JavaScript](https://www.mediawiki.org/wiki/Manual:Coding_conventions/JavaScript#Exporting).
5649 *
5650 * Since MW 1.41, an element of `scripts` may be an array in the same format as
5651 * packageFiles, giving a callback to call for content generation.
5652 *
5653 * Default: `[]`
5654 *
5655 * Extended options, concatenated in this order:
5656 *
5657 * - languageScripts `{string[]|string|array[]}`: Scripts to include in specific
5658 * language contexts. Array is keyed by language code with file path or list of
5659 * file path.
5660 * - skinScripts `{string[]|string|array[]}`: Scripts to include in specific skin contexts.
5661 * Array keyed is by skin name with file path or list of file paths.
5662 * - debugScripts `{string[]|string|array[]}`: Scripts to include in debug contexts.
5663 * %File path or list of file paths.
5664 *
5665 * - messages `{string[]}`
5666 * Localisation messages to bundle with this module, for client-side use
5667 * via `mw.msg()` and `mw.message()`. List of message keys.
5668 *
5669 * Default: `[]`
5670 *
5671 * - templates `{string[]}`
5672 * List of template files to be loaded for client-side usage via `mw.templates`.
5673 *
5674 * Default: `[]`
5675 *
5676 * - es6 `{boolean}`:
5677 * Since: MW 1.36; ignored since MW 1.41.
5678 *
5679 * Default: `true`
5680 *
5681 * - skipStructureTest `{boolean}`:
5682 * Whether to skip ResourcesTest::testRespond(). Since MW 1.42.
5683 *
5684 * Default: `false`.
5685 *
5686 * ## Examples
5687 *
5688 * **Example: Using an alternate subclass**
5689 *
5690 * ```
5691 * $wgResourceModules['ext.myExtension'] = [
5692 * 'class' => \MediaWiki\ResourceLoader\WikiModule::class,
5693 * ];
5694 * ```
5695 *
5696 * **Example: Deprecated module**
5697 *
5698 * ```
5699 * $wgResourceModules['ext.myExtension'] = [
5700 * 'deprecated' => 'You should use ext.myExtension2 instead',
5701 * ];
5702 * ```
5703 *
5704 * **Example: Base paths in extension.json**
5705 *
5706 * ```
5707 * "ext.myExtension": {
5708 * "localBasePath": "modules/ext.MyExtension",
5709 * "remoteExtPath": "MyExtension/modules/ext.MyExtension"
5710 * }
5711 * ```
5712 *
5713 * **Example: Base paths in core with PHP**
5714 *
5715 * ```
5716 * $wgResourceModules['mediawiki.example'] = [
5717 * 'localBasePath' => "$IP/resources/src/mediawiki.example",
5718 * 'remoteBasePath' => "$wgResourceBasePath/resources/src/mediawiki.example",
5719 * ];
5720 * ```
5721 *
5722 * **Example: Define a skip function**
5723 *
5724 * ```
5725 * $wgResourceModules['ext.myExtension.SomeWebAPI'] = [
5726 * 'skipFunction' => 'skip-SomeWebAPI.js',
5727 * ];
5728 * ```
5729 *
5730 * **Example: Contents of skip function file**
5731 *
5732 * ```
5733 * return typeof SomeWebAPI === 'function' && SomeWebAPI.prototype.duckMethod;
5734 * ```
5735 * @anchor wgResourceModules-example-stylesheet
5736 *
5737 * **Example: Stylesheets**
5738 *
5739 * ```
5740 * $wgResourceModules['example'] = [
5741 * 'styles' => [
5742 * 'foo.css',
5743 * 'bar.css',
5744 * ],
5745 * ];
5746 * $wgResourceModules['example.media'] = [
5747 * 'styles' => [
5748 * 'foo.css' => [ 'media' => 'print' ],
5749 * ];
5750 * $wgResourceModules['example.mixed'] = [
5751 * 'styles' => [
5752 * 'foo.css',
5753 * 'bar.css' => [ 'media' => 'print' ],
5754 * ],
5755 * ];
5756 * ```
5757 *
5758 * **Example: Package files**
5759 *
5760 * ```
5761 * "ext.myExtension": {
5762 * "localBasePath": "modules/ext.MyExtension",
5763 * "remoteExtPath": "MyExtension/modules/ext.MyExtension",
5764 * "packageFiles": [
5765 * "index.js",
5766 * "utils.js",
5767 * "data.json"
5768 * ]
5769 * }
5770 * }
5771 * ```
5772 *
5773 * **Example: Legacy scripts**
5774 *
5775 * ```
5776 * $wgResourceModules['ext.myExtension'] = [
5777 * 'scripts' => [
5778 * 'modules/ext.myExtension/utils.js',
5779 * 'modules/ext.myExtension/myExtension.js',
5780 * ],
5781 * 'languageScripts' => [
5782 * 'bs' => 'modules/ext.myExtension/languages/bs.js',
5783 * 'fi' => 'modules/ext.myExtension/languages/fi.js',
5784 * ],
5785 * 'skinScripts' => [
5786 * 'default' => 'modules/ext.myExtension/skin-default.js',
5787 * ],
5788 * 'debugScripts' => [
5789 * 'modules/ext.myExtension/debug.js',
5790 * ],
5791 * ];
5792 * ```
5793 *
5794 * **Example: Template files**
5795 *
5796 * ```
5797 * $wgResourceModules['ext.myExtension'] = [
5798 * 'templates' => [
5799 * 'templates/template.html',
5800 * 'templates/template2.html',
5801 * ],
5802 * ];
5803 * ```
5804 * @since 1.17
5805 */
5806 public const ResourceModules = [
5807 'default' => [],
5808 'type' => 'map',
5809 ];
5810
5811 /**
5812 * Add extra skin-specific styles to a resource module.
5813 *
5814 * These are automatically added by ResourceLoader to the 'skinStyles' list of
5815 * the existing module. The 'styles' list cannot be modified or disabled.
5816 *
5817 * For example, below a module "bar" is defined and skin Foo provides additional
5818 * styles for it:
5819 *
5820 * **Example:**
5821 *
5822 * ```
5823 * $wgResourceModules['bar'] = [
5824 * 'scripts' => 'resources/bar/bar.js',
5825 * 'styles' => 'resources/bar/main.css',
5826 * ];
5827 *
5828 * $wgResourceModuleSkinStyles['foo'] = [
5829 * 'bar' => 'skins/Foo/bar.css',
5830 * ];
5831 * ```
5832 *
5833 * This is effectively equivalent to:
5834 *
5835 * **Equivalent:**
5836 *
5837 * ```
5838 * $wgResourceModules['bar'] = [
5839 * 'scripts' => 'resources/bar/bar.js',
5840 * 'styles' => 'resources/bar/main.css',
5841 * 'skinStyles' => [
5842 * 'foo' => skins/Foo/bar.css',
5843 * ],
5844 * ];
5845 * ```
5846 *
5847 * If the module already defines its own entry in `skinStyles` for a given skin, then
5848 * $wgResourceModuleSkinStyles is ignored.
5849 *
5850 * If a module defines a `skinStyles['default']` the skin may want to extend that instead
5851 * of replacing it. This can be done using the `+` prefix.
5852 *
5853 * **Example:**
5854 *
5855 * ```
5856 * $wgResourceModules['bar'] = [
5857 * 'scripts' => 'resources/bar/bar.js',
5858 * 'styles' => 'resources/bar/basic.css',
5859 * 'skinStyles' => [
5860 * 'default' => 'resources/bar/additional.css',
5861 * ],
5862 * ];
5863 * // Note the '+' character:
5864 * $wgResourceModuleSkinStyles['foo'] = [
5865 * '+bar' => 'skins/Foo/bar.css',
5866 * ];
5867 * ```
5868 *
5869 * This is effectively equivalent to:
5870 *
5871 * **Equivalent:**
5872 *
5873 * ```
5874 * $wgResourceModules['bar'] = [
5875 * 'scripts' => 'resources/bar/bar.js',
5876 * 'styles' => 'resources/bar/basic.css',
5877 * 'skinStyles' => [
5878 * 'default' => 'resources/bar/additional.css',
5879 * 'foo' => [
5880 * 'resources/bar/additional.css',
5881 * 'skins/Foo/bar.css',
5882 * ],
5883 * ],
5884 * ];
5885 * ```
5886 *
5887 * In other words, as a module author, use the `styles` list for stylesheets that may not be
5888 * disabled by a skin. To provide default styles that may be extended or replaced,
5889 * use `skinStyles['default']`.
5890 *
5891 * As with $wgResourceModules, always set the localBasePath and remoteBasePath
5892 * keys (or one of remoteExtPath/remoteSkinPath).
5893 *
5894 * **Example:**
5895 *
5896 * ```
5897 * $wgResourceModuleSkinStyles['foo'] = [
5898 * 'bar' => 'bar.css',
5899 * 'quux' => 'quux.css',
5900 * 'remoteSkinPath' => 'Foo',
5901 * 'localBasePath' => __DIR__,
5902 * ];
5903 * ```
5904 */
5905 public const ResourceModuleSkinStyles = [
5906 'default' => [],
5907 'type' => 'map',
5908 ];
5909
5910 /**
5911 * Extensions should register foreign module sources here. 'local' is a
5912 * built-in source that is not in this array, but defined by
5913 * ResourceLoader::__construct() so that it cannot be unset.
5914 *
5915 * **Example:**
5916 *
5917 * ```
5918 * $wgResourceLoaderSources['foo'] = 'http://example.org/w/load.php';
5919 * ```
5920 */
5921 public const ResourceLoaderSources = [
5922 'default' => [],
5923 'type' => 'map',
5924 ];
5925
5926 /**
5927 * The default 'remoteBasePath' value for instances of MediaWiki\ResourceLoader\FileModule.
5928 *
5929 * Defaults to $wgScriptPath.
5930 */
5931 public const ResourceBasePath = [
5932 'default' => null,
5933 'dynamicDefault' => [ 'use' => [ 'ScriptPath' ] ]
5934 ];
5935
5936 /**
5937 * @param mixed $scriptPath Value of ScriptPath
5938 * @return string
5939 */
5940 public static function getDefaultResourceBasePath( $scriptPath ): string {
5941 return $scriptPath;
5942 }
5943
5944 /**
5945 * Override how long a CDN or browser may cache a ResourceLoader HTTP response.
5946 *
5947 * Maximum time in seconds. Used for the `max-age` and `s-maxage` Cache-Control headers.
5948 *
5949 * Valid keys:
5950 * - versioned
5951 * - unversioned
5952 *
5953 * @see \MediaWiki\ResourceLoader\ResourceLoader::__construct
5954 * @since 1.35
5955 */
5956 public const ResourceLoaderMaxage = [
5957 'default' => [],
5958 'type' => 'map',
5959 ];
5960
5961 /**
5962 * Use the main stash instead of the module_deps table for indirect dependency tracking
5963 *
5964 * @deprecated since 1.43; This will be removed in 1.44
5965 * @since 1.35
5966 */
5967 public const ResourceLoaderUseObjectCacheForDeps = [
5968 'default' => true,
5969 ];
5970
5971 /**
5972 * The default debug mode (on/off) for of ResourceLoader requests.
5973 *
5974 * This will still be overridden when the debug URL parameter is used.
5975 */
5976 public const ResourceLoaderDebug = [
5977 'default' => false,
5978 ];
5979
5980 /**
5981 * ResourceLoader will not generate URLs whose query string is more than
5982 * this many characters long, and will instead use multiple requests with
5983 * shorter query strings. Using multiple requests may degrade performance,
5984 * but may be needed based on the query string limit supported by your web
5985 * server and/or your user's web browsers.
5986 *
5987 * Default: `2000`.
5988 *
5989 * @see \MediaWiki\ResourceLoader\StartUpModule::getMaxQueryLength
5990 * @since 1.17
5991 */
5992 public const ResourceLoaderMaxQueryLength = [
5993 'default' => false,
5994 'type' => 'integer|false',
5995 ];
5996
5997 /**
5998 * Validate JavaScript code loaded from wiki pages.
5999 *
6000 * If a syntax error is found, the script is replaced with a warning
6001 * logged to the browser console. This ensures errors are found early and
6002 * consistently (independent of the editor's own browser), and prevents
6003 * breaking other modules loaded in the same batch from load.php.
6004 *
6005 * @see \MediaWiki\ResourceLoader\Module::validateScriptFile
6006 */
6007 public const ResourceLoaderValidateJS = [
6008 'default' => true,
6009 ];
6010
6011 /**
6012 * When enabled, execution of JavaScript modules is profiled client-side.
6013 *
6014 * Instrumentation happens in mw.loader.profiler.
6015 * Use `mw.inspect('time')` from the browser console to display the data.
6016 *
6017 * @since 1.32
6018 */
6019 public const ResourceLoaderEnableJSProfiler = [
6020 'default' => false,
6021 ];
6022
6023 /**
6024 * Whether ResourceLoader should attempt to persist modules in localStorage on
6025 * browsers that support the Web Storage API.
6026 */
6027 public const ResourceLoaderStorageEnabled = [
6028 'default' => true,
6029 ];
6030
6031 /**
6032 * Cache version for client-side ResourceLoader module storage. You can trigger
6033 * invalidation of the contents of the module store by incrementing this value.
6034 *
6035 * @since 1.23
6036 */
6037 public const ResourceLoaderStorageVersion = [
6038 'default' => 1,
6039 ];
6040
6041 /**
6042 * Whether to include a SourceMap header in ResourceLoader responses
6043 * for JavaScript modules.
6044 *
6045 * @since 1.41
6046 */
6047 public const ResourceLoaderEnableSourceMapLinks = [
6048 'default' => true,
6049 ];
6050
6051 /**
6052 * Whether to allow site-wide CSS (MediaWiki:Common.css and friends) on
6053 * restricted pages like Special:UserLogin or Special:Preferences where
6054 * JavaScript is disabled for security reasons. As it is possible to
6055 * execute JavaScript through CSS, setting this to true opens up a
6056 * potential security hole. Some sites may "skin" their wiki by using
6057 * site-wide CSS, causing restricted pages to look unstyled and different
6058 * from the rest of the site.
6059 *
6060 * @since 1.25
6061 */
6062 public const AllowSiteCSSOnRestrictedPages = [
6063 'default' => false,
6064 ];
6065
6066 /**
6067 * Whether to use the development version of Vue.js. This should be disabled
6068 * for production installations. For development installations, enabling this
6069 * provides useful additional warnings and checks.
6070 *
6071 * Even when this is disabled, using ResourceLoader's debug mode (?debug=true)
6072 * will cause the development version to be loaded.
6073 *
6074 * @since 1.35
6075 */
6076 public const VueDevelopmentMode = [
6077 'default' => false,
6078 ];
6079
6080 /**
6081 * If this is set, MediaWiki will look for Codex files in this directory
6082 * instead of in resources/lib/codex/ and friends.
6083 *
6084 * To use a local development version of Codex, set this to the full file
6085 * path of the root directory of a local clone of the Codex repository, and
6086 * run `npm run build-all` in the Codex root directory. Rerun this command
6087 * after making any changes.
6088 *
6089 * This should be disabled for production installations.
6090 *
6091 * @since 1.43
6092 */
6093 public const CodexDevelopmentDir = [
6094 'default' => null,
6095 ];
6096
6097 // endregion -- End of ResourceLoader settings
6098
6099 /***************************************************************************/
6100 // region Page titles and redirects
6101 /** @name Page titles and redirects */
6102
6103 /**
6104 * Name of the project namespace. If left set to false, $wgSitename will be
6105 * used instead.
6106 */
6107 public const MetaNamespace = [
6108 'default' => false,
6109 'dynamicDefault' => [ 'use' => [ 'Sitename' ] ]
6110 ];
6111
6112 /**
6113 * @param mixed $sitename Value of Sitename
6114 * @return string
6115 */
6116 public static function getDefaultMetaNamespace( $sitename ): string {
6117 return str_replace( ' ', '_', $sitename );
6118 }
6119
6120 /**
6121 * Name of the project talk namespace.
6122 *
6123 * Normally you can ignore this and it will be something like
6124 * $wgMetaNamespace . "_talk". In some languages, you may want to set this
6125 * manually for grammatical reasons.
6126 */
6127 public const MetaNamespaceTalk = [
6128 'default' => false,
6129 ];
6130
6131 /**
6132 * Canonical namespace names.
6133 *
6134 * Must not be changed directly in configuration or by extensions, use $wgExtraNamespaces
6135 * instead.
6136 */
6137 public const CanonicalNamespaceNames = [
6138 'default' => NamespaceInfo::CANONICAL_NAMES,
6139 'type' => 'map',
6140 ];
6141
6142 /**
6143 * Additional namespaces. If the namespaces defined in Language.php and
6144 * Namespace.php are insufficient, you can create new ones here, for example,
6145 * to import Help files in other languages. You can also override the namespace
6146 * names of existing namespaces. Extensions should use the CanonicalNamespaces
6147 * hook or extension.json.
6148 *
6149 * @warning Once you delete a namespace, the pages in that namespace will
6150 * no longer be accessible. If you rename it, then you can access them through
6151 * the new namespace name.
6152 *
6153 * Custom namespaces should start at 100 to avoid conflicting with standard
6154 * namespaces, and should always follow the even/odd main/talk pattern.
6155 *
6156 * **Example:**
6157 *
6158 * ```
6159 * $wgExtraNamespaces = [
6160 * 100 => "Hilfe",
6161 * 101 => "Hilfe_Diskussion",
6162 * 102 => "Aide",
6163 * 103 => "Discussion_Aide"
6164 * ];
6165 * ```
6166 * @todo Add a note about maintenance/namespaceDupes.php
6167 */
6168 public const ExtraNamespaces = [
6169 'default' => [],
6170 'type' => 'map',
6171 ];
6172
6173 /**
6174 * Same as above, but for namespaces with gender distinction.
6175 *
6176 * Note: the default form for the namespace should also be set
6177 * using $wgExtraNamespaces for the same index.
6178 *
6179 * @since 1.18
6180 */
6181 public const ExtraGenderNamespaces = [
6182 'default' => [],
6183 'type' => 'map',
6184 ];
6185
6186 /**
6187 * Define extra namespace aliases.
6188 *
6189 * These are alternate names for the primary localised namespace names, which
6190 * are defined by $wgExtraNamespaces and the language file. If a page is
6191 * requested with such a prefix, the request will be redirected to the primary
6192 * name.
6193 *
6194 * Set this to a map from namespace names to IDs.
6195 *
6196 * **Example:**
6197 *
6198 * ```
6199 * $wgNamespaceAliases = [
6200 * 'Wikipedian' => NS_USER,
6201 * 'Help' => 100,
6202 * ];
6203 * ```
6204 *
6205 * @see \MediaWiki\Language\Language::getNamespaceAliases for accessing the full list of aliases,
6206 * including those defined by other means.
6207 */
6208 public const NamespaceAliases = [
6209 'default' => [],
6210 'type' => 'map',
6211 ];
6212
6213 /**
6214 * Allowed title characters -- regex character class
6215 * Don't change this unless you know what you're doing
6216 *
6217 * Problematic punctuation:
6218 * - []}|# Are needed for link syntax, never enable these
6219 * - <> Causes problems with HTML escaping, don't use
6220 * - % Enabled by default, minor problems with path to query rewrite rules, see below
6221 * - + Enabled by default, but doesn't work with path to query rewrite rules,
6222 * corrupted by apache
6223 * - ? Enabled by default, but doesn't work with path to PATH_INFO rewrites
6224 *
6225 * All three of these punctuation problems can be avoided by using an alias,
6226 * instead of a rewrite rule of either variety.
6227 *
6228 * The problem with % is that when using a path to query rewrite rule, URLs are
6229 * double-unescaped: once by Apache's path conversion code, and again by PHP. So
6230 * %253F, for example, becomes "?". Our code does not double-escape to compensate
6231 * for this, indeed double escaping would break if the double-escaped title was
6232 * passed in the query string rather than the path. This is a minor security issue
6233 * because articles can be created such that they are hard to view or edit.
6234 *
6235 * In some rare cases you may wish to remove + for compatibility with old links.
6236 * @deprecated since 1.41; use Extension:TitleBlacklist or (soon)
6237 * Extension:AbuseFilter to customize this set.
6238 */
6239 public const LegalTitleChars = [
6240 'default' => ' %!"$&\'()*,\\-.\\/0-9:;=?@A-Z\\\\^_`a-z~\\x80-\\xFF+',
6241 'deprecated' => 'since 1.41; use Extension:TitleBlacklist to customize',
6242 ];
6243
6244 /**
6245 * Set this to false to avoid forcing the first letter of links to capitals.
6246 *
6247 * @warning may break links! This makes links COMPLETELY case-sensitive. Links
6248 * appearing with a capital at the beginning of a sentence will *not* go to the
6249 * same place as links in the middle of a sentence using a lowercase initial.
6250 */
6251 public const CapitalLinks = [
6252 'default' => true,
6253 ];
6254
6255 /**
6256 * @since 1.16 - This can now be set per-namespace. Some special namespaces (such as Special,
6257 * see NamespaceInfo::ALWAYS_CAPITALIZED_NAMESPACES for the full list) must be true by
6258 * default (and setting them has no effect), due to various things that require them to be
6259 * so. Also, since Talk namespaces need to directly mirror their associated content
6260 * namespaces, the values for those are ignored in favor of the subject namespace's
6261 * setting. Setting for NS_MEDIA is taken automatically from NS_FILE.
6262 *
6263 * **Example:**
6264 *
6265 * ```
6266 * $wgCapitalLinkOverrides[ NS_FILE ] = false;
6267 * ```
6268 */
6269 public const CapitalLinkOverrides = [
6270 'default' => [],
6271 'type' => 'map',
6272 ];
6273
6274 /**
6275 * Which namespaces should support subpages?
6276 * See Language.php for a list of namespaces.
6277 */
6278 public const NamespacesWithSubpages = [
6279 'default' => [
6280 NS_TALK => true,
6281 NS_USER => true,
6282 NS_USER_TALK => true,
6283 NS_PROJECT => true,
6284 NS_PROJECT_TALK => true,
6285 NS_FILE_TALK => true,
6286 NS_MEDIAWIKI => true,
6287 NS_MEDIAWIKI_TALK => true,
6288 NS_TEMPLATE => true,
6289 NS_TEMPLATE_TALK => true,
6290 NS_HELP => true,
6291 NS_HELP_TALK => true,
6292 NS_CATEGORY_TALK => true
6293 ],
6294 'type' => 'map',
6295 ];
6296
6297 /**
6298 * Array of namespaces which can be deemed to contain valid "content", as far
6299 * as the site statistics are concerned. Useful if additional namespaces also
6300 * contain "content" which should be considered when generating a count of the
6301 * number of articles in the wiki.
6302 */
6303 public const ContentNamespaces = [
6304 'default' => [ NS_MAIN ],
6305 'type' => 'list',
6306 ];
6307
6308 /**
6309 * Optional array of namespaces which should be excluded from Special:ShortPages.
6310 *
6311 * Only pages inside $wgContentNamespaces but not $wgShortPagesNamespaceExclusions will
6312 * be shown on that page.
6313 *
6314 * @since 1.37; previously $wgShortPagesNamespaceBlacklist
6315 */
6316 public const ShortPagesNamespaceExclusions = [
6317 'default' => [],
6318 'type' => 'list',
6319 ];
6320
6321 /**
6322 * Array of namespaces, in addition to the talk namespaces, where signatures
6323 * (~~~~) are likely to be used. This determines whether to display the
6324 * Signature button on the edit toolbar, and may also be used by extensions.
6325 *
6326 * For example, "traditional" style wikis, where content and discussion are
6327 * intermixed, could place NS_MAIN and NS_PROJECT namespaces in this array.
6328 */
6329 public const ExtraSignatureNamespaces = [
6330 'default' => [],
6331 'type' => 'list',
6332 ];
6333
6334 /**
6335 * Array of invalid page redirect targets.
6336 *
6337 * Attempting to create a redirect to any of the pages in this array
6338 * will make the redirect fail.
6339 * Userlogout is hard-coded, so it does not need to be listed here.
6340 * (T12569) Disallow Mypage and Mytalk as well.
6341 *
6342 * As of now, this only checks special pages. Redirects to pages in
6343 * other namespaces cannot be invalidated by this variable.
6344 */
6345 public const InvalidRedirectTargets = [
6346 'default' => [ 'Filepath', 'Mypage', 'Mytalk', 'Redirect', 'Mylog' ],
6347 'type' => 'list',
6348 ];
6349
6350 /**
6351 * Disable redirects to special pages and interwiki redirects, which use a 302
6352 * and have no "redirected from" link.
6353 *
6354 * @note This is only for articles with #REDIRECT in them. URL's containing a
6355 * local interwiki prefix (or a non-canonical special page name) are still hard
6356 * redirected regardless of this setting.
6357 */
6358 public const DisableHardRedirects = [
6359 'default' => false,
6360 ];
6361
6362 /**
6363 * Fix double redirects after a page move.
6364 *
6365 * Tends to conflict with page move vandalism, use only on a private wiki.
6366 */
6367 public const FixDoubleRedirects = [
6368 'default' => false,
6369 ];
6370
6371 // endregion -- End of title and interwiki settings
6372
6373 /***************************************************************************/
6374 // region Interwiki links and sites
6375 /** @name Interwiki links and sites */
6376
6377 /**
6378 * Array for local interwiki values, for each of the interwiki prefixes that point to
6379 * the current wiki.
6380 *
6381 * Note, recent changes feeds use only the first entry in this array. See $wgRCFeeds.
6382 */
6383 public const LocalInterwikis = [
6384 'default' => [],
6385 'type' => 'list',
6386 ];
6387
6388 /**
6389 * Expiry time for cache of interwiki table
6390 */
6391 public const InterwikiExpiry = [
6392 'default' => 10800,
6393 ];
6394
6395 /**
6396 * Interwiki cache as an associative array.
6397 *
6398 * When set, the InterwikiLookup service will not use the built-in `interwiki` database table,
6399 * but instead use this static array as its source.
6400 *
6401 * This cache data structure can be generated by the `dumpInterwiki.php` maintenance
6402 * script (which lives in the WikimediaMaintenance repository) and has key
6403 * formats such as the following:
6404 *
6405 * - dbname:key - a simple key (e.g. enwiki:meta)
6406 * - _sitename:key - site-scope key (e.g. wiktionary:meta)
6407 * - __global:key - global-scope key (e.g. __global:meta)
6408 * - __sites:dbname - site mapping (e.g. __sites:enwiki)
6409 *
6410 * Sites mapping just specifies site name, other keys provide "local url"
6411 * data layout.
6412 *
6413 * @see \MediaWiki\Interwiki\ClassicInterwikiLookup
6414 */
6415 public const InterwikiCache = [
6416 'default' => false,
6417 'type' => 'false|map',
6418 'mergeStrategy' => 'replace',
6419 ];
6420
6421 /**
6422 * Specify number of domains to check for messages.
6423 *
6424 * - 1: Just wiki(db)-level
6425 * - 2: wiki and global levels
6426 * - 3: site levels
6427 */
6428 public const InterwikiScopes = [
6429 'default' => 3,
6430 ];
6431
6432 /**
6433 * Fallback site, if unable to resolve from cache
6434 */
6435 public const InterwikiFallbackSite = [
6436 'default' => 'wiki',
6437 ];
6438
6439 /**
6440 * If local interwikis are set up which allow redirects,
6441 * set this regexp to restrict URLs which will be displayed
6442 * as 'redirected from' links.
6443 *
6444 * **Example:**
6445 * It might look something like this:
6446 *
6447 * ```
6448 * $wgRedirectSources = '!^https?://[a-z-]+\.wikipedia\.org/!';
6449 * ```
6450 *
6451 * Leave at false to avoid displaying any incoming redirect markers.
6452 * This does not affect intra-wiki redirects, which don't change
6453 * the URL.
6454 */
6455 public const RedirectSources = [
6456 'default' => false,
6457 ];
6458
6459 /**
6460 * Register handlers for specific types of sites.
6461 *
6462 * @since 1.21
6463 */
6464 public const SiteTypes = [
6465 'default' => [ 'mediawiki' => MediaWikiSite::class, ],
6466 'type' => 'map',
6467 ];
6468
6469 // endregion -- Interwiki links and sites
6470
6471 /***************************************************************************/
6472 // region Parser settings
6473 /** @name Parser settings
6474 * These settings configure the transformation from wikitext to HTML.
6475 */
6476
6477 /**
6478 * Maximum indent level of toc.
6479 */
6480 public const MaxTocLevel = [
6481 'default' => 999,
6482 ];
6483
6484 /**
6485 * A complexity limit on template expansion: the maximum number of nodes visited
6486 * by PPFrame::expand()
6487 */
6488 public const MaxPPNodeCount = [
6489 'default' => 1_000_000,
6490 ];
6491
6492 /**
6493 * Maximum recursion depth for templates within templates.
6494 *
6495 * The current parser adds two levels to the PHP call stack for each template,
6496 * and xdebug limits the call stack to 256 by default. So this should hopefully
6497 * stop the parser before it hits the xdebug limit.
6498 */
6499 public const MaxTemplateDepth = [
6500 'default' => 100,
6501 ];
6502
6503 /**
6504 * @see self::MaxTemplateDepth
6505 */
6506 public const MaxPPExpandDepth = [
6507 'default' => 100,
6508 ];
6509
6510 /**
6511 * URL schemes that should be recognized as valid by UrlUtils::parse().
6512 *
6513 * WARNING: Do not add 'file:' to this or internal file links will be broken.
6514 * Instead, if you want to support file links, add 'file://'. The same applies
6515 * to any other protocols with the same name as a namespace. See task T46011 for
6516 * more information.
6517 *
6518 * @see \MediaWiki\Utils\UrlUtils::parse()
6519 */
6520 public const UrlProtocols = [
6521 'default' => [
6522 'bitcoin:', 'ftp://', 'ftps://', 'geo:', 'git://', 'gopher://', 'http://',
6523 'https://', 'irc://', 'ircs://', 'magnet:', 'mailto:', 'matrix:', 'mms://',
6524 'news:', 'nntp://', 'redis://', 'sftp://', 'sip:', 'sips:', 'sms:',
6525 'ssh://', 'svn://', 'tel:', 'telnet://', 'urn:', 'worldwind://', 'xmpp:',
6526 '//',
6527 ],
6528 'type' => 'list',
6529 ];
6530
6531 /**
6532 * If true, removes (by substituting) templates in signatures.
6533 */
6534 public const CleanSignatures = [
6535 'default' => true,
6536 ];
6537
6538 /**
6539 * Whether to allow inline image pointing to other websites
6540 */
6541 public const AllowExternalImages = [
6542 'default' => false,
6543 ];
6544
6545 /**
6546 * If the above is false, you can specify an exception here. Image URLs
6547 * that start with this string are then rendered, while all others are not.
6548 *
6549 * You can use this to set up a trusted, simple repository of images.
6550 * You may also specify an array of strings to allow multiple sites
6551 *
6552 * **Examples:**
6553 *
6554 * ```
6555 * $wgAllowExternalImagesFrom = 'http://127.0.0.1/';
6556 * $wgAllowExternalImagesFrom = [ 'http://127.0.0.1/', 'http://example.com' ];
6557 * ```
6558 */
6559 public const AllowExternalImagesFrom = [
6560 'default' => '',
6561 ];
6562
6563 /**
6564 * If $wgAllowExternalImages is false, you can allow an on-wiki
6565 * allow list of regular expression fragments to match the image URL
6566 * against. If the image matches one of the regular expression fragments,
6567 * the image will be displayed.
6568 *
6569 * Set this to true to enable the on-wiki allow list (MediaWiki:External image whitelist)
6570 * Or false to disable it
6571 *
6572 * @since 1.14
6573 */
6574 public const EnableImageWhitelist = [
6575 'default' => false,
6576 ];
6577
6578 /**
6579 * Configuration for HTML postprocessing tool. Set this to a configuration
6580 * array to enable an external tool. By default, we now use the RemexHtml
6581 * library; historically, other postprocessors were used.
6582 *
6583 * Setting this to null will use default settings.
6584 *
6585 * Keys include:
6586 * - treeMutationTrace: a boolean to turn on Remex tracing
6587 * - serializerTrace: a boolean to turn on Remex tracing
6588 * - mungerTrace: a boolean to turn on Remex tracing
6589 * - pwrap: whether <p> wrapping should be done (default true)
6590 *
6591 * See includes/tidy/RemexDriver.php for detail on configuration.
6592 *
6593 * Overriding the default configuration is strongly discouraged in
6594 * production.
6595 */
6596 public const TidyConfig = [
6597 'default' => [],
6598 'type' => 'map',
6599 ];
6600
6601 /**
6602 * Default Parsoid configuration.
6603 *
6604 * Overriding the default configuration is strongly discouraged in
6605 * production.
6606 *
6607 * @since 1.39
6608 */
6609 public const ParsoidSettings = [
6610 'default' => [
6611 'useSelser' => true,
6612 ],
6613 'type' => 'map',
6614 ];
6615
6616 /**
6617 * Enable legacy media HTML structure in the output from the Parser. The
6618 * alternative modern HTML structure that replaces it is described at
6619 * https://www.mediawiki.org/wiki/Parsing/Media_structure
6620 *
6621 * @deprecated since 1.41
6622 * @since 1.36
6623 */
6624 public const ParserEnableLegacyMediaDOM = [
6625 'default' => false,
6626 'deprecated' => 'since 1.41',
6627 ];
6628
6629 /**
6630 * Enable legacy HTML structure for headings in the output from the Parser.
6631 * The legacy structure includes section edit links (and other markup added
6632 * by some extensions) inside the headings rather than outside them, leading
6633 * to poor accessibility. This doesn't affect headings on special pages.
6634 * Note that each skin also has to indicate support for the new structure.
6635 * More information: https://www.mediawiki.org/wiki/Heading_HTML_changes
6636 *
6637 * @since 1.43
6638 */
6639 public const ParserEnableLegacyHeadingDOM = [
6640 'default' => true,
6641 ];
6642
6643 /**
6644 * Enable shipping the styles for the media HTML structure that replaces
6645 * legacy, when $wgParserEnableLegacyMediaDOM is `false`. This is configured
6646 * separately so that it can continue to be served after the latter is disabled
6647 * but still in the cache.
6648 *
6649 * @deprecated since 1.41
6650 * @internal Temporary flag, T51097.
6651 * @since 1.38
6652 */
6653 public const UseContentMediaStyles = [
6654 'default' => false,
6655 'deprecated' => 'since 1.41',
6656 ];
6657
6658 /**
6659 * Disable shipping the styles for the legacy media HTML structure
6660 * that has been replaced when $wgParserEnableLegacyMediaDOM is `false`. This is
6661 * configured separately to give time for templates and extensions that mimic the
6662 * parser output to be migrated away.
6663 *
6664 * @internal Temporary feature flag for T318433.
6665 * @since 1.41
6666 */
6667 public const UseLegacyMediaStyles = [
6668 'default' => false,
6669 ];
6670
6671 /**
6672 * Allow raw, unchecked HTML in "<html>...</html>" sections.
6673 *
6674 * THIS IS VERY DANGEROUS on a publicly editable site, so USE $wgGroupPermissions
6675 * TO RESTRICT EDITING to only those that you trust
6676 */
6677 public const RawHtml = [
6678 'default' => false,
6679 ];
6680
6681 /**
6682 * Set a default target for external links, e.g. _blank to pop up a new window.
6683 *
6684 * This will also set the "noreferrer" and "noopener" link rel to prevent the
6685 * attack described at https://mathiasbynens.github.io/rel-noopener/ .
6686 * Some older browsers may not support these link attributes, hence
6687 * setting $wgExternalLinkTarget to _blank may represent a security risk
6688 * to some of your users.
6689 */
6690 public const ExternalLinkTarget = [
6691 'default' => false,
6692 ];
6693
6694 /**
6695 * If true, external URL links in wiki text will be given the
6696 * rel="nofollow" attribute as a hint to search engines that
6697 * they should not be followed for ranking purposes as they
6698 * are user-supplied and thus subject to spamming.
6699 */
6700 public const NoFollowLinks = [
6701 'default' => true,
6702 ];
6703
6704 /**
6705 * Namespaces in which $wgNoFollowLinks doesn't apply.
6706 *
6707 * See Language.php for a list of namespaces.
6708 */
6709 public const NoFollowNsExceptions = [
6710 'default' => [],
6711 'type' => 'list',
6712 ];
6713
6714 /**
6715 * If this is set to an array of domains, external links to these domain names
6716 * (or any subdomains) will not be set to rel="nofollow" regardless of the
6717 * value of $wgNoFollowLinks. For instance:
6718 *
6719 * $wgNoFollowDomainExceptions = [ 'en.wikipedia.org', 'wiktionary.org', 'mediawiki.org' ];
6720 *
6721 * This would add rel="nofollow" to links to de.wikipedia.org, but not
6722 * en.wikipedia.org, wiktionary.org, en.wiktionary.org, us.en.wikipedia.org,
6723 * etc.
6724 *
6725 * Defaults to mediawiki.org for the links included in the software by default.
6726 */
6727 public const NoFollowDomainExceptions = [
6728 'default' => [ 'mediawiki.org', ],
6729 'type' => 'list',
6730 ];
6731
6732 /**
6733 * By default MediaWiki does not register links pointing to same server in
6734 * externallinks dataset, use this value to override:
6735 */
6736 public const RegisterInternalExternals = [
6737 'default' => false,
6738 ];
6739
6740 /**
6741 * Allow DISPLAYTITLE to change title display
6742 */
6743 public const AllowDisplayTitle = [
6744 'default' => true,
6745 ];
6746
6747 /**
6748 * For consistency, restrict DISPLAYTITLE to text that normalizes to the same
6749 * canonical DB key. Also disallow some inline CSS rules like display: none;
6750 * which can cause the text to be hidden or unselectable.
6751 */
6752 public const RestrictDisplayTitle = [
6753 'default' => true,
6754 ];
6755
6756 /**
6757 * Maximum number of calls per parse to expensive parser functions such as
6758 * PAGESINCATEGORY.
6759 */
6760 public const ExpensiveParserFunctionLimit = [
6761 'default' => 100,
6762 ];
6763
6764 /**
6765 * Preprocessor caching threshold
6766 * Setting it to 'false' will disable the preprocessor cache.
6767 */
6768 public const PreprocessorCacheThreshold = [
6769 'default' => 1000,
6770 ];
6771
6772 /**
6773 * Enable interwiki transcluding. Only when iw_trans=1 in the interwiki table.
6774 */
6775 public const EnableScaryTranscluding = [
6776 'default' => false,
6777 ];
6778
6779 /**
6780 * Expiry time for transcluded templates cached in object cache.
6781 *
6782 * Only used $wgEnableInterwikiTranscluding is set to true.
6783 */
6784 public const TranscludeCacheExpiry = [
6785 'default' => 3600,
6786 ];
6787
6788 /**
6789 * Enable the magic links feature of automatically turning ISBN xxx,
6790 * PMID xxx, RFC xxx into links
6791 *
6792 * @since 1.28
6793 */
6794 public const EnableMagicLinks = [
6795 'default' => [
6796 'ISBN' => false,
6797 'PMID' => false,
6798 'RFC' => false,
6799 ],
6800 'type' => 'map',
6801 ];
6802
6803 /**
6804 * Set this to true to allow the {{USERLANGUAGE}} magic word to return the
6805 * actual user language. If it is false, {{USERLANGUAGE}} will return the
6806 * page language. Setting this to true is discouraged since the page
6807 * language should typically be used in the content area. Accessing the user
6808 * language using this feature reduces the efficiency of the parser cache.
6809 *
6810 * @since 1.43
6811 */
6812 public const ParserEnableUserLanguage = [
6813 'default' => false,
6814 ];
6815
6816 // endregion -- end of parser settings
6817
6818 /***************************************************************************/
6819 // region Statistics and content analysis
6820 /** @name Statistics and content analysis */
6821
6822 /**
6823 * Method used to determine if a page in a content namespace should be counted
6824 * as a valid article.
6825 *
6826 * Redirect pages will never be counted as valid articles.
6827 *
6828 * This variable can have the following values:
6829 * - 'any': all pages as considered as valid articles
6830 * - 'link': the page must contain a [[wiki link]] to be considered valid
6831 *
6832 * See also See https://www.mediawiki.org/wiki/Manual:Article_count
6833 *
6834 * Retroactively changing this variable will not affect the existing count,
6835 * to update it, you will need to run the maintenance/updateArticleCount.php
6836 * script.
6837 */
6838 public const ArticleCountMethod = [
6839 'default' => 'link',
6840 ];
6841
6842 /**
6843 * How many days user must be idle before he is considered inactive. Will affect
6844 * the number shown on Special:Statistics, Special:ActiveUsers, and the
6845 * {{NUMBEROFACTIVEUSERS}} magic word in wikitext.
6846 *
6847 * You might want to leave this as the default value, to provide comparable
6848 * numbers between different wikis.
6849 */
6850 public const ActiveUserDays = [
6851 'default' => 30,
6852 ];
6853
6854 /**
6855 * The following variables define 3 user experience levels:
6856 *
6857 * - newcomer: has not yet reached the 'learner' level
6858 *
6859 * - learner: has at least $wgLearnerEdits and has been
6860 * a member for $wgLearnerMemberSince days
6861 * but has not yet reached the 'experienced' level.
6862 *
6863 * - experienced: has at least $wgExperiencedUserEdits edits and
6864 * has been a member for $wgExperiencedUserMemberSince days.
6865 */
6866 public const LearnerEdits = [
6867 'default' => 10,
6868 ];
6869
6870 /**
6871 * Number of days the user must exist before becoming a learner.
6872 *
6873 * @see self::LearnerEdits
6874 */
6875 public const LearnerMemberSince = [
6876 'default' => 4,
6877 ];
6878
6879 /**
6880 * Number of edits the user must have before becoming "experienced".
6881 *
6882 * @see self::LearnerEdits
6883 */
6884 public const ExperiencedUserEdits = [
6885 'default' => 500,
6886 ];
6887
6888 /**
6889 * Number of days the user must exist before becoming "experienced".
6890 *
6891 * @see self::LearnerEdits
6892 */
6893 public const ExperiencedUserMemberSince = [
6894 'default' => 30,
6895 ];
6896
6897 /**
6898 * Maximum number of revisions of a page that will be checked against every new edit
6899 * made to determine whether the edit was a manual revert.
6900 *
6901 * Computational time required increases roughly linearly with this configuration
6902 * variable.
6903 *
6904 * Larger values will let you detect very deep reverts, but at the same time can give
6905 * unexpected results (such as marking large amounts of edits as reverts) and may slow
6906 * down the wiki slightly when saving new edits.
6907 *
6908 * Setting this to 0 will disable the manual revert detection feature entirely.
6909 *
6910 * See this document for a discussion on this topic:
6911 * https://meta.wikimedia.org/wiki/Research:Revert
6912 *
6913 * @since 1.36
6914 */
6915 public const ManualRevertSearchRadius = [
6916 'default' => 15,
6917 'type' => 'integer',
6918 ];
6919
6920 /**
6921 * Maximum depth (revision count) of reverts that will have their reverted edits marked
6922 * with the mw-reverted change tag. Reverts deeper than that will not have any edits
6923 * marked as reverted at all.
6924 *
6925 * Large values can lead to lots of revisions being marked as "reverted", which may appear
6926 * confusing to users.
6927 *
6928 * Setting this to 0 will disable the reverted tag entirely.
6929 *
6930 * @since 1.36
6931 */
6932 public const RevertedTagMaxDepth = [
6933 'default' => 15,
6934 'type' => 'integer',
6935 ];
6936
6937 // endregion -- End of statistics and content analysis
6938
6939 /***************************************************************************/
6940 // region User accounts, authentication
6941 /** @name User accounts, authentication */
6942
6943 /**
6944 * Central ID lookup providers
6945 * Key is the provider ID, value is a specification for ObjectFactory
6946 *
6947 * @since 1.27
6948 */
6949 public const CentralIdLookupProviders = [
6950 'default' => [
6951 'local' => [
6952 'class' => LocalIdLookup::class,
6953 'services' => [
6954 'MainConfig',
6955 'DBLoadBalancerFactory',
6956 'HideUserUtils',
6957 ]
6958 ]
6959 ],
6960 'type' => 'map',
6961 ];
6962
6963 /**
6964 * Central ID lookup provider to use by default
6965 */
6966 public const CentralIdLookupProvider = [
6967 'default' => 'local',
6968 'type' => 'string',
6969 ];
6970
6971 /**
6972 * User registration timestamp provider classes
6973 * @since 1.41
6974 */
6975 public const UserRegistrationProviders = [
6976 'default' => [
6977 LocalUserRegistrationProvider::TYPE => [
6978 'class' => LocalUserRegistrationProvider::class,
6979 'services' => [
6980 'UserFactory'
6981 ]
6982 ]
6983 ],
6984 'type' => 'map',
6985 ];
6986
6987 /**
6988 * Password policy for the wiki.
6989 *
6990 * Structured as
6991 * ```
6992 * [
6993 * 'policies' => [ <group> => [ <policy> => <settings>, ... ], ... ],
6994 * 'checks' => [ <policy> => <callback>, ... ],
6995 * ]
6996 * ```
6997 * where <group> is a user group, <policy> is a password policy name
6998 * (arbitrary string) defined in the 'checks' part, <callback> is the
6999 * PHP callable implementing the policy check, <settings> is an array
7000 * of options with the following keys:
7001 * - value: (number, boolean or null) the value to pass to the callback
7002 * - forceChange: (boolean, default false) if the password is invalid, do
7003 * not let the user log in without changing the password
7004 * - suggestChangeOnLogin: (boolean, default false) if true and the password is
7005 * invalid, suggest a password change if logging in. If all the failing policies
7006 * that apply to the user have this set to false, the password change
7007 * screen will not be shown. 'forceChange' takes precedence over
7008 * 'suggestChangeOnLogin' if they are both present.
7009 * As a shorthand for [ 'value' => <value> ], simply <value> can be written.
7010 * When multiple password policies are defined for a user, the settings
7011 * arrays are merged, and for fields which are set in both arrays, the
7012 * larger value (as understood by PHP's 'max' method) is taken.
7013 *
7014 * A user's effective policy is the superset of all policy statements
7015 * from the policies for the groups where the user is a member. If more
7016 * than one group policy include the same policy statement, the value is
7017 * the max() of the values. Note true > false. The 'default' policy group
7018 * is required, and serves as the minimum policy for all users.
7019 *
7020 * Callbacks receive three arguments: the policy value, the User object
7021 * and the password; and must return a StatusValue. A non-good status
7022 * means the password will not be accepted for new accounts, and existing
7023 * accounts will be prompted for password change or barred from logging in
7024 * (depending on whether the status is a fatal or merely error/warning).
7025 *
7026 * The checks supported by core are:
7027 * - MinimalPasswordLength - Minimum length a user can set.
7028 * - MinimumPasswordLengthToLogin - Passwords shorter than this will
7029 * not be allowed to login, or offered a chance to reset their password
7030 * as part of the login workflow, regardless if it is correct.
7031 * - MaximalPasswordLength - maximum length password a user is allowed
7032 * to attempt. Prevents DoS attacks with pbkdf2.
7033 * - PasswordCannotBeSubstringInUsername - Password cannot be a substring
7034 * (contained within) the username.
7035 * - PasswordCannotMatchDefaults - Username/password combination cannot
7036 * match a list of default passwords used by MediaWiki in the past.
7037 * - PasswordNotInCommonList - Password not in best practices list of
7038 * 100,000 commonly used passwords. Due to the size of the list this
7039 * is a probabilistic test.
7040 *
7041 * If you add custom checks, for Special:PasswordPolicies to display them correctly,
7042 * every check should have a corresponding passwordpolicies-policy-<check> message,
7043 * and every settings field other than 'value' should have a corresponding
7044 * passwordpolicies-policyflag-<flag> message (<check> and <flag> are in lowercase).
7045 * The check message receives the policy value as a parameter, the flag message
7046 * receives the flag value (or values if it's an array).
7047 *
7048 * @since 1.26
7049 * @see \MediaWiki\Password\PasswordPolicyChecks
7050 * @see \MediaWiki\User\User::checkPasswordValidity()
7051 */
7052 public const PasswordPolicy = [
7053 'default' => [
7054 'policies' => [
7055 'bureaucrat' => [
7056 'MinimalPasswordLength' => 10,
7057 'MinimumPasswordLengthToLogin' => 1,
7058 ],
7059 'sysop' => [
7060 'MinimalPasswordLength' => 10,
7061 'MinimumPasswordLengthToLogin' => 1,
7062 ],
7063 'interface-admin' => [
7064 'MinimalPasswordLength' => 10,
7065 'MinimumPasswordLengthToLogin' => 1,
7066 ],
7067 'bot' => [
7068 'MinimalPasswordLength' => 10,
7069 'MinimumPasswordLengthToLogin' => 1,
7070 ],
7071 'default' => [
7072 'MinimalPasswordLength' => [ 'value' => 8, 'suggestChangeOnLogin' => true ],
7073 'PasswordCannotBeSubstringInUsername' => [
7074 'value' => true,
7075 'suggestChangeOnLogin' => true
7076 ],
7077 'PasswordCannotMatchDefaults' => [ 'value' => true, 'suggestChangeOnLogin' => true ],
7078 'MaximalPasswordLength' => [ 'value' => 4096, 'suggestChangeOnLogin' => true ],
7079 'PasswordNotInCommonList' => [ 'value' => true, 'suggestChangeOnLogin' => true ],
7080 ],
7081 ],
7082 'checks' => [
7083 'MinimalPasswordLength' => [ PasswordPolicyChecks::class, 'checkMinimalPasswordLength' ],
7084 'MinimumPasswordLengthToLogin' => [ PasswordPolicyChecks::class, 'checkMinimumPasswordLengthToLogin' ],
7085 'PasswordCannotBeSubstringInUsername' => [ PasswordPolicyChecks::class, 'checkPasswordCannotBeSubstringInUsername' ],
7086 'PasswordCannotMatchDefaults' => [ PasswordPolicyChecks::class, 'checkPasswordCannotMatchDefaults' ],
7087 'MaximalPasswordLength' => [ PasswordPolicyChecks::class, 'checkMaximalPasswordLength' ],
7088 'PasswordNotInCommonList' => [ PasswordPolicyChecks::class, 'checkPasswordNotInCommonList' ],
7089 ],
7090 ],
7091 'type' => 'map',
7092 'mergeStrategy' => 'array_replace_recursive',
7093 ];
7094
7095 /**
7096 * Configure AuthManager
7097 *
7098 * All providers are constructed using ObjectFactory, see that for the general
7099 * structure. The array may also contain a key "sort" used to order providers:
7100 * providers are stably sorted by this value, which should be an integer
7101 * (default is 0).
7102 *
7103 * Elements are:
7104 * - preauth: Array (keys ignored) of specifications for PreAuthenticationProviders
7105 * - primaryauth: Array (keys ignored) of specifications for PrimaryAuthenticationProviders
7106 * - secondaryauth: Array (keys ignored) of specifications for SecondaryAuthenticationProviders
7107 *
7108 * @since 1.27
7109 * @note If this is null or empty, the value from $wgAuthManagerAutoConfig is
7110 * used instead. Local customization should generally set this variable from
7111 * scratch to the desired configuration. Extensions that want to
7112 * auto-configure themselves should use $wgAuthManagerAutoConfig instead.
7113 */
7114 public const AuthManagerConfig = [
7115 'default' => null,
7116 'type' => '?map',
7117 ];
7118
7119 /**
7120 * @see self::AuthManagerConfig
7121 * @since 1.27
7122 */
7123 public const AuthManagerAutoConfig = [
7124 'default' => [
7125 'preauth' => [
7126 ThrottlePreAuthenticationProvider::class => [
7127 'class' => ThrottlePreAuthenticationProvider::class,
7128 'sort' => 0,
7129 ],
7130 ],
7131 'primaryauth' => [
7132 // TemporaryPasswordPrimaryAuthenticationProvider should come before
7133 // any other PasswordAuthenticationRequest-based
7134 // PrimaryAuthenticationProvider (or at least any that might return
7135 // FAIL rather than ABSTAIN for a wrong password), or password reset
7136 // won't work right. Do not remove this (or change the key) or
7137 // auto-configuration of other such providers in extensions will
7138 // probably auto-insert themselves in the wrong place.
7139 TemporaryPasswordPrimaryAuthenticationProvider::class => [
7140 'class' => TemporaryPasswordPrimaryAuthenticationProvider::class,
7141 'services' => [
7142 'DBLoadBalancerFactory',
7143 'UserOptionsLookup',
7144 ],
7145 'args' => [ [
7146 // Fall through to LocalPasswordPrimaryAuthenticationProvider
7147 'authoritative' => false,
7148 ] ],
7149 'sort' => 0,
7150 ],
7151 LocalPasswordPrimaryAuthenticationProvider::class => [
7152 'class' => LocalPasswordPrimaryAuthenticationProvider::class,
7153 'services' => [
7154 'DBLoadBalancerFactory',
7155 ],
7156 'args' => [ [
7157 // Last one should be authoritative, or else the user will get
7158 // a less-than-helpful error message (something like "supplied
7159 // authentication info not supported" rather than "wrong
7160 // password") if it too fails.
7161 'authoritative' => true,
7162 ] ],
7163 'sort' => 100,
7164 ],
7165 ],
7166 'secondaryauth' => [
7167 CheckBlocksSecondaryAuthenticationProvider::class => [
7168 'class' => CheckBlocksSecondaryAuthenticationProvider::class,
7169 'sort' => 0,
7170 ],
7171 ResetPasswordSecondaryAuthenticationProvider::class => [
7172 'class' => ResetPasswordSecondaryAuthenticationProvider::class,
7173 'sort' => 100,
7174 ],
7175 // Linking during login is experimental, enable at your own risk - T134952
7176 // MediaWiki\Auth\ConfirmLinkSecondaryAuthenticationProvider::class => [
7177 // 'class' => MediaWiki\Auth\ConfirmLinkSecondaryAuthenticationProvider::class,
7178 // 'sort' => 100,
7179 // ],
7180 EmailNotificationSecondaryAuthenticationProvider::class => [
7181 'class' => EmailNotificationSecondaryAuthenticationProvider::class,
7182 'services' => [
7183 'DBLoadBalancerFactory',
7184 ],
7185 'sort' => 200,
7186 ],
7187 ],
7188 ],
7189 'type' => 'map',
7190 'mergeStrategy' => 'array_plus_2d',
7191 ];
7192
7193 /**
7194 * Configures RememberMe authentication request added by AuthManager. It can show a "remember
7195 * me" checkbox that, when checked, will cause it to take more time for the authenticated
7196 * session to expire. It can also be configured to always or to never extend the authentication
7197 * session.
7198 *
7199 * Valid values are listed in RememberMeAuthenticationRequest::ALLOWED_FLAGS.
7200 *
7201 * @since 1.36
7202 */
7203 public const RememberMe = [
7204 'default' => 'choose',
7205 'type' => 'string',
7206 ];
7207
7208 /**
7209 * Time frame for re-authentication.
7210 *
7211 * With only password-based authentication, you'd just ask the user to re-enter
7212 * their password to verify certain operations like changing the password or
7213 * changing the account's email address. But under AuthManager, the user might
7214 * not have a password (you might even have to redirect the browser to a
7215 * third-party service or something complex like that), you might want to have
7216 * both factors of a two-factor authentication, and so on. So, the options are:
7217 * - Incorporate the whole multi-step authentication flow within everything
7218 * that needs to do this.
7219 * - Consider it good if they used Special:UserLogin during this session within
7220 * the last X seconds.
7221 * - Come up with a third option.
7222 *
7223 * MediaWiki currently takes the second option. This setting configures the
7224 * "X seconds".
7225 *
7226 * This allows for configuring different time frames for different
7227 * "operations". The operations used in MediaWiki core include:
7228 * - LinkAccounts
7229 * - UnlinkAccount
7230 * - ChangeCredentials
7231 * - RemoveCredentials
7232 * - ChangeEmail
7233 *
7234 * Additional operations may be used by extensions, either explicitly by
7235 * calling AuthManager::securitySensitiveOperationStatus(),
7236 * ApiAuthManagerHelper::securitySensitiveOperation() or
7237 * SpecialPage::checkLoginSecurityLevel(), or implicitly by overriding
7238 * SpecialPage::getLoginSecurityLevel() or by subclassing
7239 * AuthManagerSpecialPage.
7240 *
7241 * The key 'default' is used if a requested operation isn't defined in the array.
7242 *
7243 * @since 1.27
7244 */
7245 public const ReauthenticateTime = [
7246 'default' => [ 'default' => 3600, ],
7247 'type' => 'map',
7248 'additionalProperties' => [ 'type' => 'integer', ],
7249 ];
7250
7251 /**
7252 * Whether to allow security-sensitive operations when re-authentication is not possible.
7253 *
7254 * If AuthManager::canAuthenticateNow() is false (e.g. the current
7255 * SessionProvider is not able to change users, such as when OAuth is in use),
7256 * AuthManager::securitySensitiveOperationStatus() cannot sensibly return
7257 * SEC_REAUTH. Setting an operation true here will have it return SEC_OK in
7258 * that case, while setting it false will have it return SEC_FAIL.
7259 *
7260 * The key 'default' is used if a requested operation isn't defined in the array.
7261 *
7262 * @since 1.27
7263 * @see self::ReauthenticateTime
7264 */
7265 public const AllowSecuritySensitiveOperationIfCannotReauthenticate = [
7266 'default' => [ 'default' => true, ],
7267 'type' => 'map',
7268 'additionalProperties' => [ 'type' => 'boolean', ],
7269 ];
7270
7271 /**
7272 * List of AuthenticationRequest class names which are not changeable through
7273 * Special:ChangeCredentials and the changeauthenticationdata API.
7274 *
7275 * This is only enforced on the client level; AuthManager itself (e.g.
7276 * AuthManager::allowsAuthenticationDataChange calls) is not affected.
7277 * Class names are checked for exact match (not for subclasses).
7278 *
7279 * @since 1.27
7280 */
7281 public const ChangeCredentialsBlacklist = [
7282 'default' => [
7283 TemporaryPasswordAuthenticationRequest::class,
7284 ],
7285 'type' => 'list',
7286 'items' => [ 'type' => 'string', ],
7287 ];
7288
7289 /**
7290 * List of AuthenticationRequest class names which are not removable through
7291 * Special:RemoveCredentials and the removeauthenticationdata API.
7292 *
7293 * This is only enforced on the client level; AuthManager itself (e.g.
7294 * AuthManager::allowsAuthenticationDataChange calls) is not affected.
7295 * Class names are checked for exact match (not for subclasses).
7296 *
7297 * @since 1.27
7298 */
7299 public const RemoveCredentialsBlacklist = [
7300 'default' => [
7301 PasswordAuthenticationRequest::class,
7302 ],
7303 'type' => 'list',
7304 'items' => [ 'type' => 'string', ],
7305 ];
7306
7307 /**
7308 * Specifies if users should be sent to a password-reset form on login, if their
7309 * password doesn't meet the requirements of User::isValidPassword().
7310 *
7311 * @since 1.23
7312 */
7313 public const InvalidPasswordReset = [
7314 'default' => true,
7315 ];
7316
7317 /**
7318 * Default password type to use when hashing user passwords.
7319 *
7320 * Must be set to a type defined in $wgPasswordConfig, or a type that
7321 * is registered by default in PasswordFactory.php.
7322 *
7323 * @since 1.24
7324 */
7325 public const PasswordDefault = [
7326 'default' => 'pbkdf2',
7327 ];
7328
7329 /**
7330 * Configuration for built-in password types.
7331 *
7332 * Maps the password type to an array of options:
7333 *
7334 * - class: The Password class to use.
7335 * - factory (since 1.40): A function that creates and returns a suitable Password object.
7336 * This option is intended only for internal use; the function signature is unstable and
7337 * subject to change in future versions.
7338 *
7339 * All other options are class-dependent.
7340 *
7341 * An advanced example:
7342 *
7343 * ```
7344 * $wgPasswordConfig['bcrypt-peppered'] = [
7345 * 'class' => EncryptedPassword::class,
7346 * 'underlying' => 'bcrypt',
7347 * 'secrets' => [
7348 * hash( 'sha256', 'secret', true ),
7349 * ],
7350 * 'cipher' => 'aes-256-cbc',
7351 * ];
7352 * ```
7353 *
7354 * @since 1.24
7355 */
7356 public const PasswordConfig = [
7357 'default' => [
7358 'A' => [
7359 'class' => MWOldPassword::class,
7360 ],
7361 'B' => [
7362 'class' => MWSaltedPassword::class,
7363 ],
7364 'pbkdf2-legacyA' => [
7365 'class' => LayeredParameterizedPassword::class,
7366 'types' => [
7367 'A',
7368 'pbkdf2',
7369 ],
7370 ],
7371 'pbkdf2-legacyB' => [
7372 'class' => LayeredParameterizedPassword::class,
7373 'types' => [
7374 'B',
7375 'pbkdf2',
7376 ],
7377 ],
7378 'bcrypt' => [
7379 'class' => BcryptPassword::class,
7380 'cost' => 9,
7381 ],
7382 'pbkdf2' => [
7383 'class' => Pbkdf2PasswordUsingOpenSSL::class,
7384 'algo' => 'sha512',
7385 'cost' => '30000',
7386 'length' => '64',
7387 ],
7388 'argon2' => [
7389 'class' => Argon2Password::class,
7390
7391 // Algorithm used:
7392 // * 'argon2i' is optimized against side-channel attacks
7393 // * 'argon2id' is optimized against both side-channel and GPU cracking
7394 // * 'auto' to use the best available algorithm. If you're using more than one server, be
7395 // careful when you're mixing PHP versions because newer PHP might generate hashes that
7396 // older versions would not understand.
7397 'algo' => 'auto',
7398
7399 // The parameters below are the same as options accepted by password_hash().
7400 // Set them to override that function's defaults.
7401 //
7402 // 'memory_cost' => PASSWORD_ARGON2_DEFAULT_MEMORY_COST,
7403 // 'time_cost' => PASSWORD_ARGON2_DEFAULT_TIME_COST,
7404 // 'threads' => PASSWORD_ARGON2_DEFAULT_THREADS,
7405 ],
7406 ],
7407 'type' => 'map',
7408 ];
7409
7410 /**
7411 * Whether to allow password resets ("enter some identifying data, and we'll send an email
7412 * with a temporary password you can use to get back into the account") identified by
7413 * various bits of data. Setting all of these to false (or the whole variable to false)
7414 * has the effect of disabling password resets entirely
7415 */
7416 public const PasswordResetRoutes = [
7417 'default' => [
7418 'username' => true,
7419 'email' => true,
7420 ],
7421 'type' => 'map',
7422 ];
7423
7424 /**
7425 * Maximum number of Unicode characters in signature
7426 */
7427 public const MaxSigChars = [
7428 'default' => 255,
7429 ];
7430
7431 /**
7432 * Behavior of signature validation. Allowed values are:
7433 * - 'warning' - invalid signatures cause a warning to be displayed on the preferences page,
7434 * but they are still used when signing comments; new invalid signatures can still be saved as
7435 * normal
7436 * - 'new' - existing invalid signatures behave as above; new invalid signatures can't be
7437 * saved
7438 * - 'disallow' - existing invalid signatures are no longer used when signing comments; new
7439 * invalid signatures can't be saved
7440 *
7441 * @since 1.35
7442 */
7443 public const SignatureValidation = [
7444 'default' => 'warning',
7445 ];
7446
7447 /**
7448 * List of lint error codes which don't cause signature validation to fail.
7449 *
7450 * @see https://www.mediawiki.org/wiki/Help:Lint_errors
7451 * @since 1.35
7452 */
7453 public const SignatureAllowedLintErrors = [
7454 'default' => [ 'obsolete-tag', ],
7455 'type' => 'list',
7456 ];
7457
7458 /**
7459 * Maximum number of bytes in username. You want to run the maintenance
7460 * script ./maintenance/checkUsernames.php once you have changed this value.
7461 */
7462 public const MaxNameChars = [
7463 'default' => 255,
7464 ];
7465
7466 /**
7467 * Array of usernames which may not be registered or logged in from
7468 * Maintenance scripts can still use these
7469 *
7470 * @see \MediaWiki\User\User::MAINTENANCE_SCRIPT_USER
7471 */
7472 public const ReservedUsernames = [
7473 'default' => [
7474 'MediaWiki default', // Default 'Main Page' and MediaWiki: message pages
7475 'Conversion script', // Used for the old Wikipedia software upgrade
7476 'Maintenance script', // Maintenance scripts which perform editing, image import script
7477 'Template namespace initialisation script', // Used in 1.2->1.3 upgrade
7478 'ScriptImporter', // Default user name used by maintenance/importSiteScripts.php
7479 'Delete page script', // Default user name used by maintenance/deleteBatch.php
7480 'Move page script', // Default user name used by maintenance/deleteBatch.php
7481 'Command line script', // Default user name used by maintenance/undelete.php
7482 'Unknown user', // Used in WikiImporter & RevisionStore for revisions with no author and in User for invalid user id
7483 'msg:double-redirect-fixer', // Automatic double redirect fix
7484 'msg:usermessage-editor', // Default user for leaving user messages
7485 'msg:proxyblocker', // For $wgProxyList and Special:Blockme (removed in 1.22)
7486 'msg:sorbs', // For $wgEnableDnsBlacklist etc.
7487 'msg:spambot_username', // Used by cleanupSpam.php
7488 'msg:autochange-username', // Used by anon category RC entries (parser functions, Lua & purges)
7489 ],
7490 'type' => 'list',
7491 ];
7492
7493 /**
7494 * Settings added to this array will override the default globals for the user
7495 * preferences used by anonymous visitors and newly created accounts.
7496 *
7497 * For instance, to disable editing on double clicks:
7498 * $wgDefaultUserOptions ['editondblclick'] = 0;
7499 *
7500 * To save storage space, no user_properties row will be stored for users with the
7501 * default setting for a given option, even if the user manually selects that option.
7502 * This means that a change to the defaults will change the setting for all users who
7503 * have been using the default setting; there is no way for users to opt out of this.
7504 * $wgConditionalUserOptions can be used to change the default value for future users
7505 * only.
7506 *
7507 * @see self::ConditionalUserOptions
7508 */
7509 public const DefaultUserOptions = [
7510 'default' =>
7511 // This array should be sorted by key
7512 [
7513 'ccmeonemails' => 0,
7514 'date' => 'default',
7515 'diffonly' => 0,
7516 'diff-type' => 'table',
7517 'disablemail' => 0,
7518 'editfont' => 'monospace',
7519 'editondblclick' => 0,
7520 'editrecovery' => 0,
7521 'editsectiononrightclick' => 0,
7522 'email-allow-new-users' => 1,
7523 'enotifminoredits' => 0,
7524 'enotifrevealaddr' => 0,
7525 'enotifusertalkpages' => 1,
7526 'enotifwatchlistpages' => 1,
7527 'extendwatchlist' => 1,
7528 'fancysig' => 0,
7529 'forceeditsummary' => 0,
7530 'forcesafemode' => 0,
7531 'gender' => 'unknown',
7532 'hidecategorization' => 1,
7533 'hideminor' => 0,
7534 'hidepatrolled' => 0,
7535 'imagesize' => 2,
7536 'minordefault' => 0,
7537 'newpageshidepatrolled' => 0,
7538 'nickname' => '',
7539 'norollbackdiff' => 0,
7540 'prefershttps' => 1,
7541 'previewonfirst' => 0,
7542 'previewontop' => 1,
7543 'pst-cssjs' => 1,
7544 'rcdays' => 7,
7545 'rcenhancedfilters-disable' => 0,
7546 'rclimit' => 50,
7547 'requireemail' => 0,
7548 'search-match-redirect' => true,
7549 'search-special-page' => 'Search',
7550 'search-thumbnail-extra-namespaces' => true,
7551 'searchlimit' => 20,
7552 'showhiddencats' => 0,
7553 'shownumberswatching' => 1,
7554 'showrollbackconfirmation' => 0,
7555 'skin' => false,
7556 'skin-responsive' => 1,
7557 'thumbsize' => 5,
7558 'underline' => 2,
7559 'useeditwarning' => 1,
7560 'uselivepreview' => 0,
7561 'usenewrc' => 1,
7562 'watchcreations' => 1,
7563 'watchdefault' => 1,
7564 'watchdeletion' => 0,
7565 'watchlistdays' => 7,
7566 'watchlisthideanons' => 0,
7567 'watchlisthidebots' => 0,
7568 'watchlisthidecategorization' => 1,
7569 'watchlisthideliu' => 0,
7570 'watchlisthideminor' => 0,
7571 'watchlisthideown' => 0,
7572 'watchlisthidepatrolled' => 0,
7573 'watchlistreloadautomatically' => 0,
7574 'watchlistunwatchlinks' => 0,
7575 'watchmoves' => 0,
7576 'watchrollback' => 0,
7577 'watchuploads' => 1,
7578 'wlenhancedfilters-disable' => 0,
7579 'wllimit' => 250,
7580 ],
7581 'type' => 'map',
7582 ];
7583
7584 /**
7585 * Conditional defaults for user options
7586 *
7587 * Map of user options to conditional defaults descriptors, which is an array
7588 * of conditional cases [ VALUE, CONDITION1, CONDITION2 ], where VALUE is the default value for
7589 * all users that meet ALL conditions, and each CONDITION is either a:
7590 * (a) a CUDCOND_* constant (when condition does not take any arguments), or
7591 * (b) an array [ CUDCOND_*, argument1, argument1, ... ] (when chosen condition takes at
7592 * least one argument).
7593 *
7594 * When `null` is used as the VALUE, it is interpreted as "no conditional default for this
7595 * condition". In other words, `null` and $wgDefaultUserOptions['user-option'] can be used
7596 * interchangeably as the VALUE.
7597 *
7598 * All conditions are evaluated in order. When no condition matches.
7599 * $wgDefaultUserOptions is used instead.
7600 *
7601 * Example of valid configuration:
7602 * $wgConditionalUserOptions['user-option'] = [
7603 * [ 'registered in 2024', [ CUDCOND_AFTER, '20240101000000' ] ]
7604 * ];
7605 *
7606 * List of valid conditions:
7607 * * CUDCOND_AFTER: user registered after given timestamp (args: string $timestamp)
7608 * * CUDCOND_ANON: allows specifying a default for anonymous (logged-out, non-temporary) users
7609 * * CUDCOND_NAMED: allows specifying a default for named (registered, non-temporary) users
7610 * * CUDCOND_USERGROUP: users with a specific user group
7611 *
7612 * @since 1.42
7613 * @see self::DefaultUserOptions
7614 */
7615 public const ConditionalUserOptions = [
7616 'default' => [],
7617 'type' => 'map',
7618 ];
7619
7620 /**
7621 * An array of preferences to not show for the user
7622 */
7623 public const HiddenPrefs = [
7624 'default' => [],
7625 'type' => 'list',
7626 ];
7627
7628 /**
7629 * Characters to prevent during new account creations.
7630 *
7631 * This is used in a regular expression character class during
7632 * registration (regex metacharacters like / are escaped).
7633 */
7634 public const InvalidUsernameCharacters = [
7635 'default' => '@:>=',
7636 ];
7637
7638 /**
7639 * Character used as a delimiter when testing for interwiki userrights
7640 * (In Special:UserRights, it is possible to modify users on different
7641 * databases if the delimiter is used, e.g. "Someuser@enwiki").
7642 *
7643 * It is recommended that you have this delimiter in
7644 * $wgInvalidUsernameCharacters above, or you will not be able to
7645 * modify the user rights of those users via Special:UserRights
7646 */
7647 public const UserrightsInterwikiDelimiter = [
7648 'default' => '@',
7649 ];
7650
7651 /**
7652 * This is to let user authenticate using https when they come from http.
7653 *
7654 * Based on an idea by George Herbert on wikitech-l:
7655 * https://lists.wikimedia.org/pipermail/wikitech-l/2010-October/050039.html
7656 *
7657 * @since 1.17
7658 */
7659 public const SecureLogin = [
7660 'default' => false,
7661 ];
7662
7663 /**
7664 * Versioning for authentication tokens.
7665 *
7666 * If non-null, this is combined with the user's secret (the user_token field
7667 * in the DB) to generate the token cookie. Changing this will invalidate all
7668 * active sessions (i.e. it will log everyone out).
7669 *
7670 * @since 1.27
7671 */
7672 public const AuthenticationTokenVersion = [
7673 'default' => null,
7674 'type' => '?string',
7675 ];
7676
7677 /**
7678 * MediaWiki\Session\SessionProvider configuration.
7679 *
7680 * Values are ObjectFactory specifications for the SessionProviders to be
7681 * used. Keys in the array are ignored; the class name is conventionally
7682 * used as the key to avoid collisions. Order is not significant.
7683 *
7684 * @since 1.27
7685 */
7686 public const SessionProviders = [
7687 'type' => 'map',
7688 'default' => [
7689 \MediaWiki\Session\CookieSessionProvider::class => [
7690 'class' => \MediaWiki\Session\CookieSessionProvider::class,
7691 'args' => [ [
7692 'priority' => 30,
7693 ] ],
7694 ],
7695 \MediaWiki\Session\BotPasswordSessionProvider::class => [
7696 'class' => \MediaWiki\Session\BotPasswordSessionProvider::class,
7697 'args' => [ [
7698 'priority' => 75,
7699 ] ],
7700 'services' => [
7701 'GrantsInfo'
7702 ],
7703 ],
7704 ],
7705 ];
7706
7707 /**
7708 * Configuration for automatic creation of temporary accounts on page save.
7709 * This can be enabled to avoid exposing the IP addresses of casual editors who
7710 * do not explicitly create an account.
7711 *
7712 * @warning This is EXPERIMENTAL, enabling may break extensions.
7713 *
7714 * An associative array with the following keys:
7715 *
7716 * - known: (bool) Whether auto-creation is known about. Set this to 'true' if
7717 * temp accounts have been created on this wiki already. This setting allows
7718 * temp users to be recognized even if auto-creation is currently disabled.
7719 * If auto-creation is enabled via the 'enabled' property, then 'known' is
7720 * overriden to true.
7721 * - enabled: (bool) Whether auto-creation is enabled. If changing this
7722 * value from 'true' to 'false', you should also set 'known' to true, so
7723 * that relevant code can continue to identify temporary accounts as
7724 * visually and conceptually distinct from anonymous accounts and named accounts.
7725 * - actions: (array) A list of actions for which the feature is enabled.
7726 * Currently only "edit" is supported.
7727 * - genPattern: (string) The pattern used when generating new usernames.
7728 * This should have "$1" indicating the place where the serial string will
7729 * be substituted.
7730 * - matchPattern: (string|string[]|null) The pattern used when determining whether a
7731 * username is a temporary user. This affects the rights of the user
7732 * and also prevents explicit creation of users with matching names.
7733 * This is ignored if "enabled" is false. If the value is null, the
7734 * the genPattern value is used as the matchPattern.
7735 * - reservedPattern: (string) A pattern used to determine whether a
7736 * username should be denied for explicit creation, in addition to
7737 * matchPattern. This is used even if "enabled" is false.
7738 * - serialProvider: (array) Configuration for generation of unique integer
7739 * indexes which are used to make temporary usernames.
7740 * - type: (string) May be "local" to allocate indexes using the local
7741 * database. If the CentralAuth extension is enabled, it may be
7742 * "centralauth". Extensions may plug in additional types using the
7743 * TempUserSerialProviders attribute.
7744 * - numShards (int, default 1): A small integer. This can be set to a
7745 * value greater than 1 to avoid acquiring a global lock when
7746 * allocating IDs, at the expense of making the IDs be non-monotonic.
7747 * - useYear: (bool) Restart at 1 each time the year changes (in UTC).
7748 * To avoid naming conflicts, the year is included in the name after
7749 * the prefix, in the form 'YYYY-'.
7750 * - serialMapping: (array) Configuration for mapping integer indexes to strings
7751 * to substitute into genPattern.
7752 * - type: (string) May be
7753 * - "plain-numeric" to use ASCII decimal numbers
7754 * - "localized-numeric" to use numbers localized using a specific language
7755 * - "filtered-radix" to use numbers in an arbitrary base between 2 and 36,
7756 * with an optional list of "bad" IDs to skip over.
7757 * - "scramble": to use ASCII decimal numbers that are short but
7758 * non-consecutive.
7759 * - language: (string) With "localized-numeric", the language code
7760 * - radix: (int) With "filtered-radix", the base
7761 * - badIndexes: (array) With "filtered-radix", an array with the bad unmapped
7762 * indexes in the values. The integers must be sorted and the list
7763 * must never change after the indexes have been allocated. The keys must
7764 * be zero-based array indexes.
7765 * - uppercase: (bool) With "filtered-radix", whether to use uppercase
7766 * letters, default false.
7767 * - offset: (int) With "plain-numeric", a constant to add to the stored index.
7768 * - expireAfterDays: (int|null, default 90) If not null, how many days should the temporary
7769 * accounts expire? Requires expireTemporaryAccounts.php to be periodically executed in
7770 * order to work.
7771 * - notifyBeforeExpirationDays: (int|null, default 10) If not null, how many days before the
7772 * expiration of a temporary account should it be notified that their account is to be expired.
7773 *
7774 * @unstable EXPERIMENTAL
7775 * @since 1.39
7776 */
7777 public const AutoCreateTempUser = [
7778 'properties' => [
7779 'known' => [ 'type' => 'bool', 'default' => false ],
7780 'enabled' => [ 'type' => 'bool', 'default' => false ],
7781 'actions' => [ 'type' => 'list', 'default' => [ 'edit' ] ],
7782 'genPattern' => [ 'type' => 'string', 'default' => '~$1' ],
7783 'matchPattern' => [ 'type' => 'string|array|null', 'default' => null ],
7784 'reservedPattern' => [ 'type' => 'string|null', 'default' => '~$1' ],
7785 'serialProvider' => [ 'type' => 'object', 'default' => [ 'type' => 'local', 'useYear' => true ] ],
7786 'serialMapping' => [ 'type' => 'object', 'default' => [ 'type' => 'plain-numeric' ] ],
7787 'expireAfterDays' => [ 'type' => 'int|null', 'default' => 90 ],
7788 'notifyBeforeExpirationDays' => [ 'type' => 'int|null', 'default' => 10 ],
7789 ],
7790 'type' => 'object',
7791 ];
7792
7793 // endregion -- end user accounts
7794
7795 /***************************************************************************/
7796 // region User rights, access control and monitoring
7797 /** @name User rights, access control and monitoring */
7798
7799 /**
7800 * Number of seconds before autoblock entries expire. Default 86400 = 1 day.
7801 */
7802 public const AutoblockExpiry = [
7803 'default' => 86400,
7804 ];
7805
7806 /**
7807 * Set this to true to allow blocked users to edit their own user talk page.
7808 *
7809 * This only applies to sitewide blocks. Partial blocks always allow users to
7810 * edit their own user talk page unless otherwise specified in the block
7811 * restrictions.
7812 */
7813 public const BlockAllowsUTEdit = [
7814 'default' => true,
7815 ];
7816
7817 /**
7818 * Limits on the possible sizes of range blocks.
7819 *
7820 * CIDR notation is hard to understand, it's easy to mistakenly assume that a
7821 * /1 is a small range and a /31 is a large range. For IPv4, setting a limit of
7822 * half the number of bits avoids such errors, and allows entire ISPs to be
7823 * blocked using a small number of range blocks.
7824 *
7825 * For IPv6, RFC 3177 recommends that a /48 be allocated to every residential
7826 * customer, so range blocks larger than /64 (half the number of bits) will
7827 * plainly be required. RFC 4692 implies that a very large ISP may be
7828 * allocated a /19 if a generous HD-Ratio of 0.8 is used, so we will use that
7829 * as our limit. As of 2012, blocking the whole world would require a /4 range.
7830 */
7831 public const BlockCIDRLimit = [
7832 'default' => [
7833 'IPv4' => 16,
7834 'IPv6' => 19,
7835 ],
7836 'type' => 'map',
7837 ];
7838
7839 /**
7840 * If true, sitewide blocked users will not be allowed to login. (Direct
7841 * blocks only; IP blocks are ignored.) This can be used to remove users'
7842 * read access on a private wiki.
7843 */
7844 public const BlockDisablesLogin = [
7845 'default' => false,
7846 ];
7847
7848 /**
7849 * Flag to enable partial blocks against performing certain actions.
7850 *
7851 * @unstable Temporary feature flag, T280532
7852 * @since 1.37
7853 */
7854 public const EnablePartialActionBlocks = [
7855 'default' => false,
7856 'type' => 'boolean',
7857 ];
7858
7859 /**
7860 * If this is false, the number of blocks of a given target is limited to only 1.
7861 *
7862 * @since 1.42
7863 */
7864 public const EnableMultiBlocks = [
7865 'default' => false,
7866 'type' => 'boolean',
7867 ];
7868
7869 /**
7870 * Ipblocks table schema migration stage, for normalizing ipb_address field and
7871 * adding the block_target table.
7872 *
7873 * Use the SCHEMA_COMPAT_XXX flags. Supported values:
7874 *
7875 * - SCHEMA_COMPAT_OLD
7876 * - SCHEMA_COMPAT_WRITE_BOTH | SCHEMA_COMPAT_READ_OLD
7877 * - SCHEMA_COMPAT_NEW
7878 *
7879 * History:
7880 * - 1.42: Added
7881 * - 1.43: Default changed from SCHEMA_COMPAT_OLD to SCHEMA_COMPAT_NEW
7882 * - 1.43: Deprecated, ignored, SCHEMA_COMPAT_NEW is implied
7883 *
7884 * @deprecated since 1.43
7885 */
7886 public const BlockTargetMigrationStage = [
7887 'default' => SCHEMA_COMPAT_NEW,
7888 'type' => 'integer',
7889 ];
7890
7891 /**
7892 * Pages anonymous user may see, set as an array of pages titles.
7893 *
7894 * **Example:**
7895 *
7896 * ```
7897 * $wgWhitelistRead = [ "Main Page", "Wikipedia:Help" ];
7898 * ```
7899 *
7900 * Special:Userlogin and Special:ChangePassword are always allowed.
7901 *
7902 * @note This will only work if $wgGroupPermissions['*']['read'] is false --
7903 * see below. Otherwise, ALL pages are accessible, regardless of this setting.
7904 * @note Also that this will only protect _pages in the wiki_. Uploaded files
7905 * will remain readable. You can use img_auth.php to protect uploaded files,
7906 * see https://www.mediawiki.org/wiki/Manual:Image_Authorization
7907 * @note Extensions should not modify this, but use the TitleReadWhitelist
7908 * hook instead.
7909 */
7910 public const WhitelistRead = [
7911 'default' => false,
7912 ];
7913
7914 /**
7915 * Pages anonymous user may see, set as an array of regular expressions.
7916 *
7917 * This function will match the regexp against the title name, which
7918 * is without underscore.
7919 *
7920 * **Example:**
7921 * To whitelist [[Main Page]]:
7922 *
7923 * ```
7924 * $wgWhitelistReadRegexp = [ "/Main Page/" ];
7925 * ```
7926 * @note Unless ^ and/or $ is specified, a regular expression might match
7927 * pages not intended to be allowed. The above example will also
7928 * allow a page named 'Security Main Page'.
7929 *
7930 * **Example:**
7931 * To allow reading any page starting with 'User' regardless of the case:
7932 *
7933 * ```
7934 * $wgWhitelistReadRegexp = [ "@^UsEr.*@i" ];
7935 * ```
7936 *
7937 * Will allow both [[User is banned]] and [[User:JohnDoe]]
7938 * @note This will only work if $wgGroupPermissions['*']['read'] is false --
7939 * see below. Otherwise, ALL pages are accessible, regardless of this setting.
7940 */
7941 public const WhitelistReadRegexp = [
7942 'default' => false,
7943 ];
7944
7945 /**
7946 * Should editors be required to have a validated e-mail
7947 * address before being allowed to edit?
7948 */
7949 public const EmailConfirmToEdit = [
7950 'default' => false,
7951 ];
7952
7953 /**
7954 * Should MediaWiki attempt to protect user's privacy when doing redirects?
7955 * Keep this true if access counts to articles are made public.
7956 */
7957 public const HideIdentifiableRedirects = [
7958 'default' => true,
7959 ];
7960
7961 /**
7962 * Permission keys given to users in each group.
7963 *
7964 * This is an array where the keys are all groups and each value is an
7965 * array of the format (right => boolean).
7966 *
7967 * The second format is used to support per-namespace permissions.
7968 * Note that this feature does not fully work for all permission types.
7969 *
7970 * All users are implicitly in the '*' group including anonymous visitors;
7971 * logged-in users are all implicitly in the 'user' group. These will be
7972 * combined with the permissions of all groups that a given user is listed
7973 * in the user_groups table.
7974 *
7975 * Note: Don't set $wgGroupPermissions = []; unless you know what you're
7976 * doing! This will wipe all permissions, and may mean that your users are
7977 * unable to perform certain essential tasks or access new functionality
7978 * when new permissions are introduced and default grants established.
7979 *
7980 * Functionality to make pages inaccessible has not been extensively tested
7981 * for security. Use at your own risk!
7982 *
7983 * This replaces $wgWhitelistAccount and $wgWhitelistEdit
7984 */
7985 public const GroupPermissions = [
7986 'type' => 'map',
7987 'additionalProperties' => [
7988 'type' => 'map',
7989 'additionalProperties' => [ 'type' => 'boolean', ],
7990 ],
7991 'mergeStrategy' => 'array_plus_2d',
7992 'default' => [
7993 '*' => [
7994 'createaccount' => true,
7995 'read' => true,
7996 'edit' => true,
7997 'createpage' => true,
7998 'createtalk' => true,
7999 'viewmyprivateinfo' => true,
8000 'editmyprivateinfo' => true,
8001 'editmyoptions' => true,
8002 ],
8003 'user' => [
8004 'move' => true,
8005 'move-subpages' => true,
8006 'move-rootuserpages' => true,
8007 'move-categorypages' => true,
8008 'movefile' => true,
8009 'read' => true,
8010 'edit' => true,
8011 'createpage' => true,
8012 'createtalk' => true,
8013 'upload' => true,
8014 'reupload' => true,
8015 'reupload-shared' => true,
8016 'minoredit' => true,
8017 'editmyusercss' => true,
8018 'editmyuserjson' => true,
8019 'editmyuserjs' => true,
8020 'editmyuserjsredirect' => true,
8021 'sendemail' => true,
8022 'applychangetags' => true,
8023 'changetags' => true,
8024 'editcontentmodel' => true,
8025 'viewmywatchlist' => true,
8026 'editmywatchlist' => true,
8027 ],
8028 'autoconfirmed' => [
8029 'autoconfirmed' => true,
8030 'editsemiprotected' => true,
8031 ],
8032 'bot' => [
8033 'bot' => true,
8034 'autoconfirmed' => true,
8035 'editsemiprotected' => true,
8036 'nominornewtalk' => true,
8037 'autopatrol' => true,
8038 'suppressredirect' => true,
8039 'apihighlimits' => true,
8040 ],
8041 'sysop' => [
8042 'block' => true,
8043 'createaccount' => true,
8044 'delete' => true,
8045 'bigdelete' => true,
8046 'deletedhistory' => true,
8047 'deletedtext' => true,
8048 'undelete' => true,
8049 'editinterface' => true,
8050 'editsitejson' => true,
8051 'edituserjson' => true,
8052 'import' => true,
8053 'importupload' => true,
8054 'move' => true,
8055 'move-subpages' => true,
8056 'move-rootuserpages' => true,
8057 'move-categorypages' => true,
8058 'patrol' => true,
8059 'autopatrol' => true,
8060 'protect' => true,
8061 'editprotected' => true,
8062 'rollback' => true,
8063 'upload' => true,
8064 'reupload' => true,
8065 'reupload-shared' => true,
8066 'unwatchedpages' => true,
8067 'autoconfirmed' => true,
8068 'editsemiprotected' => true,
8069 'ipblock-exempt' => true,
8070 'blockemail' => true,
8071 'markbotedits' => true,
8072 'apihighlimits' => true,
8073 'browsearchive' => true,
8074 'noratelimit' => true,
8075 'movefile' => true,
8076 'unblockself' => true,
8077 'suppressredirect' => true,
8078 'mergehistory' => true,
8079 'managechangetags' => true,
8080 'deletechangetags' => true,
8081 ],
8082 'interface-admin' => [
8083 'editinterface' => true,
8084 'editsitecss' => true,
8085 'editsitejson' => true,
8086 'editsitejs' => true,
8087 'editusercss' => true,
8088 'edituserjson' => true,
8089 'edituserjs' => true,
8090 ],
8091 'bureaucrat' => [
8092 'userrights' => true,
8093 'noratelimit' => true,
8094 'renameuser' => true,
8095 ],
8096 'suppress' => [
8097 'hideuser' => true,
8098 'suppressrevision' => true,
8099 'viewsuppressed' => true,
8100 'suppressionlog' => true,
8101 'deleterevision' => true,
8102 'deletelogentry' => true,
8103 ],
8104 ],
8105 ];
8106
8107 /**
8108 * List of groups which should be considered privileged (user accounts
8109 * belonging in these groups can be abused in dangerous ways).
8110 * This is used for some security checks, mainly logging.
8111 * @since 1.41
8112 * @see \MediaWiki\User\UserGroupManager::getUserPrivilegedGroups()
8113 */
8114 public const PrivilegedGroups = [
8115 'default' => [
8116 'bureaucrat',
8117 'interface-admin',
8118 'suppress',
8119 'sysop',
8120 ],
8121 'type' => 'list',
8122 ];
8123
8124 /**
8125 * Permission keys revoked from users in each group.
8126 *
8127 * This acts the same way as $wgGroupPermissions above, except that
8128 * if the user is in a group here, the permission will be removed from them.
8129 *
8130 * Improperly setting this could mean that your users will be unable to perform
8131 * certain essential tasks, so use at your own risk!
8132 */
8133 public const RevokePermissions = [
8134 'default' => [],
8135 'type' => 'map',
8136 'mergeStrategy' => 'array_plus_2d',
8137 ];
8138
8139 /**
8140 * Groups that should inherit permissions from another group
8141 *
8142 * This allows defining a group that inherits its permissions
8143 * from another group without having to copy all the permission
8144 * grants over. For example, if you wanted a manual "confirmed"
8145 * group that had the same permissions as "autoconfirmed":
8146 *
8147 * ```
8148 * $wgGroupInheritsPermissions['confirmed'] = 'autoconfirmed';
8149 * ```
8150 *
8151 * Recursive inheritance is currently not supported. In the above
8152 * example, confirmed will only gain the permissions explicitly
8153 * granted (or revoked) from autoconfirmed, not any permissions
8154 * that autoconfirmed might inherit.
8155 *
8156 * @since 1.38
8157 */
8158 public const GroupInheritsPermissions = [
8159 'default' => [],
8160 'type' => 'map',
8161 'additionalProperties' => [ 'type' => 'string', ],
8162 ];
8163
8164 /**
8165 * Implicit groups, aren't shown on Special:Listusers or somewhere else
8166 */
8167 public const ImplicitGroups = [
8168 'default' => [ '*', 'user', 'autoconfirmed' ],
8169 'type' => 'list',
8170 ];
8171
8172 /**
8173 * A map of group names that the user is in, to group names that those users
8174 * are allowed to add or revoke.
8175 *
8176 * Setting the list of groups to add or revoke to true is equivalent to "any
8177 * group".
8178 *
8179 * **Example:**
8180 * To allow sysops to add themselves to the "bot" group:
8181 *
8182 * ```
8183 * $wgGroupsAddToSelf = [ 'sysop' => [ 'bot' ] ];
8184 * ```
8185 *
8186 * **Example:**
8187 * Implicit groups may be used for the source group, for instance:
8188 *
8189 * ```
8190 * $wgGroupsRemoveFromSelf = [ '*' => true ];
8191 * ```
8192 *
8193 * This allows users in the '*' group (i.e. any user) to remove themselves from
8194 * any group that they happen to be in.
8195 */
8196 public const GroupsAddToSelf = [
8197 'default' => [],
8198 'type' => 'map',
8199 ];
8200
8201 /**
8202 * @see self::GroupsAddToSelf
8203 */
8204 public const GroupsRemoveFromSelf = [
8205 'default' => [],
8206 'type' => 'map',
8207 ];
8208
8209 /**
8210 * Set of available actions that can be restricted via action=protect
8211 * You probably shouldn't change this.
8212 *
8213 * Translated through restriction-* messages.
8214 * RestrictionStore::listApplicableRestrictionTypes() will remove restrictions that are not
8215 * applicable to a specific title (create and upload)
8216 */
8217 public const RestrictionTypes = [
8218 'default' => [ 'create', 'edit', 'move', 'upload' ],
8219 'type' => 'list',
8220 ];
8221
8222 /**
8223 * Rights which can be required for each protection level (via action=protect)
8224 *
8225 * You can add a new protection level that requires a specific
8226 * permission by manipulating this array. The ordering of elements
8227 * dictates the order on the protection form's lists.
8228 *
8229 * - '' will be ignored (i.e. unprotected)
8230 * - 'autoconfirmed' is quietly rewritten to 'editsemiprotected' for backwards compatibility
8231 * - 'sysop' is quietly rewritten to 'editprotected' for backwards compatibility
8232 */
8233 public const RestrictionLevels = [
8234 'default' => [ '', 'autoconfirmed', 'sysop' ],
8235 'type' => 'list',
8236 ];
8237
8238 /**
8239 * Restriction levels that can be used with cascading protection
8240 *
8241 * A page can only be protected with cascading protection if the
8242 * requested restriction level is included in this array.
8243 *
8244 * 'autoconfirmed' is quietly rewritten to 'editsemiprotected' for backwards compatibility.
8245 * 'sysop' is quietly rewritten to 'editprotected' for backwards compatibility.
8246 */
8247 public const CascadingRestrictionLevels = [
8248 'default' => [ 'sysop', ],
8249 'type' => 'list',
8250 ];
8251
8252 /**
8253 * Restriction levels that should be considered "semiprotected"
8254 *
8255 * Certain places in the interface recognize a dichotomy between "protected"
8256 * and "semiprotected", without further distinguishing the specific levels. In
8257 * general, if anyone can be eligible to edit a protection level merely by
8258 * reaching some condition in $wgAutopromote, it should probably be considered
8259 * "semiprotected".
8260 *
8261 * 'autoconfirmed' is quietly rewritten to 'editsemiprotected' for backwards compatibility.
8262 * 'sysop' is not changed, since it really shouldn't be here.
8263 */
8264 public const SemiprotectedRestrictionLevels = [
8265 'default' => [ 'autoconfirmed', ],
8266 'type' => 'list',
8267 ];
8268
8269 /**
8270 * Set the minimum permissions required to edit pages in each
8271 * namespace. If you list more than one permission, a user must
8272 * have all of them to edit pages in that namespace.
8273 *
8274 * @note NS_MEDIAWIKI is implicitly restricted to 'editinterface'.
8275 */
8276 public const NamespaceProtection = [
8277 'default' => [],
8278 'type' => 'map',
8279 ];
8280
8281 /**
8282 * Pages in namespaces in this array can not be used as templates.
8283 *
8284 * Elements MUST be numeric namespace ids, you can safely use the MediaWiki
8285 * namespaces constants (NS_USER, NS_MAIN...).
8286 *
8287 * Among other things, this may be useful to enforce read-restrictions
8288 * which may otherwise be bypassed by using the template mechanism.
8289 */
8290 public const NonincludableNamespaces = [
8291 'default' => [],
8292 'type' => 'map',
8293 ];
8294
8295 /**
8296 * Number of seconds an account is required to age before it's given the
8297 * implicit 'autoconfirm' group membership. This can be used to limit
8298 * privileges of new accounts.
8299 *
8300 * Accounts created by earlier versions of the software may not have a
8301 * recorded creation date, and will always be considered to pass the age test.
8302 *
8303 * When left at 0, all registered accounts will pass.
8304 *
8305 * **Example:**
8306 * Set automatic confirmation to 10 minutes (which is 600 seconds):
8307 *
8308 * ```
8309 * $wgAutoConfirmAge = 600; // ten minutes
8310 * ```
8311 *
8312 * Set age to one day:
8313 *
8314 * ```
8315 * $wgAutoConfirmAge = 3600*24; // one day
8316 * ```
8317 */
8318 public const AutoConfirmAge = [
8319 'default' => 0,
8320 ];
8321
8322 /**
8323 * Number of edits an account requires before it is autoconfirmed.
8324 *
8325 * Passing both this AND the time requirement is needed. Example:
8326 *
8327 * **Example:**
8328 *
8329 * ```
8330 * $wgAutoConfirmCount = 50;
8331 * ```
8332 */
8333 public const AutoConfirmCount = [
8334 'default' => 0,
8335 ];
8336
8337 /**
8338 * Array containing the conditions of automatic promotion of a user to specific groups.
8339 *
8340 * The basic syntax for `$wgAutopromote` is:
8341 *
8342 * $wgAutopromote = [
8343 * 'groupname' => cond,
8344 * 'group2' => cond2,
8345 * ];
8346 *
8347 * A `cond` may be:
8348 * - a single condition without arguments:
8349 * Note that Autopromote wraps a single non-array value into an array
8350 * e.g. `APCOND_EMAILCONFIRMED` OR
8351 * [ `APCOND_EMAILCONFIRMED` ]
8352 * - a single condition with arguments:
8353 * e.g. `[ APCOND_EDITCOUNT, 100 ]`
8354 * - a set of conditions:
8355 * e.g. `[ 'operand', cond1, cond2, ... ]`
8356 *
8357 * When constructing a set of conditions, the following conditions are available:
8358 * - `&` (**AND**):
8359 * promote if user matches **ALL** conditions
8360 * - `|` (**OR**):
8361 * promote if user matches **ANY** condition
8362 * - `^` (**XOR**):
8363 * promote if user matches **ONLY ONE OF THE CONDITIONS**
8364 * - `!` (**NOT**):
8365 * promote if user matces **NO** condition
8366 * - [ APCOND_EMAILCONFIRMED ]:
8367 * true if user has a confirmed e-mail
8368 * - [ APCOND_EDITCOUNT, number of edits (if null or missing $wgAutoConfirmCount will be used)]:
8369 * true if user has the at least the number of edits as the passed parameter
8370 * - [ APCOND_AGE, seconds since registration (if null or missing $wgAutoConfirmAge will be used)]:
8371 * true if the length of time since the user created his/her account
8372 * is at least the same length of time as the passed parameter
8373 * - [ APCOND_AGE_FROM_EDIT, seconds since first edit ]:
8374 * true if the length of time since the user made his/her first edit
8375 * is at least the same length of time as the passed parameter
8376 * - [ APCOND_INGROUPS, group1, group2, ... ]:
8377 * true if the user is a member of each of the passed groups
8378 * - [ APCOND_ISIP, ip ]:
8379 * true if the user has the passed IP address
8380 * - [ APCOND_IPINRANGE, range ]:
8381 * true if the user has an IP address in the range of the passed parameter
8382 * - [ APCOND_BLOCKED ]:
8383 * true if the user is sitewide blocked
8384 * - [ APCOND_ISBOT ]:
8385 * true if the user is a bot
8386 * - similar constructs can be defined by extensions
8387 *
8388 * The sets of conditions are evaluated recursively, so you can use nested sets of conditions
8389 * linked by operands.
8390 *
8391 * Note that if $wgEmailAuthentication is disabled, APCOND_EMAILCONFIRMED will be true for any
8392 * user who has provided an e-mail address.
8393 */
8394 public const Autopromote = [
8395 'default' => [
8396 'autoconfirmed' => [ '&',
8397 [ APCOND_EDITCOUNT, null ], // NOTE: null means $wgAutoConfirmCount
8398 [ APCOND_AGE, null ], // NOTE: null means AutoConfirmAge
8399 ],
8400 ],
8401 'type' => 'map',
8402 ];
8403
8404 /**
8405 * Automatically add a usergroup to any user who matches certain conditions.
8406 *
8407 * Does not add the user to the group again if it has been removed.
8408 * Also, does not remove the group if the user no longer meets the criteria.
8409 *
8410 * The format is:
8411 *
8412 * ```
8413 * [ event => criteria, ... ]
8414 * ```
8415 *
8416 * The only recognised value for event is 'onEdit' (when the user edits).
8417 *
8418 * Criteria has the same format as $wgAutopromote
8419 *
8420 * @see self::Autopromote
8421 * @since 1.18
8422 */
8423 public const AutopromoteOnce = [
8424 'default' => [ 'onEdit' => [], ],
8425 'type' => 'map',
8426 ];
8427
8428 /**
8429 * Put user rights log entries for autopromotion in recent changes?
8430 *
8431 * @since 1.18
8432 */
8433 public const AutopromoteOnceLogInRC = [
8434 'default' => true,
8435 ];
8436
8437 /**
8438 * $wgAddGroups and $wgRemoveGroups can be used to give finer control over who
8439 * can assign which groups at Special:Userrights.
8440 *
8441 * **Example:**
8442 * Bureaucrats can add any group:
8443 *
8444 * ```
8445 * $wgAddGroups['bureaucrat'] = true;
8446 * ```
8447 *
8448 * Bureaucrats can only remove bots and sysops:
8449 *
8450 * ```
8451 * $wgRemoveGroups['bureaucrat'] = [ 'bot', 'sysop' ];
8452 * ```
8453 *
8454 * Sysops can make bots:
8455 *
8456 * ```
8457 * $wgAddGroups['sysop'] = [ 'bot' ];
8458 * ```
8459 *
8460 * Sysops can disable other sysops in an emergency, and disable bots:
8461 *
8462 * ```
8463 * $wgRemoveGroups['sysop'] = [ 'sysop', 'bot' ];
8464 * ```
8465 */
8466 public const AddGroups = [
8467 'default' => [],
8468 'type' => 'map',
8469 ];
8470
8471 /**
8472 * @see self::AddGroups
8473 */
8474 public const RemoveGroups = [
8475 'default' => [],
8476 'type' => 'map',
8477 ];
8478
8479 /**
8480 * A list of available rights, in addition to the ones defined by the core.
8481 * Rights in this list are denied unless explicitly granted, typically
8482 * using GroupPermissions.
8483 *
8484 * For extensions only.
8485 *
8486 * @see self::GroupPermissions
8487 * @see self::ImplicitRights
8488 */
8489 public const AvailableRights = [
8490 'default' => [],
8491 'type' => 'list',
8492 'items' => [ 'type' => 'string', ],
8493 ];
8494
8495 /**
8496 * A list of implicit rights, in addition to the ones defined by the core.
8497 * Rights in this list are granted implicitly to all users, but rate limits
8498 * may apply to them.
8499 *
8500 * Extensions that define rate limits should add the corresponding right to
8501 * either ImplicitRights or AvailableRights, depending on whether the right
8502 * should be granted to everyone.
8503 *
8504 * @since 1.41
8505 * @see self::RateLimits
8506 * @see self::AvailableRights
8507 */
8508 public const ImplicitRights = [
8509 'default' => [],
8510 'type' => 'list',
8511 'items' => [ 'type' => 'string', ]
8512 ];
8513
8514 /**
8515 * Optional to restrict deletion of pages with higher revision counts
8516 * to users with the 'bigdelete' permission. (Default given to sysops.)
8517 */
8518 public const DeleteRevisionsLimit = [
8519 'default' => 0,
8520 ];
8521
8522 /**
8523 * Page deletions with > this number of revisions will use the job queue.
8524 *
8525 * Revisions will be archived in batches of (at most) this size, one batch per job.
8526 */
8527 public const DeleteRevisionsBatchSize = [
8528 'default' => 1000,
8529 ];
8530
8531 /**
8532 * The maximum number of edits a user can have and
8533 * can still be hidden by users with the hideuser permission.
8534 *
8535 * This is limited for performance reason.
8536 * Set to false to disable the limit.
8537 *
8538 * @since 1.23
8539 */
8540 public const HideUserContribLimit = [
8541 'default' => 1000,
8542 ];
8543
8544 /**
8545 * Number of accounts each IP address may create per specified period(s).
8546 *
8547 * **Example:**
8548 *
8549 * ```
8550 * $wgAccountCreationThrottle = [
8551 * // no more than 100 per month
8552 * [
8553 * 'count' => 100,
8554 * 'seconds' => 30*86400,
8555 * ],
8556 * // no more than 10 per day
8557 * [
8558 * 'count' => 10,
8559 * 'seconds' => 86400,
8560 * ],
8561 * ];
8562 * ```
8563 *
8564 * @note For backwards compatibility reasons, this may also be given as a single
8565 * integer, representing the number of account creations per day.
8566 * @see self::TempAccountCreationThrottle for the temporary accounts version of
8567 * this throttle
8568 * @warning Requires $wgMainCacheType to be enabled
8569 */
8570 public const AccountCreationThrottle = [
8571 'default' => [ [
8572 'count' => 0,
8573 'seconds' => 86400,
8574 ] ],
8575 'type' => 'int|list',
8576 ];
8577
8578 /**
8579 * Number of temporary accounts each IP address may create per specified period(s).
8580 *
8581 * **Example:**
8582 *
8583 * ```
8584 * $wgTempAccountCreationThrottle = [
8585 * // no more than 100 per month
8586 * [
8587 * 'count' => 100,
8588 * 'seconds' => 30*86400,
8589 * ],
8590 * // no more than 6 per day
8591 * [
8592 * 'count' => 6,
8593 * 'seconds' => 86400,
8594 * ],
8595 * ];
8596 * ```
8597 *
8598 * @see self::AccountCreationThrottle for the regular account version of this throttle.
8599 * @warning Requires $wgMainCacheType to be enabled
8600 *
8601 * @since 1.42
8602 */
8603 public const TempAccountCreationThrottle = [
8604 'default' => [ [
8605 'count' => 6,
8606 'seconds' => 86400,
8607 ] ],
8608 'type' => 'list',
8609 ];
8610
8611 /**
8612 * Number of temporary accounts usernames each IP address may acquire per specified period(s).
8613 *
8614 * This should be set to a higher value than TempAccountCreationThrottle.
8615 *
8616 * On editing, we first attempt to acquire a temp username before proceeding with saving an edit
8617 * and potentially creating a temp account if the edit save is successful.
8618 *
8619 * Some edits may fail (due to core or extensions denying an edit); this throttle ensures that
8620 * there are limits to the number of temporary account names that can be acquired and stored in
8621 * the database.
8622 *
8623 * **Example:**
8624 *
8625 * ```
8626 * $wgTempAccountNameAcquisitionThrottle = [
8627 * // no more than 100 per month
8628 * [
8629 * 'count' => 100,
8630 * 'seconds' => 30*86400,
8631 * ],
8632 * // no more than 60 per day
8633 * [
8634 * 'count' => 60,
8635 * 'seconds' => 86400,
8636 * ],
8637 * ];
8638 * ```
8639 *
8640 * @see self::TempAccountCreationThrottle Make sure that TempAccountNameAcquisitionThrottle is greater than or
8641 * equal to TempAccountCreationThrottle
8642 * @warning Requires $wgMainCacheType to be enabled
8643 *
8644 * @since 1.42
8645 */
8646 public const TempAccountNameAcquisitionThrottle = [
8647 'default' => [ [
8648 'count' => 60,
8649 'seconds' => 86400,
8650 ] ],
8651 'type' => 'list',
8652 ];
8653
8654 /**
8655 * Edits matching these regular expressions in body text
8656 * will be recognised as spam and rejected automatically.
8657 *
8658 * There's no administrator override on-wiki, so be careful what you set. :)
8659 * May be an array of regexes or a single string for backwards compatibility.
8660 *
8661 * @see https://en.wikipedia.org/wiki/Regular_expression
8662 * @note Each regex needs a beginning/end delimiter, eg: # or /
8663 */
8664 public const SpamRegex = [
8665 'default' => [],
8666 'type' => 'list',
8667 ];
8668
8669 /**
8670 * Same as SpamRegex except for edit summaries
8671 */
8672 public const SummarySpamRegex = [
8673 'default' => [],
8674 'type' => 'list',
8675 ];
8676
8677 /**
8678 * Whether to use DNS blacklists in $wgDnsBlacklistUrls to check for open
8679 * proxies
8680 *
8681 * @since 1.16
8682 */
8683 public const EnableDnsBlacklist = [
8684 'default' => false,
8685 ];
8686
8687 /**
8688 * List of DNS blacklists to use, if $wgEnableDnsBlacklist is true.
8689 *
8690 * This is an array of either a URL or an array with the URL and a key (should
8691 * the blacklist require a key).
8692 *
8693 * **Example:**
8694 *
8695 * ```
8696 * $wgDnsBlacklistUrls = [
8697 * // String containing URL
8698 * 'http.dnsbl.sorbs.net.',
8699 * // Array with URL and key, for services that require a key
8700 * [ 'dnsbl.httpbl.net.', 'mykey' ],
8701 * // Array with just the URL. While this works, it is recommended that you
8702 * // just use a string as shown above
8703 * [ 'opm.tornevall.org.' ]
8704 * ];
8705 * ```
8706 *
8707 * @note You should end the domain name with a . to avoid searching your
8708 * eventual domain search suffixes.
8709 * @since 1.16
8710 */
8711 public const DnsBlacklistUrls = [
8712 'default' => [],
8713 'type' => 'list',
8714 ];
8715
8716 /**
8717 * List of banned IP addresses.
8718 *
8719 * This can have the following formats:
8720 * - An array of addresses
8721 * - A string, in which case this is the path to a file
8722 * containing the list of IP addresses, one per line
8723 */
8724 public const ProxyList = [
8725 'default' => [],
8726 'type' => 'string|list',
8727 ];
8728
8729 /**
8730 * Proxy whitelist, list of addresses that are assumed to be non-proxy despite
8731 * what the other methods might say.
8732 */
8733 public const ProxyWhitelist = [
8734 'default' => [],
8735 'type' => 'list',
8736 ];
8737
8738 /**
8739 * IP ranges that should be considered soft-blocked (anon-only, account
8740 * creation allowed). The intent is to use this to prevent anonymous edits from
8741 * shared resources such as Wikimedia Labs.
8742 *
8743 * @since 1.29
8744 */
8745 public const SoftBlockRanges = [
8746 'default' => [],
8747 'type' => 'list',
8748 'items' => [ 'type' => 'string', ],
8749 ];
8750
8751 /**
8752 * Whether to look at the X-Forwarded-For header's list of (potentially spoofed)
8753 * IPs and apply IP blocks to them. This allows for IP blocks to work with correctly-configured
8754 * (transparent) proxies without needing to block the proxies themselves.
8755 */
8756 public const ApplyIpBlocksToXff = [
8757 'default' => false,
8758 ];
8759
8760 /**
8761 * Simple rate limiter options to brake edit floods.
8762 *
8763 * Maximum number actions allowed in the given number of seconds; after that
8764 * the violating client receives HTTP 500 error pages until the period
8765 * elapses.
8766 *
8767 * **Example:**
8768 * Limits per configured per action and then type of users.
8769 *
8770 * ```
8771 * $wgRateLimits = [
8772 * 'edit' => [
8773 * 'anon' => [ x, y ], // any and all anonymous edits (aggregate)
8774 * 'user' => [ x, y ], // each logged-in user
8775 * 'user-global' => [ x, y ], // per username, across all sites (assumes names are
8776 * global)
8777 * 'newbie' => [ x, y ], // each new autoconfirmed accounts; overrides 'user'
8778 * 'ip' => [ x, y ], // each anon and recent account, across all sites
8779 * 'subnet' => [ x, y ], // ... within a /24 subnet in IPv4 or /64 in IPv6
8780 * 'ip-all' => [ x, y ], // per ip, across all sites
8781 * 'subnet-all' => [ x, y ], // ... within a /24 subnet in IPv4 or /64 in IPv6
8782 * 'groupName' => [ x, y ], // by group membership
8783 * ]
8784 * ];
8785 * ```
8786 *
8787 * **Normally, the 'noratelimit' right allows a user to bypass any rate**
8788 * limit checks. This can be disabled on a per-action basis by setting the
8789 * special '&can-bypass' key to false in that action's configuration.
8790 *
8791 * ```
8792 * $wgRateLimits = [
8793 * 'some-action' => [
8794 * '&can-bypass' => false,
8795 * 'user' => [ x, y ],
8796 * ];
8797 * ```
8798 *
8799 * @see self::ImplicitRights
8800 * @warning Requires that $wgMainCacheType is set to something persistent
8801 */
8802 public const RateLimits = [
8803 'default' => [
8804 // Page edits
8805 'edit' => [
8806 'ip' => [ 8, 60 ],
8807 'newbie' => [ 8, 60 ],
8808 'user' => [ 90, 60 ],
8809 ],
8810 // Page moves
8811 'move' => [
8812 'newbie' => [ 2, 120 ],
8813 'user' => [ 8, 60 ],
8814 ],
8815 // File uploads
8816 'upload' => [
8817 'ip' => [ 8, 60 ],
8818 'newbie' => [ 8, 60 ],
8819 ],
8820 // Page rollbacks
8821 'rollback' => [
8822 'user' => [ 10, 60 ],
8823 'newbie' => [ 5, 120 ]
8824 ],
8825 // Triggering password resets emails
8826 'mailpassword' => [
8827 'ip' => [ 5, 3600 ],
8828 ],
8829 // Emailing other users using MediaWiki
8830 'sendemail' => [
8831 'ip' => [ 5, 86400 ],
8832 'newbie' => [ 5, 86400 ],
8833 'user' => [ 20, 86400 ],
8834 ],
8835 'changeemail' => [
8836 'ip-all' => [ 10, 3600 ],
8837 'user' => [ 4, 86400 ]
8838 ],
8839 // since 1.33 - rate limit email confirmations
8840 'confirmemail' => [
8841 'ip-all' => [ 10, 3600 ],
8842 'user' => [ 4, 86400 ]
8843 ],
8844 // Purging pages
8845 'purge' => [
8846 'ip' => [ 30, 60 ],
8847 'user' => [ 30, 60 ],
8848 ],
8849 // Purges of link tables
8850 'linkpurge' => [
8851 'ip' => [ 30, 60 ],
8852 'user' => [ 30, 60 ],
8853 ],
8854 // Files rendered via thumb.php or thumb_handler.php
8855 'renderfile' => [
8856 'ip' => [ 700, 30 ],
8857 'user' => [ 700, 30 ],
8858 ],
8859 // Same as above but for non-standard thumbnails
8860 'renderfile-nonstandard' => [
8861 'ip' => [ 70, 30 ],
8862 'user' => [ 70, 30 ],
8863 ],
8864 // Stashing edits into cache before save
8865 'stashedit' => [
8866 'ip' => [ 30, 60 ],
8867 'newbie' => [ 30, 60 ],
8868 ],
8869 // Stash base HTML for VE edits
8870 'stashbasehtml' => [
8871 'ip' => [ 5, 60 ],
8872 'newbie' => [ 5, 60 ],
8873 ],
8874 // Adding or removing change tags
8875 'changetags' => [
8876 'ip' => [ 8, 60 ],
8877 'newbie' => [ 8, 60 ],
8878 ],
8879 // Changing the content model of a page
8880 'editcontentmodel' => [
8881 'newbie' => [ 2, 120 ],
8882 'user' => [ 8, 60 ],
8883 ],
8884 ],
8885 'type' => 'map',
8886 'mergeStrategy' => 'array_plus_2d',
8887 ];
8888
8889 /**
8890 * Array of IPs / CIDR ranges which should be excluded from rate limits.
8891 *
8892 * This may be useful for allowing NAT gateways for conferences, etc.
8893 */
8894 public const RateLimitsExcludedIPs = [
8895 'default' => [],
8896 'type' => 'list',
8897 ];
8898
8899 /**
8900 * Log IP addresses in the recentchanges table; can be accessed only by
8901 * extensions (e.g. CheckUser) or a DB admin
8902 * Used for retroactive autoblocks
8903 */
8904 public const PutIPinRC = [
8905 'default' => true,
8906 ];
8907
8908 /**
8909 * Integer defining default number of entries to show on
8910 * special pages which are query-pages such as Special:Whatlinkshere.
8911 */
8912 public const QueryPageDefaultLimit = [
8913 'default' => 50,
8914 ];
8915
8916 /**
8917 * Limit password attempts to X attempts per Y seconds per IP per account.
8918 *
8919 * Value is an array of arrays. Each sub-array must have a key for count
8920 * (ie count of how many attempts before throttle) and a key for seconds.
8921 * If the key 'allIPs' (case sensitive) is present, then the limit is
8922 * just per account instead of per IP per account.
8923 *
8924 * @since 1.27 allIps support and multiple limits added in 1.27. Prior
8925 * to 1.27 this only supported having a single throttle.
8926 * @warning Requires $wgMainCacheType to be enabled
8927 */
8928 public const PasswordAttemptThrottle = [
8929 'default' => [
8930 // Short term limit
8931 [ 'count' => 5, 'seconds' => 300 ],
8932 // Long term limit. We need to balance the risk
8933 // of somebody using this as a DoS attack to lock someone
8934 // out of their account, and someone doing a brute force attack.
8935 [ 'count' => 150, 'seconds' => 60 * 60 * 48 ],
8936 ],
8937 'type' => 'list',
8938 ];
8939
8940 /**
8941 * Users authorize consumers (like Apps) to act on their behalf but only with
8942 * a subset of the user's normal account rights (signed off on by the user).
8943 * The possible rights to grant to a consumer are bundled into groups called
8944 * "grants". Each grant defines some rights it lets consumers inherit from the
8945 * account they may act on behalf of. Note that a user granting a right does
8946 * nothing if that user does not actually have that right to begin with.
8947 *
8948 * @since 1.27
8949 */
8950 public const GrantPermissions = [
8951 'default' => [
8952 'basic' => [
8953 'autocreateaccount' => true,
8954 'autoconfirmed' => true,
8955 'autopatrol' => true,
8956 'editsemiprotected' => true,
8957 'ipblock-exempt' => true,
8958 'nominornewtalk' => true,
8959 'patrolmarks' => true,
8960 'read' => true,
8961 'unwatchedpages' => true,
8962 ],
8963 'highvolume' => [
8964 'bot' => true,
8965 'apihighlimits' => true,
8966 'noratelimit' => true,
8967 'markbotedits' => true,
8968 ],
8969 'import' => [
8970 'import' => true,
8971 'importupload' => true,
8972 ],
8973 'editpage' => [
8974 'edit' => true,
8975 'minoredit' => true,
8976 'applychangetags' => true,
8977 'changetags' => true,
8978 'editcontentmodel' => true,
8979 'pagelang' => true,
8980 ],
8981 'editprotected' => [
8982 'edit' => true,
8983 'minoredit' => true,
8984 'applychangetags' => true,
8985 'changetags' => true,
8986 'editcontentmodel' => true,
8987 'editprotected' => true,
8988 ],
8989 'editmycssjs' => [
8990 'edit' => true,
8991 'minoredit' => true,
8992 'applychangetags' => true,
8993 'changetags' => true,
8994 'editcontentmodel' => true,
8995 'editmyusercss' => true,
8996 'editmyuserjson' => true,
8997 'editmyuserjs' => true,
8998 ],
8999 'editmyoptions' => [
9000 'editmyoptions' => true,
9001 'editmyuserjson' => true,
9002 ],
9003 'editinterface' => [
9004 'edit' => true,
9005 'minoredit' => true,
9006 'applychangetags' => true,
9007 'changetags' => true,
9008 'editcontentmodel' => true,
9009 'editinterface' => true,
9010 'edituserjson' => true,
9011 'editsitejson' => true,
9012 ],
9013 'editsiteconfig' => [
9014 'edit' => true,
9015 'minoredit' => true,
9016 'applychangetags' => true,
9017 'changetags' => true,
9018 'editcontentmodel' => true,
9019 'editinterface' => true,
9020 'edituserjson' => true,
9021 'editsitejson' => true,
9022 'editusercss' => true,
9023 'edituserjs' => true,
9024 'editsitecss' => true,
9025 'editsitejs' => true,
9026 ],
9027 'createeditmovepage' => [
9028 'edit' => true,
9029 'minoredit' => true,
9030 'applychangetags' => true,
9031 'changetags' => true,
9032 'editcontentmodel' => true,
9033 'createpage' => true,
9034 'createtalk' => true,
9035 'delete-redirect' => true,
9036 'move' => true,
9037 'move-rootuserpages' => true,
9038 'move-subpages' => true,
9039 'move-categorypages' => true,
9040 'suppressredirect' => true,
9041 ],
9042 'uploadfile' => [
9043 'upload' => true,
9044 'reupload-own' => true,
9045 ],
9046 'uploadeditmovefile' => [
9047 'upload' => true,
9048 'reupload-own' => true,
9049 'reupload' => true,
9050 'reupload-shared' => true,
9051 'upload_by_url' => true,
9052 'movefile' => true,
9053 'suppressredirect' => true,
9054 ],
9055 'patrol' => [
9056 'patrol' => true,
9057 ],
9058 'rollback' => [
9059 'rollback' => true,
9060 ],
9061 'blockusers' => [
9062 'block' => true,
9063 'blockemail' => true,
9064 ],
9065 'viewdeleted' => [
9066 'browsearchive' => true,
9067 'deletedhistory' => true,
9068 'deletedtext' => true,
9069 ],
9070 'viewrestrictedlogs' => [
9071 'suppressionlog' => true,
9072 ],
9073 'delete' => [
9074 'edit' => true,
9075 'minoredit' => true,
9076 'applychangetags' => true,
9077 'changetags' => true,
9078 'editcontentmodel' => true,
9079 'browsearchive' => true,
9080 'deletedhistory' => true,
9081 'deletedtext' => true,
9082 'delete' => true,
9083 'bigdelete' => true,
9084 'deletelogentry' => true,
9085 'deleterevision' => true,
9086 'undelete' => true,
9087 ],
9088 'oversight' => [
9089 'suppressrevision' => true,
9090 'viewsuppressed' => true,
9091 ],
9092 'protect' => [
9093 'edit' => true,
9094 'minoredit' => true,
9095 'applychangetags' => true,
9096 'changetags' => true,
9097 'editcontentmodel' => true,
9098 'editprotected' => true,
9099 'protect' => true,
9100 ],
9101 'viewmywatchlist' => [
9102 'viewmywatchlist' => true,
9103 ],
9104 'editmywatchlist' => [
9105 'editmywatchlist' => true,
9106 ],
9107 'sendemail' => [
9108 'sendemail' => true,
9109 ],
9110 'createaccount' => [
9111 'createaccount' => true,
9112 ],
9113 'privateinfo' => [
9114 'viewmyprivateinfo' => true,
9115 ],
9116 'mergehistory' => [
9117 'mergehistory' => true,
9118 ],
9119 ],
9120 'type' => 'map',
9121 'mergeStrategy' => 'array_plus_2d',
9122 'additionalProperties' => [
9123 'type' => 'map',
9124 'additionalProperties' => [ 'type' => 'boolean', ],
9125 ],
9126 ];
9127
9128 /**
9129 * Grant groups are used on some user interfaces to display conceptually
9130 * similar grants together.
9131 *
9132 * This configuration value should usually be set by extensions, not
9133 * site administrators.
9134 *
9135 * @see self::GrantPermissions
9136 * @since 1.27
9137 */
9138 public const GrantPermissionGroups = [
9139 'default' =>
9140 [
9141 // Hidden grants are implicitly present
9142 'basic' => 'hidden',
9143
9144 'editpage' => 'page-interaction',
9145 'createeditmovepage' => 'page-interaction',
9146 'editprotected' => 'page-interaction',
9147 'patrol' => 'page-interaction',
9148
9149 'uploadfile' => 'file-interaction',
9150 'uploadeditmovefile' => 'file-interaction',
9151
9152 'sendemail' => 'email',
9153
9154 'viewmywatchlist' => 'watchlist-interaction',
9155 'editviewmywatchlist' => 'watchlist-interaction',
9156
9157 'editmycssjs' => 'customization',
9158 'editmyoptions' => 'customization',
9159
9160 'editinterface' => 'administration',
9161 'editsiteconfig' => 'administration',
9162 'rollback' => 'administration',
9163 'blockusers' => 'administration',
9164 'delete' => 'administration',
9165 'viewdeleted' => 'administration',
9166 'viewrestrictedlogs' => 'administration',
9167 'protect' => 'administration',
9168 'oversight' => 'administration',
9169 'createaccount' => 'administration',
9170 'mergehistory' => 'administration',
9171 'import' => 'administration',
9172
9173 'highvolume' => 'high-volume',
9174
9175 'privateinfo' => 'private-information',
9176 ],
9177 'type' => 'map',
9178 'additionalProperties' => [ 'type' => 'string', ],
9179 ];
9180
9181 /**
9182 * Group grants by risk level. Keys are grant names (i.e. keys from GrantPermissions),
9183 * values are GrantsInfo::RISK_* constants.
9184 *
9185 * Note that this classification is only informative; merely applying 'security' or 'internal'
9186 * to a grant won't prevent it from being available. It's used to give guidance to users
9187 * in various interfaces about the riskiness of the various grants.
9188 *
9189 * @since 1.42
9190 */
9191 public const GrantRiskGroups = [
9192 'default' => [
9193 'basic' => GrantsInfo::RISK_LOW,
9194 'editpage' => GrantsInfo::RISK_LOW,
9195 'createeditmovepage' => GrantsInfo::RISK_LOW,
9196 'editprotected' => GrantsInfo::RISK_VANDALISM,
9197 'patrol' => GrantsInfo::RISK_LOW,
9198 'uploadfile' => GrantsInfo::RISK_LOW,
9199 'uploadeditmovefile' => GrantsInfo::RISK_LOW,
9200 'sendemail' => GrantsInfo::RISK_SECURITY,
9201 'viewmywatchlist' => GrantsInfo::RISK_LOW,
9202 'editviewmywatchlist' => GrantsInfo::RISK_LOW,
9203 'editmycssjs' => GrantsInfo::RISK_SECURITY,
9204 'editmyoptions' => GrantsInfo::RISK_SECURITY,
9205 'editinterface' => GrantsInfo::RISK_VANDALISM,
9206 'editsiteconfig' => GrantsInfo::RISK_SECURITY,
9207 'rollback' => GrantsInfo::RISK_LOW,
9208 'blockusers' => GrantsInfo::RISK_VANDALISM,
9209 'delete' => GrantsInfo::RISK_VANDALISM,
9210 'viewdeleted' => GrantsInfo::RISK_VANDALISM,
9211 'viewrestrictedlogs' => GrantsInfo::RISK_SECURITY,
9212 'protect' => GrantsInfo::RISK_VANDALISM,
9213 'oversight' => GrantsInfo::RISK_SECURITY,
9214 'createaccount' => GrantsInfo::RISK_LOW,
9215 'mergehistory' => GrantsInfo::RISK_VANDALISM,
9216 'import' => GrantsInfo::RISK_SECURITY,
9217 'highvolume' => GrantsInfo::RISK_LOW,
9218 'privateinfo' => GrantsInfo::RISK_LOW,
9219 ],
9220 'type' => 'map',
9221 ];
9222
9223 /**
9224 * @since 1.27
9225 */
9226 public const EnableBotPasswords = [
9227 'default' => true,
9228 'type' => 'boolean',
9229 ];
9230
9231 /**
9232 * Cluster for the bot_passwords table
9233 *
9234 * @since 1.27
9235 * @deprecated since 1.42 Use $wgVirtualDomainsMapping instead.
9236 */
9237 public const BotPasswordsCluster = [
9238 'default' => false,
9239 'type' => 'string|false',
9240 ];
9241
9242 /**
9243 * Database name for the bot_passwords table
9244 *
9245 * To use a database with a table prefix, set this variable to
9246 * "{$database}-{$prefix}".
9247 *
9248 * @since 1.27
9249 * @deprecated since 1.42 Use $wgVirtualDomainsMapping instead.
9250 */
9251 public const BotPasswordsDatabase = [
9252 'default' => false,
9253 'type' => 'string|false',
9254 ];
9255
9256 // endregion -- end of user rights settings
9257
9258 /***************************************************************************/
9259 // region Security
9260 /** @name Security */
9261
9262 /**
9263 * This should always be customised in LocalSettings.php
9264 */
9265 public const SecretKey = [
9266 'default' => false,
9267 ];
9268
9269 /**
9270 * Allow user Javascript page?
9271 * This enables a lot of neat customizations, but may
9272 * increase security risk to users and server load.
9273 */
9274 public const AllowUserJs = [
9275 'default' => false,
9276 ];
9277
9278 /**
9279 * Allow user Cascading Style Sheets (CSS)?
9280 * This enables a lot of neat customizations, but may
9281 * increase security risk to users and server load.
9282 */
9283 public const AllowUserCss = [
9284 'default' => false,
9285 ];
9286
9287 /**
9288 * Allow style-related user-preferences?
9289 *
9290 * This controls whether the `editfont` and `underline` preferences
9291 * are available to users.
9292 */
9293 public const AllowUserCssPrefs = [
9294 'default' => true,
9295 ];
9296
9297 /**
9298 * Use the site's Javascript page?
9299 */
9300 public const UseSiteJs = [
9301 'default' => true,
9302 ];
9303
9304 /**
9305 * Use the site's Cascading Style Sheets (CSS)?
9306 */
9307 public const UseSiteCss = [
9308 'default' => true,
9309 ];
9310
9311 /**
9312 * Break out of framesets. This can be used to prevent clickjacking attacks,
9313 * or to prevent external sites from framing your site with ads.
9314 */
9315 public const BreakFrames = [
9316 'default' => false,
9317 ];
9318
9319 /**
9320 * The X-Frame-Options header to send on pages sensitive to clickjacking
9321 * attacks, such as edit pages. This prevents those pages from being displayed
9322 * in a frame or iframe. The options are:
9323 *
9324 * - 'DENY': Do not allow framing. This is recommended for most wikis.
9325 *
9326 * - 'SAMEORIGIN': Allow framing by pages on the same domain. This can be used
9327 * to allow framing within a trusted domain. This is insecure if there
9328 * is a page on the same domain which allows framing of arbitrary URLs.
9329 *
9330 * - false: Allow all framing. This opens up the wiki to XSS attacks and thus
9331 * full compromise of local user accounts. Private wikis behind a
9332 * corporate firewall are especially vulnerable. This is not
9333 * recommended.
9334 *
9335 * For extra safety, set $wgBreakFrames = true, to prevent framing on all pages,
9336 * not just edit pages.
9337 */
9338 public const EditPageFrameOptions = [
9339 'default' => 'DENY',
9340 ];
9341
9342 /**
9343 * Disallow framing of API pages directly, by setting the X-Frame-Options
9344 * header. Since the API returns CSRF tokens, allowing the results to be
9345 * framed can compromise your user's account security.
9346 *
9347 * Options are:
9348 * - 'DENY': Do not allow framing. This is recommended for most wikis.
9349 * - 'SAMEORIGIN': Allow framing by pages on the same domain.
9350 * - false: Allow all framing.
9351 * Note: $wgBreakFrames will override this for human formatted API output.
9352 */
9353 public const ApiFrameOptions = [
9354 'default' => 'DENY',
9355 ];
9356
9357 /**
9358 * Controls Content-Security-Policy header
9359 *
9360 * @warning May cause slowness on Windows due to slow random number generator.
9361 *
9362 * @unstable EXPERIMENTAL
9363 * @since 1.32
9364 * @see https://www.w3.org/TR/CSP2/
9365 */
9366 public const CSPHeader = [
9367 'default' => false,
9368 'type' => 'false|object',
9369 ];
9370
9371 /**
9372 * Controls Content-Security-Policy-Report-Only header
9373 *
9374 * @since 1.32
9375 */
9376 public const CSPReportOnlyHeader = [
9377 'default' => false,
9378 'type' => 'false|object',
9379 ];
9380
9381 /**
9382 * List of urls which appear often to be triggering CSP reports
9383 * but do not appear to be caused by actual content, but by client
9384 * software inserting scripts (i.e. Ad-Ware).
9385 *
9386 * List based on results from Wikimedia logs.
9387 *
9388 * @since 1.28
9389 */
9390 public const CSPFalsePositiveUrls = [
9391 'default' => [
9392 'https://3hub.co' => true,
9393 'https://morepro.info' => true,
9394 'https://p.ato.mx' => true,
9395 'https://s.ato.mx' => true,
9396 'https://adserver.adtech.de' => true,
9397 'https://ums.adtechus.com' => true,
9398 'https://cas.criteo.com' => true,
9399 'https://cat.nl.eu.criteo.com' => true,
9400 'https://atpixel.alephd.com' => true,
9401 'https://rtb.metrigo.com' => true,
9402 'https://d5p.de17a.com' => true,
9403 'https://ad.lkqd.net/vpaid/vpaid.js' => true,
9404 'https://ad.lkqd.net/vpaid/vpaid.js?fusion=1.0' => true,
9405 'https://t.lkqd.net/t' => true,
9406 'chrome-extension' => true,
9407 ],
9408 'type' => 'map',
9409 ];
9410
9411 /**
9412 * Allow anonymous cross origin requests to the REST API.
9413 *
9414 * This should be disabled for intranet sites (sites behind a firewall).
9415 *
9416 * @since 1.36
9417 */
9418 public const AllowCrossOrigin = [
9419 'default' => false,
9420 'type' => 'boolean',
9421 ];
9422
9423 /**
9424 * Allows authenticated cross-origin requests to the REST API with session cookies.
9425 *
9426 * With this option enabled, any origin specified in $wgCrossSiteAJAXdomains may send session
9427 * cookies for authorization in the REST API.
9428 *
9429 * There is a performance impact by enabling this option. Therefore, it should be left disabled
9430 * for most wikis and clients should instead use OAuth to make cross-origin authenticated
9431 * requests.
9432 *
9433 * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials
9434 * @since 1.36
9435 */
9436 public const RestAllowCrossOriginCookieAuth = [
9437 'default' => false,
9438 'type' => 'boolean',
9439 ];
9440
9441 /**
9442 * Secret for session storage.
9443 *
9444 * This should be set in LocalSettings.php, otherwise $wgSecretKey will
9445 * be used.
9446 *
9447 * @since 1.27
9448 */
9449 public const SessionSecret = [
9450 'default' => false,
9451 ];
9452
9453 /**
9454 * Enable the deprecated xslt option in the Action API.
9455 *
9456 * This is unsafe and allows users with the editinterface right to perform XSS.
9457 *
9458 * @see https://phabricator.wikimedia.org/T401995
9459 */
9460 public const EnableUnsafeXsltOption = [
9461 'default' => false,
9462 ];
9463
9464 // endregion -- end of security
9465
9466 /***************************************************************************/
9467 // region Cookie settings
9468 /** @name Cookie settings */
9469
9470 /**
9471 * Default cookie lifetime, in seconds. Setting to 0 makes all cookies session-only.
9472 */
9473 public const CookieExpiration = [
9474 'default' => 30 * 86400,
9475 ];
9476
9477 /**
9478 * Default login cookie lifetime, in seconds. Setting
9479 * $wgExtendLoginCookieExpiration to null will use $wgCookieExpiration to
9480 * calculate the cookie lifetime. As with $wgCookieExpiration, 0 will make
9481 * login cookies session-only.
9482 */
9483 public const ExtendedLoginCookieExpiration = [
9484 'default' => 180 * 86400,
9485 ];
9486
9487 /**
9488 * Set to set an explicit domain on the login cookies eg, "justthis.domain.org"
9489 * or ".any.subdomain.net"
9490 */
9491 public const CookieDomain = [
9492 'default' => '',
9493 ];
9494
9495 /**
9496 * Set this variable if you want to restrict cookies to a certain path within
9497 * the domain specified by $wgCookieDomain.
9498 */
9499 public const CookiePath = [
9500 'default' => '/',
9501 ];
9502
9503 /**
9504 * Whether the "secure" flag should be set on the cookie. This can be:
9505 * - true: Set secure flag
9506 * - false: Don't set secure flag
9507 * - "detect": Set the secure flag if $wgServer is set to an HTTPS URL,
9508 * or if $wgForceHTTPS is true.
9509 *
9510 * If $wgForceHTTPS is true, session cookies will be secure regardless of this
9511 * setting. However, other cookies will still be affected.
9512 */
9513 public const CookieSecure = [
9514 'default' => 'detect',
9515 'dynamicDefault' => [ 'use' => [ 'ForceHTTPS' ] ]
9516 ];
9517
9518 public static function getDefaultCookieSecure( $forceHTTPS ): bool {
9519 return $forceHTTPS || ( WebRequest::detectProtocol() === 'https' );
9520 }
9521
9522 /**
9523 * Cookies generated by MediaWiki have names starting with this prefix. Set it
9524 * to a string to use a custom prefix. Setting it to false causes the database
9525 * name to be used as a prefix.
9526 */
9527 public const CookiePrefix = [
9528 'default' => false,
9529 'dynamicDefault' => [
9530 'use' => [ 'SharedDB', 'SharedPrefix', 'SharedTables', 'DBname', 'DBprefix' ]
9531 ],
9532 ];
9533
9534 public static function getDefaultCookiePrefix(
9535 $sharedDB, $sharedPrefix, $sharedTables, $dbName, $dbPrefix
9536 ): string {
9537 if ( $sharedDB && in_array( 'user', $sharedTables ) ) {
9538 return $sharedDB . ( $sharedPrefix ? "_$sharedPrefix" : '' );
9539 }
9540 return $dbName . ( $dbPrefix ? "_$dbPrefix" : '' );
9541 }
9542
9543 /**
9544 * Set authentication cookies to HttpOnly to prevent access by JavaScript,
9545 * in browsers that support this feature. This can mitigates some classes of
9546 * XSS attack.
9547 */
9548 public const CookieHttpOnly = [
9549 'default' => true,
9550 ];
9551
9552 /**
9553 * The SameSite cookie attribute used for login cookies. This can be "Lax",
9554 * "Strict", "None" or empty/null to omit the attribute.
9555 *
9556 * This only applies to login cookies, since the correct value for other
9557 * cookies depends on what kind of cookie it is.
9558 *
9559 * @since 1.35
9560 */
9561 public const CookieSameSite = [
9562 'default' => null,
9563 'type' => '?string',
9564 ];
9565
9566 /**
9567 * A list of cookies that vary the cache (for use by extensions)
9568 */
9569 public const CacheVaryCookies = [
9570 'default' => [],
9571 'type' => 'list',
9572 ];
9573
9574 /**
9575 * Override to customise the session name
9576 */
9577 public const SessionName = [
9578 'default' => false,
9579 ];
9580
9581 /**
9582 * Whether to set a cookie when a user is autoblocked. Doing so means that a blocked user, even
9583 * after logging out and moving to a new IP address, will still be blocked. This cookie will
9584 * contain an authentication code if $wgSecretKey is set, or otherwise will just be the block
9585 * ID (in which case there is a possibility of an attacker discovering the names of revdeleted
9586 * users, so it is best to use this in conjunction with $wgSecretKey being set).
9587 */
9588 public const CookieSetOnAutoblock = [
9589 'default' => true,
9590 ];
9591
9592 /**
9593 * Whether to set a cookie when a logged-out user is blocked. Doing so means that a blocked
9594 * user, even after moving to a new IP address, will still be blocked. This cookie will contain
9595 * an authentication code if $wgSecretKey is set, or otherwise will just be the block ID (in
9596 * which case there is a possibility of an attacker discovering the names of revdeleted users,
9597 * so it is best to use this in conjunction with $wgSecretKey being set).
9598 */
9599 public const CookieSetOnIpBlock = [
9600 'default' => true,
9601 ];
9602
9603 // endregion -- end of cookie settings
9604
9605 /***************************************************************************/
9606 // region Profiling, testing and debugging
9607 /** @name Profiling, testing and debugging */
9608 // See $wgProfiler for how to enable profiling.
9609
9610 /**
9611 * Enable verbose debug logging for all channels and log levels.
9612 *
9613 * See https://www.mediawiki.org/wiki/How_to_debug
9614 *
9615 * For static requests, this enables all channels and warning-level and
9616 * above only. Use $wgDebugRawPage to make those verbose as well.
9617 *
9618 * The debug log file should be not be web-accessible if it is used in
9619 * a production environment, as may contain private data.
9620 */
9621 public const DebugLogFile = [
9622 'default' => '',
9623 ];
9624
9625 /**
9626 * Prefix for debug log lines
9627 */
9628 public const DebugLogPrefix = [
9629 'default' => '',
9630 ];
9631
9632 /**
9633 * If true, instead of redirecting, show a page with a link to the redirect
9634 * destination. This allows for the inspection of PHP error messages, and easy
9635 * resubmission of form data. For developer use only.
9636 */
9637 public const DebugRedirects = [
9638 'default' => false,
9639 ];
9640
9641 /**
9642 * If true, debug logging is also enabled for load.php and action=raw requests.
9643 *
9644 * By default, $wgDebugLogFile enables all channels and warning-level and
9645 * above for static requests.
9646 *
9647 * This ensures that the debug log is likely a chronological record of
9648 * of specific web request you are debugging, instead of overlapping with
9649 * messages from static requests, which would make it unclear which message
9650 * originated from what request.
9651 *
9652 * Also, during development this can make browsing and JavaScript testing
9653 * considerably slower (T85805).
9654 */
9655 public const DebugRawPage = [
9656 'default' => false,
9657 ];
9658
9659 /**
9660 * Send debug data to an HTML comment in the output.
9661 *
9662 * This may occasionally be useful when supporting a non-technical end-user.
9663 * It's more secure than exposing the debug log file to the web, since the
9664 * output only contains private data for the current user. But it's not ideal
9665 * for development use since data is lost on fatal errors and redirects.
9666 */
9667 public const DebugComments = [
9668 'default' => false,
9669 ];
9670
9671 /**
9672 * Write SQL queries to the debug log.
9673 *
9674 * This setting is only used $wgLBFactoryConf['class'] is set to
9675 * '\Wikimedia\Rdbms\LBFactorySimple'; otherwise the DBO_DEBUG flag must be set in
9676 * the 'flags' option of the database connection to achieve the same functionality.
9677 */
9678 public const DebugDumpSql = [
9679 'default' => false,
9680 ];
9681
9682 /**
9683 * Performance expectations for DB usage
9684 *
9685 * @since 1.26
9686 */
9687 public const TrxProfilerLimits = [
9688 'default' => [
9689 // HTTP GET/HEAD requests.
9690 // Primary queries should not happen on GET requests
9691 'GET' => [
9692 'masterConns' => 0,
9693 'writes' => 0,
9694 'readQueryTime' => 5,
9695 'readQueryRows' => 10000
9696 ],
9697 // HTTP POST requests.
9698 // Primary reads and writes will happen for a subset of these.
9699 'POST' => [
9700 'readQueryTime' => 5,
9701 'writeQueryTime' => 1,
9702 'readQueryRows' => 100_000,
9703 'maxAffected' => 1000
9704 ],
9705 'POST-nonwrite' => [
9706 'writes' => 0,
9707 'readQueryTime' => 5,
9708 'readQueryRows' => 10000
9709 ],
9710 // Deferred updates that run after HTTP response is sent for GET requests
9711 'PostSend-GET' => [
9712 'readQueryTime' => 5,
9713 'writeQueryTime' => 1,
9714 'readQueryRows' => 10000,
9715 'maxAffected' => 1000,
9716 // Log primary queries under the post-send entry point as they are discouraged
9717 'masterConns' => 0,
9718 'writes' => 0,
9719 ],
9720 // Deferred updates that run after HTTP response is sent for POST requests
9721 'PostSend-POST' => [
9722 'readQueryTime' => 5,
9723 'writeQueryTime' => 1,
9724 'readQueryRows' => 100_000,
9725 'maxAffected' => 1000
9726 ],
9727 // Background job runner
9728 'JobRunner' => [
9729 'readQueryTime' => 30,
9730 'writeQueryTime' => 5,
9731 'readQueryRows' => 100_000,
9732 'maxAffected' => 500 // ballpark of $wgUpdateRowsPerQuery
9733 ],
9734 // Command-line scripts
9735 'Maintenance' => [
9736 'writeQueryTime' => 5,
9737 'maxAffected' => 1000
9738 ]
9739 ],
9740 'type' => 'map',
9741 ];
9742
9743 /**
9744 * Map of string log group names to log destinations.
9745 *
9746 * If set, wfDebugLog() output for that group will go to that file instead
9747 * of the regular $wgDebugLogFile. Useful for enabling selective logging
9748 * in production.
9749 *
9750 * Log destinations may be one of the following:
9751 * - false to completely remove from the output, including from $wgDebugLogFile.
9752 * - string values specifying a filename or URI.
9753 * - associative array with keys:
9754 * - 'destination' desired filename or URI.
9755 * - 'sample' an integer value, specifying a sampling factor (optional)
9756 * - 'level' A \Psr\Log\LogLevel constant, indicating the minimum level
9757 * to log (optional, since 1.25)
9758 *
9759 * **Example:**
9760 *
9761 * ```
9762 * $wgDebugLogGroups['redis'] = '/var/log/mediawiki/redis.log';
9763 * ```
9764 *
9765 * **Advanced example:**
9766 *
9767 * ```
9768 * $wgDebugLogGroups['memcached'] = [
9769 * 'destination' => '/var/log/mediawiki/memcached.log',
9770 * 'sample' => 1000, // log 1 message out of every 1,000.
9771 * 'level' => \Psr\Log\LogLevel::WARNING
9772 * ];
9773 * ```
9774 */
9775 public const DebugLogGroups = [
9776 'default' => [],
9777 'type' => 'map',
9778 ];
9779
9780 /**
9781 * Default service provider for creating Psr\Log\LoggerInterface instances.
9782 *
9783 * The value should be an array suitable for use with
9784 * ObjectFactory::getObjectFromSpec(). The created object is expected to
9785 * implement the MediaWiki\Logger\Spi interface. See ObjectFactory for additional
9786 * details.
9787 *
9788 * Alternately the MediaWiki\Logger\LoggerFactory::registerProvider method can
9789 * be called to inject an MediaWiki\Logger\Spi instance into the LoggerFactory
9790 * and bypass the use of this configuration variable entirely.
9791 *
9792 * **To completely disable logging:**
9793 *
9794 * ```
9795 * $wgMWLoggerDefaultSpi = [ 'class' => \MediaWiki\Logger\NullSpi::class ];
9796 * ```
9797 *
9798 * @since 1.25
9799 * @see \MwLogger
9800 */
9801 public const MWLoggerDefaultSpi = [
9802 'default' => [ 'class' => 'MediaWiki\\Logger\\LegacySpi', ],
9803 'mergeStrategy' => 'replace',
9804 'type' => 'map',
9805 ];
9806
9807 /**
9808 * Display debug data at the bottom of the main content area.
9809 *
9810 * Useful for developers and technical users trying to working on a closed wiki.
9811 */
9812 public const ShowDebug = [
9813 'default' => false,
9814 ];
9815
9816 /**
9817 * Show the contents of $wgHooks in Special:Version
9818 */
9819 public const SpecialVersionShowHooks = [
9820 'default' => false,
9821 ];
9822
9823 /**
9824 * Show exception message and stack trace when printing details about uncaught exceptions
9825 * in web response output.
9826 *
9827 * This may reveal private information in error messages or function parameters.
9828 * If set to false, only the exception type or class name will be exposed.
9829 */
9830 public const ShowExceptionDetails = [
9831 'default' => false,
9832 ];
9833
9834 /**
9835 * If true, send the exception backtrace to the error log
9836 */
9837 public const LogExceptionBacktrace = [
9838 'default' => true,
9839 ];
9840
9841 /**
9842 * If true, the MediaWiki error handler passes errors/warnings to the default error handler
9843 * after logging them. The setting is ignored when the track_errors php.ini flag is true.
9844 */
9845 public const PropagateErrors = [
9846 'default' => true,
9847 ];
9848
9849 /**
9850 * Expose backend server host names through the API and various HTML comments
9851 */
9852 public const ShowHostnames = [
9853 'default' => false,
9854 ];
9855
9856 /**
9857 * Override server hostname detection with a hardcoded value.
9858 *
9859 * Should be a string, default false.
9860 *
9861 * @since 1.20
9862 */
9863 public const OverrideHostname = [
9864 'default' => false,
9865 ];
9866
9867 /**
9868 * If set to true MediaWiki will throw notices for some possible error
9869 * conditions and for deprecated functions.
9870 */
9871 public const DevelopmentWarnings = [
9872 'default' => false,
9873 ];
9874
9875 /**
9876 * Release limitation to wfDeprecated warnings, if set to a release number
9877 * development warnings will not be generated for deprecations added in releases
9878 * after the limit.
9879 */
9880 public const DeprecationReleaseLimit = [
9881 'default' => false,
9882 ];
9883
9884 /**
9885 * Profiler configuration.
9886 *
9887 * To use a profiler, set $wgProfiler in LocalSettings.php.
9888 *
9889 * Options:
9890 *
9891 * - 'class' (`string`): The Profiler subclass to use.
9892 * Default: ProfilerStub.
9893 * - 'sampling' (`integer`): Only enable the profiler on one in this many requests.
9894 * For requests that are not in the sampling,
9895 * the 'class' option will be replaced with ProfilerStub.
9896 * Default: `1`.
9897 * - 'threshold' (`float`): Only process the recorded data if the total elapsed
9898 * time for a request is more than this number of seconds.
9899 * Default: `0.0`.
9900 * - 'output' (`string|string[]`): ProfilerOutput subclass or subclasess to use.
9901 * Default: `[]`.
9902 *
9903 * The options array is passed in its entirety to the specified
9904 * Profiler `class`. Check individual Profiler subclasses for additional
9905 * options that may be available.
9906 *
9907 * Profiler subclasses available in MediaWiki core:
9908 *
9909 * - ProfilerXhprof: Based on XHProf or Tideways-XHProf.
9910 * - ProfilerExcimer: Based on Excimer.
9911 * - ProfilerSectionOnly
9912 *
9913 * Profiler output classes available in MediaWiki:
9914 *
9915 * - ProfilerOutputText: outputs profiling data in the web page body as
9916 * a comment. You can make the profiling data in HTML render visibly
9917 * instead by setting the 'visible' configuration flag.
9918 *
9919 * - ProfilerOutputStats: outputs profiling data as StatsD metrics.
9920 * It expects that $wgStatsdServer is set to the host (or host:port)
9921 * of a statsd server.
9922 *
9923 * - ProfilerOutputDump: outputs dump files that are compatible
9924 * with the XHProf gui. It expects that `$wgProfiler['outputDir']`
9925 * is set as well.
9926 *
9927 * Examples:
9928 *
9929 * ```
9930 * $wgProfiler = [
9931 * 'class' => ProfilerXhprof::class,
9932 * 'output' => ProfilerOutputText::class,
9933 * ];
9934 * ```
9935 *
9936 * ```
9937 * $wgProfiler = [
9938 * 'class' => ProfilerXhprof::class,
9939 * 'output' => [ ProfilerOutputText::class ],
9940 * 'sampling' => 50, // one in every 50 requests
9941 * ];
9942 * ```
9943 *
9944 * For performance, the profiler is always disabled for CLI scripts as they
9945 * could be long running and the data would accumulate. Use the `--profiler`
9946 * parameter of maintenance scripts to override this.
9947 *
9948 * @since 1.17.0
9949 */
9950 public const Profiler = [
9951 'default' => [],
9952 'type' => 'map',
9953 'mergeStrategy' => 'replace',
9954 ];
9955
9956 /**
9957 * Destination of statsd metrics.
9958 *
9959 * A host or host:port of a statsd server. Port defaults to 8125.
9960 *
9961 * If not set, statsd metrics will not be collected.
9962 *
9963 * @see MediaWiki::emitBufferedStatsdData()
9964 * @since 1.25
9965 */
9966 public const StatsdServer = [
9967 'default' => false,
9968 ];
9969
9970 /**
9971 * Prefix for metric names sent to $wgStatsdServer.
9972 *
9973 * @see \MediaWiki\MediaWikiServices::getInstance()->getStatsdDataFactory
9974 * @see \Wikimedia\Stats\BufferingStatsdDataFactory
9975 * @since 1.25
9976 */
9977 public const StatsdMetricPrefix = [
9978 'default' => 'MediaWiki',
9979 ];
9980
9981 /**
9982 * Stats output target URI e.g. udp://127.0.0.1:8125
9983 *
9984 * If null, metrics will not be sent.
9985 * Note: this only affects metrics instantiated by the StatsFactory service
9986 *
9987 * @since 1.38
9988 */
9989 public const StatsTarget = [
9990 'default' => null,
9991 'type' => '?string',
9992 ];
9993
9994 /**
9995 * Stats output format
9996 *
9997 * If null, metrics will not be rendered nor sent.
9998 * Note: this only affects metrics instantiated by the StatsFactory service
9999 *
10000 * @see \Wikimedia\Stats\OutputFormats::SUPPORTED_FORMATS
10001 * @since 1.41
10002 */
10003 public const StatsFormat = [
10004 'default' => null,
10005 'type' => '?string',
10006 ];
10007
10008 /**
10009 * Stats service name prefix
10010 *
10011 * Required. Must not be zero-length.
10012 * Defaults to: 'mediawiki'
10013 * Note: this only affects metrics instantiated by the StatsFactory service
10014 *
10015 * @since 1.41
10016 */
10017 public const StatsPrefix = [
10018 'default' => 'mediawiki',
10019 'type' => 'string',
10020 ];
10021
10022 /**
10023 * Configuration for OpenTelemetry instrumentation, or `null` to disable it.
10024 * Possible keys:
10025 * - `samplingProbability`: probability in % of sampling a trace for which no sampling decision has been
10026 * taken yet. Must be between 0 and 100.
10027 * - `serviceName`: name of the service being instrumented.
10028 * - `endpoint`: URL of the OpenTelemetry collector to send trace data to.
10029 * This has to be an endpoint accepting OTLP data over HTTP (not gRPC).
10030 *
10031 * An example config to send data to a local OpenTelemetry or Jaeger collector instance:
10032 * ```
10033 * $wgOpenTelemetryConfig = [
10034 * 'samplingProbability' => 0.1,
10035 * 'serviceName' => 'mediawiki-local',
10036 * 'endpoint' => 'http://127.0.0.1:4318/v1/traces',
10037 * ];
10038 * ```
10039 * @since 1.43
10040 */
10041 public const OpenTelemetryConfig = [
10042 'default' => null,
10043 'type' => 'map|null'
10044 ];
10045
10046 /**
10047 * InfoAction retrieves a list of transclusion links (both to and from).
10048 *
10049 * This number puts a limit on that query in the case of highly transcluded
10050 * templates.
10051 */
10052 public const PageInfoTransclusionLimit = [
10053 'default' => 50,
10054 ];
10055
10056 /**
10057 * Allow running of QUnit tests via [[Special:JavaScriptTest]].
10058 */
10059 public const EnableJavaScriptTest = [
10060 'default' => false,
10061 ];
10062
10063 /**
10064 * Overwrite the caching key prefix with custom value.
10065 *
10066 * @since 1.19
10067 */
10068 public const CachePrefix = [
10069 'default' => false,
10070 ];
10071
10072 /**
10073 * Display the new debugging toolbar. This also enables profiling on database
10074 * queries and other useful output.
10075 *
10076 * Will be ignored if $wgUseFileCache or $wgUseCdn is enabled.
10077 *
10078 * @since 1.19
10079 */
10080 public const DebugToolbar = [
10081 'default' => false,
10082 ];
10083
10084 // endregion -- end of profiling, testing and debugging
10085
10086 /***************************************************************************/
10087 // region Search
10088 /** @name Search */
10089
10090 /**
10091 * Set this to true to disable the full text search feature.
10092 */
10093 public const DisableTextSearch = [
10094 'default' => false,
10095 ];
10096
10097 /**
10098 * Set to true to have nicer highlighted text in search results,
10099 * by default off due to execution overhead
10100 */
10101 public const AdvancedSearchHighlighting = [
10102 'default' => false,
10103 ];
10104
10105 /**
10106 * Regexp to match word boundaries, defaults for non-CJK languages
10107 * should be empty for CJK since the words are not separate
10108 */
10109 public const SearchHighlightBoundaries = [
10110 'default' => '[\\p{Z}\\p{P}\\p{C}]',
10111 ];
10112
10113 /**
10114 * Templates for OpenSearch suggestions, defaults to API action=opensearch
10115 *
10116 * Sites with heavy load would typically have these point to a custom
10117 * PHP wrapper to avoid firing up mediawiki for every keystroke
10118 *
10119 * Placeholders: {searchTerms}
10120 */
10121 public const OpenSearchTemplates = [
10122 'default' => [
10123 'application/x-suggestions+json' => false,
10124 'application/x-suggestions+xml' => false,
10125 ],
10126 'type' => 'map',
10127 ];
10128
10129 /**
10130 * This was previously a used to force empty responses from ApiOpenSearch
10131 * with the 'suggest' parameter set.
10132 *
10133 * @deprecated since 1.35 No longer used
10134 */
10135 public const EnableOpenSearchSuggest = [
10136 'default' => true,
10137 'obsolete' => 'Since 1.35, no longer used',
10138 'description' => 'Has been emitting warnings since 1.39 (LTS). ' .
10139 'Can be removed completely in 1.44, assuming 1.43 is an LTS release.'
10140 ];
10141
10142 /**
10143 * Integer defining default number of entries to show on
10144 * OpenSearch call.
10145 */
10146 public const OpenSearchDefaultLimit = [
10147 'default' => 10,
10148 ];
10149
10150 /**
10151 * Minimum length of extract in <Description>. Actual extracts will last until the end of
10152 * sentence.
10153 */
10154 public const OpenSearchDescriptionLength = [
10155 'default' => 100,
10156 ];
10157
10158 /**
10159 * Expiry time for search suggestion responses
10160 */
10161 public const SearchSuggestCacheExpiry = [
10162 'default' => 1200,
10163 ];
10164
10165 /**
10166 * If you've disabled search semi-permanently, this also disables updates to the
10167 * table. If you ever re-enable, be sure to rebuild the search table.
10168 */
10169 public const DisableSearchUpdate = [
10170 'default' => false,
10171 ];
10172
10173 /**
10174 * List of namespaces which are searched by default.
10175 *
10176 * **Example:**
10177 *
10178 * ```
10179 * $wgNamespacesToBeSearchedDefault[NS_MAIN] = true;
10180 * $wgNamespacesToBeSearchedDefault[NS_PROJECT] = true;
10181 * ```
10182 */
10183 public const NamespacesToBeSearchedDefault = [
10184 'default' => [ NS_MAIN => true, ],
10185 'type' => 'map',
10186 ];
10187
10188 /**
10189 * Disable the internal MySQL-based search, to allow it to be
10190 * implemented by an extension instead.
10191 */
10192 public const DisableInternalSearch = [
10193 'default' => false,
10194 ];
10195
10196 /**
10197 * Set this to a URL to forward search requests to some external location.
10198 *
10199 * If the URL includes '$1', this will be replaced with the URL-encoded
10200 * search term. Before using this, $wgDisableTextSearch must be set to true.
10201 *
10202 * **Example:**
10203 * To forward to Google you'd have something like:
10204 *
10205 * ```
10206 * $wgSearchForwardUrl =
10207 * 'https://www.google.com/search?q=$1' .
10208 * '&domains=https://example.com' .
10209 * '&sitesearch=https://example.com' .
10210 * '&ie=utf-8&oe=utf-8';
10211 * ```
10212 */
10213 public const SearchForwardUrl = [
10214 'default' => null,
10215 ];
10216
10217 /**
10218 * Array of namespaces to generate a Google sitemap for when the
10219 * maintenance/generateSitemap.php script is run, or false if one is to be
10220 * generated for all namespaces.
10221 */
10222 public const SitemapNamespaces = [
10223 'default' => false,
10224 'type' => 'false|list',
10225 ];
10226
10227 /**
10228 * Custom namespace priorities for sitemaps. Setting this will allow you to
10229 * set custom priorities to namespaces when sitemaps are generated using the
10230 * maintenance/generateSitemap.php script.
10231 *
10232 * This should be a map of namespace IDs to priority
10233 *
10234 * **Example:**
10235 *
10236 * ```
10237 * $wgSitemapNamespacesPriorities = [
10238 * NS_USER => '0.9',
10239 * NS_HELP => '0.0',
10240 * ];
10241 * ```
10242 */
10243 public const SitemapNamespacesPriorities = [
10244 'default' => false,
10245 'type' => 'false|map',
10246 ];
10247
10248 /**
10249 * If true, searches for IP addresses will be redirected to that IP's
10250 * contributions page. E.g. searching for "1.2.3.4" will redirect to
10251 * [[Special:Contributions/1.2.3.4]]
10252 */
10253 public const EnableSearchContributorsByIP = [
10254 'default' => true,
10255 ];
10256
10257 /**
10258 * Options for Special:Search completion widget form created by SearchFormWidget class.
10259 *
10260 * Settings that can be used:
10261 * - showDescriptions: true/false - whether to show opensearch description results
10262 * - performSearchOnClick: true/false - whether to perform search on click
10263 * See also TitleWidget.js UI widget.
10264 *
10265 * @since 1.34
10266 */
10267 public const SpecialSearchFormOptions = [
10268 'default' => [],
10269 'type' => 'map',
10270 ];
10271
10272 /**
10273 * Set true to allow logged-in users to set a preference whether or not matches in
10274 * search results should force redirection to that page. If false, the preference is
10275 * not exposed and cannot be altered from site default. To change your site's default
10276 * preference, set via $wgDefaultUserOptions['search-match-redirect'].
10277 *
10278 * @since 1.35
10279 */
10280 public const SearchMatchRedirectPreference = [
10281 'default' => false,
10282 'type' => 'boolean',
10283 ];
10284
10285 /**
10286 * Controls whether zero-result search queries with suggestions should display results for
10287 * these suggestions.
10288 *
10289 * @since 1.26
10290 */
10291 public const SearchRunSuggestedQuery = [
10292 'default' => true,
10293 'type' => 'boolean',
10294 ];
10295
10296 // endregion -- end of search settings
10297
10298 /***************************************************************************/
10299 // region Edit user interface
10300 /** @name Edit user interface */
10301
10302 /**
10303 * Path to the GNU diff3 utility. If the file doesn't exist, edit conflicts will
10304 * fall back to the old behavior (no merging).
10305 */
10306 public const Diff3 = [
10307 'default' => '/usr/bin/diff3',
10308 ];
10309
10310 /**
10311 * Path to the GNU diff utility.
10312 */
10313 public const Diff = [
10314 'default' => '/usr/bin/diff',
10315 ];
10316
10317 /**
10318 * Which namespaces have special treatment where they should be preview-on-open
10319 * Internally only Category: pages apply, but using this extensions (e.g. Semantic MediaWiki)
10320 * can specify namespaces of pages they have special treatment for
10321 */
10322 public const PreviewOnOpenNamespaces = [
10323 'default' => [
10324 NS_CATEGORY => true
10325 ],
10326 'type' => 'map',
10327 ];
10328
10329 /**
10330 * Enable the UniversalEditButton for browsers that support it
10331 * (currently only Firefox with an extension)
10332 * See http://universaleditbutton.org for more background information
10333 */
10334 public const UniversalEditButton = [
10335 'default' => true,
10336 ];
10337
10338 /**
10339 * If user doesn't specify any edit summary when making a an edit, MediaWiki
10340 * will try to automatically create one. This feature can be disabled by set-
10341 * ting this variable false.
10342 */
10343 public const UseAutomaticEditSummaries = [
10344 'default' => true,
10345 ];
10346
10347 // endregion -- end edit UI
10348
10349 /***************************************************************************/
10350 // region Maintenance
10351 /** @name Maintenance */
10352 // See also $wgSiteNotice
10353
10354 /**
10355 * For colorized maintenance script output, is your terminal background dark ?
10356 */
10357 public const CommandLineDarkBg = [
10358 'default' => false,
10359 ];
10360
10361 /**
10362 * Set this to a string to put the wiki into read-only mode. The text will be
10363 * used as an explanation to users.
10364 *
10365 * This prevents most write operations via the web interface. Cache updates may
10366 * still be possible. To prevent database writes completely, use the read_only
10367 * option in MySQL.
10368 */
10369 public const ReadOnly = [
10370 'default' => null,
10371 ];
10372
10373 /**
10374 * Set this to true to put the wiki watchlists into read-only mode.
10375 *
10376 * @since 1.31
10377 */
10378 public const ReadOnlyWatchedItemStore = [
10379 'default' => false,
10380 'type' => 'boolean',
10381 ];
10382
10383 /**
10384 * If this lock file exists (size > 0), the wiki will be forced into read-only mode.
10385 *
10386 * Its contents will be shown to users as part of the read-only warning
10387 * message.
10388 *
10389 * Will default to "{$wgUploadDirectory}/lock_yBgMBwiR" in Setup.php
10390 */
10391 public const ReadOnlyFile = [
10392 'default' => false,
10393 'dynamicDefault' => [ 'use' => [ 'UploadDirectory' ] ]
10394 ];
10395
10396 /**
10397 * @param mixed $uploadDirectory Value of UploadDirectory
10398 * @return string
10399 */
10400 public static function getDefaultReadOnlyFile( $uploadDirectory ): string {
10401 return "$uploadDirectory/lock_yBgMBwiR";
10402 }
10403
10404 /**
10405 * When you run the web-based upgrade utility, it will tell you what to set
10406 * this to in order to authorize the upgrade process. It will subsequently be
10407 * used as a password, to authorize further upgrades.
10408 *
10409 * For security, do not set this to a guessable string. Use the value supplied
10410 * by the install/upgrade process. To cause the upgrader to generate a new key,
10411 * delete the old key from LocalSettings.php.
10412 */
10413 public const UpgradeKey = [
10414 'default' => false,
10415 ];
10416
10417 /**
10418 * Fully specified path to git binary
10419 */
10420 public const GitBin = [
10421 'default' => '/usr/bin/git',
10422 ];
10423
10424 /**
10425 * Map GIT repository URLs to viewer URLs to provide links in Special:Version
10426 *
10427 * Key is a pattern passed to preg_match() and preg_replace(),
10428 * without the delimiters (which are #) and must match the whole URL.
10429 * The value is the replacement for the key (it can contain $1, etc.)
10430 * %h will be replaced by the short SHA-1 (7 first chars) and %H by the
10431 * full SHA-1 of the HEAD revision.
10432 * %r will be replaced with a URL-encoded version of $1.
10433 * %R will be replaced with $1 and no URL-encoding
10434 *
10435 * @since 1.20
10436 */
10437 public const GitRepositoryViewers = [
10438 'default' => [
10439 'https://(?:[a-z0-9_]+@)?gerrit\.wikimedia\.org/r/(?:p/)?(.*)' => 'https://gerrit.wikimedia.org/g/%R/+/%H',
10440 'ssh://(?:[a-z0-9_]+@)?gerrit\.wikimedia\.org:29418/(.*)' => 'https://gerrit.wikimedia.org/g/%R/+/%H',
10441 'https://github\.com/(.*?)(\.git)?' => 'https://github.com/$1/commit/%H',
10442 'git@github\.com:(.*?)(\.git)?' => 'https://github.com/$1/commit/%H',
10443 ],
10444 'type' => 'map',
10445 ];
10446
10447 // endregion -- End of maintenance
10448
10449 /***************************************************************************/
10450 // region Recent changes, new pages, watchlist and history
10451 /** @name Recent changes, new pages, watchlist and history */
10452
10453 /**
10454 * Recentchanges items are periodically purged; entries older than this many
10455 * seconds will go.
10456 *
10457 * Default: 90 days = about three months
10458 */
10459 public const RCMaxAge = [
10460 'default' => 90 * 24 * 3600,
10461 ];
10462
10463 /**
10464 * Page watchers inactive for more than this many seconds are considered inactive.
10465 *
10466 * Used mainly by action=info. Default: 180 days = about six months.
10467 *
10468 * @since 1.26
10469 */
10470 public const WatchersMaxAge = [
10471 'default' => 180 * 24 * 3600,
10472 ];
10473
10474 /**
10475 * If active watchers (per above) are this number or less, do not disclose it.
10476 *
10477 * Left to 1, prevents unprivileged users from knowing for sure that there are 0.
10478 * Set to -1 if you want to always complement watchers count with this info.
10479 *
10480 * @since 1.26
10481 */
10482 public const UnwatchedPageSecret = [
10483 'default' => 1,
10484 ];
10485
10486 /**
10487 * Filter $wgRCLinkDays by $wgRCMaxAge to avoid showing links for numbers
10488 * higher than what will be stored. Note that this is disabled by default
10489 * because we sometimes do have RC data which is beyond the limit for some
10490 * reason, and some users may use the high numbers to display that data which
10491 * is still there.
10492 */
10493 public const RCFilterByAge = [
10494 'default' => false,
10495 ];
10496
10497 /**
10498 * List of Limits options to list in the Special:Recentchanges and
10499 * Special:Recentchangeslinked pages.
10500 */
10501 public const RCLinkLimits = [
10502 'default' => [ 50, 100, 250, 500 ],
10503 'type' => 'list',
10504 ];
10505
10506 /**
10507 * List of Days options to list in the Special:Recentchanges and
10508 * Special:Recentchangeslinked pages.
10509 *
10510 * @see \MediaWiki\SpecialPage\ChangesListSpecialPage::getLinkDays
10511 */
10512 public const RCLinkDays = [
10513 'default' => [ 1, 3, 7, 14, 30 ],
10514 'type' => 'list',
10515 ];
10516
10517 /**
10518 * Configuration for feeds to which notifications about recent changes will be sent.
10519 *
10520 * The following feed classes are available by default:
10521 * - 'UDPRCFeedEngine' - sends recent changes over UDP to the specified server.
10522 * - 'RedisPubSubFeedEngine' - send recent changes to Redis.
10523 *
10524 * Only 'class' or 'uri' is required. If 'uri' is set instead of 'class', then
10525 * RecentChange::getEngine() is used to determine the class. All options are
10526 * passed to the constructor.
10527 *
10528 * Common options:
10529 * - 'class' -- The class to use for this feed (must implement RCFeed).
10530 * - 'omit_bots' -- Exclude bot edits from the feed. (default: false)
10531 * - 'omit_anon' -- Exclude anonymous edits from the feed. (default: false)
10532 * - 'omit_user' -- Exclude edits by registered users from the feed. (default: false)
10533 * - 'omit_minor' -- Exclude minor edits from the feed. (default: false)
10534 * - 'omit_patrolled' -- Exclude patrolled edits from the feed. (default: false)
10535 *
10536 * FormattedRCFeed-specific options:
10537 * - 'uri' -- [required] The address to which the messages are sent.
10538 * The uri scheme of this string will be looked up in $wgRCEngines
10539 * to determine which FormattedRCFeed class to use.
10540 * - 'formatter' -- [required] The class (implementing RCFeedFormatter) which will
10541 * produce the text to send. This can also be an object of the class.
10542 * Formatters available by default: JSONRCFeedFormatter, XMLRCFeedFormatter,
10543 * IRCColourfulRCFeedFormatter.
10544 *
10545 * IRCColourfulRCFeedFormatter-specific options:
10546 * - 'add_interwiki_prefix' -- whether the titles should be prefixed with
10547 * the first entry in the $wgLocalInterwikis array
10548 *
10549 * JSONRCFeedFormatter-specific options:
10550 * - 'channel' -- if set, the 'channel' parameter is also set in JSON values.
10551 *
10552 * **Examples:**
10553 *
10554 * ```
10555 * $wgRCFeeds['example'] = [
10556 * 'uri' => 'udp://localhost:1336',
10557 * 'formatter' => 'JSONRCFeedFormatter',
10558 * 'add_interwiki_prefix' => false,
10559 * 'omit_bots' => true,
10560 * ];
10561 * ```
10562 *
10563 * ```
10564 * $wgRCFeeds['example'] = [
10565 * 'uri' => 'udp://localhost:1338',
10566 * 'formatter' => 'IRCColourfulRCFeedFormatter',
10567 * 'add_interwiki_prefix' => false,
10568 * 'omit_bots' => true,
10569 * ];
10570 * ```
10571 *
10572 * ```
10573 * $wgRCFeeds['example'] = [
10574 * 'class' => ExampleRCFeed::class,
10575 * ];
10576 * ```
10577 *
10578 * @since 1.22
10579 */
10580 public const RCFeeds = [
10581 'default' => [],
10582 'type' => 'map',
10583 ];
10584
10585 /**
10586 * Used by RecentChange::getEngine to find the correct engine for a given URI scheme.
10587 *
10588 * Keys are scheme names, values are names of FormattedRCFeed sub classes.
10589 *
10590 * @since 1.22
10591 */
10592 public const RCEngines = [
10593 'default' => [
10594 'redis' => RedisPubSubFeedEngine::class,
10595 'udp' => UDPRCFeedEngine::class,
10596 ],
10597 'type' => 'map',
10598 ];
10599
10600 /**
10601 * Treat category membership changes as a RecentChange.
10602 *
10603 * Changes are mentioned in RC for page actions as follows:
10604 * - creation: pages created with categories are mentioned
10605 * - edit: category additions/removals to existing pages are mentioned
10606 * - move: nothing is mentioned (unless templates used depend on the title)
10607 * - deletion: nothing is mentioned
10608 * - undeletion: nothing is mentioned
10609 *
10610 * @since 1.27
10611 */
10612 public const RCWatchCategoryMembership = [
10613 'default' => false,
10614 ];
10615
10616 /**
10617 * Use RC Patrolling to check for vandalism (from recent changes and watchlists)
10618 * New pages and new files are included.
10619 *
10620 * @note If you disable all patrolling features, you probably also want to
10621 * remove 'patrol' from $wgFilterLogTypes so a show/hide link isn't shown on
10622 * Special:Log.
10623 */
10624 public const UseRCPatrol = [
10625 'default' => true,
10626 ];
10627
10628 /**
10629 * Polling rate, in seconds, used by the 'live update' and 'view newest' features
10630 * of the RCFilters app on SpecialRecentChanges and Special:Watchlist.
10631 *
10632 * 0 to disable completely.
10633 */
10634 public const StructuredChangeFiltersLiveUpdatePollingRate = [
10635 'default' => 3,
10636 ];
10637
10638 /**
10639 * Use new page patrolling to check new pages on Special:Newpages
10640 *
10641 * @note If you disable all patrolling features, you probably also want to
10642 * remove 'patrol' from $wgFilterLogTypes so a show/hide link isn't shown on
10643 * Special:Log.
10644 */
10645 public const UseNPPatrol = [
10646 'default' => true,
10647 ];
10648
10649 /**
10650 * Use file patrolling to check new files on Special:Newfiles
10651 *
10652 * @note If you disable all patrolling features, you probably also want to
10653 * remove 'patrol' from $wgFilterLogTypes so a show/hide link isn't shown on
10654 * Special:Log.
10655 * @since 1.27
10656 */
10657 public const UseFilePatrol = [
10658 'default' => true,
10659 ];
10660
10661 /**
10662 * Provide syndication feeds (RSS, Atom) for, e.g., Recentchanges, Newpages
10663 */
10664 public const Feed = [
10665 'default' => true,
10666 ];
10667
10668 /**
10669 * Set maximum number of results to return in syndication feeds (RSS, Atom) for
10670 * eg Recentchanges, Newpages.
10671 */
10672 public const FeedLimit = [
10673 'default' => 50,
10674 ];
10675
10676 /**
10677 * _Minimum_ timeout for cached Recentchanges feed, in seconds.
10678 *
10679 * A cached version will continue to be served out even if changes
10680 * are made, until this many seconds runs out since the last render.
10681 *
10682 * If set to 0, feed caching is disabled. Use this for debugging only;
10683 * feed generation can be pretty slow with diffs.
10684 */
10685 public const FeedCacheTimeout = [
10686 'default' => 60,
10687 ];
10688
10689 /**
10690 * When generating Recentchanges RSS/Atom feed, diffs will not be generated for
10691 * pages larger than this size.
10692 */
10693 public const FeedDiffCutoff = [
10694 'default' => 32768,
10695 ];
10696
10697 /**
10698 * Override the site's default RSS/ATOM feed for recentchanges that appears on
10699 * every page. Some sites might have a different feed they'd like to promote
10700 * instead of the RC feed (maybe like a "Recent New Articles" or "Breaking news" one).
10701 *
10702 * Should be a format as key (either 'rss' or 'atom') and an URL to the feed
10703 * as value.
10704 *
10705 * **Example:**
10706 * Configure the 'atom' feed to https://example.com/somefeed.xml
10707 *
10708 * ```
10709 * $wgSiteFeed['atom'] = "https://example.com/somefeed.xml";
10710 * ```
10711 */
10712 public const OverrideSiteFeed = [
10713 'default' => [],
10714 'type' => 'map',
10715 ];
10716
10717 /**
10718 * Available feeds objects.
10719 *
10720 * Should probably only be defined when a page is syndicated ie when
10721 * $wgOut->isSyndicated() is true.
10722 */
10723 public const FeedClasses = [
10724 'default' => [
10725 'rss' => \MediaWiki\Feed\RSSFeed::class,
10726 'atom' => \MediaWiki\Feed\AtomFeed::class,
10727 ],
10728 'type' => 'map',
10729 ];
10730
10731 /**
10732 * Which feed types should we provide by default? This can include 'rss',
10733 * 'atom', neither, or both.
10734 */
10735 public const AdvertisedFeedTypes = [
10736 'default' => [ 'atom', ],
10737 'type' => 'list',
10738 ];
10739
10740 /**
10741 * Show watching users in recent changes, watchlist and page history views
10742 */
10743 public const RCShowWatchingUsers = [
10744 'default' => false,
10745 ];
10746
10747 /**
10748 * Show the amount of changed characters in recent changes
10749 */
10750 public const RCShowChangedSize = [
10751 'default' => true,
10752 ];
10753
10754 /**
10755 * If the difference between the character counts of the text
10756 * before and after the edit is below that value, the value will be
10757 * highlighted on the RC page.
10758 */
10759 public const RCChangedSizeThreshold = [
10760 'default' => 500,
10761 ];
10762
10763 /**
10764 * Show "Updated (since my last visit)" marker in RC view, watchlist and history
10765 * view for watched pages with new changes
10766 */
10767 public const ShowUpdatedMarker = [
10768 'default' => true,
10769 ];
10770
10771 /**
10772 * Disable links to talk pages of anonymous users (IPs) in listings on special
10773 * pages like page history, Special:Recentchanges, etc.
10774 */
10775 public const DisableAnonTalk = [
10776 'default' => false,
10777 ];
10778
10779 /**
10780 * Allow filtering by change tag in recentchanges, history, etc
10781 * Has no effect if no tags are defined.
10782 */
10783 public const UseTagFilter = [
10784 'default' => true,
10785 ];
10786
10787 /**
10788 * List of core tags to enable.
10789 *
10790 * @since 1.31
10791 * @since 1.36 Added 'mw-manual-revert' and 'mw-reverted'
10792 * @see \ChangeTags::TAG_CONTENT_MODEL_CHANGE
10793 * @see \ChangeTags::TAG_NEW_REDIRECT
10794 * @see \ChangeTags::TAG_REMOVED_REDIRECT
10795 * @see \ChangeTags::TAG_CHANGED_REDIRECT_TARGET
10796 * @see \ChangeTags::TAG_BLANK
10797 * @see \ChangeTags::TAG_REPLACE
10798 * @see \ChangeTags::TAG_ROLLBACK
10799 * @see \ChangeTags::TAG_UNDO
10800 * @see \ChangeTags::TAG_MANUAL_REVERT
10801 * @see \ChangeTags::TAG_REVERTED
10802 * @see \ChangeTags::TAG_SERVER_SIDE_UPLOAD
10803 */
10804 public const SoftwareTags = [
10805 'default' => [
10806 'mw-contentmodelchange' => true,
10807 'mw-new-redirect' => true,
10808 'mw-removed-redirect' => true,
10809 'mw-changed-redirect-target' => true,
10810 'mw-blank' => true,
10811 'mw-replace' => true,
10812 'mw-rollback' => true,
10813 'mw-undo' => true,
10814 'mw-manual-revert' => true,
10815 'mw-reverted' => true,
10816 'mw-server-side-upload' => true,
10817 ],
10818 'type' => 'map',
10819 'additionalProperties' => [ 'type' => 'boolean', ],
10820 ];
10821
10822 /**
10823 * If set to an integer, pages that are watched by this many users or more
10824 * will not require the unwatchedpages permission to view the number of
10825 * watchers.
10826 *
10827 * @since 1.21
10828 */
10829 public const UnwatchedPageThreshold = [
10830 'default' => false,
10831 ];
10832
10833 /**
10834 * Flags (letter symbols) shown in recent changes and watchlist to indicate
10835 * certain types of edits.
10836 *
10837 * To register a new one:
10838 *
10839 * ```
10840 * $wgRecentChangesFlags['flag'] => [
10841 * // message for the letter displayed next to rows on changes lists
10842 * 'letter' => 'letter-msg',
10843 * // message for the tooltip of the letter
10844 * 'title' => 'tooltip-msg',
10845 * // optional (defaults to 'tooltip-msg'), message to use in the legend box
10846 * 'legend' => 'legend-msg',
10847 * // optional (defaults to 'flag'), CSS class to put on changes lists rows
10848 * 'class' => 'css-class',
10849 * // optional (defaults to 'any'), how top-level flag is determined. 'any'
10850 * // will set the top-level flag if any line contains the flag, 'all' will
10851 * // only be set if all lines contain the flag.
10852 * 'grouping' => 'any',
10853 * ];
10854 * ```
10855 *
10856 * @since 1.22
10857 */
10858 public const RecentChangesFlags = [
10859 'default' => [
10860 'newpage' => [
10861 'letter' => 'newpageletter',
10862 'title' => 'recentchanges-label-newpage',
10863 'legend' => 'recentchanges-legend-newpage',
10864 'grouping' => 'any',
10865 ],
10866 'minor' => [
10867 'letter' => 'minoreditletter',
10868 'title' => 'recentchanges-label-minor',
10869 'legend' => 'recentchanges-legend-minor',
10870 'class' => 'minoredit',
10871 'grouping' => 'all',
10872 ],
10873 'bot' => [
10874 'letter' => 'boteditletter',
10875 'title' => 'recentchanges-label-bot',
10876 'legend' => 'recentchanges-legend-bot',
10877 'class' => 'botedit',
10878 'grouping' => 'all',
10879 ],
10880 'unpatrolled' => [
10881 'letter' => 'unpatrolledletter',
10882 'title' => 'recentchanges-label-unpatrolled',
10883 'legend' => 'recentchanges-legend-unpatrolled',
10884 'grouping' => 'any',
10885 ],
10886 ],
10887 'type' => 'map',
10888 ];
10889
10890 /**
10891 * Whether to enable the watchlist expiry feature.
10892 *
10893 * @since 1.35
10894 */
10895 public const WatchlistExpiry = [
10896 'default' => false,
10897 'type' => 'boolean',
10898 ];
10899
10900 /**
10901 * Chance of expired watchlist items being purged on any page edit.
10902 *
10903 * Only has effect if $wgWatchlistExpiry is true.
10904 *
10905 * If this is zero, expired watchlist items will not be removed
10906 * and the purgeExpiredWatchlistItems.php maintenance script should be run periodically.
10907 *
10908 * @since 1.35
10909 */
10910 public const WatchlistPurgeRate = [
10911 'default' => 0.1,
10912 'type' => 'float',
10913 ];
10914
10915 /**
10916 * Relative maximum duration for watchlist expiries, as accepted by strtotime().
10917 *
10918 * This relates to finite watchlist expiries only. Pages can be watched indefinitely
10919 * regardless of what this is set to.
10920 *
10921 * This is used to ensure the watchlist_expiry table doesn't grow to be too big.
10922 *
10923 * Only has effect if $wgWatchlistExpiry is true.
10924 *
10925 * Set to null to allow expiries of any duration.
10926 *
10927 * @since 1.35
10928 */
10929 public const WatchlistExpiryMaxDuration = [
10930 'default' => '1 year',
10931 'type' => '?string',
10932 ];
10933
10934 // endregion -- end RC/watchlist
10935
10936 /***************************************************************************/
10937 // region Copyright and credits settings
10938 /** @name Copyright and credits settings */
10939
10940 /**
10941 * Override for copyright metadata.
10942 *
10943 * This is the name of the page containing information about the wiki's copyright status,
10944 * which will be added as a link in the footer if it is specified. It overrides
10945 * $wgRightsUrl if both are specified.
10946 */
10947 public const RightsPage = [
10948 'default' => null,
10949 ];
10950
10951 /**
10952 * Set this to specify an external URL containing details about the content license used on your
10953 * wiki.
10954 *
10955 * If $wgRightsPage is set then this setting is ignored.
10956 */
10957 public const RightsUrl = [
10958 'default' => null,
10959 ];
10960
10961 /**
10962 * If either $wgRightsUrl or $wgRightsPage is specified then this variable gives the text for
10963 * the link. Otherwise, it will be treated as raw HTML.
10964 *
10965 * If using $wgRightsUrl then this value must be specified. If using $wgRightsPage then the
10966 * name
10967 * of the page will also be used as the link text if this variable is not set.
10968 */
10969 public const RightsText = [
10970 'default' => null,
10971 ];
10972
10973 /**
10974 * Override for copyright metadata.
10975 */
10976 public const RightsIcon = [
10977 'default' => null,
10978 ];
10979
10980 /**
10981 * Set this to true if you want detailed copyright information forms on Upload.
10982 */
10983 public const UseCopyrightUpload = [
10984 'default' => false,
10985 ];
10986
10987 /**
10988 * Set this to the number of authors that you want to be credited below an
10989 * article text. Set it to zero to hide the attribution block, and a negative
10990 * number (like -1) to show all authors. Note that this will require 2-3 extra
10991 * database hits, which can have a not insignificant impact on performance for
10992 * large wikis.
10993 */
10994 public const MaxCredits = [
10995 'default' => 0,
10996 ];
10997
10998 /**
10999 * If there are more than $wgMaxCredits authors, show $wgMaxCredits of them.
11000 *
11001 * Otherwise, link to a separate credits page.
11002 */
11003 public const ShowCreditsIfMax = [
11004 'default' => true,
11005 ];
11006
11007 // endregion -- end of copyright and credits settings
11008
11009 /***************************************************************************/
11010 // region Import / Export
11011 /** @name Import / Export */
11012
11013 /**
11014 * List of interwiki prefixes for wikis we'll accept as sources for
11015 * Special:Import and API action=import. Since complete page history can be
11016 * imported, these should be 'trusted'.
11017 *
11018 * This can either be a regular array, or an associative map specifying
11019 * subprojects on the interwiki map of the target wiki, or a mix of the two,
11020 * e.g.
11021 *
11022 * ```
11023 * $wgImportSources = [
11024 * 'wikipedia' => [ 'cs', 'en', 'fr', 'zh' ],
11025 * 'wikispecies',
11026 * 'wikia' => [ 'animanga', 'brickipedia', 'desserts' ],
11027 * ];
11028 * ```
11029 *
11030 * If you have a very complex import sources setup, you can lazy-load it using
11031 * the ImportSources hook.
11032 *
11033 * If a user has the 'import' permission but not the 'importupload' permission,
11034 * they will only be able to run imports through this transwiki interface.
11035 */
11036 public const ImportSources = [
11037 'default' => [],
11038 'type' => 'map',
11039 ];
11040
11041 /**
11042 * Optional default target namespace for interwiki imports.
11043 *
11044 * Can use this to create an incoming "transwiki"-style queue.
11045 * Set to numeric key, not the name.
11046 *
11047 * Users may override this in the Special:Import dialog.
11048 */
11049 public const ImportTargetNamespace = [
11050 'default' => null,
11051 ];
11052
11053 /**
11054 * If set to false, disables the full-history option on Special:Export.
11055 *
11056 * This is currently poorly optimized for long edit histories, so is
11057 * disabled on Wikimedia's sites.
11058 */
11059 public const ExportAllowHistory = [
11060 'default' => true,
11061 ];
11062
11063 /**
11064 * If set nonzero, Special:Export requests for history of pages with
11065 * more revisions than this will be rejected. On some big sites things
11066 * could get bogged down by very very long pages.
11067 */
11068 public const ExportMaxHistory = [
11069 'default' => 0,
11070 ];
11071
11072 /**
11073 * Return distinct author list (when not returning full history)
11074 */
11075 public const ExportAllowListContributors = [
11076 'default' => false,
11077 ];
11078
11079 /**
11080 * If non-zero, Special:Export accepts a "pagelink-depth" parameter
11081 * up to this specified level, which will cause it to include all
11082 * pages linked to from the pages you specify. Since this number
11083 * can become *really really large* and could easily break your wiki,
11084 * it's disabled by default for now.
11085 *
11086 * @warning There's a HARD CODED limit of 5 levels of recursion to prevent a
11087 * crazy-big export from being done by someone setting the depth number too
11088 * high. In other words, last resort safety net.
11089 */
11090 public const ExportMaxLinkDepth = [
11091 'default' => 0,
11092 ];
11093
11094 /**
11095 * Whether to allow the "export all pages in namespace" option
11096 */
11097 public const ExportFromNamespaces = [
11098 'default' => false,
11099 ];
11100
11101 /**
11102 * Whether to allow exporting the entire wiki into a single file
11103 */
11104 public const ExportAllowAll = [
11105 'default' => false,
11106 ];
11107
11108 /**
11109 * Maximum number of pages returned by the GetPagesFromCategory and
11110 * GetPagesFromNamespace functions.
11111 *
11112 * @since 1.27
11113 */
11114 public const ExportPagelistLimit = [
11115 'default' => 5000,
11116 ];
11117
11118 /**
11119 * The schema to use by default when generating XML dumps. This allows sites to control
11120 * explicitly when to make breaking changes to their export and dump format.
11121 */
11122 public const XmlDumpSchemaVersion = [
11123 'default' => XML_DUMP_SCHEMA_VERSION_11,
11124 ];
11125
11126 // endregion -- end of import/export
11127
11128 /***************************************************************************/
11129 // region Wiki Farm
11130 /** @name Wiki Farm */
11131
11132 /**
11133 * A directory that contains site-specific configuration files.
11134 *
11135 * Setting this will enable multi-tenant ("wiki farm") mode, causing
11136 * site-specific settings to be loaded based on information from the web request.
11137 *
11138 * @unstable EXPERIMENTAL
11139 * @since 1.38
11140 */
11141 public const WikiFarmSettingsDirectory = [
11142 'default' => null
11143 ];
11144
11145 /**
11146 * The file extension to be used when looking up site-specific settings files in
11147 * $wgWikiFarmSettingsDirectory, such as 'json' or 'yaml'.
11148 *
11149 * @unstable EXPERIMENTAL
11150 * @since 1.38
11151 */
11152 public const WikiFarmSettingsExtension = [
11153 'default' => 'yaml'
11154 ];
11155
11156 // endregion -- End Wiki Farm
11157
11158 /***************************************************************************/
11159 // region Extensions
11160 /** @name Extensions */
11161
11162 /**
11163 * A list of callback functions which are called once MediaWiki is fully
11164 * initialised
11165 */
11166 public const ExtensionFunctions = [
11167 'default' => [],
11168 'type' => 'list',
11169 ];
11170
11171 /**
11172 * Extension messages files.
11173 *
11174 * Associative array mapping extension name to the filename where messages can be
11175 * found. The file should contain variable assignments. Any of the variables
11176 * present in languages/messages/MessagesEn.php may be defined, but $messages
11177 * is the most common.
11178 *
11179 * Variables defined in extensions will override conflicting variables defined
11180 * in the core.
11181 *
11182 * Since MediaWiki 1.23, use of this variable to define messages is discouraged; instead, store
11183 * messages in JSON format and use $wgMessagesDirs. For setting other variables than
11184 * $messages, $wgExtensionMessagesFiles should still be used. Use a DIFFERENT key because
11185 * any entry having a key that also exists in $wgMessagesDirs will be ignored.
11186 *
11187 * Extensions using the JSON message format can preserve backward compatibility with
11188 * earlier versions of MediaWiki by using a compatibility shim, such as one generated
11189 * by the generateJsonI18n.php maintenance script, listing it under the SAME key
11190 * as for the $wgMessagesDirs entry.
11191 *
11192 * **Example:**
11193 *
11194 * ```
11195 * $wgExtensionMessagesFiles['ConfirmEdit'] = __DIR__.'/ConfirmEdit.i18n.php';
11196 * ```
11197 */
11198 public const ExtensionMessagesFiles = [
11199 'default' => [],
11200 'type' => 'map',
11201 ];
11202
11203 /**
11204 * Extension messages directories.
11205 *
11206 * Associative array mapping extension name to the path of the directory where message files can
11207 * be found. The message files are expected to be JSON files named for their language code, e.g.
11208 * en.json, de.json, etc. Extensions with messages in multiple places may specify an array of
11209 * message directories.
11210 *
11211 * Message directories in core should be added to LocalisationCache::getMessagesDirs()
11212 *
11213 * **Simple example:**
11214 *
11215 * ```
11216 * $wgMessagesDirs['Example'] = __DIR__ . '/i18n';
11217 * ```
11218 *
11219 * **Complex example:**
11220 *
11221 * ```
11222 * $wgMessagesDirs['Example'] = [
11223 * __DIR__ . '/lib/ve/i18n',
11224 * __DIR__ . '/lib/ooui/i18n',
11225 * __DIR__ . '/i18n',
11226 * ]
11227 * ```
11228 *
11229 * @since 1.23
11230 */
11231 public const MessagesDirs = [
11232 'default' => [],
11233 'type' => 'map',
11234 ];
11235
11236 /**
11237 * Message directories containing JSON files for localisation of special page aliases.
11238 *
11239 * Associative array mapping extension name to the directory where configurations can be
11240 * found. The directory is expected to contain JSON files corresponding to each language code.
11241 *
11242 * Variables defined in extensions will override conflicting variables defined
11243 * in the core. We recommend using this configuration to set variables that require localisation:
11244 * special page aliases, and in the future namespace aliases and magic words.
11245 *
11246 * **Simple example**: extension.json
11247 * ```
11248 * "TranslationAliasesDirs": {
11249 * "TranslationNotificationsAlias": "i18n/aliases"
11250 * }
11251 * ```
11252 * **Complex example**: extension.json
11253 * ```
11254 * "TranslationAliasesDirs": {
11255 * "TranslationNotificationsAlias": [ "i18n/special-page-aliases", "i18n/magic-words", "i18n/namespaces" ]
11256 * }
11257 * ```
11258 *
11259 * @unstable EXPERIMENTAL
11260 * @since 1.42
11261 */
11262 public const TranslationAliasesDirs = [
11263 'default' => [],
11264 'type' => 'map',
11265 ];
11266
11267 /**
11268 * Array of files with list(s) of extension entry points to be used in
11269 * maintenance/mergeMessageFileList.php
11270 *
11271 * @since 1.22
11272 */
11273 public const ExtensionEntryPointListFiles = [
11274 'default' => [],
11275 'type' => 'map',
11276 ];
11277
11278 /**
11279 * Whether to include the NewPP limit report as a HTML comment
11280 */
11281 public const EnableParserLimitReporting = [
11282 'default' => true,
11283 ];
11284
11285 /**
11286 * List of valid skin names
11287 *
11288 * The key should be the name in all lower case.
11289 *
11290 * As of 1.35, the value should be a an array in the form of the ObjectFactory specification.
11291 *
11292 * For example for 'foobarskin' where the PHP class is 'MediaWiki\Skins\FooBar\FooBarSkin' set:
11293 *
11294 * **skin.json Example:**
11295 *
11296 * ```
11297 * "ValidSkinNames": {
11298 * "foobarskin": {
11299 * "displayname": "FooBarSkin",
11300 * "class": "MediaWiki\\Skins\\FooBar\\FooBarSkin"
11301 * }
11302 * }
11303 * ```
11304 *
11305 * Historically, the value was a properly cased name for the skin (and is still currently
11306 * supported). This value will be prefixed with "Skin" to create the class name of the
11307 * skin to load. Use Skin::getSkinNames() as an accessor if you wish to have access to the
11308 * full list.
11309 */
11310 public const ValidSkinNames = [
11311 'default' => [],
11312 'type' => 'map',
11313 ];
11314
11315 /**
11316 * Special page list. This is an associative array mapping the (canonical) names of
11317 * special pages to either a class name or a ObjectFactory spec to be instantiated, or a callback to use for
11318 * creating the special page object. In all cases, the result must be an instance of SpecialPage.
11319 */
11320 public const SpecialPages = [
11321 'default' => [],
11322 'type' => 'map',
11323 ];
11324
11325 /**
11326 * Obsolete switch that controlled legacy case-insensitive classloading.
11327 *
11328 * Case-insensitive classloading was needed for loading data that had
11329 * been serialized by PHP 4 with the class names converted to lowercase.
11330 * It is no longer necessary since 1.31; the lowercase forms in question
11331 * are now listed in autoload.php (T166759).
11332 *
11333 * @deprecated since 1.35
11334 */
11335 public const AutoloadAttemptLowercase = [
11336 'default' => false,
11337 'obsolete' => 'Since 1.40; no longer has any effect.',
11338 'description' => 'Has been emitting warnings since 1.39 (LTS). ' .
11339 'Can be removed completely in 1.44, assuming 1.43 is an LTS release.'
11340 ];
11341
11342 /**
11343 * Add information about an installed extension, keyed by its type.
11344 *
11345 * This is for use from LocalSettings.php and legacy PHP-entrypoint
11346 * extensions. In general, extensions should (only) declare this
11347 * information in their extension.json file.
11348 *
11349 * The 'name', 'path' and 'author' keys are required.
11350 *
11351 * ```
11352 * $wgExtensionCredits['other'][] = [
11353 * 'path' => __FILE__,
11354 * 'name' => 'Example extension',
11355 * 'namemsg' => 'exampleextension-name',
11356 * 'author' => [
11357 * 'Foo Barstein',
11358 * ],
11359 * 'version' => '0.0.1',
11360 * 'url' => 'https://example.org/example-extension/',
11361 * 'descriptionmsg' => 'exampleextension-desc',
11362 * 'license-name' => 'GPL-2.0-or-later',
11363 * ];
11364 * ```
11365 *
11366 * The extensions are listed on Special:Version. This page also looks for a file
11367 * named COPYING or LICENSE (optional .txt extension) and provides a link to
11368 * view said file. When the 'license-name' key is specified, this file is
11369 * interpreted as wikitext.
11370 *
11371 * - $type: One of 'specialpage', 'parserhook', 'variable', 'media', 'antispam',
11372 * 'skin', 'api', or 'other', or any additional types as specified through the
11373 * ExtensionTypes hook as used in SpecialVersion::getExtensionTypes().
11374 *
11375 * - name: Name of extension as an inline string instead of localizable message.
11376 * Do not omit this even if 'namemsg' is provided, as it is used to override
11377 * the path Special:Version uses to find extension's license info, and is
11378 * required for backwards-compatibility with MediaWiki 1.23 and older.
11379 *
11380 * - namemsg (since MW 1.24): A message key for a message containing the
11381 * extension's name, if the name is localizable. (For example, skin names
11382 * usually are.)
11383 *
11384 * - author: A string or an array of strings. Authors can be linked using
11385 * the regular wikitext link syntax. To have an internationalized version of
11386 * "and others" show, add an element "...". This element can also be linked,
11387 * for instance "[https://example ...]".
11388 *
11389 * - descriptionmsg: A message key or an array with message key and parameters:
11390 * `'descriptionmsg' => 'exampleextension-desc',`
11391 *
11392 * - description: Description of extension as an inline string instead of
11393 * localizable message (omit in favour of 'descriptionmsg').
11394 *
11395 * - license-name: Short name of the license (used as label for the link), such
11396 * as "GPL-2.0-or-later" or "MIT" (https://spdx.org/licenses/ for a list of identifiers).
11397 *
11398 * @see \MediaWiki\Specials\SpecialVersion::getCredits
11399 */
11400 public const ExtensionCredits = [
11401 'default' => [],
11402 'type' => 'map',
11403 ];
11404
11405 /**
11406 * Global list of hooks.
11407 *
11408 * The key is one of the events made available by MediaWiki, you can find
11409 * a description for most of them in their respective hook interfaces. For
11410 * overview of the hook system see docs/Hooks.md. The array is used internally
11411 * by HookContainer::run().
11412 *
11413 * The value can be one of:
11414 *
11415 * - A function name: `$wgHooks['event_name'][] = $function;`
11416 *
11417 * - A function with some data: `$wgHooks['event_name'][] = [ $function, $data ];`
11418 *
11419 *
11420 * - A an object method: `$wgHooks['event_name'][] = [ $object, 'method' ];`
11421 *
11422 * - A closure:
11423 * ```
11424 * $wgHooks['event_name'][] = function ( $hookParam ) {
11425 * // Handler code goes here.
11426 * };
11427 * ```
11428 *
11429 * @warning You should always append to an event array or you will end up
11430 * deleting a previous registered hook.
11431 * @warning Hook handlers should be registered at file scope. Registering
11432 * handlers after file scope can lead to unexpected results due to caching.
11433 */
11434 public const Hooks = [
11435 'default' => [],
11436 'type' => 'map',
11437 'mergeStrategy' => 'array_merge_recursive',
11438 ];
11439
11440 /**
11441 * List of service wiring files to be loaded by the default instance of MediaWikiServices. Each
11442 * file listed here is expected to return an associative array mapping service names to
11443 * instantiator functions. Extensions may add wiring files to define their own services.
11444 * However, this cannot be used to replace existing services - use the MediaWikiServices hook
11445 * for that.
11446 *
11447 * @note the default wiring file will be added automatically by Setup.php
11448 * @see \MediaWiki\MediaWikiServices
11449 * @see \Wikimedia\Services\ServiceContainer::loadWiringFiles() for details on loading
11450 * service instantiator functions.
11451 * @see docs/Injection.md for an overview of dependency
11452 * injection in MediaWiki.
11453 */
11454 public const ServiceWiringFiles = [
11455 'default' => [],
11456 'type' => 'list',
11457 ];
11458
11459 /**
11460 * Maps jobs to their handlers; extensions
11461 * can add to this to provide custom jobs.
11462 *
11463 * Since 1.40, job handlers can be specified as object specs
11464 * for use with ObjectFactory, using an array, a plain class name,
11465 * or a callback.
11466 *
11467 * @note The constructor signature of job classes has to follow one of two patterns:
11468 * Either it takes a parameter array as the first argument, followed by any services it
11469 * needs to have injected: ( array $params, ... ).
11470 * Or it takes a PageReference as the first parameter, followed by the parameter array,
11471 * followed by any services: ( PageReference $page, array $params, ... ).
11472 * In order to signal to the JobFactory that the $page parameter should be omitted from
11473 * the constructor arguments, the job class has to be a subclass of GenericParameterJob,
11474 * or the object specification for the job has to set the 'needsPage' key to false.
11475 * If a callback is used, its signature follows the same rules.
11476 */
11477 public const JobClasses = [
11478 'default' => [
11479 'deletePage' => DeletePageJob::class,
11480 'refreshLinks' => RefreshLinksJob::class,
11481 'deleteLinks' => DeleteLinksJob::class,
11482 'htmlCacheUpdate' => HTMLCacheUpdateJob::class,
11483 'sendMail' => [
11484 'class' => EmaillingJob::class,
11485 'services' => [
11486 0 => 'Emailer'
11487 ]
11488 ],
11489 'enotifNotify' => EnotifNotifyJob::class,
11490 'fixDoubleRedirect' => [
11491 'class' => DoubleRedirectJob::class,
11492 'services' => [
11493 'RevisionLookup',
11494 'MagicWordFactory',
11495 'WikiPageFactory',
11496 ],
11497 // This job requires a title
11498 'needsPage' => true,
11499 ],
11500 'AssembleUploadChunks' => AssembleUploadChunksJob::class,
11501 'PublishStashedFile' => PublishStashedFileJob::class,
11502 'ThumbnailRender' => ThumbnailRenderJob::class,
11503 'UploadFromUrl' => UploadFromUrlJob::class,
11504 'recentChangesUpdate' => RecentChangesUpdateJob::class,
11505 'refreshLinksPrioritized' => RefreshLinksJob::class,
11506 'refreshLinksDynamic' => RefreshLinksJob::class,
11507 'activityUpdateJob' => ActivityUpdateJob::class,
11508 'categoryMembershipChange' => CategoryMembershipChangeJob::class,
11509 'clearUserWatchlist' => ClearUserWatchlistJob::class,
11510 'watchlistExpiry' => WatchlistExpiryJob::class,
11511 'cdnPurge' => CdnPurgeJob::class,
11512 'userGroupExpiry' => UserGroupExpiryJob::class,
11513 'clearWatchlistNotifications' => ClearWatchlistNotificationsJob::class,
11514 'userOptionsUpdate' => UserOptionsUpdateJob::class,
11515 'revertedTagUpdate' => RevertedTagUpdateJob::class,
11516 'null' => NullJob::class,
11517 'userEditCountInit' => UserEditCountInitJob::class,
11518 'parsoidCachePrewarm' => [
11519 'class' => ParsoidCachePrewarmJob::class,
11520 'services' => [
11521 'ParserOutputAccess',
11522 'PageStore',
11523 'RevisionLookup',
11524 'ParsoidSiteConfig',
11525 ],
11526 // tell the JobFactory not to include the $page parameter in the constructor call
11527 'needsPage' => false
11528 ],
11529 'renameUser' => [
11530 'class' => RenameUserJob::class,
11531 'services' => [
11532 'MainConfig',
11533 'DBLoadBalancerFactory'
11534 ]
11535 ],
11536 ],
11537 'type' => 'map',
11538 ];
11539
11540 /**
11541 * Jobs that must be explicitly requested, i.e. aren't run by job runners unless
11542 * special flags are set. The values here are keys of $wgJobClasses.
11543 *
11544 * These can be:
11545 * - Very long-running jobs.
11546 * - Jobs that you would never want to run as part of a page rendering request.
11547 * - Jobs that you want to run on specialized machines ( like transcoding, or a particular
11548 * machine on your cluster has 'outside' web access you could restrict uploadFromUrl )
11549 * These settings should be global to all wikis.
11550 */
11551 public const JobTypesExcludedFromDefaultQueue = [
11552 'default' => [ 'AssembleUploadChunks', 'PublishStashedFile', 'UploadFromUrl' ],
11553 'type' => 'list',
11554 ];
11555
11556 /**
11557 * Map of job types to how many job "work items" should be run per second
11558 * on each job runner process. The meaning of "work items" varies per job,
11559 * but typically would be something like "pages to update". A single job
11560 * may have a variable number of work items, as is the case with batch jobs.
11561 *
11562 * This is used by runJobs.php and not jobs run via $wgJobRunRate.
11563 * These settings should be global to all wikis.
11564 */
11565 public const JobBackoffThrottling = [
11566 'default' => [],
11567 'type' => 'map',
11568 'additionalProperties' => [ 'type' => 'float', ],
11569 ];
11570
11571 /**
11572 * Map of job types to configuration arrays.
11573 *
11574 * This determines which queue class and storage system is used for each job type.
11575 * Job types that do not have explicit configuration will use the 'default' config.
11576 * These settings should be global to all wikis.
11577 */
11578 public const JobTypeConf = [
11579 'default' => [
11580 'default' => [
11581 'class' => JobQueueDB::class,
11582 'order' => 'random',
11583 'claimTTL' => 3600
11584 ],
11585 ],
11586 'additionalProperties' => [
11587 'type' => 'object',
11588 'properties' => [
11589 'class' => [ 'type' => 'string' ],
11590 'order' => [ 'type' => 'string' ],
11591 'claimTTL' => [ 'type' => 'int' ]
11592 ],
11593 ],
11594 'type' => 'map',
11595 ];
11596
11597 /**
11598 * Whether to include the number of jobs that are queued
11599 * for the API's maxlag parameter.
11600 *
11601 * The total number of jobs will be divided by this to get an
11602 * estimated second of maxlag. Typically bots backoff at maxlag=5,
11603 * so setting this to the max number of jobs that should be in your
11604 * queue divided by 5 should have the effect of stopping bots once
11605 * that limit is hit.
11606 *
11607 * @since 1.29
11608 */
11609 public const JobQueueIncludeInMaxLagFactor = [
11610 'default' => false,
11611 ];
11612
11613 /**
11614 * Additional functions to be performed with updateSpecialPages.
11615 *
11616 * Expensive Querypages are already updated.
11617 */
11618 public const SpecialPageCacheUpdates = [
11619 'default' => [
11620 'Statistics' => [ SiteStatsUpdate::class, 'cacheUpdate' ]
11621 ],
11622 'type' => 'map',
11623 ];
11624
11625 /**
11626 * Page property link table invalidation lists. When a page property
11627 * changes, this may require other link tables to be updated (eg
11628 * adding __HIDDENCAT__ means the hiddencat tracking category will
11629 * have been added, so the categorylinks table needs to be rebuilt).
11630 *
11631 * This array can be added to by extensions.
11632 */
11633 public const PagePropLinkInvalidations = [
11634 'default' => [ 'hiddencat' => 'categorylinks', ],
11635 'type' => 'map',
11636 ];
11637
11638 // endregion -- End extensions
11639
11640 /***************************************************************************/
11641 // region Categories
11642 /** @name Categories */
11643
11644 /**
11645 * On category pages, show thumbnail gallery for images belonging to that
11646 * category instead of listing them as articles.
11647 */
11648 public const CategoryMagicGallery = [
11649 'default' => true,
11650 ];
11651
11652 /**
11653 * Paging limit for categories
11654 */
11655 public const CategoryPagingLimit = [
11656 'default' => 200,
11657 ];
11658
11659 /**
11660 * Specify how category names should be sorted, when listed on a category page.
11661 *
11662 * A sorting scheme is also known as a collation.
11663 *
11664 * Available values are:
11665 *
11666 * - uppercase: Converts the category name to upper case, and sorts by that.
11667 *
11668 * - identity: Does no conversion. Sorts by binary value of the string.
11669 *
11670 * - uca-default: Provides access to the Unicode Collation Algorithm with
11671 * the default element table. This is a compromise collation which sorts
11672 * all languages in a mediocre way. However, it is better than "uppercase".
11673 *
11674 * To use the uca-default collation, you must have PHP's intl extension
11675 * installed. See https://www.php.net/manual/en/intl.setup.php . The details of the
11676 * resulting collation will depend on the version of ICU installed on the
11677 * server.
11678 *
11679 * After you change this, you must run maintenance/updateCollation.php to fix
11680 * the sort keys in the database.
11681 *
11682 * Extensions can define there own collations by subclassing Collation
11683 * and using the Collation::factory hook.
11684 */
11685 public const CategoryCollation = [
11686 'default' => 'uppercase',
11687 ];
11688
11689 /**
11690 * Additional category collations to store during LinksUpdate. This can be used
11691 * to perform online migration of categories from one collation to another. An
11692 * array of associative arrays each having the following keys:
11693 *
11694 * - table: (string) The table name
11695 * - collation: (string) The collation to use for cl_sortkey
11696 * - fakeCollation: (string) The collation name to insert into cl_collation
11697 *
11698 * @since 1.38
11699 */
11700 public const TempCategoryCollations = [
11701 'default' => [],
11702 'type' => 'list',
11703 ];
11704
11705 /**
11706 * Whether to sort categories in OutputPage for display.
11707 *
11708 * The value of CategoryCollation is used for sorting.
11709 *
11710 * @unstable EXPERIMENTAL This feature is used for Parsoid development,
11711 * but its future as a core feature will depend on community uptake.
11712 */
11713 public const SortedCategories = [
11714 'default' => false,
11715 'type' => 'boolean',
11716 ];
11717
11718 /**
11719 * Array holding default tracking category names.
11720 *
11721 * Array contains the system messages for each tracking category.
11722 * Tracking categories allow pages with certain characteristics to be tracked.
11723 * It works by adding any such page to a category automatically.
11724 *
11725 * A message with the suffix '-desc' should be added as a description message
11726 * to have extra information on Special:TrackingCategories.
11727 *
11728 * @deprecated since 1.25 Extensions should now register tracking categories using
11729 * the new extension registration system.
11730 * @since 1.23
11731 */
11732 public const TrackingCategories = [
11733 'default' => [],
11734 'type' => 'list',
11735 'deprecated' => 'since 1.25 Extensions should now register tracking categories using ' .
11736 'the new extension registration system.',
11737 ];
11738
11739 // endregion -- End categories
11740
11741 /***************************************************************************/
11742 // region Logging
11743 /** @name Logging */
11744
11745 /**
11746 * The logging system has two levels: an event type, which describes the
11747 * general category and can be viewed as a named subset of all logs; and
11748 * an action, which is a specific kind of event that can exist in that
11749 * log type.
11750 *
11751 * Note that code should call LogPage::validTypes() to get a list of valid
11752 * log types instead of checking the global variable.
11753 */
11754 public const LogTypes = [
11755 'default' => [
11756 '',
11757 'block',
11758 'protect',
11759 'rights',
11760 'delete',
11761 'upload',
11762 'move',
11763 'import',
11764 'patrol',
11765 'merge',
11766 'suppress',
11767 'tag',
11768 'managetags',
11769 'contentmodel',
11770 'renameuser',
11771 ],
11772 'type' => 'list',
11773 ];
11774
11775 /**
11776 * This restricts log access to those who have a certain right
11777 * Users without this will not see it in the option menu and can not view it
11778 * Restricted logs are not added to recent changes
11779 * Logs should remain non-transcludable
11780 * Format: logtype => permissiontype
11781 */
11782 public const LogRestrictions = [
11783 'default' => [ 'suppress' => 'suppressionlog', ],
11784 'type' => 'map',
11785 ];
11786
11787 /**
11788 * Show/hide links on Special:Log will be shown for these log types.
11789 *
11790 * This is associative array of log type => boolean "hide by default"
11791 *
11792 * See $wgLogTypes for a list of available log types.
11793 *
11794 * **Example:**
11795 *
11796 * `$wgFilterLogTypes = [ 'move' => true, 'import' => false ];`
11797 *
11798 * Will display show/hide links for the move and import logs. Move logs will be
11799 * hidden by default unless the link is clicked. Import logs will be shown by
11800 * default, and hidden when the link is clicked.
11801 *
11802 * A message of the form logeventslist-[type]-log should be added, and will be
11803 * used for the link text.
11804 */
11805 public const FilterLogTypes = [
11806 'default' => [
11807 'patrol' => true,
11808 'tag' => true,
11809 'newusers' => false,
11810 ],
11811 'type' => 'map',
11812 ];
11813
11814 /**
11815 * Lists the message key string for each log type. The localized messages
11816 * will be listed in the user interface.
11817 *
11818 * Extensions with custom log types may add to this array.
11819 *
11820 * @since 1.19, if you follow the naming convention log-name-TYPE,
11821 * where TYPE is your log type, you don't need to use this array.
11822 */
11823 public const LogNames = [
11824 'default' => [
11825 '' => 'all-logs-page',
11826 'block' => 'blocklogpage',
11827 'protect' => 'protectlogpage',
11828 'rights' => 'rightslog',
11829 'delete' => 'dellogpage',
11830 'upload' => 'uploadlogpage',
11831 'move' => 'movelogpage',
11832 'import' => 'importlogpage',
11833 'patrol' => 'patrol-log-page',
11834 'merge' => 'mergelog',
11835 'suppress' => 'suppressionlog',
11836 ],
11837 'type' => 'map',
11838 ];
11839
11840 /**
11841 * Lists the message key string for descriptive text to be shown at the
11842 * top of each log type.
11843 *
11844 * Extensions with custom log types may add to this array.
11845 *
11846 * @since 1.19, if you follow the naming convention log-description-TYPE,
11847 * where TYPE is your log type, yoy don't need to use this array.
11848 */
11849 public const LogHeaders = [
11850 'default' => [
11851 '' => 'alllogstext',
11852 'block' => 'blocklogtext',
11853 'delete' => 'dellogpagetext',
11854 'import' => 'importlogpagetext',
11855 'merge' => 'mergelogpagetext',
11856 'move' => 'movelogpagetext',
11857 'patrol' => 'patrol-log-header',
11858 'protect' => 'protectlogtext',
11859 'rights' => 'rightslogtext',
11860 'suppress' => 'suppressionlogtext',
11861 'upload' => 'uploadlogpagetext',
11862 ],
11863 'type' => 'map',
11864 ];
11865
11866 /**
11867 * Maps log actions to message keys, for formatting log entries of each type
11868 * and action when displaying logs to the user.
11869 * The array keys are composed as "$type/$action".
11870 *
11871 * Extensions with custom log types may add to this array.
11872 */
11873 public const LogActions = [
11874 'default' => [],
11875 'type' => 'map',
11876 ];
11877
11878 /**
11879 * The same as above, but here values are class names or ObjectFactory specifications,
11880 * not messages. The specification must resolve to a LogFormatter subclass,
11881 * and will receive the LogEntry object as its first constructor argument.
11882 * The type can be specified as '*' (e.g. 'block/*') to handle all types.
11883 *
11884 * @see \LogPage::actionText
11885 * @see \LogFormatter
11886 */
11887 public const LogActionsHandlers = [
11888 'default' => [
11889 'block/block' => BlockLogFormatter::class,
11890 'block/reblock' => BlockLogFormatter::class,
11891 'block/unblock' => BlockLogFormatter::class,
11892 'contentmodel/change' => ContentModelLogFormatter::class,
11893 'contentmodel/new' => ContentModelLogFormatter::class,
11894 'delete/delete' => DeleteLogFormatter::class,
11895 'delete/delete_redir' => DeleteLogFormatter::class,
11896 'delete/delete_redir2' => DeleteLogFormatter::class,
11897 'delete/event' => DeleteLogFormatter::class,
11898 'delete/restore' => DeleteLogFormatter::class,
11899 'delete/revision' => DeleteLogFormatter::class,
11900 'import/interwiki' => ImportLogFormatter::class,
11901 'import/upload' => ImportLogFormatter::class,
11902 'managetags/activate' => LogFormatter::class,
11903 'managetags/create' => LogFormatter::class,
11904 'managetags/deactivate' => LogFormatter::class,
11905 'managetags/delete' => LogFormatter::class,
11906 'merge/merge' => MergeLogFormatter::class,
11907 'move/move' => MoveLogFormatter::class,
11908 'move/move_redir' => MoveLogFormatter::class,
11909 'patrol/patrol' => PatrolLogFormatter::class,
11910 'patrol/autopatrol' => PatrolLogFormatter::class,
11911 'protect/modify' => ProtectLogFormatter::class,
11912 'protect/move_prot' => ProtectLogFormatter::class,
11913 'protect/protect' => ProtectLogFormatter::class,
11914 'protect/unprotect' => ProtectLogFormatter::class,
11915 'renameuser/renameuser' => RenameuserLogFormatter::class,
11916 'rights/autopromote' => RightsLogFormatter::class,
11917 'rights/rights' => RightsLogFormatter::class,
11918 'suppress/block' => BlockLogFormatter::class,
11919 'suppress/delete' => DeleteLogFormatter::class,
11920 'suppress/event' => DeleteLogFormatter::class,
11921 'suppress/reblock' => BlockLogFormatter::class,
11922 'suppress/revision' => DeleteLogFormatter::class,
11923 'tag/update' => TagLogFormatter::class,
11924 'upload/overwrite' => UploadLogFormatter::class,
11925 'upload/revert' => UploadLogFormatter::class,
11926 'upload/upload' => UploadLogFormatter::class,
11927 ],
11928 'type' => 'map',
11929 ];
11930
11931 /**
11932 * List of log types that can be filtered by action types
11933 *
11934 * To each action is associated the list of log_action
11935 * subtypes to search for, usually one, but not necessarily so
11936 * Extensions may append to this array
11937 *
11938 * @since 1.27
11939 */
11940 public const ActionFilteredLogs = [
11941 'default' => [
11942 'block' => [
11943 'block' => [ 'block' ],
11944 'reblock' => [ 'reblock' ],
11945 'unblock' => [ 'unblock' ],
11946 ],
11947 'contentmodel' => [
11948 'change' => [ 'change' ],
11949 'new' => [ 'new' ],
11950 ],
11951 'delete' => [
11952 'delete' => [ 'delete' ],
11953 'delete_redir' => [ 'delete_redir', 'delete_redir2' ],
11954 'restore' => [ 'restore' ],
11955 'event' => [ 'event' ],
11956 'revision' => [ 'revision' ],
11957 ],
11958 'import' => [
11959 'interwiki' => [ 'interwiki' ],
11960 'upload' => [ 'upload' ],
11961 ],
11962 'managetags' => [
11963 'create' => [ 'create' ],
11964 'delete' => [ 'delete' ],
11965 'activate' => [ 'activate' ],
11966 'deactivate' => [ 'deactivate' ],
11967 ],
11968 'move' => [
11969 'move' => [ 'move' ],
11970 'move_redir' => [ 'move_redir' ],
11971 ],
11972 'newusers' => [
11973 'create' => [ 'create', 'newusers' ],
11974 'create2' => [ 'create2' ],
11975 'autocreate' => [ 'autocreate' ],
11976 'byemail' => [ 'byemail' ],
11977 ],
11978 'protect' => [
11979 'protect' => [ 'protect' ],
11980 'modify' => [ 'modify' ],
11981 'unprotect' => [ 'unprotect' ],
11982 'move_prot' => [ 'move_prot' ],
11983 ],
11984 'rights' => [
11985 'rights' => [ 'rights' ],
11986 'autopromote' => [ 'autopromote' ],
11987 ],
11988 'suppress' => [
11989 'event' => [ 'event' ],
11990 'revision' => [ 'revision' ],
11991 'delete' => [ 'delete' ],
11992 'block' => [ 'block' ],
11993 'reblock' => [ 'reblock' ],
11994 ],
11995 'upload' => [
11996 'upload' => [ 'upload' ],
11997 'overwrite' => [ 'overwrite' ],
11998 'revert' => [ 'revert' ],
11999 ],
12000 ],
12001 'type' => 'map',
12002 ];
12003
12004 /**
12005 * Maintain a log of newusers at Special:Log/newusers?
12006 */
12007 public const NewUserLog = [
12008 'default' => true,
12009 ];
12010
12011 /**
12012 * Maintain a log of page creations at Special:Log/create?
12013 *
12014 * @since 1.32
12015 */
12016 public const PageCreationLog = [
12017 'default' => true,
12018 ];
12019
12020 // endregion -- end logging
12021
12022 /***************************************************************************/
12023 // region Special pages (general and miscellaneous)
12024 /** @name Special pages (general and miscellaneous) */
12025
12026 /**
12027 * Allow special page inclusions such as {{Special:Allpages}}
12028 */
12029 public const AllowSpecialInclusion = [
12030 'default' => true,
12031 ];
12032
12033 /**
12034 * Set this to an array of special page names to prevent
12035 * maintenance/updateSpecialPages.php from updating those pages.
12036 *
12037 * Mapping each special page name to a run mode like 'periodical' if a cronjob is set up.
12038 */
12039 public const DisableQueryPageUpdate = [
12040 'default' => false,
12041 ];
12042
12043 /**
12044 * On Special:Unusedimages, consider images "used", if they are put
12045 * into a category. Default (false) is not to count those as used.
12046 */
12047 public const CountCategorizedImagesAsUsed = [
12048 'default' => false,
12049 ];
12050
12051 /**
12052 * Maximum number of links to a redirect page listed on
12053 * Special:Whatlinkshere/RedirectDestination
12054 */
12055 public const MaxRedirectLinksRetrieved = [
12056 'default' => 500,
12057 ];
12058
12059 /**
12060 * Shortest CIDR limits that can be checked in any individual range check
12061 * at Special:Contributions.
12062 *
12063 * @since 1.30
12064 */
12065 public const RangeContributionsCIDRLimit = [
12066 'default' => [
12067 'IPv4' => 16,
12068 'IPv6' => 32,
12069 ],
12070 'type' => 'map',
12071 'additionalProperties' => [ 'type' => 'integer', ],
12072 ];
12073
12074 // endregion -- end special pages
12075
12076 /***************************************************************************/
12077 // region Actions
12078 /** @name Actions */
12079
12080 /**
12081 * Map of allowed values for the "title=foo&action=<action>" parameter.
12082 * to the corresponding handler code.
12083 * See ActionFactory for the syntax. Core defaults are in ActionFactory::CORE_ACTIONS,
12084 * anything here overrides that.
12085 */
12086 public const Actions = [
12087 'default' => [],
12088 'type' => 'map',
12089 ];
12090
12091 // endregion -- end actions
12092
12093 /***************************************************************************/
12094 // region Robot (search engine crawler) policy
12095 /** @name Robot (search engine crawler) policy */
12096 // See also $wgNoFollowLinks.
12097
12098 /**
12099 * Default robot policy. The default policy is to encourage indexing and fol-
12100 * lowing of links. It may be overridden on a per-namespace and/or per-page
12101 * basis.
12102 */
12103 public const DefaultRobotPolicy = [
12104 'default' => 'index,follow',
12105 ];
12106
12107 /**
12108 * Robot policies per namespaces. The default policy is given above, the array
12109 * is made of namespace constants as defined in includes/Defines.php. You can-
12110 * not specify a different default policy for NS_SPECIAL: it is always noindex,
12111 * nofollow. This is because a number of special pages (e.g., ListPages) have
12112 * many permutations of options that display the same data under redundant
12113 * URLs, so search engine spiders risk getting lost in a maze of twisty special
12114 * pages, all alike, and never reaching your actual content.
12115 *
12116 * **Example:**
12117 *
12118 * ```
12119 * $wgNamespaceRobotPolicies = [ NS_TALK => 'noindex' ];
12120 * ```
12121 */
12122 public const NamespaceRobotPolicies = [
12123 'default' => [],
12124 'type' => 'map',
12125 ];
12126
12127 /**
12128 * Robot policies per article. These override the per-namespace robot policies.
12129 *
12130 * Must be in the form of an array where the key part is a properly canonicalised
12131 * text form title and the value is a robot policy.
12132 *
12133 * **Example:**
12134 *
12135 * ```
12136 * $wgArticleRobotPolicies = [
12137 * 'Main Page' => 'noindex,follow',
12138 * 'User:Bob' => 'index,follow',
12139 * ];
12140 * ```
12141 *
12142 * **Example that DOES NOT WORK because the names are not canonical text**
12143 * forms:
12144 *
12145 * ```
12146 * $wgArticleRobotPolicies = [
12147 * // Underscore, not space!
12148 * 'Main_Page' => 'noindex,follow',
12149 * // "Project", not the actual project name!
12150 * 'Project:X' => 'index,follow',
12151 * // Needs to be "Abc", not "abc" (unless $wgCapitalLinks is false for that namespace)!
12152 * 'abc' => 'noindex,nofollow'
12153 * ];
12154 * ```
12155 */
12156 public const ArticleRobotPolicies = [
12157 'default' => [],
12158 'type' => 'map',
12159 ];
12160
12161 /**
12162 * An array of namespace keys in which the __INDEX__/__NOINDEX__ magic words
12163 * will not function, so users can't decide whether pages in that namespace are
12164 * indexed by search engines. If set to null, default to $wgContentNamespaces.
12165 *
12166 * **Example:**
12167 *
12168 * ```
12169 * $wgExemptFromUserRobotsControl = [ NS_MAIN, NS_TALK, NS_PROJECT ];
12170 * ```
12171 */
12172 public const ExemptFromUserRobotsControl = [
12173 'default' => null,
12174 'type' => '?list',
12175 ];
12176
12177 // endregion End robot policy
12178
12179 /***************************************************************************/
12180 // region Action API and REST API
12181 /** @name Action API and REST API
12182 */
12183
12184 /**
12185 * WARNING: SECURITY THREAT - debug use only
12186 *
12187 * Disables many security checks in the API for debugging purposes.
12188 * This flag should never be used on the production servers, as it introduces
12189 * a number of potential security holes. Even when enabled, the validation
12190 * will still be performed, but instead of failing, API will return a warning.
12191 * Also, there will always be a warning notifying that this flag is set.
12192 * At this point, the flag allows GET requests to go through for modules
12193 * requiring POST.
12194 *
12195 * @since 1.21
12196 */
12197 public const DebugAPI = [
12198 'default' => false,
12199 ];
12200
12201 /**
12202 * API module extensions.
12203 *
12204 * Associative array mapping module name to modules specs;
12205 * Each module spec is an associative array containing at least
12206 * the 'class' key for the module's class, and optionally a
12207 * 'factory' key for the factory function to use for the module.
12208 *
12209 * That factory function will be called with two parameters,
12210 * the parent module (an instance of ApiBase, usually ApiMain)
12211 * and the name the module was registered under. The return
12212 * value must be an instance of the class given in the 'class'
12213 * field.
12214 *
12215 * For backward compatibility, the module spec may also be a
12216 * simple string containing the module's class name. In that
12217 * case, the class' constructor will be called with the parent
12218 * module and module name as parameters, as described above.
12219 *
12220 * Examples for registering API modules:
12221 *
12222 * ```
12223 * $wgAPIModules['foo'] = 'ApiFoo';
12224 * $wgAPIModules['bar'] = [
12225 * 'class' => ApiBar::class,
12226 * 'factory' => function( $main, $name ) { ... }
12227 * ];
12228 * $wgAPIModules['xyzzy'] = [
12229 * 'class' => ApiXyzzy::class,
12230 * 'factory' => [ XyzzyFactory::class, 'newApiModule' ]
12231 * ];
12232 * ```
12233 * Extension modules may override the core modules.
12234 * See ApiMain::MODULES for a list of the core modules.
12235 */
12236 public const APIModules = [
12237 'default' => [],
12238 'type' => 'map',
12239 ];
12240
12241 /**
12242 * API format module extensions.
12243 *
12244 * Associative array mapping format module name to module specs (see $wgAPIModules).
12245 * Extension modules may override the core modules.
12246 *
12247 * See ApiMain::FORMATS for a list of the core format modules.
12248 */
12249 public const APIFormatModules = [
12250 'default' => [],
12251 'type' => 'map',
12252 ];
12253
12254 /**
12255 * API Query meta module extensions.
12256 *
12257 * Associative array mapping meta module name to module specs (see $wgAPIModules).
12258 * Extension modules may override the core modules.
12259 *
12260 * See ApiQuery::QUERY_META_MODULES for a list of the core meta modules.
12261 */
12262 public const APIMetaModules = [
12263 'default' => [],
12264 'type' => 'map',
12265 ];
12266
12267 /**
12268 * API Query prop module extensions.
12269 *
12270 * Associative array mapping prop module name to module specs (see $wgAPIModules).
12271 * Extension modules may override the core modules.
12272 *
12273 * See ApiQuery::QUERY_PROP_MODULES for a list of the core prop modules.
12274 */
12275 public const APIPropModules = [
12276 'default' => [],
12277 'type' => 'map',
12278 ];
12279
12280 /**
12281 * API Query list module extensions.
12282 *
12283 * Associative array mapping list module name to module specs (see $wgAPIModules).
12284 * Extension modules may override the core modules.
12285 *
12286 * See ApiQuery::QUERY_LIST_MODULES for a list of the core list modules.
12287 */
12288 public const APIListModules = [
12289 'default' => [],
12290 'type' => 'map',
12291 ];
12292
12293 /**
12294 * Maximum amount of rows to scan in a DB query in the API
12295 * The default value is generally fine
12296 */
12297 public const APIMaxDBRows = [
12298 'default' => 5000,
12299 ];
12300
12301 /**
12302 * The maximum size (in bytes) of an API result.
12303 *
12304 * @warning Do not set this lower than $wgMaxArticleSize*1024
12305 */
12306 public const APIMaxResultSize = [
12307 'default' => 8_388_608,
12308 ];
12309
12310 /**
12311 * The maximum number of uncached diffs that can be retrieved in one API
12312 * request. Set this to 0 to disable API diffs altogether
12313 */
12314 public const APIMaxUncachedDiffs = [
12315 'default' => 1,
12316 ];
12317
12318 /**
12319 * Maximum amount of DB lag on a majority of DB replica DBs to tolerate
12320 * before forcing bots to retry any write requests via API errors.
12321 *
12322 * This should be lower than the 'max lag' value in $wgLBFactoryConf.
12323 */
12324 public const APIMaxLagThreshold = [
12325 'default' => 7,
12326 ];
12327
12328 /**
12329 * Log file or URL (TCP or UDP) to log API requests to, or false to disable
12330 * API request logging
12331 */
12332 public const APIRequestLog = [
12333 'default' => false,
12334 'deprecated' => 'since 1.43; use api or api-request $wgDebugLogGroups channel',
12335 ];
12336
12337 /**
12338 * Set the timeout for the API help text cache. If set to 0, caching disabled
12339 */
12340 public const APICacheHelpTimeout = [
12341 'default' => 60 * 60,
12342 ];
12343
12344 /**
12345 * The ApiQueryQueryPages module should skip pages that are redundant to true
12346 * API queries.
12347 */
12348 public const APIUselessQueryPages = [
12349 'default' => [
12350 'MIMEsearch',
12351 'LinkSearch',
12352 ],
12353 'type' => 'list',
12354 ];
12355
12356 /**
12357 * Enable previewing licences via AJAX.
12358 */
12359 public const AjaxLicensePreview = [
12360 'default' => true,
12361 ];
12362
12363 /**
12364 * Settings for incoming cross-site AJAX requests:
12365 * Newer browsers support cross-site AJAX when the target resource allows requests
12366 * from the origin domain by the Access-Control-Allow-Origin header.
12367 *
12368 * This is currently only used by the API (requests to api.php)
12369 * $wgCrossSiteAJAXdomains can be set using a wildcard syntax:
12370 *
12371 * - '*' matches any number of characters
12372 * - '?' matches any 1 character
12373 *
12374 * **Example:**
12375 *
12376 * ```
12377 * $wgCrossSiteAJAXdomains = [
12378 * 'www.mediawiki.org',
12379 * '*.wikipedia.org',
12380 * '*.wikimedia.org',
12381 * '*.wiktionary.org',
12382 * ];
12383 * ```
12384 */
12385 public const CrossSiteAJAXdomains = [
12386 'default' => [],
12387 'type' => 'map',
12388 ];
12389
12390 /**
12391 * Domains that should not be allowed to make AJAX requests,
12392 * even if they match one of the domains allowed by $wgCrossSiteAJAXdomains
12393 * Uses the same syntax as $wgCrossSiteAJAXdomains
12394 */
12395 public const CrossSiteAJAXdomainExceptions = [
12396 'default' => [],
12397 'type' => 'map',
12398 ];
12399
12400 /**
12401 * List of allowed headers for cross-origin API requests.
12402 */
12403 public const AllowedCorsHeaders = [
12404 'default' => [
12405 /* simple headers (see spec) */
12406 'Accept',
12407 'Accept-Language',
12408 'Content-Language',
12409 'Content-Type',
12410 /* non-authorable headers in XHR, which are however requested by some UAs */
12411 'Accept-Encoding',
12412 'DNT',
12413 'Origin',
12414 /* MediaWiki whitelist */
12415 'User-Agent',
12416 'Api-User-Agent',
12417 /* Allowing caching preflight requests, see T269636 */
12418 'Access-Control-Max-Age',
12419 /* OAuth 2.0, see T322944 */
12420 'Authorization',
12421 ],
12422 'type' => 'list',
12423 ];
12424
12425 /**
12426 * Additional REST API Route files.
12427 *
12428 * A common usage is to enable development/experimental endpoints only on test wikis.
12429 */
12430 public const RestAPIAdditionalRouteFiles = [
12431 'default' => [],
12432 'type' => 'list',
12433 ];
12434
12435 // endregion -- End AJAX and API
12436
12437 /***************************************************************************/
12438 // region Shell and process control
12439 /** @name Shell and process control */
12440
12441 /**
12442 * Maximum amount of virtual memory available to shell processes under linux, in KiB.
12443 */
12444 public const MaxShellMemory = [
12445 'default' => 307_200,
12446 ];
12447
12448 /**
12449 * Maximum file size created by shell processes under linux, in KiB
12450 * ImageMagick convert for example can be fairly hungry for scratch space
12451 */
12452 public const MaxShellFileSize = [
12453 'default' => 102_400,
12454 ];
12455
12456 /**
12457 * Maximum CPU time in seconds for shell processes under Linux
12458 */
12459 public const MaxShellTime = [
12460 'default' => 180,
12461 ];
12462
12463 /**
12464 * Maximum wall clock time (i.e. real time, of the kind the clock on the wall
12465 * would measure) in seconds for shell processes under Linux
12466 */
12467 public const MaxShellWallClockTime = [
12468 'default' => 180,
12469 ];
12470
12471 /**
12472 * Under Linux: a cgroup directory used to constrain memory usage of shell
12473 * commands. The directory must be writable by the user which runs MediaWiki.
12474 *
12475 * If specified, this is used instead of ulimit, which is inaccurate, and
12476 * causes malloc() to return NULL, which exposes bugs in C applications, making
12477 * them segfault or deadlock.
12478 *
12479 * A wrapper script will create a cgroup for each shell command that runs, as
12480 * a subgroup of the specified cgroup. If the memory limit is exceeded, the
12481 * kernel will send a SIGKILL signal to a process in the subgroup.
12482 *
12483 * **Example:**
12484 *
12485 * ```
12486 * mkdir -p /sys/fs/cgroup/memory/mediawiki
12487 * mkdir -m 0777 /sys/fs/cgroup/memory/mediawiki/job
12488 * echo '$wgShellCgroup = "/sys/fs/cgroup/memory/mediawiki/job";' >> LocalSettings.php
12489 * ```
12490 * The reliability of cgroup cleanup can be improved by installing a
12491 * notify_on_release script in the root cgroup, see e.g.
12492 * https://gerrit.wikimedia.org/r/#/c/40784
12493 */
12494 public const ShellCgroup = [
12495 'default' => false,
12496 ];
12497
12498 /**
12499 * Executable path of the PHP cli binary. Should be set up on install.
12500 */
12501 public const PhpCli = [
12502 'default' => '/usr/bin/php',
12503 ];
12504
12505 /**
12506 * Method to use to restrict shell commands
12507 *
12508 * Supported options:
12509 * - 'autodetect': Autodetect if any restriction methods are available
12510 * - 'firejail': Use firejail <https://firejail.wordpress.com/>
12511 * - false: Don't use any restrictions
12512 *
12513 * @note If using firejail with MediaWiki running in a home directory different
12514 * from the webserver user, firejail 0.9.44+ is required.
12515 * @since 1.31
12516 */
12517 public const ShellRestrictionMethod = [
12518 'default' => 'autodetect',
12519 'type' => 'string|false',
12520 ];
12521
12522 /**
12523 * Shell commands can be run on a remote server using Shellbox. To use this
12524 * feature, set this to the URLs mapped by the service, and also configure $wgShellboxSecretKey.
12525 *
12526 * You can also disable a certain service by setting it to false or null.
12527 *
12528 * 'default' would be the default URL if no URL is defined for that service.
12529 *
12530 * For more information about installing Shellbox, see
12531 * https://www.mediawiki.org/wiki/Shellbox
12532 *
12533 * @since 1.37
12534 */
12535 public const ShellboxUrls = [
12536 'default' => [ 'default' => null, ],
12537 'type' => 'map',
12538 'additionalProperties' => [
12539 'type' => 'string|false|null',
12540 ],
12541 ];
12542
12543 /**
12544 * The secret key for HMAC verification of Shellbox requests. Set this to
12545 * a long random string.
12546 *
12547 * @since 1.36
12548 */
12549 public const ShellboxSecretKey = [
12550 'default' => null,
12551 'type' => '?string',
12552 ];
12553
12554 /**
12555 * The POSIX-compatible shell to use when running scripts. This is used by
12556 * some media handling shell commands.
12557 *
12558 * If ShellboxUrls is configured, this path should exist on the remote side.
12559 * On Windows this should be the full path to bash.exe, not git-bash.exe.
12560 *
12561 * @since 1.42
12562 */
12563 public const ShellboxShell = [
12564 'default' => '/bin/sh',
12565 'type' => '?string',
12566 ];
12567
12568 // endregion -- end Shell and process control
12569
12570 /***************************************************************************/
12571 // region HTTP client
12572 /** @name HTTP client */
12573
12574 /**
12575 * Timeout for HTTP requests done internally, in seconds.
12576 *
12577 * @since 1.5
12578 */
12579 public const HTTPTimeout = [
12580 'default' => 25,
12581 'type' => 'float',
12582 ];
12583
12584 /**
12585 * Timeout for connections done internally (in seconds).
12586 *
12587 * Only supported if cURL is installed, ignored otherwise.
12588 *
12589 * @since 1.22
12590 */
12591 public const HTTPConnectTimeout = [
12592 'default' => 5.0,
12593 'type' => 'float',
12594 ];
12595
12596 /**
12597 * The maximum HTTP request timeout in seconds. If any specified or configured
12598 * request timeout is larger than this, then this value will be used instead.
12599 * Zero is interpreted as "no limit".
12600 *
12601 * @since 1.35
12602 */
12603 public const HTTPMaxTimeout = [
12604 'default' => 0,
12605 'type' => 'float',
12606 ];
12607
12608 /**
12609 * The maximum HTTP connect timeout in seconds. If any specified or configured
12610 * connect timeout is larger than this, then this value will be used instead.
12611 * Zero is interpreted as "no limit".
12612 *
12613 * @since 1.35
12614 */
12615 public const HTTPMaxConnectTimeout = [
12616 'default' => 0,
12617 'type' => 'float',
12618 ];
12619
12620 /**
12621 * Timeout for HTTP requests done internally for transwiki imports, in seconds.
12622 *
12623 * @since 1.29
12624 */
12625 public const HTTPImportTimeout = [
12626 'default' => 25,
12627 ];
12628
12629 /**
12630 * Timeout for Asynchronous (background) HTTP requests, in seconds.
12631 */
12632 public const AsyncHTTPTimeout = [
12633 'default' => 25,
12634 ];
12635
12636 /**
12637 * Proxy to use for CURL requests.
12638 */
12639 public const HTTPProxy = [
12640 'default' => '',
12641 ];
12642
12643 /**
12644 * Local virtual hosts.
12645 *
12646 * This lists domains that are configured as virtual hosts on the same machine.
12647 * It is expected that each domain can be identified by its hostname alone,
12648 * without any ports.
12649 *
12650 * This affects the following:
12651 * - MWHttpRequest: If a request is to be made to a domain listed here, or any
12652 * subdomain thereof, then $wgLocalHTTPProxy will be used.
12653 * Command-line scripts are not affected by this setting and will always use
12654 * the proxy if it is configured.
12655 *
12656 * @since 1.25
12657 */
12658 public const LocalVirtualHosts = [
12659 'default' => [],
12660 'type' => 'map',
12661 ];
12662
12663 /**
12664 * Reverse proxy to use for requests to domains in $wgLocalVirtualHosts
12665 *
12666 * When used, any port in the request URL will be dropped. The behavior of
12667 * redirects and cookies is dependent upon the reverse proxy actually in use,
12668 * as MediaWiki doesn't implement any special handling for them.
12669 *
12670 * If set to false, no reverse proxy will be used for local requests.
12671 *
12672 * @since 1.38
12673 */
12674 public const LocalHTTPProxy = [
12675 'default' => false,
12676 'type' => 'string|false',
12677 ];
12678
12679 /**
12680 * Whether to respect/honour
12681 * - request ID provided by the incoming request via the `X-Request-Id`
12682 * - trace context provided by the incoming request via the `tracestate` and `traceparent`
12683 *
12684 * Set to `true` if the entity sitting in front of MediaWiki sanitises external requests.
12685 *
12686 * Default: `false`.
12687 */
12688 public const AllowExternalReqID = [
12689 'default' => false,
12690 ];
12691
12692 // endregion -- End HTTP client
12693
12694 /***************************************************************************/
12695 // region Job queue
12696 /** @name Job queue */
12697
12698 /**
12699 * Number of jobs to perform per request. May be less than one in which case jobs are
12700 * performed probabilistically. If this is zero, jobs will not be done during ordinary
12701 * apache requests. In this case, maintenance/runJobs.php should be run in loop every
12702 * few seconds via a service or cron job. If using a cron job, be sure to handle the
12703 * case where the script is already running (e.g. via `/usr/bin/flock -n <lock_file>`).
12704 *
12705 * If this is set to a non-zero number, then it is highly recommended that PHP run in
12706 * fastcgi mode (php_fpm). When using a standard Apache PHP handler (mod_php), it is
12707 * recommended that output_buffering and zlib.output_compression both be set to "Off",
12708 * allowing MediaWiki to install an unlimited size output buffer on the fly. Setting
12709 * output_buffering to an integer (e.g. 4096) or enabling zlib.output_compression can
12710 * cause user-visible slowness as background tasks execute during web requests.
12711 *
12712 * Regardless of the web server engine in use, be sure to configure a sufficient number
12713 * processes/threads in order to avoid exhaustion (which will cause user-visible slowness).
12714 */
12715 public const JobRunRate = [
12716 'default' => 1,
12717 ];
12718
12719 /**
12720 * When $wgJobRunRate > 0, try to run jobs asynchronously, spawning a new process
12721 * to handle the job execution, instead of blocking the request until the job
12722 * execution finishes.
12723 *
12724 * @since 1.23
12725 */
12726 public const RunJobsAsync = [
12727 'default' => false,
12728 ];
12729
12730 /**
12731 * Number of rows to update per job
12732 */
12733 public const UpdateRowsPerJob = [
12734 'default' => 300,
12735 ];
12736
12737 /**
12738 * Number of rows to update per query
12739 */
12740 public const UpdateRowsPerQuery = [
12741 'default' => 100,
12742 ];
12743
12744 // endregion -- End job queue
12745
12746 /***************************************************************************/
12747 // region Miscellaneous
12748 /** @name Miscellaneous */
12749
12750 /**
12751 * Allow redirection to another page when a user logs in.
12752 *
12753 * To enable, set to a string like 'Main Page'
12754 */
12755 public const RedirectOnLogin = [
12756 'default' => null,
12757 ];
12758
12759 /**
12760 * Global configuration variable for Virtual REST Services.
12761 *
12762 * Use the 'path' key to define automatically mounted services. The value for this
12763 * key is a map of path prefixes to service configuration. The latter is an array of:
12764 * - class : the fully qualified class name
12765 * - options : map of arguments to the class constructor
12766 * Such services will be available to handle queries under their path from the VRS
12767 * singleton, e.g. MediaWikiServices::getInstance()->getVirtualRESTServiceClient();
12768 *
12769 * Auto-mounting example for Parsoid:
12770 *
12771 * $wgVirtualRestConfig['paths']['/parsoid/'] = [
12772 * 'class' => ParsoidVirtualRESTService::class,
12773 * 'options' => [
12774 * 'url' => 'http://localhost:8000',
12775 * 'prefix' => 'enwiki',
12776 * 'domain' => 'en.wikipedia.org'
12777 * ]
12778 * ];
12779 *
12780 * Parameters for different services can also be declared inside the 'modules' value,
12781 * which is to be treated as an associative array. The parameters in 'global' will be
12782 * merged with service-specific ones. The result will then be passed to
12783 * VirtualRESTService::__construct() in the module.
12784 *
12785 * Example config for Parsoid:
12786 *
12787 * $wgVirtualRestConfig['modules']['parsoid'] = [
12788 * 'url' => 'http://localhost:8000',
12789 * 'prefix' => 'enwiki',
12790 * 'domain' => 'en.wikipedia.org',
12791 * ];
12792 *
12793 * @since 1.25
12794 */
12795 public const VirtualRestConfig = [
12796 'default' => [
12797 'paths' => [],
12798 'modules' => [],
12799 'global' => [
12800 # Timeout in seconds
12801 'timeout' => 360,
12802 # 'domain' is set to $wgCanonicalServer in Setup.php
12803 'forwardCookies' => false,
12804 'HTTPProxy' => null
12805 ]
12806 ],
12807 'mergeStrategy' => 'array_plus_2d',
12808 'type' => 'map',
12809 ];
12810
12811 /**
12812 * Mapping of event channels (or channel categories) to EventRelayer configuration.
12813 *
12814 * By setting up a PubSub system (like Kafka) and enabling a corresponding EventRelayer class
12815 * that uses it, MediaWiki can broadcast events to all subscribers. Certain features like WAN
12816 * cache purging and CDN cache purging will emit events to this system. Appropriate listeners
12817 * can subscribe to the channel and take actions based on the events. For example, a local daemon
12818 * can run on each CDN cache node and perform local purges based on the URL purge channel
12819 * events.
12820 *
12821 * Some extensions may want to use "channel categories" so that different channels can also
12822 * share the same custom relayer instance (e.g. when it's likely to be overridden). They can use
12823 * EventRelayerGroup::getRelayer() based on the category but call notify() on various different
12824 * actual channels. One reason for this would be that some systems have very different
12825 * performance vs durability needs, so one system (e.g. Kafka) may not be suitable for all
12826 * uses.
12827 *
12828 * The 'default' key is for all channels (or channel categories) without an explicit entry
12829 * here.
12830 *
12831 * @since 1.27
12832 */
12833 public const EventRelayerConfig = [
12834 'default' => [
12835 'default' => [ 'class' => EventRelayerNull::class, ],
12836 ],
12837 'type' => 'map',
12838 ];
12839
12840 /**
12841 * Share data about this installation with MediaWiki developers
12842 *
12843 * When set to true, MediaWiki will periodically ping https://www.mediawiki.org/ with basic
12844 * data about this MediaWiki instance. This data includes, for example, the type of system,
12845 * PHP version, and chosen database backend. The Wikimedia Foundation shares this data with
12846 * MediaWiki developers to help guide future development efforts.
12847 *
12848 * For details about what data is sent, see: https://www.mediawiki.org/wiki/Manual:$wgPingback
12849 *
12850 * For the pingback privacy policy, see:
12851 * https://wikimediafoundation.org/wiki/MediaWiki_Pingback_Privacy_Statement
12852 *
12853 * Aggregate pingback data is available at: https://pingback.wmcloud.org/
12854 *
12855 * @since 1.28
12856 */
12857 public const Pingback = [
12858 'default' => false,
12859 'type' => 'boolean',
12860 ];
12861
12862 /**
12863 * Origin Trials tokens.
12864 *
12865 * @since 1.33
12866 */
12867 public const OriginTrials = [
12868 'default' => [],
12869 'type' => 'list',
12870 ];
12871
12872 /**
12873 * Expiry of the endpoint definition for the Reporting API.
12874 *
12875 * @unstable EXPERIMENTAL
12876 * @since 1.34
12877 */
12878 public const ReportToExpiry = [
12879 'default' => 86400,
12880 'type' => 'integer',
12881 ];
12882
12883 /**
12884 * List of endpoints for the Reporting API.
12885 *
12886 * @unstable EXPERIMENTAL
12887 * @since 1.34
12888 */
12889 public const ReportToEndpoints = [
12890 'default' => [],
12891 'type' => 'list',
12892 ];
12893
12894 /**
12895 * List of Feature Policy Reporting types to enable.
12896 *
12897 * Each entry is turned into a Feature-Policy-Report-Only header.
12898 *
12899 * @unstable EXPERIMENTAL
12900 * @since 1.34
12901 */
12902 public const FeaturePolicyReportOnly = [
12903 'default' => [],
12904 'type' => 'list',
12905 ];
12906
12907 /**
12908 * List of preferred skins to be listed higher in Special:Preferences
12909 *
12910 * @since 1.38
12911 */
12912 public const SkinsPreferred = [
12913 'default' => [ 'vector-2022', 'vector' ],
12914 'type' => 'list',
12915 ];
12916
12917 /**
12918 * List of skins that show a link to the Special:Contribute page
12919 *
12920 * @since 1.40
12921 */
12922 public const SpecialContributeSkinsEnabled = [
12923 'default' => [],
12924 'type' => 'list',
12925 ];
12926
12927 /**
12928 * Whether to enable the client-side edit recovery feature.
12929 *
12930 * @unstable Temporary feature flag, T341844
12931 * @since 1.41
12932 */
12933 public const EnableEditRecovery = [
12934 'default' => false,
12935 'type' => 'boolean',
12936 ];
12937
12938 /**
12939 * Number of seconds to keep edit recovery data after the edit is stored.
12940 */
12941 public const EditRecoveryExpiry = [
12942 'default' => 30 * 24 * 3600,
12943 'type' => 'integer',
12944 ];
12945
12946 /**
12947 * Whether to use Codex in Special:Block form.
12948 *
12949 * @unstable Temporary feature flag, T358153
12950 * @since 1.42
12951 */
12952 public const UseCodexSpecialBlock = [
12953 'default' => false,
12954 'type' => 'boolean',
12955 ];
12956
12957 /**
12958 * Whether to display a confirmation screen during user log out.
12959 *
12960 * @unstable Temporary feature flag, T357484
12961 * @since 1.42
12962 */
12963 public const ShowLogoutConfirmation = [
12964 'default' => false,
12965 'type' => 'boolean',
12966 ];
12967
12968 /**
12969 * Whether to show indicators on a page when it is protected.
12970 *
12971 * @since 1.43
12972 */
12973 public const EnableProtectionIndicators = [
12974 'default' => false,
12975 'type' => 'boolean',
12976 ];
12977
12978 /**
12979 * OutputPipelineStages to add to the DefaultOutputPipeline.
12980 *
12981 * @unstable EXPERIMENTAL
12982 * @since 1.43
12983 */
12984 public const OutputPipelineStages = [
12985 'default' => [],
12986 'type' => 'map',
12987 ];
12988 // endregion -- End Miscellaneous
12989
12990 }