-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
DefaultSettings.php
9963 lines (9093 loc) · 322 KB
/
DefaultSettings.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
/**
* Default values for MediaWiki configuration settings.
*
*
* NEVER EDIT THIS FILE
*
*
* To customize your installation, edit "LocalSettings.php". If you make
* changes here, they will be lost on next upgrade of MediaWiki!
*
* In this file, variables whose default values depend on other
* variables are set to false. The actual default value of these variables
* will only be set in Setup.php, taking into account any custom settings
* performed in LocalSettings.php.
*
* Documentation is in the source and on:
* https://www.mediawiki.org/wiki/Manual:Configuration_settings
*
* @warning Note: this (and other things) will break if the autoloader is not
* enabled. Please include includes/AutoLoader.php before including this file.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
* @file
*/
/**
* @cond file_level_code
* This is not a valid entry point, perform no further processing unless
* MEDIAWIKI is defined
*/
if ( !defined( 'MEDIAWIKI' ) ) {
echo "This file is part of MediaWiki and is not a valid entry point\n";
die( 1 );
}
/** @endcond */
/**
* $wgConf hold the site configuration.
* Not used for much in a default install.
* @since 1.5
*/
$wgConf = new SiteConfiguration;
/**
* Registry of factory functions to create config objects:
* The 'main' key must be set, and the value should be a valid
* callable.
* @since 1.23
*/
$wgConfigRegistry = [
'main' => 'GlobalVarConfig::newInstance'
];
/**
* MediaWiki version number
* @since 1.2
* @deprecated since 1.35; use the MW_VERSION constant instead
*/
$wgVersion = MW_VERSION;
/**
* Name of the site. It must be changed in LocalSettings.php
*/
$wgSitename = 'MediaWiki';
/***************************************************************************/
// region Server URLs and file paths
/** @name Server URLs and file paths
*
* In this section, a "path" is usually a host-relative URL, i.e. a URL without
* the host part, that starts with a slash. In most cases a full URL is also
* acceptable. A "directory" is a local file path.
*
* In both paths and directories, trailing slashes should not be included.
*/
/**
* URL of the server.
*
* @par Example:
* @code
* $wgServer = 'http://example.com';
* @endcode
*
* This must be set in LocalSettings.php. The MediaWiki installer does this
* automatically since 1.18.
*
* If you want to use protocol-relative URLs on your wiki, set this to a
* protocol-relative URL like '//example.com' and set $wgCanonicalServer
* to a fully qualified URL.
*/
$wgServer = false;
/**
* Canonical URL of the server, to use in IRC feeds and notification e-mails.
* Must be fully qualified, even if $wgServer is protocol-relative.
*
* Defaults to $wgServer, expanded to a fully qualified http:// URL if needed.
* @since 1.18
*/
$wgCanonicalServer = false;
/**
* Server name. This is automatically computed by parsing the bare
* hostname out of $wgCanonicalServer. It should not be customized.
* @since 1.24
*/
$wgServerName = false;
/**
* When the wiki is running behind a proxy and this is set to true, assumes that the proxy exposes
* the wiki on the standard ports (443 for https and 80 for http).
* @var bool
* @since 1.26
*/
$wgAssumeProxiesUseDefaultProtocolPorts = true;
/**
* For installations where the canonical server is HTTP but HTTPS is optionally
* supported, you can specify a non-standard HTTPS port here. $wgServer should
* be a protocol-relative URL.
*
* If HTTPS is always used, just specify the port number in $wgServer.
*
* @see https://phabricator.wikimedia.org/T67184
*
* @since 1.24
*/
$wgHttpsPort = 443;
/**
* If this is true, when an insecure HTTP request is received, always redirect
* to HTTPS. This overrides and disables the preferhttps user preference, and it
* overrides $wgSecureLogin.
*
* $wgServer may be either https or protocol-relative. If $wgServer starts with
* "http://", an exception will be thrown.
*
* If a reverse proxy or CDN is used to forward requests from HTTPS to HTTP,
* the request header "X-Forwarded-Proto: https" should be sent to suppress
* the redirect.
*
* In addition to setting this to true, for optimal security, the web server
* should also be configured to send Strict-Transport-Security response headers.
*
* @var bool
* @since 1.35
*/
$wgForceHTTPS = false;
/**
* The path we should point to.
* It might be a virtual path in case with use apache mod_rewrite for example.
*
* This *needs* to be set correctly.
*
* Other paths will be set to defaults based on it unless they are directly
* set in LocalSettings.php
*/
$wgScriptPath = '/wiki';
/**
* Whether to support URLs like index.php/Page_title These often break when PHP
* is set up in CGI mode. PATH_INFO *may* be correct if cgi.fix_pathinfo is set,
* but then again it may not; lighttpd converts incoming path data to lowercase
* on systems with case-insensitive filesystems, and there have been reports of
* problems on Apache as well.
*
* To be safe we'll continue to keep it off by default.
*
* Override this to false if $_SERVER['PATH_INFO'] contains unexpectedly
* incorrect garbage, or to true if it is really correct.
*
* The default $wgArticlePath will be set based on this value at runtime, but if
* you have customized it, having this incorrectly set to true can cause
* redirect loops when "pretty URLs" are used.
* @since 1.2.1
*/
$wgUsePathInfo = ( strpos( PHP_SAPI, 'cgi' ) === false ) &&
( strpos( PHP_SAPI, 'apache2filter' ) === false ) &&
( strpos( PHP_SAPI, 'isapi' ) === false );
/**
* The URL path to index.php.
*
* Defaults to "{$wgScriptPath}/index.php".
*/
$wgScript = false;
/**
* The URL path to load.php.
*
* Defaults to "{$wgScriptPath}/load.php".
* @since 1.17
*/
$wgLoadScript = false;
/**
* The URL path to the REST API
* Defaults to "{$wgScriptPath}/rest.php"
* @since 1.34
*/
$wgRestPath = false;
/**
* The URL path of the skins directory.
* Defaults to "{$wgResourceBasePath}/skins".
* @since 1.3
*/
$wgStylePath = false;
/**
* The URL path of the skins directory. Should not point to an external domain.
* Defaults to "{$wgScriptPath}/skins".
* @since 1.17
*/
$wgLocalStylePath = false;
/**
* The URL path of the extensions directory.
* Defaults to "{$wgResourceBasePath}/extensions".
* @since 1.16
*/
$wgExtensionAssetsPath = false;
/**
* Filesystem extensions directory.
* @note Set to "{$IP}/extensions" by Setup.php before loading local settings.
* @note this configuration variable is used to locate extensions while loading settings.
* @since 1.25
*/
$wgExtensionDirectory = null;
/**
* Filesystem stylesheets directory.
* @note Set to "{$IP}/skins" by Setup.php before loading local settings.
* @note this configuration variable is used to locate skins while loading settings.
* @since 1.3
*/
$wgStyleDirectory = null;
/**
* Absolute filesystem path of the root directory of the MediaWiki installation.
* The MW_INSTALL_PATH environment variable can be used to set this.
*
* @note Automatically set in Setup.php before loading local settings.
* @note Do not modify in settings files! Must remain equal to the MW_INSTALL_PATH constant
* defined in Setup.php.
* @since 1.38
*/
$wgBaseDirectory = null;
/**
* The URL path for primary article page views. This path should contain $1,
* which is replaced by the article title.
*
* Defaults to "{$wgScript}/$1" or "{$wgScript}?title=$1",
* depending on $wgUsePathInfo.
*/
$wgArticlePath = false;
/**
* The URL path for the images directory.
* Defaults to "{$wgScriptPath}/images".
*/
$wgUploadPath = false;
/**
* The base path for img_auth.php. This is used to interpret the request URL
* for requests to img_auth.php that do not match the base upload path. If
* false, "{$wgScriptPath}/img_auth.php" is used.
*
* Normally, requests to img_auth.php have a REQUEST_URI which matches
* $wgUploadPath, and in that case, setting this should not be necessary.
* This variable is used in case img_auth.php is accessed via a different path
* than $wgUploadPath.
*
* @since 1.35
*/
$wgImgAuthPath = false;
/**
* The base path for thumb_handler.php. This is used to interpret the request URL
* for requests to thumb_handler.php that do not match the base upload path.
*
* @since 1.36
*/
$wgThumbPath = false;
/**
* The filesystem path of the images directory. Defaults to "{$IP}/images".
*/
$wgUploadDirectory = false;
/**
* Directory where the cached page will be saved.
* Defaults to "{$wgUploadDirectory}/cache".
*/
$wgFileCacheDirectory = false;
/**
* The URL path of the wiki logo. The logo size should be 135x135 pixels.
* Defaults to "$wgResourceBasePath/resources/assets/change-your-logo.svg".
* Developers should retrieve this logo (and other variants) using
* the static function ResourceLoaderSkinModule::getAvailableLogos
* Ignored if $wgLogos is set.
*/
$wgLogo = false;
/**
* Specification for different versions of the wiki logo.
*
* This is an array which should have the following k/v pairs:
* All path values can be either absolute or relative URIs
*
* The `1x` key is a path to the 1x version of square logo (should be 135x135 pixels)
* The `1.5x` key is a path to the 1.5x version of square logo
* The `2x` key is a path to the 2x version of square logo
* The `svg` key is a path to the svg version of square logo
* The `icon` key is a path to the version of the logo without wordmark and tagline
* The `wordmark` key should point to an array with the following fields
* - `src` path to wordmark version
* - `1x` path to svg wordmark version (if you want to
* support browsers with SVG support with an SVG logo)
* - `width` width of the logo in pixels
* - `height` height of the logo in pixels
* The `tagline` key should point to an array with the following fields
* - `src` path to tagline image
* - `width` width of the tagline in pixels
* - `height` height of the tagline in pixels
*
*
* @par Example:
* @code
* $wgLogos = [
* '1x' => 'path/to/1x_version.png',
* '1.5x' => 'path/to/1.5x_version.png',
* '2x' => 'path/to/2x_version.png',
* 'svg' => 'path/to/svg_version.svg',
* 'icon' => 'path/to/icon.png',
* 'wordmark' => [
* 'src' => 'path/to/wordmark_version.png',
* '1x' => 'path/to/wordmark_version.svg',
* 'width' => 135,
* 'height' => 20,
* ],
* 'tagline' => [
* 'src' => 'path/to/tagline_version.png',
* 'width' => 135,
* 'height' => 15,
* ]
* ];
* @endcode
*
* Defaults to [ "1x" => $wgLogo ],
* or [ "1x" => "$wgResourceBasePath/resources/assets/change-your-logo.svg" ] if $wgLogo is not set.
* @since 1.35
* @var array|false
*/
$wgLogos = false;
/**
* Array with URL paths to HD versions of the wiki logo. The scaled logo size
* should be under 135x155 pixels.
* Only 1.5x and 2x versions are supported.
*
* @par Example:
* @code
* $wgLogoHD = [
* "1.5x" => "path/to/1.5x_version.png",
* "2x" => "path/to/2x_version.png"
* ];
* @endcode
*
* SVG is also supported but when enabled, it
* disables 1.5x and 2x as svg will already
* be optimised for screen resolution.
*
* @par Example:
* @code
* $wgLogoHD = [
* "svg" => "path/to/svg_version.svg",
* ];
* @endcode
*
* @var array|false
* @since 1.25
* @deprecated since 1.35. Developers should retrieve this logo (and other variants) using
* the static function ResourceLoaderSkinModule::getAvailableLogos. $wgLogos should be used
* instead.
*/
$wgLogoHD = false;
/**
* The URL path of the shortcut icon.
* @since 1.6
*/
$wgFavicon = '/favicon.ico';
/**
* The URL path of the icon for iPhone and iPod Touch web app bookmarks.
* Defaults to no icon.
* @since 1.12
*/
$wgAppleTouchIcon = false;
/**
* Value for the referrer policy meta tag.
* One or more of the values defined in the Referrer Policy specification:
* https://w3c.github.io/webappsec-referrer-policy/
* ('no-referrer', 'no-referrer-when-downgrade', 'same-origin',
* 'origin', 'strict-origin', 'origin-when-cross-origin',
* 'strict-origin-when-cross-origin', or 'unsafe-url')
* Setting it to false prevents the meta tag from being output
* (which results in falling back to the Referrer-Policy header,
* or 'no-referrer-when-downgrade' if that's not set either.)
* Setting it to an array (supported since 1.31) will create a meta tag for
* each value, in the reverse of the order (meaning that the first array element
* will be the default and the others used as fallbacks for browsers which do not
* understand it).
*
* @var array|string|bool
* @since 1.25
*/
$wgReferrerPolicy = false;
/**
* The local filesystem path to a temporary directory. This must not be web accessible.
*
* When this setting is set to false, its value will automatically be decided
* through the first call to wfTempDir(). See that method's implementation for
* the actual detection logic.
*
* To find the temporary path for the current wiki, developers must not use
* this variable directly. Use the global function wfTempDir() instead.
*
* The temporary directory is expected to be shared with other applications,
* including other MediaWiki instances (which might not run the same version
* or configution). When storing files here, take care to avoid conflicts
* with other instances of MediaWiki. For example, when caching the result
* of a computation, the file name should incorporate the input of the
* computation so that it cannot be confused for the result of a similar
* computation by another MediaWiki instance.
*
* @see wfTempDir()
* @note Default changed to false in MediaWiki 1.20.
*/
$wgTmpDirectory = false;
/**
* If set, this URL is added to the start of $wgUploadPath to form a complete
* upload URL.
* @since 1.4
*/
$wgUploadBaseUrl = '';
/**
* To enable remote on-demand scaling, set this to the thumbnail base URL.
* Full thumbnail URL will be like $wgUploadStashScalerBaseUrl/e/e6/Foo.jpg/123px-Foo.jpg
* where 'e6' are the first two characters of the MD5 hash of the file name.
*
* @deprecated since 1.36 Use thumbProxyUrl in $wgLocalFileRepo
*
* If $wgUploadStashScalerBaseUrl and thumbProxyUrl are both false, thumbs are
* rendered locally as needed.
* @since 1.17
*/
$wgUploadStashScalerBaseUrl = false;
/**
* To set 'pretty' URL paths for actions other than
* plain page views, add to this array.
*
* @par Example:
* Set pretty URL for the edit action:
* @code
* 'edit' => "$wgScriptPath/edit/$1"
* @endcode
*
* There must be an appropriate script or rewrite rule in place to handle these
* URLs.
* @since 1.5
*/
$wgActionPaths = [];
/**
* Option to whether serve the main page as the domain root
*
* @warning EXPERIMENTAL!
*
* @since 1.34
* @var bool
*/
$wgMainPageIsDomainRoot = false;
// endregion -- end of server URLs and file paths
/***************************************************************************/
// region Files and file uploads
/** @name Files and file uploads */
/**
* Allow users to upload files.
*
* Use $wgLocalFileRepo to control how and where uploads are stored.
* Disabled by default as for security reasons.
* See <https://www.mediawiki.org/wiki/Manual:Configuring_file_uploads>.
*
* @since 1.5
*/
$wgEnableUploads = false;
/**
* The maximum age of temporary (incomplete) uploaded files
*/
$wgUploadStashMaxAge = 6 * 3600; // 6 hours
/**
* Enable deferred upload tasks that use the job queue.
* Only enable this if job runners are set up for both the
* 'AssembleUploadChunks' and 'PublishStashedFile' job types.
*
* @note If you use suhosin, this setting is incompatible with
* suhosin.session.encrypt.
*/
$wgEnableAsyncUploads = false;
/**
* To disable file delete/restore temporarily
*/
$wgUploadMaintenance = false;
/**
* Additional characters that are not allowed in filenames. They are replaced with '-' when
* uploading. Like $wgLegalTitleChars, this is a regexp character class.
*
* Slashes and backslashes are disallowed regardless of this setting, but included here for
* completeness.
*/
$wgIllegalFileChars = ":\\/\\\\";
/**
* What directory to place deleted uploads in.
* Defaults to "{$wgUploadDirectory}/deleted".
*/
$wgDeletedDirectory = false;
/**
* Set this to true if you use img_auth and want the user to see details on why access failed.
*/
$wgImgAuthDetails = false;
/**
* Map of relative URL directories to match to internal mwstore:// base storage paths.
* For img_auth.php requests, everything after "img_auth.php/" is checked to see
* if starts with any of the prefixes defined here. The prefixes should not overlap.
* The prefix that matches has a corresponding storage path, which the rest of the URL
* is assumed to be relative to. The file at that path (or a 404) is send to the client.
*
* Example:
* $wgImgAuthUrlPathMap['/timeline/'] = 'mwstore://local-fs/timeline-render/';
* The above maps ".../img_auth.php/timeline/X" to "mwstore://local-fs/timeline-render/".
* The name "local-fs" should correspond by name to an entry in $wgFileBackends.
*
* @see $wgFileBackends
*/
$wgImgAuthUrlPathMap = [];
/**
* File repository structures
*
* $wgLocalFileRepo is a single repository structure, and $wgForeignFileRepos is
* an array of such structures. Each repository structure is an associative
* array of properties configuring the repository.
*
* Properties required for all repos:
* - class The class name for the repository. May come from the core or an extension.
* The core repository classes are FileRepo, LocalRepo, ForeignDBRepo.
*
* - name A unique name for the repository (but $wgLocalFileRepo should be 'local').
* The name should consist of alpha-numeric characters.
*
* Optional common properties:
* - backend A file backend name (see $wgFileBackends). If not specified, or
* if the name is not present in $wgFileBackends, an FSFileBackend
* will automatically be configured.
* - lockManager If a file backend is automatically configured, this will be lock
* manager name used. A lock manager named in $wgLockManagers, or one of
* the default lock managers "fsLockManager" or "nullLockManager". Default
* "fsLockManager".
* - favicon URL to a favicon. This is exposed via FileRepo::getInfo and
* ApiQueryFileRepoInfo. Originally for use by MediaViewer (T77093).
*
* For most core repos:
* - zones Associative array of zone names that each map to an array with:
* container : backend container name the zone is in
* directory : root path within container for the zone
* url : base URL to the root of the zone
* urlsByExt : map of file extension types to base URLs
* (useful for using a different cache for videos)
* Zones default to using "<repo name>-<zone name>" as the container name
* and default to using the container root as the zone's root directory.
* Nesting of zone locations within other zones should be avoided.
* - url Public zone URL. The 'zones' settings take precedence.
* - hashLevels The number of directory levels for hash-based division of files.
*
* Set this to 0 if you do not want MediaWiki to divide your images
* directory into many subdirectories.
*
* It is recommended to leave this enabled. In previous versions of
* MediaWiki, some users set this to false to allow images to be added to
* the wiki by copying them into $wgUploadDirectory and then running
* maintenance/rebuildImages.php to register them in the database.
* This is no longer supported, use maintenance/importImages.php instead.
*
* Default: 2.
* - deletedHashLevels
* Optional 'hashLevels' override for the 'deleted' zone.
* - thumbScriptUrl The URL for thumb.php (optional, not recommended)
* - transformVia404 Whether to skip media file transformation on parse and rely on a 404
* handler instead.
* - thumbProxyUrl Optional. URL of where to proxy thumb.php requests to. This is
* also used internally for remote thumbnailing of upload stash files.
* Example: http://127.0.0.1:8888/wiki/dev/thumb/
* - thumbProxySecret Optional value of the X-Swift-Secret header to use in requests to
* thumbProxyUrl
* - disableLocalTransform
* If present and true, local image scaling will be disabled -- it will
* throw an exception if attempted. thumbProxyUrl must be set for this
* to work, as well as either transformVia404 (preferred) or thumbScriptUrl.
* - initialCapital Equivalent to $wgCapitalLinks (or $wgCapitalLinkOverrides[NS_FILE],
* determines whether filenames implicitly start with a capital letter.
* The current implementation may give incorrect description page links
* when the local $wgCapitalLinks and initialCapital are mismatched.
* - pathDisclosureProtection
* May be 'paranoid' to remove all parameters from error messages, 'none' to
* leave the paths in unchanged, or 'simple' to replace paths with
* placeholders. Default for LocalRepo is 'simple'.
* - fileMode This allows wikis to set the file mode when uploading/moving files. Default
* is 0644.
* - directory The local filesystem directory where public files are stored. Not used for
* some remote repos.
* - thumbDir The base thumbnail directory. Defaults to "<directory>/thumb".
* - thumbUrl The base thumbnail URL. Defaults to "<url>/thumb".
* - isPrivate Set this if measures should always be taken to keep the files private.
* One should not trust this to assure that the files are not web readable;
* the server configuration should be done manually depending on the backend.
* - useJsonMetadata Whether handler metadata should be stored in JSON format. Default: false.
* - useSplitMetadata Whether handler metadata should be split up and stored in the text table.
* Default: false.
* - splitMetadataThreshold
* If the media handler opts in, large metadata items will be split into a
* separate blob in the database if the item is larger than this threshold.
* Default: 1000
* - updateCompatibleMetadata
* When true, image metadata will be upgraded by reloading it from the original
* file, if the handler indicates that it is out of date.
*
* By default, when purging a file or otherwise refreshing file metadata, it
* is only reloaded when the metadata is invalid. Valid data originally loaded
* by a current or older compatible version is left unchanged. Enable this
* to also reload and upgrade metadata that was stored by an older compatible
* version. See also MediaHandler::isMetadataValid, and RefreshImageMetadata.
*
* Default: false.
*
* - reserializeMetadata
* If true, image metadata will be automatically rewritten to the database
* if its serialization format is out of date. Default: false
*
* These settings describe a foreign MediaWiki installation. They are optional, and will be ignored
* for local repositories:
* - descBaseUrl URL of image description pages, e.g. https://en.wikipedia.org/wiki/File:
* - scriptDirUrl URL of the MediaWiki installation, equivalent to $wgScriptPath, e.g.
* https://en.wikipedia.org/w
* - articleUrl Equivalent to $wgArticlePath, e.g. https://en.wikipedia.org/wiki/$1
* - fetchDescription Fetch the text of the remote file description page and display them
* on the local wiki.
* - abbrvThreshold File names over this size will use the short form of thumbnail names.
* Short thumbnail names only have the width, parameters, and the extension.
*
* ForeignDBRepo:
* - dbType, dbServer, dbUser, dbPassword, dbName, dbFlags
* equivalent to the corresponding member of $wgDBservers
* - tablePrefix Table prefix, the foreign wiki's $wgDBprefix
* - hasSharedCache Set to true if the foreign wiki's $wgMainCacheType is identical to,
* and accessible from, this wiki.
*
* ForeignAPIRepo:
* - apibase Use for the foreign API's URL
* - apiThumbCacheExpiry How long to locally cache thumbs for
*
* If you leave $wgLocalFileRepo set to false, Setup will fill in appropriate values.
* Otherwise, set $wgLocalFileRepo to a repository structure as described above.
* If you set $wgUseInstantCommons to true, it will add an entry for Commons.
* If you set $wgForeignFileRepos to an array of repository structures, those will
* be searched after the local file repo.
* Otherwise, you will only have access to local media files.
*
* @see FileRepo::__construct for the default options.
* @see Setup.php for an example usage and default initialization.
*/
$wgLocalFileRepo = false;
/**
* Enable the use of files from one or more other wikis.
*
* If you operate multiple wikis, you can declare a shared upload path here.
* Uploads to the local wiki will NOT be stored here - See $wgLocalFileRepo
* and $wgUploadDirectory for that.
*
* The wiki will only consider the foreign repository if no file of the given name
* is found in the local repository (e.g. via `[[File:..]]` syntax).
*
* @since 1.11
* @see $wgLocalFileRepo
*/
$wgForeignFileRepos = [];
/**
* Use Wikimedia Commons as a foreign file repository.
*
* This is a shortcut for adding an entry to $wgForeignFileRepos
* for https://commons.wikimedia.org, using ForeignAPIRepo with the
* default settings.
*
* @since 1.16
*/
$wgUseInstantCommons = false;
/**
* Shortcut for adding an entry to $wgForeignFileRepos.
*
* Uses the following variables:
*
* - directory: $wgSharedUploadDirectory.
* - url: $wgSharedUploadPath.
* - hashLevels: Based on $wgHashedSharedUploadDirectory.
* - thumbScriptUrl: $wgSharedThumbnailScriptPath.
* - transformVia404: Based on $wgGenerateThumbnailOnParse.
* - descBaseUrl: $wgRepositoryBaseUrl.
* - fetchDescription: $wgFetchCommonsDescriptions.
*
* If $wgSharedUploadDBname is set, it uses the ForeignDBRepo
* class, with also the following variables:
*
* - dbName: $wgSharedUploadDBname.
* - dbType: $wgDBtype.
* - dbServer: $wgDBserver.
* - dbUser: $wgDBuser.
* - dbPassword: $wgDBpassword.
* - dbFlags: Based on $wgDebugDumpSql.
* - tablePrefix: $wgSharedUploadDBprefix,
* - hasSharedCache: $wgCacheSharedUploads.
*
* @var bool
* @since 1.3
*/
$wgUseSharedUploads = false;
/**
* Shortcut for the 'directory' setting of $wgForeignFileRepos.
* Only used if $wgUseSharedUploads is enabled.
*
* @var string
* @since 1.3
*/
$wgSharedUploadDirectory = null;
/**
* Shortcut for the 'url' setting of $wgForeignFileRepos.
* Only used if $wgUseSharedUploads is enabled.
*
* @var string
* @since 1.3
*/
$wgSharedUploadPath = null;
/**
* Shortcut for the 'hashLevels' setting of $wgForeignFileRepos.
* Only used if $wgUseSharedUploads is enabled.
*
* @var bool
* @since 1.3
*/
$wgHashedSharedUploadDirectory = true;
/**
* Shortcut for the 'descBaseUrl' setting of $wgForeignFileRepos.
* Only used if $wgUseSharedUploads is enabled.
*
* @since 1.5
*/
$wgRepositoryBaseUrl = 'https://commons.wikimedia.org/wiki/File:';
/**
* Shortcut for the 'fetchDescription' setting of $wgForeignFileRepos.
* Only used if $wgUseSharedUploads is enabled.
*
* @var bool
* @since 1.5
*/
$wgFetchCommonsDescriptions = false;
/**
* Shortcut for the ForeignDBRepo 'dbName' setting in $wgForeignFileRepos.
* Set this to false if the uploads do not come from a wiki.
* Only used if $wgUseSharedUploads is enabled.
*
* @var bool|string
* @since 1.4
*/
$wgSharedUploadDBname = false;
/**
* Shortcut for the ForeignDBRepo 'tablePrefix' setting in $wgForeignFileRepos.
* Only used if $wgUseSharedUploads is enabled.
*
* @var string
* @since 1.5
*/
$wgSharedUploadDBprefix = '';
/**
* Shortcut for the ForeignDBRepo 'hasSharedCache' setting in $wgForeignFileRepos.
* Only used if $wgUseSharedUploads is enabled.
*
* @var bool
* @since 1.5
*/
$wgCacheSharedUploads = true;
/**
* Array of foreign file repo names (set in $wgForeignFileRepos above) that
* are allowable upload targets. These wikis must have some method of
* authentication (i.e. CentralAuth), and be CORS-enabled for this wiki.
* The string 'local' signifies the default local file repository.
*
* Example:
* $wgForeignUploadTargets = [ 'shared' ];
*/
$wgForeignUploadTargets = [ 'local' ];
/**
* Configuration for file uploads using the embeddable upload dialog
* (https://www.mediawiki.org/wiki/Upload_dialog).
*
* This applies also to foreign uploads to this wiki (the configuration is loaded by remote wikis
* using the action=query&meta=siteinfo API).
*
* See below for documentation of each property. None of the properties may be omitted.
*/
$wgUploadDialog = [
// Fields to make available in the dialog. `true` means that this field is visible, `false` means
// that it is hidden. The "Name" field can't be hidden. Note that you also have to add the
// matching replacement to the 'filepage' format key below to make use of these.
'fields' => [
'description' => true,
'date' => false,
'categories' => false,
],
// Suffix of localisation messages used to describe the license under which the uploaded file will
// be released. The same value may be set for both 'local' and 'foreign' uploads.
'licensemessages' => [
// The 'local' messages are used for local uploads on this wiki:
// * upload-form-label-own-work-message-generic-local
// * upload-form-label-not-own-work-message-generic-local
// * upload-form-label-not-own-work-local-generic-local
'local' => 'generic-local',
// The 'foreign' messages are used for cross-wiki uploads from other wikis to this wiki:
// * upload-form-label-own-work-message-generic-foreign
// * upload-form-label-not-own-work-message-generic-foreign
// * upload-form-label-not-own-work-local-generic-foreign
'foreign' => 'generic-foreign',
],
// Upload comments to use for 'local' and 'foreign' uploads. This can also be set to a single
// string value, in which case it is used for both kinds of uploads. Available replacements:
// * $HOST - domain name from which a cross-wiki upload originates
// * $PAGENAME - wiki page name from which an upload originates
'comment' => [
'local' => '',
'foreign' => '',
],
// Format of the file page wikitext to be generated from the fields input by the user.
'format' => [
// Wrapper for the whole page. Available replacements:
// * $DESCRIPTION - file description, as input by the user (only if the 'description' field is
// enabled), wrapped as defined below in the 'description' key
// * $DATE - file creation date, as input by the user (only if the 'date' field is enabled)
// * $SOURCE - as defined below in the 'ownwork' key, may be extended in the future
// * $AUTHOR - linked user name, may be extended in the future
// * $LICENSE - as defined below in the 'license' key, may be extended in the future
// * $CATEGORIES - file categories wikitext, as input by the user (only if the 'categories'
// field is enabled), or if no input, as defined below in the 'uncategorized' key
'filepage' => '$DESCRIPTION',
// Wrapped for file description. Available replacements:
// * $LANGUAGE - source wiki's content language
// * $TEXT - input by the user
'description' => '$TEXT',
'ownwork' => '',
'license' => '',
'uncategorized' => '',
],
];
/**
* File backend structure configuration.
*
* This is an array of file backend configuration arrays.
* Each backend configuration has the following parameters:
* - name : A unique name for the backend
* - class : The file backend class to use
* - wikiId : A unique string that identifies the wiki (container prefix)
* - lockManager : The name of a lock manager (see $wgLockManagers) [optional]
*
* See FileBackend::__construct() for more details.
* Additional parameters are specific to the file backend class used.
* These settings should be global to all wikis when possible.
*
* FileBackendMultiWrite::__construct() is augmented with a 'template' option that
* can be used in any of the values of the 'backends' array. Its value is the name of
* another backend in $wgFileBackends. When set, it pre-fills the array with all of the
* configuration of the named backend. Explicitly set values in the array take precedence.
*
* There are two particularly important aspects about each backend:
* - a) Whether it is fully qualified or wiki-relative.
* By default, the paths of files are relative to the current wiki,
* which works via prefixing them with the current wiki ID when accessed.
* Setting 'domainId' forces the backend to be fully qualified by prefixing
* all paths with the specified value instead. This can be useful if
* multiple wikis need to share the same data. Note that 'name' is *not*
* part of any prefix and thus should not be relied upon for namespacing.
* - b) Whether it is only defined for some wikis or is defined on all
* wikis in the wiki farm. Defining a backend globally is useful
* if multiple wikis need to share the same data.
* One should be aware of these aspects when configuring a backend for use with
* any basic feature or plugin. For example, suppose an extension stores data for
* different wikis in different directories and sometimes needs to access data from
* a foreign wiki's directory in order to render a page on given wiki. The extension
* would need a fully qualified backend that is defined on all wikis in the wiki farm.
*/
$wgFileBackends = [];
/**
* Array of configuration arrays for each lock manager.
* Each backend configuration has the following parameters:
* - name : A unique name for the lock manager
* - class : The lock manger class to use
*
* See LockManager::__construct() for more details.
* Additional parameters are specific to the lock manager class used.
* These settings should be global to all wikis.
*/
$wgLockManagers = [];
/**
* Show Exif data, on by default if available.
* Requires PHP's Exif extension: https://www.php.net/manual/en/ref.exif.php
*
* @note FOR WINDOWS USERS:
* To enable Exif functions, add the following line to the "Windows
* extensions" section of php.ini:
* @code{.ini}
* extension=extensions/php_exif.dll
* @endcode
*/
$wgShowEXIF = function_exists( 'exif_read_data' );
/**
* Shortcut for the 'updateCompatibleMetadata' setting of $wgLocalFileRepo.
*/
$wgUpdateCompatibleMetadata = false;
/**
* Allow for upload to be copied from an URL.
* The timeout for copy uploads is set by $wgCopyUploadTimeout.
* You have to assign the user right 'upload_by_url' to a user group, to use this.
*/
$wgAllowCopyUploads = false;
/**
* A list of domains copy uploads can come from
*
* @since 1.20