Merge "Add some tests for DerivedPageDataUpdater::isCountable."
[lhc/web/wiklou.git] / includes / DefaultSettings.php
1 <?php
2 /**
3 * Default values for MediaWiki configuration settings.
4 *
5 *
6 * NEVER EDIT THIS FILE
7 *
8 *
9 * To customize your installation, edit "LocalSettings.php". If you make
10 * changes here, they will be lost on next upgrade of MediaWiki!
11 *
12 * In this file, variables whose default values depend on other
13 * variables are set to false. The actual default value of these variables
14 * will only be set in Setup.php, taking into account any custom settings
15 * performed in LocalSettings.php.
16 *
17 * Documentation is in the source and on:
18 * https://www.mediawiki.org/wiki/Manual:Configuration_settings
19 *
20 * @warning Note: this (and other things) will break if the autoloader is not
21 * enabled. Please include includes/AutoLoader.php before including this file.
22 *
23 * This program is free software; you can redistribute it and/or modify
24 * it under the terms of the GNU General Public License as published by
25 * the Free Software Foundation; either version 2 of the License, or
26 * (at your option) any later version.
27 *
28 * This program is distributed in the hope that it will be useful,
29 * but WITHOUT ANY WARRANTY; without even the implied warranty of
30 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 * GNU General Public License for more details.
32 *
33 * You should have received a copy of the GNU General Public License along
34 * with this program; if not, write to the Free Software Foundation, Inc.,
35 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
36 * http://www.gnu.org/copyleft/gpl.html
37 *
38 * @file
39 */
40 use MediaWiki\MediaWikiServices;
41
42 /**
43 * @cond file_level_code
44 * This is not a valid entry point, perform no further processing unless
45 * MEDIAWIKI is defined
46 */
47 if ( !defined( 'MEDIAWIKI' ) ) {
48 echo "This file is part of MediaWiki and is not a valid entry point\n";
49 die( 1 );
50 }
51
52 /** @endcond */
53
54 /**
55 * wgConf hold the site configuration.
56 * Not used for much in a default install.
57 * @since 1.5
58 */
59 $wgConf = new SiteConfiguration;
60
61 /**
62 * Registry of factory functions to create config objects:
63 * The 'main' key must be set, and the value should be a valid
64 * callable.
65 * @since 1.23
66 */
67 $wgConfigRegistry = [
68 'main' => 'GlobalVarConfig::newInstance'
69 ];
70
71 /**
72 * MediaWiki version number
73 * @since 1.2
74 */
75 $wgVersion = '1.34.0-alpha';
76
77 /**
78 * Name of the site. It must be changed in LocalSettings.php
79 */
80 $wgSitename = 'MediaWiki';
81
82 /**
83 * When the wiki is running behind a proxy and this is set to true, assumes that the proxy exposes
84 * the wiki on the standard ports (443 for https and 80 for http).
85 * @var bool
86 * @since 1.26
87 */
88 $wgAssumeProxiesUseDefaultProtocolPorts = true;
89
90 /**
91 * URL of the server.
92 *
93 * @par Example:
94 * @code
95 * $wgServer = 'http://example.com';
96 * @endcode
97 *
98 * This is usually detected correctly by MediaWiki. If MediaWiki detects the
99 * wrong server, it will redirect incorrectly after you save a page. In that
100 * case, set this variable to fix it.
101 *
102 * If you want to use protocol-relative URLs on your wiki, set this to a
103 * protocol-relative URL like '//example.com' and set $wgCanonicalServer
104 * to a fully qualified URL.
105 */
106 $wgServer = WebRequest::detectServer();
107
108 /**
109 * Canonical URL of the server, to use in IRC feeds and notification e-mails.
110 * Must be fully qualified, even if $wgServer is protocol-relative.
111 *
112 * Defaults to $wgServer, expanded to a fully qualified http:// URL if needed.
113 * @since 1.18
114 */
115 $wgCanonicalServer = false;
116
117 /**
118 * Server name. This is automatically computed by parsing the bare
119 * hostname out of $wgCanonicalServer. It should not be customized.
120 * @since 1.24
121 */
122 $wgServerName = false;
123
124 /************************************************************************//**
125 * @name Script path settings
126 * @{
127 */
128
129 /**
130 * The path we should point to.
131 * It might be a virtual path in case with use apache mod_rewrite for example.
132 *
133 * This *needs* to be set correctly.
134 *
135 * Other paths will be set to defaults based on it unless they are directly
136 * set in LocalSettings.php
137 */
138 $wgScriptPath = '/wiki';
139
140 /**
141 * Whether to support URLs like index.php/Page_title These often break when PHP
142 * is set up in CGI mode. PATH_INFO *may* be correct if cgi.fix_pathinfo is set,
143 * but then again it may not; lighttpd converts incoming path data to lowercase
144 * on systems with case-insensitive filesystems, and there have been reports of
145 * problems on Apache as well.
146 *
147 * To be safe we'll continue to keep it off by default.
148 *
149 * Override this to false if $_SERVER['PATH_INFO'] contains unexpectedly
150 * incorrect garbage, or to true if it is really correct.
151 *
152 * The default $wgArticlePath will be set based on this value at runtime, but if
153 * you have customized it, having this incorrectly set to true can cause
154 * redirect loops when "pretty URLs" are used.
155 * @since 1.2.1
156 */
157 $wgUsePathInfo = ( strpos( PHP_SAPI, 'cgi' ) === false ) &&
158 ( strpos( PHP_SAPI, 'apache2filter' ) === false ) &&
159 ( strpos( PHP_SAPI, 'isapi' ) === false );
160
161 /** @} */
162
163 /************************************************************************//**
164 * @name URLs and file paths
165 *
166 * These various web and file path variables are set to their defaults
167 * in Setup.php if they are not explicitly set from LocalSettings.php.
168 *
169 * These will relatively rarely need to be set manually, unless you are
170 * splitting style sheets or images outside the main document root.
171 *
172 * In this section, a "path" is usually a host-relative URL, i.e. a URL without
173 * the host part, that starts with a slash. In most cases a full URL is also
174 * acceptable. A "directory" is a local file path.
175 *
176 * In both paths and directories, trailing slashes should not be included.
177 *
178 * @{
179 */
180
181 /**
182 * The URL path to index.php.
183 *
184 * Defaults to "{$wgScriptPath}/index.php".
185 */
186 $wgScript = false;
187
188 /**
189 * The URL path to load.php.
190 *
191 * Defaults to "{$wgScriptPath}/load.php".
192 * @since 1.17
193 */
194 $wgLoadScript = false;
195
196 /**
197 * The URL path to the REST API
198 * Defaults to "{$wgScriptPath}/rest.php"
199 * @since 1.34
200 */
201 $wgRestPath = false;
202
203 /**
204 * The URL path of the skins directory.
205 * Defaults to "{$wgResourceBasePath}/skins".
206 * @since 1.3
207 */
208 $wgStylePath = false;
209 $wgStyleSheetPath = &$wgStylePath;
210
211 /**
212 * The URL path of the skins directory. Should not point to an external domain.
213 * Defaults to "{$wgScriptPath}/skins".
214 * @since 1.17
215 */
216 $wgLocalStylePath = false;
217
218 /**
219 * The URL path of the extensions directory.
220 * Defaults to "{$wgResourceBasePath}/extensions".
221 * @since 1.16
222 */
223 $wgExtensionAssetsPath = false;
224
225 /**
226 * Filesystem extensions directory.
227 * Defaults to "{$IP}/extensions".
228 * @since 1.25
229 */
230 $wgExtensionDirectory = "{$IP}/extensions";
231
232 /**
233 * Filesystem stylesheets directory.
234 * Defaults to "{$IP}/skins".
235 * @since 1.3
236 */
237 $wgStyleDirectory = "{$IP}/skins";
238
239 /**
240 * The URL path for primary article page views. This path should contain $1,
241 * which is replaced by the article title.
242 *
243 * Defaults to "{$wgScript}/$1" or "{$wgScript}?title=$1",
244 * depending on $wgUsePathInfo.
245 */
246 $wgArticlePath = false;
247
248 /**
249 * The URL path for the images directory.
250 * Defaults to "{$wgScriptPath}/images".
251 */
252 $wgUploadPath = false;
253
254 /**
255 * The filesystem path of the images directory. Defaults to "{$IP}/images".
256 */
257 $wgUploadDirectory = false;
258
259 /**
260 * Directory where the cached page will be saved.
261 * Defaults to "{$wgUploadDirectory}/cache".
262 */
263 $wgFileCacheDirectory = false;
264
265 /**
266 * The URL path of the wiki logo. The logo size should be 135x135 pixels.
267 * Defaults to "$wgResourceBasePath/resources/assets/wiki.png".
268 */
269 $wgLogo = false;
270
271 /**
272 * Array with URL paths to HD versions of the wiki logo. The scaled logo size
273 * should be under 135x155 pixels.
274 * Only 1.5x and 2x versions are supported.
275 *
276 * @par Example:
277 * @code
278 * $wgLogoHD = [
279 * "1.5x" => "path/to/1.5x_version.png",
280 * "2x" => "path/to/2x_version.png"
281 * ];
282 * @endcode
283 *
284 * SVG is also supported but when enabled, it
285 * disables 1.5x and 2x as svg will already
286 * be optimised for screen resolution.
287 *
288 * @par Example:
289 * @code
290 * $wgLogoHD = [
291 * "svg" => "path/to/svg_version.svg",
292 * ];
293 * @endcode
294 *
295 * @since 1.25
296 */
297 $wgLogoHD = false;
298
299 /**
300 * The URL path of the shortcut icon.
301 * @since 1.6
302 */
303 $wgFavicon = '/favicon.ico';
304
305 /**
306 * The URL path of the icon for iPhone and iPod Touch web app bookmarks.
307 * Defaults to no icon.
308 * @since 1.12
309 */
310 $wgAppleTouchIcon = false;
311
312 /**
313 * Value for the referrer policy meta tag.
314 * One or more of the values defined in the Referrer Policy specification:
315 * https://w3c.github.io/webappsec-referrer-policy/
316 * ('no-referrer', 'no-referrer-when-downgrade', 'same-origin',
317 * 'origin', 'strict-origin', 'origin-when-cross-origin',
318 * 'strict-origin-when-cross-origin', or 'unsafe-url')
319 * Setting it to false prevents the meta tag from being output
320 * (which results in falling back to the Referrer-Policy header,
321 * or 'no-referrer-when-downgrade' if that's not set either.)
322 * Setting it to an array (supported since 1.31) will create a meta tag for
323 * each value, in the reverse of the order (meaning that the first array element
324 * will be the default and the others used as fallbacks for browsers which do not
325 * understand it).
326 *
327 * @var array|string|bool
328 * @since 1.25
329 */
330 $wgReferrerPolicy = false;
331
332 /**
333 * The local filesystem path to a temporary directory. This must not be web accessible.
334 *
335 * When this setting is set to false, its value will automatically be decided
336 * through the first call to wfTempDir(). See that method's implementation for
337 * the actual detection logic.
338 *
339 * To find the temporary path for the current wiki, developers must not use
340 * this variable directly. Use the global function wfTempDir() instead.
341 *
342 * The temporary directory is expected to be shared with other applications,
343 * including other MediaWiki instances (which might not run the same version
344 * or configution). When storing files here, take care to avoid conflicts
345 * with other instances of MediaWiki. For example, when caching the result
346 * of a computation, the file name should incorporate the input of the
347 * computation so that it cannot be confused for the result of a similar
348 * computation by another MediaWiki instance.
349 *
350 * @see wfTempDir()
351 * @note Default changed to false in MediaWiki 1.20.
352 */
353 $wgTmpDirectory = false;
354
355 /**
356 * If set, this URL is added to the start of $wgUploadPath to form a complete
357 * upload URL.
358 * @since 1.4
359 */
360 $wgUploadBaseUrl = '';
361
362 /**
363 * To enable remote on-demand scaling, set this to the thumbnail base URL.
364 * Full thumbnail URL will be like $wgUploadStashScalerBaseUrl/e/e6/Foo.jpg/123px-Foo.jpg
365 * where 'e6' are the first two characters of the MD5 hash of the file name.
366 * If $wgUploadStashScalerBaseUrl is set to false, thumbs are rendered locally as needed.
367 * @since 1.17
368 */
369 $wgUploadStashScalerBaseUrl = false;
370
371 /**
372 * To set 'pretty' URL paths for actions other than
373 * plain page views, add to this array.
374 *
375 * @par Example:
376 * Set pretty URL for the edit action:
377 * @code
378 * 'edit' => "$wgScriptPath/edit/$1"
379 * @endcode
380 *
381 * There must be an appropriate script or rewrite rule in place to handle these
382 * URLs.
383 * @since 1.5
384 */
385 $wgActionPaths = [];
386
387 /** @} */
388
389 /************************************************************************//**
390 * @name Files and file uploads
391 * @{
392 */
393
394 /**
395 * Allow users to upload files.
396 *
397 * Use $wgLocalFileRepo to control how and where uploads are stored.
398 * Disabled by default as for security reasons.
399 * See <https://www.mediawiki.org/wiki/Manual:Configuring_file_uploads>.
400 *
401 * @since 1.5
402 */
403 $wgEnableUploads = false;
404
405 /**
406 * The maximum age of temporary (incomplete) uploaded files
407 */
408 $wgUploadStashMaxAge = 6 * 3600; // 6 hours
409
410 /**
411 * Allows to move images and other media files
412 */
413 $wgAllowImageMoving = true;
414
415 /**
416 * Enable deferred upload tasks that use the job queue.
417 * Only enable this if job runners are set up for both the
418 * 'AssembleUploadChunks' and 'PublishStashedFile' job types.
419 *
420 * @note If you use suhosin, this setting is incompatible with
421 * suhosin.session.encrypt.
422 */
423 $wgEnableAsyncUploads = false;
424
425 /**
426 * Additional characters that are not allowed in filenames. They are replaced with '-' when
427 * uploading. Like $wgLegalTitleChars, this is a regexp character class.
428 *
429 * Slashes and backslashes are disallowed regardless of this setting, but included here for
430 * completeness.
431 */
432 $wgIllegalFileChars = ":\\/\\\\";
433
434 /**
435 * What directory to place deleted uploads in.
436 * Defaults to "{$wgUploadDirectory}/deleted".
437 */
438 $wgDeletedDirectory = false;
439
440 /**
441 * Set this to true if you use img_auth and want the user to see details on why access failed.
442 */
443 $wgImgAuthDetails = false;
444
445 /**
446 * Map of relative URL directories to match to internal mwstore:// base storage paths.
447 * For img_auth.php requests, everything after "img_auth.php/" is checked to see
448 * if starts with any of the prefixes defined here. The prefixes should not overlap.
449 * The prefix that matches has a corresponding storage path, which the rest of the URL
450 * is assumed to be relative to. The file at that path (or a 404) is send to the client.
451 *
452 * Example:
453 * $wgImgAuthUrlPathMap['/timeline/'] = 'mwstore://local-fs/timeline-render/';
454 * The above maps ".../img_auth.php/timeline/X" to "mwstore://local-fs/timeline-render/".
455 * The name "local-fs" should correspond by name to an entry in $wgFileBackends.
456 *
457 * @see $wgFileBackends
458 */
459 $wgImgAuthUrlPathMap = [];
460
461 /**
462 * File repository structures
463 *
464 * $wgLocalFileRepo is a single repository structure, and $wgForeignFileRepos is
465 * an array of such structures. Each repository structure is an associative
466 * array of properties configuring the repository.
467 *
468 * Properties required for all repos:
469 * - class The class name for the repository. May come from the core or an extension.
470 * The core repository classes are FileRepo, LocalRepo, ForeignDBRepo.
471 *
472 * - name A unique name for the repository (but $wgLocalFileRepo should be 'local').
473 * The name should consist of alpha-numeric characters.
474 * - backend A file backend name (see $wgFileBackends).
475 *
476 * For most core repos:
477 * - zones Associative array of zone names that each map to an array with:
478 * container : backend container name the zone is in
479 * directory : root path within container for the zone
480 * url : base URL to the root of the zone
481 * urlsByExt : map of file extension types to base URLs
482 * (useful for using a different cache for videos)
483 * Zones default to using "<repo name>-<zone name>" as the container name
484 * and default to using the container root as the zone's root directory.
485 * Nesting of zone locations within other zones should be avoided.
486 * - url Public zone URL. The 'zones' settings take precedence.
487 * - hashLevels The number of directory levels for hash-based division of files
488 * - thumbScriptUrl The URL for thumb.php (optional, not recommended)
489 * - transformVia404 Whether to skip media file transformation on parse and rely on a 404
490 * handler instead.
491 * - initialCapital Equivalent to $wgCapitalLinks (or $wgCapitalLinkOverrides[NS_FILE],
492 * determines whether filenames implicitly start with a capital letter.
493 * The current implementation may give incorrect description page links
494 * when the local $wgCapitalLinks and initialCapital are mismatched.
495 * - pathDisclosureProtection
496 * May be 'paranoid' to remove all parameters from error messages, 'none' to
497 * leave the paths in unchanged, or 'simple' to replace paths with
498 * placeholders. Default for LocalRepo is 'simple'.
499 * - fileMode This allows wikis to set the file mode when uploading/moving files. Default
500 * is 0644.
501 * - directory The local filesystem directory where public files are stored. Not used for
502 * some remote repos.
503 * - thumbDir The base thumbnail directory. Defaults to "<directory>/thumb".
504 * - thumbUrl The base thumbnail URL. Defaults to "<url>/thumb".
505 * - isPrivate Set this if measures should always be taken to keep the files private.
506 * One should not trust this to assure that the files are not web readable;
507 * the server configuration should be done manually depending on the backend.
508 *
509 * These settings describe a foreign MediaWiki installation. They are optional, and will be ignored
510 * for local repositories:
511 * - descBaseUrl URL of image description pages, e.g. https://en.wikipedia.org/wiki/File:
512 * - scriptDirUrl URL of the MediaWiki installation, equivalent to $wgScriptPath, e.g.
513 * https://en.wikipedia.org/w
514 * - articleUrl Equivalent to $wgArticlePath, e.g. https://en.wikipedia.org/wiki/$1
515 * - fetchDescription Fetch the text of the remote file description page and display them
516 * on the local wiki.
517 * - abbrvThreshold File names over this size will use the short form of thumbnail names.
518 * Short thumbnail names only have the width, parameters, and the extension.
519 *
520 * ForeignDBRepo:
521 * - dbType, dbServer, dbUser, dbPassword, dbName, dbFlags
522 * equivalent to the corresponding member of $wgDBservers
523 * - tablePrefix Table prefix, the foreign wiki's $wgDBprefix
524 * - hasSharedCache Set to true if the foreign wiki's $wgMainCacheType is identical to,
525 * and accessible from, this wiki.
526 *
527 * ForeignAPIRepo:
528 * - apibase Use for the foreign API's URL
529 * - apiThumbCacheExpiry How long to locally cache thumbs for
530 *
531 * If you leave $wgLocalFileRepo set to false, Setup will fill in appropriate values.
532 * Otherwise, set $wgLocalFileRepo to a repository structure as described above.
533 * If you set $wgUseInstantCommons to true, it will add an entry for Commons.
534 * If you set $wgForeignFileRepos to an array of repository structures, those will
535 * be searched after the local file repo.
536 * Otherwise, you will only have access to local media files.
537 *
538 * @see Setup.php for an example usage and default initialization.
539 */
540 $wgLocalFileRepo = false;
541
542 /**
543 * Enable the use of files from one or more other wikis.
544 *
545 * If you operate multiple wikis, you can declare a shared upload path here.
546 * Uploads to the local wiki will NOT be stored here - See $wgLocalFileRepo
547 * and $wgUploadDirectory for that.
548 *
549 * The wiki will only consider the foreign repository if no file of the given name
550 * is found in the local repository (e.g. via `[[File:..]]` syntax).
551 *
552 * @since 1.11
553 * @see $wgLocalFileRepo
554 */
555 $wgForeignFileRepos = [];
556
557 /**
558 * Use Wikimedia Commons as a foreign file repository.
559 *
560 * This is a shortcut for adding an entry to to $wgForeignFileRepos
561 * for https://commons.wikimedia.org, using ForeignAPIRepo with the
562 * default settings.
563 *
564 * @since 1.16
565 */
566 $wgUseInstantCommons = false;
567
568 /**
569 * Shortcut for adding an entry to $wgForeignFileRepos.
570 *
571 * Uses the following variables:
572 *
573 * - directory: $wgSharedUploadDirectory.
574 * - url: $wgSharedUploadPath.
575 * - hashLevels: Based on $wgHashedSharedUploadDirectory.
576 * - thumbScriptUrl: $wgSharedThumbnailScriptPath.
577 * - transformVia404: Based on $wgGenerateThumbnailOnParse.
578 * - descBaseUrl: $wgRepositoryBaseUrl.
579 * - fetchDescription: $wgFetchCommonsDescriptions.
580 *
581 * If $wgSharedUploadDBname is set, it uses the ForeignDBRepo
582 * class, with also the following variables:
583 *
584 * - dbName: $wgSharedUploadDBname.
585 * - dbType: $wgDBtype.
586 * - dbServer: $wgDBserver.
587 * - dbUser: $wgDBuser.
588 * - dbPassword: $wgDBpassword.
589 * - dbFlags: Based on $wgDebugDumpSql.
590 * - tablePrefix: $wgSharedUploadDBprefix,
591 * - hasSharedCache: $wgCacheSharedUploads.
592 *
593 * @var bool
594 * @since 1.3
595 */
596 $wgUseSharedUploads = false;
597
598 /**
599 * Shortcut for the 'directory' setting of $wgForeignFileRepos.
600 * Only used if $wgUseSharedUploads is enabled.
601 *
602 * @var string
603 * @since 1.3
604 */
605 $wgSharedUploadDirectory = null;
606
607 /**
608 * Shortcut for the 'url' setting of $wgForeignFileRepos.
609 * Only used if $wgUseSharedUploads is enabled.
610 *
611 * @var string
612 * @since 1.3
613 */
614 $wgSharedUploadPath = null;
615
616 /**
617 * Shortcut for the 'hashLevels' setting of $wgForeignFileRepos.
618 * Only used if $wgUseSharedUploads is enabled.
619 *
620 * @var bool
621 * @since 1.3
622 */
623 $wgHashedSharedUploadDirectory = true;
624
625 /**
626 * Shortcut for the 'descBaseUrl' setting of $wgForeignFileRepos.
627 * Only used if $wgUseSharedUploads is enabled.
628 *
629 * @since 1.5
630 */
631 $wgRepositoryBaseUrl = 'https://commons.wikimedia.org/wiki/File:';
632
633 /**
634 * Shortcut for the 'fetchDescription' setting of $wgForeignFileRepos.
635 * Only used if $wgUseSharedUploads is enabled.
636 *
637 * @var bool
638 * @since 1.5
639 */
640 $wgFetchCommonsDescriptions = false;
641
642 /**
643 * Shortcut for the ForeignDBRepo 'dbName' setting in $wgForeignFileRepos.
644 * Set this to false if the uploads do not come from a wiki.
645 * Only used if $wgUseSharedUploads is enabled.
646 *
647 * @var bool|string
648 * @since 1.4
649 */
650 $wgSharedUploadDBname = false;
651
652 /**
653 * Shortcut for the ForeignDBRepo 'tablePrefix' setting in $wgForeignFileRepos.
654 * Only used if $wgUseSharedUploads is enabled.
655 *
656 * @var string
657 * @since 1.5
658 */
659 $wgSharedUploadDBprefix = '';
660
661 /**
662 * Shortcut for the ForeignDBRepo 'hasSharedCache' setting in $wgForeignFileRepos.
663 * Only used if $wgUseSharedUploads is enabled.
664 *
665 * @var bool
666 * @since 1.5
667 */
668 $wgCacheSharedUploads = true;
669
670 /**
671 * Array of foreign file repo names (set in $wgForeignFileRepos above) that
672 * are allowable upload targets. These wikis must have some method of
673 * authentication (i.e. CentralAuth), and be CORS-enabled for this wiki.
674 * The string 'local' signifies the default local file repository.
675 *
676 * Example:
677 * $wgForeignUploadTargets = [ 'shared' ];
678 */
679 $wgForeignUploadTargets = [ 'local' ];
680
681 /**
682 * Configuration for file uploads using the embeddable upload dialog
683 * (https://www.mediawiki.org/wiki/Upload_dialog).
684 *
685 * This applies also to foreign uploads to this wiki (the configuration is loaded by remote wikis
686 * using the action=query&meta=siteinfo API).
687 *
688 * See below for documentation of each property. None of the properties may be omitted.
689 */
690 $wgUploadDialog = [
691 // Fields to make available in the dialog. `true` means that this field is visible, `false` means
692 // that it is hidden. The "Name" field can't be hidden. Note that you also have to add the
693 // matching replacement to the 'filepage' format key below to make use of these.
694 'fields' => [
695 'description' => true,
696 'date' => false,
697 'categories' => false,
698 ],
699 // Suffix of localisation messages used to describe the license under which the uploaded file will
700 // be released. The same value may be set for both 'local' and 'foreign' uploads.
701 'licensemessages' => [
702 // The 'local' messages are used for local uploads on this wiki:
703 // * upload-form-label-own-work-message-generic-local
704 // * upload-form-label-not-own-work-message-generic-local
705 // * upload-form-label-not-own-work-local-generic-local
706 'local' => 'generic-local',
707 // The 'foreign' messages are used for cross-wiki uploads from other wikis to this wiki:
708 // * upload-form-label-own-work-message-generic-foreign
709 // * upload-form-label-not-own-work-message-generic-foreign
710 // * upload-form-label-not-own-work-local-generic-foreign
711 'foreign' => 'generic-foreign',
712 ],
713 // Upload comments to use for 'local' and 'foreign' uploads. This can also be set to a single
714 // string value, in which case it is used for both kinds of uploads. Available replacements:
715 // * $HOST - domain name from which a cross-wiki upload originates
716 // * $PAGENAME - wiki page name from which an upload originates
717 'comment' => [
718 'local' => '',
719 'foreign' => '',
720 ],
721 // Format of the file page wikitext to be generated from the fields input by the user.
722 'format' => [
723 // Wrapper for the whole page. Available replacements:
724 // * $DESCRIPTION - file description, as input by the user (only if the 'description' field is
725 // enabled), wrapped as defined below in the 'description' key
726 // * $DATE - file creation date, as input by the user (only if the 'date' field is enabled)
727 // * $SOURCE - as defined below in the 'ownwork' key, may be extended in the future
728 // * $AUTHOR - linked user name, may be extended in the future
729 // * $LICENSE - as defined below in the 'license' key, may be extended in the future
730 // * $CATEGORIES - file categories wikitext, as input by the user (only if the 'categories'
731 // field is enabled), or if no input, as defined below in the 'uncategorized' key
732 'filepage' => '$DESCRIPTION',
733 // Wrapped for file description. Available replacements:
734 // * $LANGUAGE - source wiki's content language
735 // * $TEXT - input by the user
736 'description' => '$TEXT',
737 'ownwork' => '',
738 'license' => '',
739 'uncategorized' => '',
740 ],
741 ];
742
743 /**
744 * File backend structure configuration.
745 *
746 * This is an array of file backend configuration arrays.
747 * Each backend configuration has the following parameters:
748 * - name : A unique name for the backend
749 * - class : The file backend class to use
750 * - wikiId : A unique string that identifies the wiki (container prefix)
751 * - lockManager : The name of a lock manager (see $wgLockManagers) [optional]
752 * - fileJournal : File journal configuration for FileJournal::__construct() [optional]
753 *
754 * See FileBackend::__construct() for more details.
755 * Additional parameters are specific to the file backend class used.
756 * These settings should be global to all wikis when possible.
757 *
758 * FileBackendMultiWrite::__construct() is augmented with a 'template' option that
759 * can be used in any of the values of the 'backends' array. Its value is the name of
760 * another backend in $wgFileBackends. When set, it pre-fills the array with all of the
761 * configuration of the named backend. Explicitly set values in the array take precedence.
762 *
763 * There are two particularly important aspects about each backend:
764 * - a) Whether it is fully qualified or wiki-relative.
765 * By default, the paths of files are relative to the current wiki,
766 * which works via prefixing them with the current wiki ID when accessed.
767 * Setting 'domainId' forces the backend to be fully qualified by prefixing
768 * all paths with the specified value instead. This can be useful if
769 * multiple wikis need to share the same data. Note that 'name' is *not*
770 * part of any prefix and thus should not be relied upon for namespacing.
771 * - b) Whether it is only defined for some wikis or is defined on all
772 * wikis in the wiki farm. Defining a backend globally is useful
773 * if multiple wikis need to share the same data.
774 * One should be aware of these aspects when configuring a backend for use with
775 * any basic feature or plugin. For example, suppose an extension stores data for
776 * different wikis in different directories and sometimes needs to access data from
777 * a foreign wiki's directory in order to render a page on given wiki. The extension
778 * would need a fully qualified backend that is defined on all wikis in the wiki farm.
779 */
780 $wgFileBackends = [];
781
782 /**
783 * Array of configuration arrays for each lock manager.
784 * Each backend configuration has the following parameters:
785 * - name : A unique name for the lock manager
786 * - class : The lock manger class to use
787 *
788 * See LockManager::__construct() for more details.
789 * Additional parameters are specific to the lock manager class used.
790 * These settings should be global to all wikis.
791 *
792 * When using DBLockManager, the 'dbsByBucket' map can reference 'localDBMaster' as
793 * a peer database in each bucket. This will result in an extra connection to the domain
794 * that the LockManager services, which must also be a valid wiki ID.
795 */
796 $wgLockManagers = [];
797
798 /**
799 * Show Exif data, on by default if available.
800 * Requires PHP's Exif extension: https://www.php.net/manual/en/ref.exif.php
801 *
802 * @note FOR WINDOWS USERS:
803 * To enable Exif functions, add the following line to the "Windows
804 * extensions" section of php.ini:
805 * @code{.ini}
806 * extension=extensions/php_exif.dll
807 * @endcode
808 */
809 $wgShowEXIF = function_exists( 'exif_read_data' );
810
811 /**
812 * If to automatically update the img_metadata field
813 * if the metadata field is outdated but compatible with the current version.
814 * Defaults to false.
815 */
816 $wgUpdateCompatibleMetadata = false;
817
818 /**
819 * Allow for upload to be copied from an URL.
820 * The timeout for copy uploads is set by $wgCopyUploadTimeout.
821 * You have to assign the user right 'upload_by_url' to a user group, to use this.
822 */
823 $wgAllowCopyUploads = false;
824
825 /**
826 * A list of domains copy uploads can come from
827 *
828 * @since 1.20
829 */
830 $wgCopyUploadsDomains = [];
831
832 /**
833 * Enable copy uploads from Special:Upload. $wgAllowCopyUploads must also be
834 * true. If $wgAllowCopyUploads is true, but this is false, you will only be
835 * able to perform copy uploads from the API or extensions (e.g. UploadWizard).
836 */
837 $wgCopyUploadsFromSpecialUpload = false;
838
839 /**
840 * Proxy to use for copy upload requests.
841 * @since 1.20
842 */
843 $wgCopyUploadProxy = false;
844
845 /**
846 * Different timeout for upload by url
847 * This could be useful since when fetching large files, you may want a
848 * timeout longer than the default $wgHTTPTimeout. False means fallback
849 * to default.
850 *
851 * @var int|bool
852 *
853 * @since 1.22
854 */
855 $wgCopyUploadTimeout = false;
856
857 /**
858 * Max size for uploads, in bytes. If not set to an array, applies to all
859 * uploads. If set to an array, per upload type maximums can be set, using the
860 * file and url keys. If the * key is set this value will be used as maximum
861 * for non-specified types.
862 *
863 * @par Example:
864 * @code
865 * $wgMaxUploadSize = [
866 * '*' => 250 * 1024,
867 * 'url' => 500 * 1024,
868 * ];
869 * @endcode
870 * Sets the maximum for all uploads to 250 kB except for upload-by-url, which
871 * will have a maximum of 500 kB.
872 */
873 $wgMaxUploadSize = 1024 * 1024 * 100; # 100MB
874
875 /**
876 * Minimum upload chunk size, in bytes. When using chunked upload, non-final
877 * chunks smaller than this will be rejected. May be reduced based on the
878 * 'upload_max_filesize' or 'post_max_size' PHP settings.
879 * @since 1.26
880 */
881 $wgMinUploadChunkSize = 1024; # 1KB
882
883 /**
884 * Point the upload navigation link to an external URL
885 * Useful if you want to use a shared repository by default
886 * without disabling local uploads (use $wgEnableUploads = false for that).
887 *
888 * @par Example:
889 * @code
890 * $wgUploadNavigationUrl = 'https://commons.wikimedia.org/wiki/Special:Upload';
891 * @endcode
892 */
893 $wgUploadNavigationUrl = false;
894
895 /**
896 * Point the upload link for missing files to an external URL, as with
897 * $wgUploadNavigationUrl. The URL will get "(?|&)wpDestFile=<filename>"
898 * appended to it as appropriate.
899 */
900 $wgUploadMissingFileUrl = false;
901
902 /**
903 * Give a path here to use thumb.php for thumbnail generation on client
904 * request, instead of generating them on render and outputting a static URL.
905 * This is necessary if some of your apache servers don't have read/write
906 * access to the thumbnail path.
907 *
908 * @par Example:
909 * @code
910 * $wgThumbnailScriptPath = "{$wgScriptPath}/thumb.php";
911 * @endcode
912 */
913 $wgThumbnailScriptPath = false;
914
915 /**
916 * Shortcut for the 'thumbScriptUrl' setting of $wgForeignFileRepos.
917 * Only used if $wgUseSharedUploads is enabled.
918 *
919 * @var string
920 * @since 1.3
921 */
922 $wgSharedThumbnailScriptPath = false;
923
924 /**
925 * Set this to false if you do not want MediaWiki to divide your images
926 * directory into many subdirectories, for improved performance.
927 *
928 * It's almost always good to leave this enabled. In previous versions of
929 * MediaWiki, some users set this to false to allow images to be added to the
930 * wiki by simply copying them into $wgUploadDirectory and then running
931 * maintenance/rebuildImages.php to register them in the database. This is no
932 * longer recommended, use maintenance/importImages.php instead.
933 *
934 * @note That this variable may be ignored if $wgLocalFileRepo is set.
935 * @todo Deprecate the setting and ultimately remove it from Core.
936 */
937 $wgHashedUploadDirectory = true;
938
939 /**
940 * This is the list of preferred extensions for uploading files. Uploading files
941 * with extensions not in this list will trigger a warning.
942 *
943 * @warning If you add any OpenOffice or Microsoft Office file formats here,
944 * such as odt or doc, and untrusted users are allowed to upload files, then
945 * your wiki will be vulnerable to cross-site request forgery (CSRF).
946 */
947 $wgFileExtensions = [ 'png', 'gif', 'jpg', 'jpeg', 'webp' ];
948
949 /**
950 * Files with these extensions will never be allowed as uploads.
951 * An array of file extensions to blacklist. You should append to this array
952 * if you want to blacklist additional files.
953 */
954 $wgFileBlacklist = [
955 # HTML may contain cookie-stealing JavaScript and web bugs
956 'html', 'htm', 'js', 'jsb', 'mhtml', 'mht', 'xhtml', 'xht',
957 # PHP scripts may execute arbitrary code on the server
958 'php', 'phtml', 'php3', 'php4', 'php5', 'phps', 'phar',
959 # Other types that may be interpreted by some servers
960 'shtml', 'jhtml', 'pl', 'py', 'cgi',
961 # May contain harmful executables for Windows victims
962 'exe', 'scr', 'dll', 'msi', 'vbs', 'bat', 'com', 'pif', 'cmd', 'vxd', 'cpl' ];
963
964 /**
965 * Files with these MIME types will never be allowed as uploads
966 * if $wgVerifyMimeType is enabled.
967 */
968 $wgMimeTypeBlacklist = [
969 # HTML may contain cookie-stealing JavaScript and web bugs
970 'text/html', 'text/javascript', 'text/x-javascript', 'application/x-shellscript',
971 # PHP scripts may execute arbitrary code on the server
972 'application/x-php', 'text/x-php',
973 # Other types that may be interpreted by some servers
974 'text/x-python', 'text/x-perl', 'text/x-bash', 'text/x-sh', 'text/x-csh',
975 # Client-side hazards on Internet Explorer
976 'text/scriptlet', 'application/x-msdownload',
977 # Windows metafile, client-side vulnerability on some systems
978 'application/x-msmetafile',
979 ];
980
981 /**
982 * Allow Java archive uploads.
983 * This is not recommended for public wikis since a maliciously-constructed
984 * applet running on the same domain as the wiki can steal the user's cookies.
985 */
986 $wgAllowJavaUploads = false;
987
988 /**
989 * This is a flag to determine whether or not to check file extensions on upload.
990 *
991 * @warning Setting this to false is insecure for public wikis.
992 */
993 $wgCheckFileExtensions = true;
994
995 /**
996 * If this is turned off, users may override the warning for files not covered
997 * by $wgFileExtensions.
998 *
999 * @warning Setting this to false is insecure for public wikis.
1000 */
1001 $wgStrictFileExtensions = true;
1002
1003 /**
1004 * Setting this to true will disable the upload system's checks for HTML/JavaScript.
1005 *
1006 * @warning THIS IS VERY DANGEROUS on a publicly editable site, so USE
1007 * $wgGroupPermissions TO RESTRICT UPLOADING to only those that you trust
1008 */
1009 $wgDisableUploadScriptChecks = false;
1010
1011 /**
1012 * Warn if uploaded files are larger than this (in bytes), or false to disable
1013 */
1014 $wgUploadSizeWarning = false;
1015
1016 /**
1017 * list of trusted media-types and MIME types.
1018 * Use the MEDIATYPE_xxx constants to represent media types.
1019 * This list is used by File::isSafeFile
1020 *
1021 * Types not listed here will have a warning about unsafe content
1022 * displayed on the images description page. It would also be possible
1023 * to use this for further restrictions, like disabling direct
1024 * [[media:...]] links for non-trusted formats.
1025 */
1026 $wgTrustedMediaFormats = [
1027 MEDIATYPE_BITMAP, // all bitmap formats
1028 MEDIATYPE_AUDIO, // all audio formats
1029 MEDIATYPE_VIDEO, // all plain video formats
1030 "image/svg+xml", // svg (only needed if inline rendering of svg is not supported)
1031 "application/pdf", // PDF files
1032 # "application/x-shockwave-flash", //flash/shockwave movie
1033 ];
1034
1035 /**
1036 * Plugins for media file type handling.
1037 * Each entry in the array maps a MIME type to a class name
1038 *
1039 * Core media handlers are listed in MediaHandlerFactory,
1040 * and extensions should use extension.json.
1041 */
1042 $wgMediaHandlers = [];
1043
1044 /**
1045 * Media handler overrides for parser tests (they don't need to generate actual
1046 * thumbnails, so a mock will do)
1047 */
1048 $wgParserTestMediaHandlers = [
1049 'image/jpeg' => 'MockBitmapHandler',
1050 'image/png' => 'MockBitmapHandler',
1051 'image/gif' => 'MockBitmapHandler',
1052 'image/tiff' => 'MockBitmapHandler',
1053 'image/webp' => 'MockBitmapHandler',
1054 'image/x-ms-bmp' => 'MockBitmapHandler',
1055 'image/x-bmp' => 'MockBitmapHandler',
1056 'image/x-xcf' => 'MockBitmapHandler',
1057 'image/svg+xml' => 'MockSvgHandler',
1058 'image/vnd.djvu' => 'MockDjVuHandler',
1059 ];
1060
1061 /**
1062 * Plugins for page content model handling.
1063 * Each entry in the array maps a model id to a class name or callback
1064 * that creates an instance of the appropriate ContentHandler subclass.
1065 *
1066 * @since 1.21
1067 */
1068 $wgContentHandlers = [
1069 // the usual case
1070 CONTENT_MODEL_WIKITEXT => WikitextContentHandler::class,
1071 // dumb version, no syntax highlighting
1072 CONTENT_MODEL_JAVASCRIPT => JavaScriptContentHandler::class,
1073 // simple implementation, for use by extensions, etc.
1074 CONTENT_MODEL_JSON => JsonContentHandler::class,
1075 // dumb version, no syntax highlighting
1076 CONTENT_MODEL_CSS => CssContentHandler::class,
1077 // plain text, for use by extensions, etc.
1078 CONTENT_MODEL_TEXT => TextContentHandler::class,
1079 ];
1080
1081 /**
1082 * Whether to enable server-side image thumbnailing. If false, images will
1083 * always be sent to the client in full resolution, with appropriate width= and
1084 * height= attributes on the <img> tag for the client to do its own scaling.
1085 */
1086 $wgUseImageResize = true;
1087
1088 /**
1089 * Resizing can be done using PHP's internal image libraries or using
1090 * ImageMagick or another third-party converter, e.g. GraphicMagick.
1091 * These support more file formats than PHP, which only supports PNG,
1092 * GIF, JPG, XBM and WBMP.
1093 *
1094 * Use Image Magick instead of PHP builtin functions.
1095 */
1096 $wgUseImageMagick = false;
1097
1098 /**
1099 * The convert command shipped with ImageMagick
1100 */
1101 $wgImageMagickConvertCommand = '/usr/bin/convert';
1102
1103 /**
1104 * Array of max pixel areas for interlacing per MIME type
1105 * @since 1.27
1106 */
1107 $wgMaxInterlacingAreas = [];
1108
1109 /**
1110 * Sharpening parameter to ImageMagick
1111 */
1112 $wgSharpenParameter = '0x0.4';
1113
1114 /**
1115 * Reduction in linear dimensions below which sharpening will be enabled
1116 */
1117 $wgSharpenReductionThreshold = 0.85;
1118
1119 /**
1120 * Temporary directory used for ImageMagick. The directory must exist. Leave
1121 * this set to false to let ImageMagick decide for itself.
1122 */
1123 $wgImageMagickTempDir = false;
1124
1125 /**
1126 * Use another resizing converter, e.g. GraphicMagick
1127 * %s will be replaced with the source path, %d with the destination
1128 * %w and %h will be replaced with the width and height.
1129 *
1130 * @par Example for GraphicMagick:
1131 * @code
1132 * $wgCustomConvertCommand = "gm convert %s -resize %wx%h %d"
1133 * @endcode
1134 *
1135 * Leave as false to skip this.
1136 */
1137 $wgCustomConvertCommand = false;
1138
1139 /**
1140 * used for lossless jpeg rotation
1141 *
1142 * @since 1.21
1143 */
1144 $wgJpegTran = '/usr/bin/jpegtran';
1145
1146 /**
1147 * At default setting of 'yuv420', JPEG thumbnails will use 4:2:0 chroma
1148 * subsampling to reduce file size, at the cost of possible color fringing
1149 * at sharp edges.
1150 *
1151 * See https://en.wikipedia.org/wiki/Chroma_subsampling
1152 *
1153 * Supported values:
1154 * false - use scaling system's default (same as pre-1.27 behavior)
1155 * 'yuv444' - luma and chroma at same resolution
1156 * 'yuv422' - chroma at 1/2 resolution horizontally, full vertically
1157 * 'yuv420' - chroma at 1/2 resolution in both dimensions
1158 *
1159 * This setting is currently supported only for the ImageMagick backend;
1160 * others may default to 4:2:0 or 4:4:4 or maintaining the source file's
1161 * sampling in the thumbnail.
1162 *
1163 * @since 1.27
1164 */
1165 $wgJpegPixelFormat = 'yuv420';
1166
1167 /**
1168 * When scaling a JPEG thumbnail, this is the quality we request
1169 * from the backend. It should be an int between 1 and 100,
1170 * with 100 indicating 100% quality.
1171 *
1172 * @since 1.32
1173 */
1174 $wgJpegQuality = 80;
1175
1176 /**
1177 * Some tests and extensions use exiv2 to manipulate the Exif metadata in some
1178 * image formats.
1179 */
1180 $wgExiv2Command = '/usr/bin/exiv2';
1181
1182 /**
1183 * Path to exiftool binary. Used for lossless ICC profile swapping.
1184 *
1185 * @since 1.26
1186 */
1187 $wgExiftool = '/usr/bin/exiftool';
1188
1189 /**
1190 * Scalable Vector Graphics (SVG) may be uploaded as images.
1191 * Since SVG support is not yet standard in browsers, it is
1192 * necessary to rasterize SVGs to PNG as a fallback format.
1193 *
1194 * An external program is required to perform this conversion.
1195 * If set to an array, the first item is a PHP callable and any further items
1196 * are passed as parameters after $srcPath, $dstPath, $width, $height
1197 */
1198 $wgSVGConverters = [
1199 'ImageMagick' =>
1200 '$path/convert -background "#ffffff00" -thumbnail $widthx$height\! $input PNG:$output',
1201 'sodipodi' => '$path/sodipodi -z -w $width -f $input -e $output',
1202 'inkscape' => '$path/inkscape -z -w $width -f $input -e $output',
1203 'batik' => 'java -Djava.awt.headless=true -jar $path/batik-rasterizer.jar -w $width -d '
1204 . '$output $input',
1205 'rsvg' => '$path/rsvg-convert -w $width -h $height -o $output $input',
1206 'imgserv' => '$path/imgserv-wrapper -i svg -o png -w$width $input $output',
1207 'ImagickExt' => [ 'SvgHandler::rasterizeImagickExt' ],
1208 ];
1209
1210 /**
1211 * Pick a converter defined in $wgSVGConverters
1212 */
1213 $wgSVGConverter = 'ImageMagick';
1214
1215 /**
1216 * If not in the executable PATH, specify the SVG converter path.
1217 */
1218 $wgSVGConverterPath = '';
1219
1220 /**
1221 * Don't scale a SVG larger than this
1222 */
1223 $wgSVGMaxSize = 5120;
1224
1225 /**
1226 * Don't read SVG metadata beyond this point.
1227 * Default is 1024*256 bytes
1228 */
1229 $wgSVGMetadataCutoff = 262144;
1230
1231 /**
1232 * Obsolete, no longer used.
1233 * SVG file uploads now always allow <title> elements.
1234 *
1235 * @deprecated 1.34
1236 */
1237 $wgAllowTitlesInSVG = true;
1238
1239 /**
1240 * Whether thumbnails should be generated in target language (usually, same as
1241 * page language), if available.
1242 * Currently, applies only to SVG images that use the systemLanguage attribute
1243 * to specify text language.
1244 *
1245 * @since 1.33
1246 */
1247 $wgMediaInTargetLanguage = true;
1248
1249 /**
1250 * The maximum number of pixels a source image can have if it is to be scaled
1251 * down by a scaler that requires the full source image to be decompressed
1252 * and stored in decompressed form, before the thumbnail is generated.
1253 *
1254 * This provides a limit on memory usage for the decompression side of the
1255 * image scaler. The limit is used when scaling PNGs with any of the
1256 * built-in image scalers, such as ImageMagick or GD. It is ignored for
1257 * JPEGs with ImageMagick, and when using the VipsScaler extension.
1258 *
1259 * The default is 50 MB if decompressed to RGBA form, which corresponds to
1260 * 12.5 million pixels or 3500x3500.
1261 */
1262 $wgMaxImageArea = 1.25e7;
1263
1264 /**
1265 * Force thumbnailing of animated GIFs above this size to a single
1266 * frame instead of an animated thumbnail. As of MW 1.17 this limit
1267 * is checked against the total size of all frames in the animation.
1268 * It probably makes sense to keep this equal to $wgMaxImageArea.
1269 */
1270 $wgMaxAnimatedGifArea = 1.25e7;
1271
1272 /**
1273 * Browsers don't support TIFF inline generally...
1274 * For inline display, we need to convert to PNG or JPEG.
1275 * Note scaling should work with ImageMagick, but may not with GD scaling.
1276 *
1277 * @par Example:
1278 * @code
1279 * // PNG is lossless, but inefficient for photos
1280 * $wgTiffThumbnailType = [ 'png', 'image/png' ];
1281 * // JPEG is good for photos, but has no transparency support. Bad for diagrams.
1282 * $wgTiffThumbnailType = [ 'jpg', 'image/jpeg' ];
1283 * @endcode
1284 */
1285 $wgTiffThumbnailType = false;
1286
1287 /**
1288 * If rendered thumbnail files are older than this timestamp, they
1289 * will be rerendered on demand as if the file didn't already exist.
1290 * Update if there is some need to force thumbs and SVG rasterizations
1291 * to rerender, such as fixes to rendering bugs.
1292 */
1293 $wgThumbnailEpoch = '20030516000000';
1294
1295 /**
1296 * Certain operations are avoided if there were too many recent failures,
1297 * for example, thumbnail generation. Bump this value to invalidate all
1298 * memory of failed operations and thus allow further attempts to resume.
1299 * This is useful when a cause for the failures has been found and fixed.
1300 */
1301 $wgAttemptFailureEpoch = 1;
1302
1303 /**
1304 * If set, inline scaled images will still produce "<img>" tags ready for
1305 * output instead of showing an error message.
1306 *
1307 * This may be useful if errors are transitory, especially if the site
1308 * is configured to automatically render thumbnails on request.
1309 *
1310 * On the other hand, it may obscure error conditions from debugging.
1311 * Enable the debug log or the 'thumbnail' log group to make sure errors
1312 * are logged to a file for review.
1313 */
1314 $wgIgnoreImageErrors = false;
1315
1316 /**
1317 * Allow thumbnail rendering on page view. If this is false, a valid
1318 * thumbnail URL is still output, but no file will be created at
1319 * the target location. This may save some time if you have a
1320 * thumb.php or 404 handler set up which is faster than the regular
1321 * webserver(s).
1322 */
1323 $wgGenerateThumbnailOnParse = true;
1324
1325 /**
1326 * Show thumbnails for old images on the image description page
1327 */
1328 $wgShowArchiveThumbnails = true;
1329
1330 /**
1331 * If set to true, images that contain certain the exif orientation tag will
1332 * be rotated accordingly. If set to null, try to auto-detect whether a scaler
1333 * is available that can rotate.
1334 */
1335 $wgEnableAutoRotation = null;
1336
1337 /**
1338 * Internal name of virus scanner. This serves as a key to the
1339 * $wgAntivirusSetup array. Set this to NULL to disable virus scanning. If not
1340 * null, every file uploaded will be scanned for viruses.
1341 */
1342 $wgAntivirus = null;
1343
1344 /**
1345 * Configuration for different virus scanners. This an associative array of
1346 * associative arrays. It contains one setup array per known scanner type.
1347 * The entry is selected by $wgAntivirus, i.e.
1348 * valid values for $wgAntivirus are the keys defined in this array.
1349 *
1350 * The configuration array for each scanner contains the following keys:
1351 * "command", "codemap", "messagepattern":
1352 *
1353 * "command" is the full command to call the virus scanner - %f will be
1354 * replaced with the name of the file to scan. If not present, the filename
1355 * will be appended to the command. Note that this must be overwritten if the
1356 * scanner is not in the system path; in that case, please set
1357 * $wgAntivirusSetup[$wgAntivirus]['command'] to the desired command with full
1358 * path.
1359 *
1360 * "codemap" is a mapping of exit code to return codes of the detectVirus
1361 * function in SpecialUpload.
1362 * - An exit code mapped to AV_SCAN_FAILED causes the function to consider
1363 * the scan to be failed. This will pass the file if $wgAntivirusRequired
1364 * is not set.
1365 * - An exit code mapped to AV_SCAN_ABORTED causes the function to consider
1366 * the file to have an unsupported format, which is probably immune to
1367 * viruses. This causes the file to pass.
1368 * - An exit code mapped to AV_NO_VIRUS will cause the file to pass, meaning
1369 * no virus was found.
1370 * - All other codes (like AV_VIRUS_FOUND) will cause the function to report
1371 * a virus.
1372 * - You may use "*" as a key in the array to catch all exit codes not mapped otherwise.
1373 *
1374 * "messagepattern" is a perl regular expression to extract the meaningful part of the scanners
1375 * output. The relevant part should be matched as group one (\1).
1376 * If not defined or the pattern does not match, the full message is shown to the user.
1377 */
1378 $wgAntivirusSetup = [
1379
1380 # setup for clamav
1381 'clamav' => [
1382 'command' => 'clamscan --no-summary ',
1383 'codemap' => [
1384 "0" => AV_NO_VIRUS, # no virus
1385 "1" => AV_VIRUS_FOUND, # virus found
1386 "52" => AV_SCAN_ABORTED, # unsupported file format (probably immune)
1387 "*" => AV_SCAN_FAILED, # else scan failed
1388 ],
1389 'messagepattern' => '/.*?:(.*)/sim',
1390 ],
1391 ];
1392
1393 /**
1394 * Determines if a failed virus scan (AV_SCAN_FAILED) will cause the file to be rejected.
1395 */
1396 $wgAntivirusRequired = true;
1397
1398 /**
1399 * Determines if the MIME type of uploaded files should be checked
1400 */
1401 $wgVerifyMimeType = true;
1402
1403 /**
1404 * Determines whether extra checks for IE type detection should be applied.
1405 * This is a conservative check for exactly what IE 6 or so checked for,
1406 * and shouldn't trigger on for instance JPEG files containing links in EXIF
1407 * metadata.
1408 *
1409 * @since 1.34
1410 */
1411 $wgVerifyMimeTypeIE = true;
1412
1413 /**
1414 * Sets the MIME type definition file to use by includes/libs/mime/MimeAnalyzer.php.
1415 * Set to null, to use built-in defaults only.
1416 * example: $wgMimeTypeFile = '/etc/mime.types';
1417 */
1418 $wgMimeTypeFile = 'includes/mime.types';
1419
1420 /**
1421 * Sets the MIME type info file to use by includes/libs/mime/MimeAnalyzer.php.
1422 * Set to null, to use built-in defaults only.
1423 */
1424 $wgMimeInfoFile = 'includes/mime.info';
1425
1426 /**
1427 * Sets an external MIME detector program. The command must print only
1428 * the MIME type to standard output.
1429 * The name of the file to process will be appended to the command given here.
1430 * If not set or NULL, PHP's mime_content_type function will be used.
1431 *
1432 * @par Example:
1433 * @code
1434 * #$wgMimeDetectorCommand = "file -bi"; # use external MIME detector (Linux)
1435 * @endcode
1436 */
1437 $wgMimeDetectorCommand = null;
1438
1439 /**
1440 * Switch for trivial MIME detection. Used by thumb.php to disable all fancy
1441 * things, because only a few types of images are needed and file extensions
1442 * can be trusted.
1443 */
1444 $wgTrivialMimeDetection = false;
1445
1446 /**
1447 * Additional XML types we can allow via MIME-detection.
1448 * array = [ 'rootElement' => 'associatedMimeType' ]
1449 */
1450 $wgXMLMimeTypes = [
1451 'http://www.w3.org/2000/svg:svg' => 'image/svg+xml',
1452 'svg' => 'image/svg+xml',
1453 'http://www.lysator.liu.se/~alla/dia/:diagram' => 'application/x-dia-diagram',
1454 'http://www.w3.org/1999/xhtml:html' => 'text/html', // application/xhtml+xml?
1455 'html' => 'text/html', // application/xhtml+xml?
1456 ];
1457
1458 /**
1459 * Limit images on image description pages to a user-selectable limit. In order
1460 * to reduce disk usage, limits can only be selected from a list.
1461 * The user preference is saved as an array offset in the database, by default
1462 * the offset is set with $wgDefaultUserOptions['imagesize']. Make sure you
1463 * change it if you alter the array (see T10858).
1464 * This is the list of settings the user can choose from:
1465 */
1466 $wgImageLimits = [
1467 [ 320, 240 ],
1468 [ 640, 480 ],
1469 [ 800, 600 ],
1470 [ 1024, 768 ],
1471 [ 1280, 1024 ]
1472 ];
1473
1474 /**
1475 * Adjust thumbnails on image pages according to a user setting. In order to
1476 * reduce disk usage, the values can only be selected from a list. This is the
1477 * list of settings the user can choose from:
1478 */
1479 $wgThumbLimits = [
1480 120,
1481 150,
1482 180,
1483 200,
1484 250,
1485 300
1486 ];
1487
1488 /**
1489 * When defined, is an array of image widths used as buckets for thumbnail generation.
1490 * The goal is to save resources by generating thumbnails based on reference buckets instead of
1491 * always using the original. This will incur a speed gain but cause a quality loss.
1492 *
1493 * The buckets generation is chained, with each bucket generated based on the above bucket
1494 * when possible. File handlers have to opt into using that feature. For now only BitmapHandler
1495 * supports it.
1496 */
1497 $wgThumbnailBuckets = null;
1498
1499 /**
1500 * When using thumbnail buckets as defined above, this sets the minimum distance to the bucket
1501 * above the requested size. The distance represents how many extra pixels of width the bucket
1502 * needs in order to be used as the reference for a given thumbnail. For example, with the
1503 * following buckets:
1504 *
1505 * $wgThumbnailBuckets = [ 128, 256, 512 ];
1506 *
1507 * and a distance of 50:
1508 *
1509 * $wgThumbnailMinimumBucketDistance = 50;
1510 *
1511 * If we want to render a thumbnail of width 220px, the 512px bucket will be used,
1512 * because 220 + 50 = 270 and the closest bucket bigger than 270px is 512.
1513 */
1514 $wgThumbnailMinimumBucketDistance = 50;
1515
1516 /**
1517 * When defined, is an array of thumbnail widths to be rendered at upload time. The idea is to
1518 * prerender common thumbnail sizes, in order to avoid the necessity to render them on demand, which
1519 * has a performance impact for the first client to view a certain size.
1520 *
1521 * This obviously means that more disk space is needed per upload upfront.
1522 *
1523 * @since 1.25
1524 */
1525
1526 $wgUploadThumbnailRenderMap = [];
1527
1528 /**
1529 * The method through which the thumbnails will be prerendered for the entries in
1530 * $wgUploadThumbnailRenderMap
1531 *
1532 * The method can be either "http" or "jobqueue". The former uses an http request to hit the
1533 * thumbnail's URL.
1534 * This method only works if thumbnails are configured to be rendered by a 404 handler. The latter
1535 * option uses the job queue to render the thumbnail.
1536 *
1537 * @since 1.25
1538 */
1539 $wgUploadThumbnailRenderMethod = 'jobqueue';
1540
1541 /**
1542 * When using the "http" wgUploadThumbnailRenderMethod, lets one specify a custom Host HTTP header.
1543 *
1544 * @since 1.25
1545 */
1546 $wgUploadThumbnailRenderHttpCustomHost = false;
1547
1548 /**
1549 * When using the "http" wgUploadThumbnailRenderMethod, lets one specify a custom domain to send the
1550 * HTTP request to.
1551 *
1552 * @since 1.25
1553 */
1554 $wgUploadThumbnailRenderHttpCustomDomain = false;
1555
1556 /**
1557 * When this variable is true and JPGs use the sRGB ICC profile, swaps it for the more lightweight
1558 * (and free) TinyRGB profile when generating thumbnails.
1559 *
1560 * @since 1.26
1561 */
1562 $wgUseTinyRGBForJPGThumbnails = false;
1563
1564 /**
1565 * Parameters for the "<gallery>" tag.
1566 * Fields are:
1567 * - imagesPerRow: Default number of images per-row in the gallery. 0 -> Adapt to screensize
1568 * - imageWidth: Width of the cells containing images in galleries (in "px")
1569 * - imageHeight: Height of the cells containing images in galleries (in "px")
1570 * - captionLength: Length to truncate filename to in caption when using "showfilename".
1571 * A value of 'true' will truncate the filename to one line using CSS
1572 * and will be the behaviour after deprecation.
1573 * @deprecated since 1.28
1574 * - showBytes: Show the filesize in bytes in categories
1575 * - showDimensions: Show the dimensions (width x height) in categories
1576 * - mode: Gallery mode
1577 */
1578 $wgGalleryOptions = [];
1579
1580 /**
1581 * Adjust width of upright images when parameter 'upright' is used
1582 * This allows a nicer look for upright images without the need to fix the width
1583 * by hardcoded px in wiki sourcecode.
1584 */
1585 $wgThumbUpright = 0.75;
1586
1587 /**
1588 * Default value for chmoding of new directories.
1589 */
1590 $wgDirectoryMode = 0777;
1591
1592 /**
1593 * Generate and use thumbnails suitable for screens with 1.5 and 2.0 pixel densities.
1594 *
1595 * This means a 320x240 use of an image on the wiki will also generate 480x360 and 640x480
1596 * thumbnails, output via the srcset attribute.
1597 */
1598 $wgResponsiveImages = true;
1599
1600 /**
1601 * @name DJVU settings
1602 * @{
1603 */
1604
1605 /**
1606 * Path of the djvudump executable
1607 * Enable this and $wgDjvuRenderer to enable djvu rendering
1608 * example: $wgDjvuDump = 'djvudump';
1609 */
1610 $wgDjvuDump = null;
1611
1612 /**
1613 * Path of the ddjvu DJVU renderer
1614 * Enable this and $wgDjvuDump to enable djvu rendering
1615 * example: $wgDjvuRenderer = 'ddjvu';
1616 */
1617 $wgDjvuRenderer = null;
1618
1619 /**
1620 * Path of the djvutxt DJVU text extraction utility
1621 * Enable this and $wgDjvuDump to enable text layer extraction from djvu files
1622 * example: $wgDjvuTxt = 'djvutxt';
1623 */
1624 $wgDjvuTxt = null;
1625
1626 /**
1627 * Path of the djvutoxml executable
1628 * This works like djvudump except much, much slower as of version 3.5.
1629 *
1630 * For now we recommend you use djvudump instead. The djvuxml output is
1631 * probably more stable, so we'll switch back to it as soon as they fix
1632 * the efficiency problem.
1633 * https://sourceforge.net/tracker/index.php?func=detail&aid=1704049&group_id=32953&atid=406583
1634 *
1635 * @par Example:
1636 * @code
1637 * $wgDjvuToXML = 'djvutoxml';
1638 * @endcode
1639 */
1640 $wgDjvuToXML = null;
1641
1642 /**
1643 * Shell command for the DJVU post processor
1644 * Default: pnmtojpeg, since ddjvu generates ppm output
1645 * Set this to false to output the ppm file directly.
1646 */
1647 $wgDjvuPostProcessor = 'pnmtojpeg';
1648
1649 /**
1650 * File extension for the DJVU post processor output
1651 */
1652 $wgDjvuOutputExtension = 'jpg';
1653
1654 /** @} */ # end of DJvu }
1655
1656 /** @} */ # end of file uploads }
1657
1658 /************************************************************************//**
1659 * @name Email settings
1660 * @{
1661 */
1662
1663 /**
1664 * Site admin email address.
1665 *
1666 * Defaults to "wikiadmin@$wgServerName" (in Setup.php).
1667 */
1668 $wgEmergencyContact = false;
1669
1670 /**
1671 * Sender email address for e-mail notifications.
1672 *
1673 * The address we use as sender when a user requests a password reminder,
1674 * as well as other e-mail notifications.
1675 *
1676 * Defaults to "apache@$wgServerName" (in Setup.php).
1677 */
1678 $wgPasswordSender = false;
1679
1680 /**
1681 * Reply-To address for e-mail notifications.
1682 *
1683 * Defaults to $wgPasswordSender (in Setup.php).
1684 */
1685 $wgNoReplyAddress = false;
1686
1687 /**
1688 * Set to true to enable the e-mail basic features:
1689 * Password reminders, etc. If sending e-mail on your
1690 * server doesn't work, you might want to disable this.
1691 */
1692 $wgEnableEmail = true;
1693
1694 /**
1695 * Set to true to enable user-to-user e-mail.
1696 * This can potentially be abused, as it's hard to track.
1697 */
1698 $wgEnableUserEmail = true;
1699
1700 /**
1701 * Set to true to enable the Special Mute page. This allows users
1702 * to mute unwanted communications from other users, and is linked
1703 * to from emails originating from Special:Email.
1704 *
1705 * @since 1.34
1706 * @deprecated 1.34
1707 */
1708 $wgEnableSpecialMute = false;
1709
1710 /**
1711 * Set to true to enable user-to-user e-mail blacklist.
1712 *
1713 * @since 1.30
1714 */
1715 $wgEnableUserEmailBlacklist = false;
1716
1717 /**
1718 * If true put the sending user's email in a Reply-To header
1719 * instead of From (false). ($wgPasswordSender will be used as From.)
1720 *
1721 * Some mailers (eg SMTP) set the SMTP envelope sender to the From value,
1722 * which can cause problems with SPF validation and leak recipient addresses
1723 * when bounces are sent to the sender. In addition, DMARC restrictions
1724 * can cause emails to fail to be received when false.
1725 */
1726 $wgUserEmailUseReplyTo = true;
1727
1728 /**
1729 * Minimum time, in hours, which must elapse between password reminder
1730 * emails for a given account. This is to prevent abuse by mail flooding.
1731 */
1732 $wgPasswordReminderResendTime = 24;
1733
1734 /**
1735 * The time, in seconds, when an emailed temporary password expires.
1736 */
1737 $wgNewPasswordExpiry = 3600 * 24 * 7;
1738
1739 /**
1740 * The time, in seconds, when an email confirmation email expires
1741 */
1742 $wgUserEmailConfirmationTokenExpiry = 7 * 24 * 60 * 60;
1743
1744 /**
1745 * The number of days that a user's password is good for. After this number of days, the
1746 * user will be asked to reset their password. Set to false to disable password expiration.
1747 */
1748 $wgPasswordExpirationDays = false;
1749
1750 /**
1751 * If a user's password is expired, the number of seconds when they can still login,
1752 * and cancel their password change, but are sent to the password change form on each login.
1753 */
1754 $wgPasswordExpireGrace = 3600 * 24 * 7; // 7 days
1755
1756 /**
1757 * SMTP Mode.
1758 *
1759 * For using a direct (authenticated) SMTP server connection.
1760 * Default to false or fill an array :
1761 *
1762 * @code
1763 * $wgSMTP = [
1764 * 'host' => 'SMTP domain',
1765 * 'IDHost' => 'domain for MessageID',
1766 * 'port' => '25',
1767 * 'auth' => [true|false],
1768 * 'username' => [SMTP username],
1769 * 'password' => [SMTP password],
1770 * ];
1771 * @endcode
1772 */
1773 $wgSMTP = false;
1774
1775 /**
1776 * Additional email parameters, will be passed as the last argument to mail() call.
1777 */
1778 $wgAdditionalMailParams = null;
1779
1780 /**
1781 * For parts of the system that have been updated to provide HTML email content, send
1782 * both text and HTML parts as the body of the email
1783 */
1784 $wgAllowHTMLEmail = false;
1785
1786 /**
1787 * Allow sending of e-mail notifications with the editor's address as sender.
1788 *
1789 * This setting depends on $wgEnotifRevealEditorAddress also being enabled.
1790 * If both are enabled, notifications for actions from users that have opted-in,
1791 * will be sent to other users with their address as "From" instead of "Reply-To".
1792 *
1793 * If disabled, or not opted-in, notifications come from $wgPasswordSender.
1794 *
1795 * @var bool
1796 */
1797 $wgEnotifFromEditor = false;
1798
1799 // TODO move UPO to preferences probably ?
1800 # If set to true, users get a corresponding option in their preferences and can choose to
1801 # enable or disable at their discretion
1802 # If set to false, the corresponding input form on the user preference page is suppressed
1803 # It call this to be a "user-preferences-option (UPO)"
1804
1805 /**
1806 * Require email authentication before sending mail to an email address.
1807 * This is highly recommended. It prevents MediaWiki from being used as an open
1808 * spam relay.
1809 */
1810 $wgEmailAuthentication = true;
1811
1812 /**
1813 * Allow users to enable email notification ("enotif") on watchlist changes.
1814 */
1815 $wgEnotifWatchlist = false;
1816
1817 /**
1818 * Allow users to enable email notification ("enotif") when someone edits their
1819 * user talk page.
1820 *
1821 * The owner of the user talk page must also have the 'enotifusertalkpages' user
1822 * preference set to true.
1823 */
1824 $wgEnotifUserTalk = false;
1825
1826 /**
1827 * Allow sending of e-mail notifications with the editor's address in "Reply-To".
1828 *
1829 * Note, enabling this only actually uses it in notification e-mails if the user
1830 * opted-in to this feature. This feature flag also controls visibility of the
1831 * 'enotifrevealaddr' preference, which, if users opt into, will make e-mail
1832 * notifications about their actions use their address as "Reply-To".
1833 *
1834 * To set the address as "From" instead of "Reply-To", also enable $wgEnotifFromEditor.
1835 *
1836 * If disabled, or not opted-in, notifications come from $wgPasswordSender.
1837 *
1838 * @var bool
1839 */
1840 $wgEnotifRevealEditorAddress = false;
1841
1842 /**
1843 * Potentially send notification mails on minor edits to pages. This is enabled
1844 * by default. If this is false, users will never be notified on minor edits.
1845 *
1846 * If it is true, editors with the 'nominornewtalk' right (typically bots) will still not
1847 * trigger notifications for minor edits they make (to any page, not just user talk).
1848 *
1849 * Finally, if the watcher/recipient has the 'enotifminoredits' user preference set to
1850 * false, they will not receive notifications for minor edits.
1851 *
1852 * User talk notifications are also affected by $wgEnotifMinorEdits, the above settings,
1853 * $wgEnotifUserTalk, and the preference described there.
1854 */
1855 $wgEnotifMinorEdits = true;
1856
1857 /**
1858 * Send a generic mail instead of a personalised mail for each user. This
1859 * always uses UTC as the time zone, and doesn't include the username.
1860 *
1861 * For pages with many users watching, this can significantly reduce mail load.
1862 * Has no effect when using sendmail rather than SMTP.
1863 */
1864 $wgEnotifImpersonal = false;
1865
1866 /**
1867 * Maximum number of users to mail at once when using impersonal mail. Should
1868 * match the limit on your mail server.
1869 */
1870 $wgEnotifMaxRecips = 500;
1871
1872 /**
1873 * Use real name instead of username in e-mail "from" field.
1874 */
1875 $wgEnotifUseRealName = false;
1876
1877 /**
1878 * Array of usernames who will be sent a notification email for every change
1879 * which occurs on a wiki. Users will not be notified of their own changes.
1880 */
1881 $wgUsersNotifiedOnAllChanges = [];
1882
1883 /** @} */ # end of email settings
1884
1885 /************************************************************************//**
1886 * @name Database settings
1887 * @{
1888 */
1889
1890 /**
1891 * Database host name or IP address
1892 */
1893 $wgDBserver = 'localhost';
1894
1895 /**
1896 * Database port number (for PostgreSQL and Microsoft SQL Server).
1897 */
1898 $wgDBport = 5432;
1899
1900 /**
1901 * Name of the database; this should be alphanumeric and not contain spaces nor hyphens
1902 */
1903 $wgDBname = 'my_wiki';
1904
1905 /**
1906 * Database username
1907 */
1908 $wgDBuser = 'wikiuser';
1909
1910 /**
1911 * Database user's password
1912 */
1913 $wgDBpassword = '';
1914
1915 /**
1916 * Database type
1917 */
1918 $wgDBtype = 'mysql';
1919
1920 /**
1921 * Whether to use SSL in DB connection.
1922 *
1923 * This setting is only used if $wgLBFactoryConf['class'] is set to
1924 * '\Wikimedia\Rdbms\LBFactorySimple' and $wgDBservers is an empty array; otherwise
1925 * the DBO_SSL flag must be set in the 'flags' option of the database
1926 * connection to achieve the same functionality.
1927 */
1928 $wgDBssl = false;
1929
1930 /**
1931 * Whether to use compression in DB connection.
1932 *
1933 * This setting is only used $wgLBFactoryConf['class'] is set to
1934 * '\Wikimedia\Rdbms\LBFactorySimple' and $wgDBservers is an empty array; otherwise
1935 * the DBO_COMPRESS flag must be set in the 'flags' option of the database
1936 * connection to achieve the same functionality.
1937 */
1938 $wgDBcompress = false;
1939
1940 /**
1941 * Separate username for maintenance tasks. Leave as null to use the default.
1942 */
1943 $wgDBadminuser = null;
1944
1945 /**
1946 * Separate password for maintenance tasks. Leave as null to use the default.
1947 */
1948 $wgDBadminpassword = null;
1949
1950 /**
1951 * Search type.
1952 * Leave as null to select the default search engine for the
1953 * selected database type (eg SearchMySQL), or set to a class
1954 * name to override to a custom search engine.
1955 */
1956 $wgSearchType = null;
1957
1958 /**
1959 * Alternative search types
1960 * Sometimes you want to support multiple search engines for testing. This
1961 * allows users to select their search engine of choice via url parameters
1962 * to Special:Search and the action=search API. If using this, there's no
1963 * need to add $wgSearchType to it, that is handled automatically.
1964 */
1965 $wgSearchTypeAlternatives = null;
1966
1967 /**
1968 * Table name prefix.
1969 * Should be alphanumeric plus underscores, and not contain spaces nor hyphens.
1970 * Suggested format ends with an underscore.
1971 */
1972 $wgDBprefix = '';
1973
1974 /**
1975 * MySQL table options to use during installation or update
1976 */
1977 $wgDBTableOptions = 'ENGINE=InnoDB, DEFAULT CHARSET=binary';
1978
1979 /**
1980 * SQL Mode - default is turning off all modes, including strict, if set.
1981 * null can be used to skip the setting for performance reasons and assume
1982 * DBA has done his best job.
1983 * String override can be used for some additional fun :-)
1984 */
1985 $wgSQLMode = '';
1986
1987 /**
1988 * Mediawiki schema; this should be alphanumeric and not contain spaces nor hyphens
1989 */
1990 $wgDBmwschema = null;
1991
1992 /**
1993 * Default group to use when getting database connections.
1994 * Will be used as default query group in ILoadBalancer::getConnection.
1995 * @since 1.32
1996 */
1997 $wgDBDefaultGroup = null;
1998
1999 /**
2000 * To override default SQLite data directory ($docroot/../data)
2001 */
2002 $wgSQLiteDataDir = '';
2003
2004 /**
2005 * Shared database for multiple wikis. Commonly used for storing a user table
2006 * for single sign-on. The server for this database must be the same as for the
2007 * main database.
2008 *
2009 * For backwards compatibility the shared prefix is set to the same as the local
2010 * prefix, and the user table is listed in the default list of shared tables.
2011 * The user_properties table is also added so that users will continue to have their
2012 * preferences shared (preferences were stored in the user table prior to 1.16)
2013 *
2014 * $wgSharedTables may be customized with a list of tables to share in the shared
2015 * database. However it is advised to limit what tables you do share as many of
2016 * MediaWiki's tables may have side effects if you try to share them.
2017 *
2018 * $wgSharedPrefix is the table prefix for the shared database. It defaults to
2019 * $wgDBprefix.
2020 *
2021 * $wgSharedSchema is the table schema for the shared database. It defaults to
2022 * $wgDBmwschema.
2023 *
2024 * @deprecated since 1.21 In new code, use the $wiki parameter to LBFactory::getMainLB() to
2025 * access remote databases. Using LBFactory::getMainLB() allows the shared database to
2026 * reside on separate servers to the wiki's own database, with suitable
2027 * configuration of $wgLBFactoryConf.
2028 */
2029 $wgSharedDB = null;
2030
2031 /**
2032 * @see $wgSharedDB
2033 */
2034 $wgSharedPrefix = false;
2035
2036 /**
2037 * @see $wgSharedDB
2038 */
2039 $wgSharedTables = [ 'user', 'user_properties' ];
2040
2041 /**
2042 * @see $wgSharedDB
2043 * @since 1.23
2044 */
2045 $wgSharedSchema = false;
2046
2047 /**
2048 * Database load balancer
2049 * This is a two-dimensional array, an array of server info structures
2050 * Fields are:
2051 * - host: Host name
2052 * - dbname: Default database name
2053 * - user: DB user
2054 * - password: DB password
2055 * - type: DB type
2056 * - driver: DB driver (when there are multiple drivers)
2057 *
2058 * - load: Ratio of DB_REPLICA load, must be >=0, the sum of all loads must be >0.
2059 * If this is zero for any given server, no normal query traffic will be
2060 * sent to it. It will be excluded from lag checks in maintenance scripts.
2061 * The only way it can receive traffic is if groupLoads is used.
2062 *
2063 * - groupLoads: (optional) Array of load ratios, the key is the query group name. A query
2064 * may belong to several groups, the most specific group defined here is used.
2065 *
2066 * - flags: (optional) Bit field of properties:
2067 * - DBO_DEFAULT: Transactionalize web requests and use autocommit otherwise
2068 * - DBO_DEBUG: Equivalent of $wgDebugDumpSql
2069 * - DBO_SSL: Use TLS connection encryption if available
2070 * - DBO_COMPRESS: Use protocol compression with database connections
2071 * - DBO_PERSISTENT: Enables persistent database connections
2072 *
2073 * - max lag: (optional) Maximum replication lag before a replica DB goes out of rotation
2074 * - is static: (optional) Set to true if the dataset is static and no replication is used.
2075 * - cliMode: (optional) Connection handles will not assume that requests are short-lived
2076 * nor that INSERT..SELECT can be rewritten into a buffered SELECT and INSERT.
2077 * This is what DBO_DEFAULT uses to determine when a web request is present.
2078 * [Default: uses value of $wgCommandLineMode]
2079 *
2080 * These and any other user-defined properties will be assigned to the mLBInfo member
2081 * variable of the Database object.
2082 *
2083 * Leave at false to use the single-server variables above. If you set this
2084 * variable, the single-server variables will generally be ignored (except
2085 * perhaps in some command-line scripts).
2086 *
2087 * The first server listed in this array (with key 0) will be the master. The
2088 * rest of the servers will be replica DBs. To prevent writes to your replica DBs due to
2089 * accidental misconfiguration or MediaWiki bugs, set read_only=1 on all your
2090 * replica DBs in my.cnf. You can set read_only mode at runtime using:
2091 *
2092 * @code
2093 * SET @@read_only=1;
2094 * @endcode
2095 *
2096 * Since the effect of writing to a replica DB is so damaging and difficult to clean
2097 * up, we at Wikimedia set read_only=1 in my.cnf on all our DB servers, even
2098 * our masters, and then set read_only=0 on masters at runtime.
2099 */
2100 $wgDBservers = false;
2101
2102 /**
2103 * Load balancer factory configuration
2104 * To set up a multi-master wiki farm, set the class here to something that
2105 * can return a LoadBalancer with an appropriate master on a call to getMainLB().
2106 * The class identified here is responsible for reading $wgDBservers,
2107 * $wgDBserver, etc., so overriding it may cause those globals to be ignored.
2108 *
2109 * The LBFactoryMulti class is provided for this purpose, please see
2110 * includes/db/LBFactoryMulti.php for configuration information.
2111 */
2112 $wgLBFactoryConf = [ 'class' => \Wikimedia\Rdbms\LBFactorySimple::class ];
2113
2114 /**
2115 * After a state-changing request is done by a client, this determines
2116 * how many seconds that client should keep using the master datacenter.
2117 * This avoids unexpected stale or 404 responses due to replication lag.
2118 * @since 1.27
2119 */
2120 $wgDataCenterUpdateStickTTL = 10;
2121
2122 /**
2123 * File to log database errors to
2124 */
2125 $wgDBerrorLog = false;
2126
2127 /**
2128 * Timezone to use in the error log.
2129 * Defaults to the wiki timezone ($wgLocaltimezone).
2130 *
2131 * A list of usable timezones can found at:
2132 * https://www.php.net/manual/en/timezones.php
2133 *
2134 * @par Examples:
2135 * @code
2136 * $wgDBerrorLogTZ = 'UTC';
2137 * $wgDBerrorLogTZ = 'GMT';
2138 * $wgDBerrorLogTZ = 'PST8PDT';
2139 * $wgDBerrorLogTZ = 'Europe/Sweden';
2140 * $wgDBerrorLogTZ = 'CET';
2141 * @endcode
2142 *
2143 * @since 1.20
2144 */
2145 $wgDBerrorLogTZ = false;
2146
2147 /**
2148 * Other wikis on this site, can be administered from a single developer account.
2149 *
2150 * @var string[] List of wiki DB domain IDs; the format of each ID consist of 1-3 hyphen
2151 * delimited alphanumeric components (each with no hyphens nor spaces) of any of the forms:
2152 * - "<DB NAME>-<DB SCHEMA>-<TABLE PREFIX>"
2153 * - "<DB NAME>-<TABLE PREFIX>"
2154 * - "<DB NAME>"
2155 * If hyphens appear in any of the components, then the domain ID parsing may not work
2156 * in all cases and site functionality might be affected. If the schema ($wgDBmwschema)
2157 * is left to the default "mediawiki" for all wikis, then the schema should be omitted
2158 * from these IDs.
2159 */
2160 $wgLocalDatabases = [];
2161
2162 /**
2163 * If lag is higher than $wgSlaveLagWarning, show a warning in some special
2164 * pages (like watchlist). If the lag is higher than $wgSlaveLagCritical,
2165 * show a more obvious warning.
2166 */
2167 $wgSlaveLagWarning = 10;
2168
2169 /**
2170 * @see $wgSlaveLagWarning
2171 */
2172 $wgSlaveLagCritical = 30;
2173
2174 /**
2175 * Use Windows Authentication instead of $wgDBuser / $wgDBpassword for MS SQL Server
2176 */
2177 $wgDBWindowsAuthentication = false;
2178
2179 /** @} */ # End of DB settings }
2180
2181 /************************************************************************//**
2182 * @name Text storage
2183 * @{
2184 */
2185
2186 /**
2187 * We can also compress text stored in the 'text' table. If this is set on, new
2188 * revisions will be compressed on page save if zlib support is available. Any
2189 * compressed revisions will be decompressed on load regardless of this setting,
2190 * but will not be readable at all* if zlib support is not available.
2191 */
2192 $wgCompressRevisions = false;
2193
2194 /**
2195 * External stores allow including content
2196 * from non database sources following URL links.
2197 *
2198 * Short names of ExternalStore classes may be specified in an array here:
2199 * @code
2200 * $wgExternalStores = [ "http","file","custom" ]...
2201 * @endcode
2202 *
2203 * CAUTION: Access to database might lead to code execution
2204 */
2205 $wgExternalStores = [];
2206
2207 /**
2208 * An array of external MySQL servers.
2209 *
2210 * @par Example:
2211 * Create a cluster named 'cluster1' containing three servers:
2212 * @code
2213 * $wgExternalServers = [
2214 * 'cluster1' => <array in the same format as $wgDBservers>
2215 * ];
2216 * @endcode
2217 *
2218 * Used by \Wikimedia\Rdbms\LBFactorySimple, may be ignored if $wgLBFactoryConf is set to
2219 * another class.
2220 */
2221 $wgExternalServers = [];
2222
2223 /**
2224 * The place to put new revisions, false to put them in the local text table.
2225 * Part of a URL, e.g. DB://cluster1
2226 *
2227 * Can be an array instead of a single string, to enable data distribution. Keys
2228 * must be consecutive integers, starting at zero.
2229 *
2230 * @par Example:
2231 * @code
2232 * $wgDefaultExternalStore = [ 'DB://cluster1', 'DB://cluster2' ];
2233 * @endcode
2234 *
2235 * @var array
2236 */
2237 $wgDefaultExternalStore = false;
2238
2239 /**
2240 * Revision text may be cached in $wgMemc to reduce load on external storage
2241 * servers and object extraction overhead for frequently-loaded revisions.
2242 *
2243 * Set to 0 to disable, or number of seconds before cache expiry.
2244 */
2245 $wgRevisionCacheExpiry = 86400 * 7;
2246
2247 /** @} */ # end text storage }
2248
2249 /************************************************************************//**
2250 * @name Performance hacks and limits
2251 * @{
2252 */
2253
2254 /**
2255 * Disable database-intensive features
2256 */
2257 $wgMiserMode = false;
2258
2259 /**
2260 * Disable all query pages if miser mode is on, not just some
2261 */
2262 $wgDisableQueryPages = false;
2263
2264 /**
2265 * Number of rows to cache in 'querycache' table when miser mode is on
2266 */
2267 $wgQueryCacheLimit = 1000;
2268
2269 /**
2270 * Number of links to a page required before it is deemed "wanted"
2271 */
2272 $wgWantedPagesThreshold = 1;
2273
2274 /**
2275 * Enable slow parser functions
2276 */
2277 $wgAllowSlowParserFunctions = false;
2278
2279 /**
2280 * Allow schema updates
2281 */
2282 $wgAllowSchemaUpdates = true;
2283
2284 /**
2285 * Maximum article size in kilobytes
2286 */
2287 $wgMaxArticleSize = 2048;
2288
2289 /**
2290 * The minimum amount of memory that MediaWiki "needs"; MediaWiki will try to
2291 * raise PHP's memory limit if it's below this amount.
2292 */
2293 $wgMemoryLimit = "50M";
2294
2295 /**
2296 * The minimum amount of time that MediaWiki needs for "slow" write request,
2297 * particularly ones with multiple non-atomic writes that *should* be as
2298 * transactional as possible; MediaWiki will call set_time_limit() if needed.
2299 * @since 1.26
2300 */
2301 $wgTransactionalTimeLimit = 120;
2302
2303 /** @} */ # end performance hacks }
2304
2305 /************************************************************************//**
2306 * @name Cache settings
2307 * @{
2308 */
2309
2310 /**
2311 * Directory for caching data in the local filesystem. Should not be accessible
2312 * from the web.
2313 *
2314 * Note: if multiple wikis share the same localisation cache directory, they
2315 * must all have the same set of extensions. You can set a directory just for
2316 * the localisation cache using $wgLocalisationCacheConf['storeDirectory'].
2317 */
2318 $wgCacheDirectory = false;
2319
2320 /**
2321 * Main cache type. This should be a cache with fast access, but it may have
2322 * limited space. By default, it is disabled, since the stock database cache
2323 * is not fast enough to make it worthwhile.
2324 *
2325 * The options are:
2326 *
2327 * - CACHE_ANYTHING: Use anything, as long as it works
2328 * - CACHE_NONE: Do not cache
2329 * - CACHE_DB: Store cache objects in the DB
2330 * - CACHE_MEMCACHED: MemCached, must specify servers in $wgMemCachedServers
2331 * - CACHE_ACCEL: APC, APCU or WinCache
2332 * - (other): A string may be used which identifies a cache
2333 * configuration in $wgObjectCaches.
2334 *
2335 * @see $wgMessageCacheType, $wgParserCacheType
2336 */
2337 $wgMainCacheType = CACHE_NONE;
2338
2339 /**
2340 * The cache type for storing the contents of the MediaWiki namespace. This
2341 * cache is used for a small amount of data which is expensive to regenerate.
2342 *
2343 * For available types see $wgMainCacheType.
2344 */
2345 $wgMessageCacheType = CACHE_ANYTHING;
2346
2347 /**
2348 * The cache type for storing article HTML. This is used to store data which
2349 * is expensive to regenerate, and benefits from having plenty of storage space.
2350 *
2351 * For available types see $wgMainCacheType.
2352 */
2353 $wgParserCacheType = CACHE_ANYTHING;
2354
2355 /**
2356 * The cache type for storing session data.
2357 *
2358 * For available types see $wgMainCacheType.
2359 */
2360 $wgSessionCacheType = CACHE_ANYTHING;
2361
2362 /**
2363 * The cache type for storing language conversion tables,
2364 * which are used when parsing certain text and interface messages.
2365 *
2366 * For available types see $wgMainCacheType.
2367 *
2368 * @since 1.20
2369 */
2370 $wgLanguageConverterCacheType = CACHE_ANYTHING;
2371
2372 /**
2373 * Advanced object cache configuration.
2374 *
2375 * Use this to define the class names and constructor parameters which are used
2376 * for the various cache types. Custom cache types may be defined here and
2377 * referenced from $wgMainCacheType, $wgMessageCacheType, $wgParserCacheType,
2378 * or $wgLanguageConverterCacheType.
2379 *
2380 * The format is an associative array where the key is a cache identifier, and
2381 * the value is an associative array of parameters. The "class" parameter is the
2382 * class name which will be used. Alternatively, a "factory" parameter may be
2383 * given, giving a callable function which will generate a suitable cache object.
2384 */
2385 $wgObjectCaches = [
2386 CACHE_NONE => [ 'class' => EmptyBagOStuff::class, 'reportDupes' => false ],
2387 CACHE_DB => [ 'class' => SqlBagOStuff::class, 'loggroup' => 'SQLBagOStuff' ],
2388
2389 CACHE_ANYTHING => [ 'factory' => 'ObjectCache::newAnything' ],
2390 CACHE_ACCEL => [ 'factory' => 'ObjectCache::getLocalServerInstance' ],
2391 CACHE_MEMCACHED => [ 'class' => MemcachedPhpBagOStuff::class, 'loggroup' => 'memcached' ],
2392
2393 'db-replicated' => [
2394 'class' => ReplicatedBagOStuff::class,
2395 'readFactory' => [
2396 'class' => SqlBagOStuff::class,
2397 'args' => [ [ 'replicaOnly' => true ] ]
2398 ],
2399 'writeFactory' => [
2400 'class' => SqlBagOStuff::class,
2401 'args' => [ [ 'replicaOnly' => false ] ]
2402 ],
2403 'loggroup' => 'SQLBagOStuff',
2404 'reportDupes' => false
2405 ],
2406
2407 'apc' => [ 'class' => APCBagOStuff::class, 'reportDupes' => false ],
2408 'apcu' => [ 'class' => APCUBagOStuff::class, 'reportDupes' => false ],
2409 'wincache' => [ 'class' => WinCacheBagOStuff::class, 'reportDupes' => false ],
2410 'memcached-php' => [ 'class' => MemcachedPhpBagOStuff::class, 'loggroup' => 'memcached' ],
2411 'memcached-pecl' => [ 'class' => MemcachedPeclBagOStuff::class, 'loggroup' => 'memcached' ],
2412 'hash' => [ 'class' => HashBagOStuff::class, 'reportDupes' => false ],
2413 ];
2414
2415 /**
2416 * Main Wide-Area-Network cache type. This should be a cache with fast access,
2417 * but it may have limited space. By default, it is disabled, since the basic stock
2418 * cache is not fast enough to make it worthwhile. For single data-center setups, this can
2419 * simply be pointed to a cache in $wgWANObjectCaches that uses a local $wgObjectCaches
2420 * cache with a relayer of type EventRelayerNull.
2421 *
2422 * The options are:
2423 * - false: Configure the cache using $wgMainCacheType, without using
2424 * a relayer (only matters if there are multiple data-centers)
2425 * - CACHE_NONE: Do not cache
2426 * - (other): A string may be used which identifies a cache
2427 * configuration in $wgWANObjectCaches
2428 * @since 1.26
2429 */
2430 $wgMainWANCache = false;
2431
2432 /**
2433 * Advanced WAN object cache configuration.
2434 *
2435 * Each WAN cache wraps a registered object cache (for the local cluster)
2436 * and it must also be configured to point to a PubSub instance. Subscribers
2437 * must be configured to relay purges to the actual cache servers.
2438 *
2439 * The format is an associative array where the key is a cache identifier, and
2440 * the value is an associative array of parameters. The "cacheId" parameter is
2441 * a cache identifier from $wgObjectCaches. The "loggroup" parameter controls
2442 * where log events are sent.
2443 *
2444 * @since 1.26
2445 */
2446 $wgWANObjectCaches = [
2447 CACHE_NONE => [
2448 'class' => WANObjectCache::class,
2449 'cacheId' => CACHE_NONE
2450 ]
2451 /* Example of a simple single data-center cache:
2452 'memcached-php' => [
2453 'class' => WANObjectCache::class,
2454 'cacheId' => 'memcached-php'
2455 ]
2456 */
2457 ];
2458
2459 /**
2460 * Verify and enforce WAN cache purges using reliable DB sources as streams.
2461 *
2462 * These secondary cache purges are de-duplicated via simple cache mutexes.
2463 * This improves consistency when cache purges are lost, which becomes more likely
2464 * as more cache servers are added or if there are multiple datacenters. Only keys
2465 * related to important mutable content will be checked.
2466 *
2467 * @var bool
2468 * @since 1.29
2469 */
2470 $wgEnableWANCacheReaper = false;
2471
2472 /**
2473 * The object store type of the main stash.
2474 *
2475 * This store should be a very fast storage system optimized for holding lightweight data
2476 * like incrementable hit counters and current user activity. The store should replicate the
2477 * dataset among all data-centers. Any add(), merge(), lock(), and unlock() operations should
2478 * maintain "best effort" linearizability; as long as connectivity is strong, latency is low,
2479 * and there is no eviction pressure prompted by low free space, those operations should be
2480 * linearizable. In terms of PACELC (https://en.wikipedia.org/wiki/PACELC_theorem), the store
2481 * should act as a PA/EL distributed system for these operations. One optimization for these
2482 * operations is to route them to a "primary" data-center (e.g. one that serves HTTP POST) for
2483 * synchronous execution and then replicate to the others asynchronously. This means that at
2484 * least calls to these operations during HTTP POST requests would quickly return.
2485 *
2486 * All other operations, such as get(), set(), delete(), changeTTL(), incr(), and decr(),
2487 * should be synchronous in the local data-center, replicating asynchronously to the others.
2488 * This behavior can be overriden by the use of the WRITE_SYNC and READ_LATEST flags.
2489 *
2490 * The store should *preferably* have eventual consistency to handle network partitions.
2491 *
2492 * Modules that rely on the stash should be prepared for:
2493 * - add(), merge(), lock(), and unlock() to be slower than other write operations,
2494 * at least in "secondary" data-centers (e.g. one that only serves HTTP GET/HEAD)
2495 * - Other write operations to have race conditions accross data-centers
2496 * - Read operations to have race conditions accross data-centers
2497 * - Consistency to be either eventual (with Last-Write-Wins) or just "best effort"
2498 *
2499 * In general, this means avoiding updates during idempotent HTTP requests (GET/HEAD) and
2500 * avoiding assumptions of true linearizability (e.g. accepting anomalies). Modules that need
2501 * these kind of guarantees should use other storage mediums.
2502 *
2503 * The options are:
2504 * - db: Store cache objects in the DB
2505 * - (other): A string may be used which identifies a cache
2506 * configuration in $wgObjectCaches
2507 *
2508 * @since 1.26
2509 */
2510 $wgMainStash = 'db-replicated';
2511
2512 /**
2513 * The expiry time for the parser cache, in seconds.
2514 * The default is 86400 (one day).
2515 */
2516 $wgParserCacheExpireTime = 86400;
2517
2518 /**
2519 * The expiry time to use for session storage, in seconds.
2520 */
2521 $wgObjectCacheSessionExpiry = 3600;
2522
2523 /**
2524 * Whether to use PHP session handling ($_SESSION and session_*() functions)
2525 *
2526 * If the constant MW_NO_SESSION is defined, this is forced to 'disable'.
2527 *
2528 * If the constant MW_NO_SESSION_HANDLER is defined, this is ignored and PHP
2529 * session handling will function independently of SessionHandler.
2530 * SessionHandler and PHP's session handling may attempt to override each
2531 * others' cookies.
2532 *
2533 * @since 1.27
2534 * @var string
2535 * - 'enable': Integrate with PHP's session handling as much as possible.
2536 * - 'warn': Integrate but log warnings if anything changes $_SESSION.
2537 * - 'disable': Throw exceptions if PHP session handling is used.
2538 */
2539 $wgPHPSessionHandling = 'enable';
2540
2541 /**
2542 * Number of internal PBKDF2 iterations to use when deriving session secrets.
2543 *
2544 * @since 1.28
2545 */
2546 $wgSessionPbkdf2Iterations = 10001;
2547
2548 /**
2549 * If enabled, will send MemCached debugging information to $wgDebugLogFile
2550 */
2551 $wgMemCachedDebug = false;
2552
2553 /**
2554 * The list of MemCached servers and port numbers
2555 */
2556 $wgMemCachedServers = [ '127.0.0.1:11211' ];
2557
2558 /**
2559 * Use persistent connections to MemCached, which are shared across multiple
2560 * requests.
2561 */
2562 $wgMemCachedPersistent = false;
2563
2564 /**
2565 * Read/write timeout for MemCached server communication, in microseconds.
2566 */
2567 $wgMemCachedTimeout = 500000;
2568
2569 /**
2570 * Set this to true to maintain a copy of the message cache on the local server.
2571 *
2572 * This layer of message cache is in addition to the one configured by $wgMessageCacheType.
2573 *
2574 * The local copy is put in APC. If APC is not installed, this setting does nothing.
2575 *
2576 * Note that this is about the message cache, which stores interface messages
2577 * maintained as wiki pages. This is separate from the localisation cache for interface
2578 * messages provided by the software, which is configured by $wgLocalisationCacheConf.
2579 */
2580 $wgUseLocalMessageCache = false;
2581
2582 /**
2583 * Instead of caching everything, only cache those messages which have
2584 * been customised in the site content language. This means that
2585 * MediaWiki:Foo/ja is ignored if MediaWiki:Foo doesn't exist.
2586 * This option is probably only useful for translatewiki.net.
2587 */
2588 $wgAdaptiveMessageCache = false;
2589
2590 /**
2591 * Localisation cache configuration.
2592 *
2593 * Used by Language::getLocalisationCache() to decide how to construct the
2594 * LocalisationCache instance. Associative array with keys:
2595 *
2596 * class: The class to use for constructing the LocalisationCache object.
2597 * This may be overridden by extensions to a subclass of LocalisationCache.
2598 * Sub classes are expected to still honor the 'storeClass', 'storeDirectory'
2599 * and 'manualRecache' options where applicable.
2600 *
2601 * storeClass: Which LCStore class implementation to use. This is optional.
2602 * The default LocalisationCache class offers the 'store' option
2603 * as abstraction for this.
2604 *
2605 * store: How and where to store localisation cache data.
2606 * This option is ignored if 'storeClass' is explicitly set to a class name.
2607 * Must be one of:
2608 * - 'detect' (default): Automatically select 'files' if 'storeDirectory'
2609 * or $wgCacheDirectory is set, and fall back to 'db' otherwise.
2610 * - 'files': Store in $wgCacheDirectory as CDB files.
2611 * - 'array': Store in $wgCacheDirectory as PHP static array files.
2612 * - 'db': Store in the l10n_cache database table.
2613 *
2614 * storeDirectory: If the selected LCStore class puts its data in files, then it
2615 * will use this directory. If set to false (default), then
2616 * $wgCacheDirectory is used instead.
2617 *
2618 * manualRecache: Set this to true to disable cache updates on web requests.
2619 * Use maintenance/rebuildLocalisationCache.php instead.
2620 */
2621 $wgLocalisationCacheConf = [
2622 'class' => LocalisationCache::class,
2623 'store' => 'detect',
2624 'storeClass' => false,
2625 'storeDirectory' => false,
2626 'manualRecache' => false,
2627 ];
2628
2629 /**
2630 * Allow client-side caching of pages
2631 */
2632 $wgCachePages = true;
2633
2634 /**
2635 * Set this to current time to invalidate all prior cached pages. Affects both
2636 * client-side and server-side caching.
2637 * You can get the current date on your server by using the command:
2638 * @verbatim
2639 * date +%Y%m%d%H%M%S
2640 * @endverbatim
2641 */
2642 $wgCacheEpoch = '20030516000000';
2643
2644 /**
2645 * Directory where GitInfo will look for pre-computed cache files. If false,
2646 * $wgCacheDirectory/gitinfo will be used.
2647 */
2648 $wgGitInfoCacheDirectory = false;
2649
2650 /**
2651 * This will cache static pages for non-logged-in users to reduce
2652 * database traffic on public sites. ResourceLoader requests to default
2653 * language and skins are cached as well as single module requests.
2654 */
2655 $wgUseFileCache = false;
2656
2657 /**
2658 * Depth of the subdirectory hierarchy to be created under
2659 * $wgFileCacheDirectory. The subdirectories will be named based on
2660 * the MD5 hash of the title. A value of 0 means all cache files will
2661 * be put directly into the main file cache directory.
2662 */
2663 $wgFileCacheDepth = 2;
2664
2665 /**
2666 * Append a configured value to the parser cache and the sitenotice key so
2667 * that they can be kept separate for some class of activity.
2668 */
2669 $wgRenderHashAppend = '';
2670
2671 /**
2672 * If on, the sidebar navigation links are cached for users with the
2673 * current language set. This can save a touch of load on a busy site
2674 * by shaving off extra message lookups.
2675 *
2676 * However it is also fragile: changing the site configuration, or
2677 * having a variable $wgArticlePath, can produce broken links that
2678 * don't update as expected.
2679 */
2680 $wgEnableSidebarCache = false;
2681
2682 /**
2683 * Expiry time for the sidebar cache, in seconds
2684 */
2685 $wgSidebarCacheExpiry = 86400;
2686
2687 /**
2688 * When using the file cache, we can store the cached HTML gzipped to save disk
2689 * space. Pages will then also be served compressed to clients that support it.
2690 *
2691 * Requires zlib support enabled in PHP.
2692 */
2693 $wgUseGzip = false;
2694
2695 /**
2696 * Invalidate various caches when LocalSettings.php changes. This is equivalent
2697 * to setting $wgCacheEpoch to the modification time of LocalSettings.php, as
2698 * was previously done in the default LocalSettings.php file.
2699 *
2700 * On high-traffic wikis, this should be set to false, to avoid the need to
2701 * check the file modification time, and to avoid the performance impact of
2702 * unnecessary cache invalidations.
2703 */
2704 $wgInvalidateCacheOnLocalSettingsChange = true;
2705
2706 /**
2707 * When loading extensions through the extension registration system, this
2708 * can be used to invalidate the cache. A good idea would be to set this to
2709 * one file, you can just `touch` that one to invalidate the cache
2710 *
2711 * @par Example:
2712 * @code
2713 * $wgExtensionInfoMtime = filemtime( "$IP/LocalSettings.php" );
2714 * @endcode
2715 *
2716 * If set to false, the mtime for each individual JSON file will be checked,
2717 * which can be slow if a large number of extensions are being loaded.
2718 *
2719 * @var int|bool
2720 */
2721 $wgExtensionInfoMTime = false;
2722
2723 /** @} */ # end of cache settings
2724
2725 /************************************************************************//**
2726 * @name HTTP proxy (CDN) settings
2727 *
2728 * Many of these settings apply to any HTTP proxy used in front of MediaWiki,
2729 * although they are sometimes still referred to as Squid settings for
2730 * historical reasons.
2731 *
2732 * Achieving a high hit ratio with an HTTP proxy requires special
2733 * configuration. See https://www.mediawiki.org/wiki/Manual:Squid_caching for
2734 * more details.
2735 *
2736 * @{
2737 */
2738
2739 /**
2740 * Enable/disable CDN.
2741 * See https://www.mediawiki.org/wiki/Manual:Squid_caching
2742 *
2743 * @since 1.34 Renamed from $wgUseSquid.
2744 */
2745 $wgUseCdn = false;
2746
2747 /**
2748 * If you run Squid3 with ESI support, enable this (default:false):
2749 * @deprecated in 1.33. This was a now-defunct experimental feature.
2750 */
2751 $wgUseESI = false;
2752
2753 /**
2754 * Add X-Forwarded-Proto to the Vary and Key headers for API requests and
2755 * RSS/Atom feeds. Use this if you have an SSL termination setup
2756 * and need to split the cache between HTTP and HTTPS for API requests,
2757 * feed requests and HTTP redirect responses in order to prevent cache
2758 * pollution. This does not affect 'normal' requests to index.php other than
2759 * HTTP redirects.
2760 */
2761 $wgVaryOnXFP = false;
2762
2763 /**
2764 * Internal server name as known to CDN, if different.
2765 *
2766 * @par Example:
2767 * @code
2768 * $wgInternalServer = 'http://yourinternal.tld:8000';
2769 * @endcode
2770 */
2771 $wgInternalServer = false;
2772
2773 /**
2774 * Cache TTL for the CDN sent as s-maxage (without ESI) or
2775 * Surrogate-Control (with ESI). Without ESI, you should strip
2776 * out s-maxage in the CDN config.
2777 *
2778 * 18000 seconds = 5 hours, more cache hits with 2678400 = 31 days.
2779 *
2780 * @since 1.34 Renamed from $wgSquidMaxage
2781 */
2782 $wgCdnMaxAge = 18000;
2783
2784 /**
2785 * Cache timeout for the CDN when DB replica DB lag is high
2786 * @see $wgCdnMaxAge
2787 *
2788 * @since 1.27
2789 */
2790 $wgCdnMaxageLagged = 30;
2791
2792 /**
2793 * If set, any SquidPurge call on a URL or URLs will send a second purge no less than
2794 * this many seconds later via the job queue. This requires delayed job support.
2795 * This should be safely higher than the 'max lag' value in $wgLBFactoryConf, so that
2796 * replica DB lag does not cause page to be stuck in stales states in CDN.
2797 *
2798 * This also fixes race conditions in two-tiered CDN setups (e.g. cdn2 => cdn1 => MediaWiki).
2799 * If a purge for a URL reaches cdn2 before cdn1 and a request reaches cdn2 for that URL,
2800 * it will populate the response from the stale cdn1 value. When cdn1 gets the purge, cdn2
2801 * will still be stale. If the rebound purge delay is safely higher than the time to relay
2802 * a purge to all nodes, then the rebound purge will clear cdn2 after cdn1 was cleared.
2803 *
2804 * @since 1.27
2805 */
2806 $wgCdnReboundPurgeDelay = 0;
2807
2808 /**
2809 * Cache timeout for the CDN when a response is known to be wrong or incomplete (due to load)
2810 * @see $wgCdnMaxAge
2811 * @since 1.27
2812 */
2813 $wgCdnMaxageSubstitute = 60;
2814
2815 /**
2816 * Default maximum age for raw CSS/JS accesses
2817 *
2818 * 300 seconds = 5 minutes.
2819 */
2820 $wgForcedRawSMaxage = 300;
2821
2822 /**
2823 * List of proxy servers to purge on changes; default port is 80. Use IP addresses.
2824 *
2825 * When MediaWiki is running behind a proxy, it will trust X-Forwarded-For
2826 * headers sent/modified from these proxies when obtaining the remote IP address
2827 *
2828 * For a list of trusted servers which *aren't* purged, see $wgSquidServersNoPurge.
2829 *
2830 * @since 1.34 Renamed from $wgSquidServers.
2831 */
2832 $wgCdnServers = [];
2833
2834 /**
2835 * As with $wgCdnServers, except these servers aren't purged on page changes;
2836 * use to set a list of trusted proxies, etc. Supports both individual IP
2837 * addresses and CIDR blocks.
2838 *
2839 * @since 1.23 Supports CIDR ranges
2840 * @since 1.34 Renamed from $wgSquidServersNoPurge
2841 */
2842 $wgCdnServersNoPurge = [];
2843
2844 /**
2845 * Whether to use a Host header in purge requests sent to the proxy servers
2846 * configured in $wgCdnServers. Set this to false to support a CDN
2847 * configured in forward-proxy mode.
2848 *
2849 * If this is set to true, a Host header will be sent, and only the path
2850 * component of the URL will appear on the request line, as if the request
2851 * were a non-proxy HTTP 1.1 request. Varnish only supports this style of
2852 * request. Squid supports this style of request only if reverse-proxy mode
2853 * (http_port ... accel) is enabled.
2854 *
2855 * If this is set to false, no Host header will be sent, and the absolute URL
2856 * will be sent in the request line, as is the standard for an HTTP proxy
2857 * request in both HTTP 1.0 and 1.1. This style of request is not supported
2858 * by Varnish, but is supported by Squid in either configuration (forward or
2859 * reverse).
2860 *
2861 * @since 1.21
2862 * @deprecated since 1.33, will always be true in a future release.
2863 */
2864 $wgSquidPurgeUseHostHeader = true;
2865
2866 /**
2867 * Routing configuration for HTCP multicast purging. Add elements here to
2868 * enable HTCP and determine which purges are sent where. If set to an empty
2869 * array, HTCP is disabled.
2870 *
2871 * Each key in this array is a regular expression to match against the purged
2872 * URL, or an empty string to match all URLs. The purged URL is matched against
2873 * the regexes in the order specified, and the first rule whose regex matches
2874 * is used, all remaining rules will thus be ignored.
2875 *
2876 * @par Example configuration to send purges for upload.wikimedia.org to one
2877 * multicast group and all other purges to another:
2878 * @code
2879 * $wgHTCPRouting = [
2880 * '|^https?://upload\.wikimedia\.org|' => [
2881 * 'host' => '239.128.0.113',
2882 * 'port' => 4827,
2883 * ],
2884 * '' => [
2885 * 'host' => '239.128.0.112',
2886 * 'port' => 4827,
2887 * ],
2888 * ];
2889 * @endcode
2890 *
2891 * You can also pass an array of hosts to send purges too. This is useful when
2892 * you have several multicast groups or unicast address that should receive a
2893 * given purge. Multiple hosts support was introduced in MediaWiki 1.22.
2894 *
2895 * @par Example of sending purges to multiple hosts:
2896 * @code
2897 * $wgHTCPRouting = [
2898 * '' => [
2899 * // Purges to text caches using multicast
2900 * [ 'host' => '239.128.0.114', 'port' => '4827' ],
2901 * // Purges to a hardcoded list of caches
2902 * [ 'host' => '10.88.66.1', 'port' => '4827' ],
2903 * [ 'host' => '10.88.66.2', 'port' => '4827' ],
2904 * [ 'host' => '10.88.66.3', 'port' => '4827' ],
2905 * ],
2906 * ];
2907 * @endcode
2908 *
2909 * @since 1.22
2910 * @see $wgHTCPMulticastTTL
2911 */
2912 $wgHTCPRouting = [];
2913
2914 /**
2915 * HTCP multicast TTL.
2916 * @see $wgHTCPRouting
2917 */
2918 $wgHTCPMulticastTTL = 1;
2919
2920 /**
2921 * Should forwarded Private IPs be accepted?
2922 */
2923 $wgUsePrivateIPs = false;
2924
2925 /** @} */ # end of HTTP proxy settings
2926
2927 /************************************************************************//**
2928 * @name Language, regional and character encoding settings
2929 * @{
2930 */
2931
2932 /**
2933 * Site language code. See languages/data/Names.php for languages supported by
2934 * MediaWiki out of the box. Not all languages listed there have translations,
2935 * see languages/messages/ for the list of languages with some localisation.
2936 *
2937 * Warning: Don't use any of MediaWiki's deprecated language codes listed in
2938 * LanguageCode::getDeprecatedCodeMapping or $wgDummyLanguageCodes, like "no"
2939 * for Norwegian (use "nb" instead). If you do, things will break unexpectedly.
2940 *
2941 * This defines the default interface language for all users, but users can
2942 * change it in their preferences.
2943 *
2944 * This also defines the language of pages in the wiki. The content is wrapped
2945 * in a html element with lang=XX attribute. This behavior can be overridden
2946 * via hooks, see Title::getPageLanguage.
2947 */
2948 $wgLanguageCode = 'en';
2949
2950 /**
2951 * Language cache size, or really how many languages can we handle
2952 * simultaneously without degrading to crawl speed.
2953 */
2954 $wgLangObjCacheSize = 10;
2955
2956 /**
2957 * Some languages need different word forms, usually for different cases.
2958 * Used in Language::convertGrammar().
2959 *
2960 * @par Example:
2961 * @code
2962 * $wgGrammarForms['en']['genitive']['car'] = 'car\'s';
2963 * @endcode
2964 */
2965 $wgGrammarForms = [];
2966
2967 /**
2968 * Treat language links as magic connectors, not inline links
2969 */
2970 $wgInterwikiMagic = true;
2971
2972 /**
2973 * Hide interlanguage links from the sidebar
2974 */
2975 $wgHideInterlanguageLinks = false;
2976
2977 /**
2978 * List of additional interwiki prefixes that should be treated as
2979 * interlanguage links (i.e. placed in the sidebar).
2980 * Notes:
2981 * - This will not do anything unless the prefixes are defined in the interwiki
2982 * map.
2983 * - The display text for these custom interlanguage links will be fetched from
2984 * the system message "interlanguage-link-xyz" where xyz is the prefix in
2985 * this array.
2986 * - A friendly name for each site, used for tooltip text, may optionally be
2987 * placed in the system message "interlanguage-link-sitename-xyz" where xyz is
2988 * the prefix in this array.
2989 */
2990 $wgExtraInterlanguageLinkPrefixes = [];
2991
2992 /**
2993 * List of language names or overrides for default names in Names.php
2994 */
2995 $wgExtraLanguageNames = [];
2996
2997 /**
2998 * List of mappings from one language code to another.
2999 * This array makes the codes not appear as a selectable language on the
3000 * installer, and excludes them when running the transstat.php script.
3001 *
3002 * In Setup.php, the variable $wgDummyLanguageCodes is created by combining
3003 * these codes with a list of "deprecated" codes, which are mostly leftovers
3004 * from renames or other legacy things, and the internal codes 'qqq' and 'qqx'.
3005 * If a mapping in $wgExtraLanguageCodes collide with a built-in mapping, the
3006 * value in $wgExtraLanguageCodes will be used.
3007 *
3008 * @since 1.29
3009 */
3010 $wgExtraLanguageCodes = [
3011 // Language codes of macro languages, which get mapped to the main language
3012 'bh' => 'bho', // Bihari language family
3013 'no' => 'nb', // Norwegian language family
3014
3015 // Language variants which get mapped to the main language
3016 'simple' => 'en', // Simple English
3017 ];
3018
3019 /**
3020 * Functionally the same as $wgExtraLanguageCodes, but deprecated. Instead of
3021 * appending values to this array, append them to $wgExtraLanguageCodes.
3022 *
3023 * @deprecated since 1.29
3024 */
3025 $wgDummyLanguageCodes = [];
3026
3027 /**
3028 * Set this to true to replace Arabic presentation forms with their standard
3029 * forms in the U+0600-U+06FF block. This only works if $wgLanguageCode is
3030 * set to "ar".
3031 *
3032 * Note that pages with titles containing presentation forms will become
3033 * inaccessible, run maintenance/cleanupTitles.php to fix this.
3034 *
3035 * @deprecated since 1.33: in the future will always be true.
3036 */
3037 $wgFixArabicUnicode = true;
3038
3039 /**
3040 * Set this to true to replace ZWJ-based chillu sequences in Malayalam text
3041 * with their Unicode 5.1 equivalents. This only works if $wgLanguageCode is
3042 * set to "ml". Note that some clients (even new clients as of 2010) do not
3043 * support these characters.
3044 *
3045 * If you enable this on an existing wiki, run maintenance/cleanupTitles.php to
3046 * fix any ZWJ sequences in existing page titles.
3047 *
3048 * @deprecated since 1.33: in the future will always be true.
3049 */
3050 $wgFixMalayalamUnicode = true;
3051
3052 /**
3053 * Set this to always convert certain Unicode sequences to modern ones
3054 * regardless of the content language. This has a small performance
3055 * impact.
3056 *
3057 * See $wgFixArabicUnicode and $wgFixMalayalamUnicode for conversion
3058 * details.
3059 *
3060 * @since 1.17
3061 */
3062 $wgAllUnicodeFixes = false;
3063
3064 /**
3065 * Set this to eg 'ISO-8859-1' to perform character set conversion when
3066 * loading old revisions not marked with "utf-8" flag. Use this when
3067 * converting a wiki from MediaWiki 1.4 or earlier to UTF-8 without the
3068 * burdensome mass conversion of old text data.
3069 *
3070 * @note This DOES NOT touch any fields other than old_text. Titles, comments,
3071 * user names, etc still must be converted en masse in the database before
3072 * continuing as a UTF-8 wiki.
3073 */
3074 $wgLegacyEncoding = false;
3075
3076 /**
3077 * If set to true, the MediaWiki 1.4 to 1.5 schema conversion will
3078 * create stub reference rows in the text table instead of copying
3079 * the full text of all current entries from 'cur' to 'text'.
3080 *
3081 * This will speed up the conversion step for large sites, but
3082 * requires that the cur table be kept around for those revisions
3083 * to remain viewable.
3084 *
3085 * This option affects the updaters *only*. Any present cur stub
3086 * revisions will be readable at runtime regardless of this setting.
3087 */
3088 $wgLegacySchemaConversion = false;
3089
3090 /**
3091 * Enable dates like 'May 12' instead of '12 May', if the default date format
3092 * is 'dmy or mdy'.
3093 */
3094 $wgAmericanDates = false;
3095
3096 /**
3097 * For Hindi and Arabic use local numerals instead of Western style (0-9)
3098 * numerals in interface.
3099 */
3100 $wgTranslateNumerals = true;
3101
3102 /**
3103 * Translation using MediaWiki: namespace.
3104 * Interface messages will be loaded from the database.
3105 */
3106 $wgUseDatabaseMessages = true;
3107
3108 /**
3109 * Expiry time for the message cache key
3110 */
3111 $wgMsgCacheExpiry = 86400;
3112
3113 /**
3114 * Maximum entry size in the message cache, in bytes
3115 */
3116 $wgMaxMsgCacheEntrySize = 10000;
3117
3118 /**
3119 * Whether to enable language variant conversion.
3120 */
3121 $wgDisableLangConversion = false;
3122
3123 /**
3124 * Whether to enable language variant conversion for links.
3125 */
3126 $wgDisableTitleConversion = false;
3127
3128 /**
3129 * Default variant code, if false, the default will be the language code
3130 */
3131 $wgDefaultLanguageVariant = false;
3132
3133 /**
3134 * Whether to enable the pig Latin variant of English (en-x-piglatin),
3135 * used to ease variant development work.
3136 */
3137 $wgUsePigLatinVariant = false;
3138
3139 /**
3140 * Disabled variants array of language variant conversion.
3141 *
3142 * @par Example:
3143 * @code
3144 * $wgDisabledVariants[] = 'zh-mo';
3145 * $wgDisabledVariants[] = 'zh-my';
3146 * @endcode
3147 */
3148 $wgDisabledVariants = [];
3149
3150 /**
3151 * Like $wgArticlePath, but on multi-variant wikis, this provides a
3152 * path format that describes which parts of the URL contain the
3153 * language variant.
3154 *
3155 * @par Example:
3156 * @code
3157 * $wgLanguageCode = 'sr';
3158 * $wgVariantArticlePath = '/$2/$1';
3159 * $wgArticlePath = '/wiki/$1';
3160 * @endcode
3161 *
3162 * A link to /wiki/ would be redirected to /sr/Главна_страна
3163 *
3164 * It is important that $wgArticlePath not overlap with possible values
3165 * of $wgVariantArticlePath.
3166 */
3167 $wgVariantArticlePath = false;
3168
3169 /**
3170 * Show a bar of language selection links in the user login and user
3171 * registration forms; edit the "loginlanguagelinks" message to
3172 * customise these.
3173 */
3174 $wgLoginLanguageSelector = false;
3175
3176 /**
3177 * When translating messages with wfMessage(), it is not always clear what
3178 * should be considered UI messages and what should be content messages.
3179 *
3180 * For example, for the English Wikipedia, there should be only one 'mainpage',
3181 * so when getting the link for 'mainpage', we should treat it as site content
3182 * and call ->inContentLanguage()->text(), but for rendering the text of the
3183 * link, we call ->text(). The code behaves this way by default. However,
3184 * sites like the Wikimedia Commons do offer different versions of 'mainpage'
3185 * and the like for different languages. This array provides a way to override
3186 * the default behavior.
3187 *
3188 * @par Example:
3189 * To allow language-specific main page and community
3190 * portal:
3191 * @code
3192 * $wgForceUIMsgAsContentMsg = [ 'mainpage', 'portal-url' ];
3193 * @endcode
3194 */
3195 $wgForceUIMsgAsContentMsg = [];
3196
3197 /**
3198 * Fake out the timezone that the server thinks it's in. This will be used for
3199 * date display and not for what's stored in the DB. Leave to null to retain
3200 * your server's OS-based timezone value.
3201 *
3202 * This variable is currently used only for signature formatting and for local
3203 * time/date parser variables ({{LOCALTIME}} etc.)
3204 *
3205 * Timezones can be translated by editing MediaWiki messages of type
3206 * timezone-nameinlowercase like timezone-utc.
3207 *
3208 * A list of usable timezones can found at:
3209 * https://www.php.net/manual/en/timezones.php
3210 *
3211 * @par Examples:
3212 * @code
3213 * $wgLocaltimezone = 'UTC';
3214 * $wgLocaltimezone = 'GMT';
3215 * $wgLocaltimezone = 'PST8PDT';
3216 * $wgLocaltimezone = 'Europe/Sweden';
3217 * $wgLocaltimezone = 'CET';
3218 * @endcode
3219 */
3220 $wgLocaltimezone = null;
3221
3222 /**
3223 * Set an offset from UTC in minutes to use for the default timezone setting
3224 * for anonymous users and new user accounts.
3225 *
3226 * This setting is used for most date/time displays in the software, and is
3227 * overridable in user preferences. It is *not* used for signature timestamps.
3228 *
3229 * By default, this will be set to match $wgLocaltimezone.
3230 */
3231 $wgLocalTZoffset = null;
3232
3233 /**
3234 * List of Unicode characters for which capitalization is overridden in
3235 * Language::ucfirst. The characters should be
3236 * represented as char_to_convert => conversion_override. See T219279 for details
3237 * on why this is useful during php version transitions.
3238 *
3239 * @warning: EXPERIMENTAL!
3240 *
3241 * @since 1.34
3242 * @var array
3243 */
3244 $wgOverrideUcfirstCharacters = [];
3245
3246 /** @} */ # End of language/charset settings
3247
3248 /*************************************************************************//**
3249 * @name Output format and skin settings
3250 * @{
3251 */
3252
3253 /**
3254 * The default Content-Type header.
3255 */
3256 $wgMimeType = 'text/html';
3257
3258 /**
3259 * Defines the value of the version attribute in the &lt;html&gt; tag, if any.
3260 *
3261 * If your wiki uses RDFa, set it to the correct value for RDFa+HTML5.
3262 * Correct current values are 'HTML+RDFa 1.0' or 'XHTML+RDFa 1.0'.
3263 * See also https://www.w3.org/TR/rdfa-in-html/#document-conformance
3264 * @since 1.16
3265 */
3266 $wgHtml5Version = null;
3267
3268 /**
3269 * Temporary variable that allows HTMLForms to be rendered as tables.
3270 * Table based layouts cause various issues when designing for mobile.
3271 * This global allows skins or extensions a means to force non-table based rendering.
3272 * Setting to false forces form components to always render as div elements.
3273 * @since 1.24
3274 */
3275 $wgHTMLFormAllowTableFormat = true;
3276
3277 /**
3278 * Temporary variable that applies MediaWiki UI wherever it can be supported.
3279 * Temporary variable that should be removed when mediawiki ui is more
3280 * stable and change has been communicated.
3281 * @since 1.24
3282 */
3283 $wgUseMediaWikiUIEverywhere = false;
3284
3285 /**
3286 * Whether to label the store-to-database-and-show-to-others button in the editor
3287 * as "Save page"/"Save changes" if false (the default) or, if true, instead as
3288 * "Publish page"/"Publish changes".
3289 *
3290 * @since 1.28
3291 */
3292 $wgEditSubmitButtonLabelPublish = false;
3293
3294 /**
3295 * Permit other namespaces in addition to the w3.org default.
3296 *
3297 * Use the prefix for the key and the namespace for the value.
3298 *
3299 * @par Example:
3300 * @code
3301 * $wgXhtmlNamespaces['svg'] = 'http://www.w3.org/2000/svg';
3302 * @endcode
3303 * Normally we wouldn't have to define this in the root "<html>"
3304 * element, but IE needs it there in some circumstances.
3305 *
3306 * This is ignored if $wgMimeType is set to a non-XML MIME type.
3307 */
3308 $wgXhtmlNamespaces = [];
3309
3310 /**
3311 * Site notice shown at the top of each page
3312 *
3313 * MediaWiki:Sitenotice page, which will override this. You can also
3314 * provide a separate message for logged-out users using the
3315 * MediaWiki:Anonnotice page.
3316 */
3317 $wgSiteNotice = '';
3318
3319 /**
3320 * Default skin, for new users and anonymous visitors. Registered users may
3321 * change this to any one of the other available skins in their preferences.
3322 */
3323 $wgDefaultSkin = 'vector';
3324
3325 /**
3326 * Fallback skin used when the skin defined by $wgDefaultSkin can't be found.
3327 *
3328 * @since 1.24
3329 */
3330 $wgFallbackSkin = 'fallback';
3331
3332 /**
3333 * Specify the names of skins that should not be presented in the list of
3334 * available skins in user preferences. If you want to remove a skin entirely,
3335 * remove it from the skins/ directory and its entry from LocalSettings.php.
3336 */
3337 $wgSkipSkins = [];
3338
3339 /**
3340 * @deprecated since 1.23; use $wgSkipSkins instead
3341 */
3342 $wgSkipSkin = '';
3343
3344 /**
3345 * Allow user Javascript page?
3346 * This enables a lot of neat customizations, but may
3347 * increase security risk to users and server load.
3348 */
3349 $wgAllowUserJs = false;
3350
3351 /**
3352 * Allow user Cascading Style Sheets (CSS)?
3353 * This enables a lot of neat customizations, but may
3354 * increase security risk to users and server load.
3355 */
3356 $wgAllowUserCss = false;
3357
3358 /**
3359 * Allow style-related user-preferences?
3360 *
3361 * This controls whether the `editfont` and `underline` preferences
3362 * are available to users.
3363 */
3364 $wgAllowUserCssPrefs = true;
3365
3366 /**
3367 * Use the site's Javascript page?
3368 */
3369 $wgUseSiteJs = true;
3370
3371 /**
3372 * Use the site's Cascading Style Sheets (CSS)?
3373 */
3374 $wgUseSiteCss = true;
3375
3376 /**
3377 * Break out of framesets. This can be used to prevent clickjacking attacks,
3378 * or to prevent external sites from framing your site with ads.
3379 */
3380 $wgBreakFrames = false;
3381
3382 /**
3383 * The X-Frame-Options header to send on pages sensitive to clickjacking
3384 * attacks, such as edit pages. This prevents those pages from being displayed
3385 * in a frame or iframe. The options are:
3386 *
3387 * - 'DENY': Do not allow framing. This is recommended for most wikis.
3388 *
3389 * - 'SAMEORIGIN': Allow framing by pages on the same domain. This can be used
3390 * to allow framing within a trusted domain. This is insecure if there
3391 * is a page on the same domain which allows framing of arbitrary URLs.
3392 *
3393 * - false: Allow all framing. This opens up the wiki to XSS attacks and thus
3394 * full compromise of local user accounts. Private wikis behind a
3395 * corporate firewall are especially vulnerable. This is not
3396 * recommended.
3397 *
3398 * For extra safety, set $wgBreakFrames = true, to prevent framing on all pages,
3399 * not just edit pages.
3400 */
3401 $wgEditPageFrameOptions = 'DENY';
3402
3403 /**
3404 * Disallow framing of API pages directly, by setting the X-Frame-Options
3405 * header. Since the API returns CSRF tokens, allowing the results to be
3406 * framed can compromise your user's account security.
3407 * Options are:
3408 * - 'DENY': Do not allow framing. This is recommended for most wikis.
3409 * - 'SAMEORIGIN': Allow framing by pages on the same domain.
3410 * - false: Allow all framing.
3411 * Note: $wgBreakFrames will override this for human formatted API output.
3412 */
3413 $wgApiFrameOptions = 'DENY';
3414
3415 /**
3416 * Disable output compression (enabled by default if zlib is available)
3417 */
3418 $wgDisableOutputCompression = false;
3419
3420 /**
3421 * How should section IDs be encoded?
3422 * This array can contain 1 or 2 elements, each of them can be one of:
3423 * - 'html5' is modern HTML5 style encoding with minimal escaping. Displays Unicode
3424 * characters in most browsers' address bars.
3425 * - 'legacy' is old MediaWiki-style encoding, e.g. 啤酒 turns into .E5.95.A4.E9.85.92
3426 *
3427 * The first element of this array specifies the primary mode of escaping IDs. This
3428 * is what users will see when they e.g. follow an [[#internal link]] to a section of
3429 * a page.
3430 *
3431 * The optional second element defines a fallback mode, useful for migrations.
3432 * If present, it will direct MediaWiki to add empty <span>s to every section with its
3433 * id attribute set to fallback encoded title so that links using the previous encoding
3434 * would still work.
3435 *
3436 * Example: you want to migrate your wiki from 'legacy' to 'html5'
3437 *
3438 * On the first step, set this variable to [ 'legacy', 'html5' ]. After a while, when
3439 * all caches (parser, HTTP, etc.) contain only pages generated with this setting,
3440 * flip the value to [ 'html5', 'legacy' ]. This will result in all internal links being
3441 * generated in the new encoding while old links (both external and cached internal) will
3442 * still work. After a long time, you might want to ditch backwards compatibility and
3443 * set it to [ 'html5' ]. After all, pages get edited, breaking incoming links no matter which
3444 * fragment mode is used.
3445 *
3446 * @since 1.30
3447 */
3448 $wgFragmentMode = [ 'legacy', 'html5' ];
3449
3450 /**
3451 * Which ID escaping mode should be used for external interwiki links? See documentation
3452 * for $wgFragmentMode above for details of each mode. Because you can't control external sites,
3453 * this setting should probably always be 'legacy', unless every wiki you link to has converted
3454 * to 'html5'.
3455 *
3456 * @since 1.30
3457 */
3458 $wgExternalInterwikiFragmentMode = 'legacy';
3459
3460 /**
3461 * Abstract list of footer icons for skins in place of old copyrightico and poweredbyico code
3462 * You can add new icons to the built in copyright or poweredby, or you can create
3463 * a new block. Though note that you may need to add some custom css to get good styling
3464 * of new blocks in monobook. vector and modern should work without any special css.
3465 *
3466 * $wgFooterIcons itself is a key/value array.
3467 * The key is the name of a block that the icons will be wrapped in. The final id varies
3468 * by skin; Monobook and Vector will turn poweredby into f-poweredbyico while Modern
3469 * turns it into mw_poweredby.
3470 * The value is either key/value array of icons or a string.
3471 * In the key/value array the key may or may not be used by the skin but it can
3472 * be used to find the icon and unset it or change the icon if needed.
3473 * This is useful for disabling icons that are set by extensions.
3474 * The value should be either a string or an array. If it is a string it will be output
3475 * directly as html, however some skins may choose to ignore it. An array is the preferred format
3476 * for the icon, the following keys are used:
3477 * - src: An absolute url to the image to use for the icon, this is recommended
3478 * but not required, however some skins will ignore icons without an image
3479 * - srcset: optional additional-resolution images; see HTML5 specs
3480 * - url: The url to use in the a element around the text or icon, if not set an a element will
3481 * not be outputted
3482 * - alt: This is the text form of the icon, it will be displayed without an image in
3483 * skins like Modern or if src is not set, and will otherwise be used as
3484 * the alt="" for the image. This key is required.
3485 * - width and height: If the icon specified by src is not of the standard size
3486 * you can specify the size of image to use with these keys.
3487 * Otherwise they will default to the standard 88x31.
3488 * @todo Reformat documentation.
3489 */
3490 $wgFooterIcons = [
3491 "copyright" => [
3492 "copyright" => [], // placeholder for the built in copyright icon
3493 ],
3494 "poweredby" => [
3495 "mediawiki" => [
3496 // Defaults to point at
3497 // "$wgResourceBasePath/resources/assets/poweredby_mediawiki_88x31.png"
3498 // plus srcset for 1.5x, 2x resolution variants.
3499 "src" => null,
3500 "url" => "https://www.mediawiki.org/",
3501 "alt" => "Powered by MediaWiki",
3502 ]
3503 ],
3504 ];
3505
3506 /**
3507 * Login / create account link behavior when it's possible for anonymous users
3508 * to create an account.
3509 * - true = use a combined login / create account link
3510 * - false = split login and create account into two separate links
3511 */
3512 $wgUseCombinedLoginLink = false;
3513
3514 /**
3515 * Display user edit counts in various prominent places.
3516 */
3517 $wgEdititis = false;
3518
3519 /**
3520 * Some web hosts attempt to rewrite all responses with a 404 (not found)
3521 * status code, mangling or hiding MediaWiki's output. If you are using such a
3522 * host, you should start looking for a better one. While you're doing that,
3523 * set this to false to convert some of MediaWiki's 404 responses to 200 so
3524 * that the generated error pages can be seen.
3525 *
3526 * In cases where for technical reasons it is more important for MediaWiki to
3527 * send the correct status code than for the body to be transmitted intact,
3528 * this configuration variable is ignored.
3529 */
3530 $wgSend404Code = true;
3531
3532 /**
3533 * The $wgShowRollbackEditCount variable is used to show how many edits can be rolled back.
3534 * The numeric value of the variable controls how many edits MediaWiki will look back to
3535 * determine whether a rollback is allowed (by checking that they are all from the same author).
3536 * If the value is false or 0, the edits are not counted. Disabling this will prevent MediaWiki
3537 * from hiding some useless rollback links.
3538 *
3539 * @since 1.20
3540 */
3541 $wgShowRollbackEditCount = 10;
3542
3543 /**
3544 * Output a <link rel="canonical"> tag on every page indicating the canonical
3545 * server which should be used, i.e. $wgServer or $wgCanonicalServer. Since
3546 * detection of the current server is unreliable, the link is sent
3547 * unconditionally.
3548 */
3549 $wgEnableCanonicalServerLink = false;
3550
3551 /**
3552 * When OutputHandler is used, mangle any output that contains
3553 * <cross-domain-policy>. Without this, an attacker can send their own
3554 * cross-domain policy unless it is prevented by the crossdomain.xml file at
3555 * the domain root.
3556 *
3557 * @since 1.25
3558 */
3559 $wgMangleFlashPolicy = true;
3560