forked from jparyani/mediawiki-sandstorm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DefaultSettings.php
7101 lines (6334 loc) · 218 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
*/
/**
* @defgroup Globalsettings Global settings
*/
/**
* @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 );
}
/**
* 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 = array(
'main' => 'GlobalVarConfig::newInstance'
);
/**
* MediaWiki version number
* @since 1.2
*/
$wgVersion = '1.23.0';
/**
* Name of the site. It must be changed in LocalSettings.php
*/
$wgSitename = 'MediaWiki';
/**
* URL of the server.
*
* @par Example:
* @code
* $wgServer = 'http://example.com';
* @endcode
*
* This is usually detected correctly by MediaWiki. If MediaWiki detects the
* wrong server, it will redirect incorrectly after you save a page. In that
* case, set this variable to fix it.
*
* 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 = WebRequest::detectServer();
/**
* 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;
/************************************************************************//**
* @name Script path settings
* @{
*/
/**
* 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 extension to append to script names by default. This can either be .php
* or .php5.
*
* Some hosting providers use PHP 4 for *.php files, and PHP 5 for *.php5. This
* variable is provided to support those providers.
* @since 1.11
*/
$wgScriptExtension = '.php';
/**@}*/
/************************************************************************//**
* @name URLs and file paths
*
* These various web and file path variables are set to their defaults
* in Setup.php if they are not explicitly set from LocalSettings.php.
*
* These will relatively rarely need to be set manually, unless you are
* splitting style sheets or images outside the main document root.
*
* 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.
*
* @{
*/
/**
* The URL path to index.php.
*
* Defaults to "{$wgScriptPath}/index{$wgScriptExtension}".
*/
$wgScript = false;
/**
* The URL path to load.php.
*
* Defaults to "{$wgScriptPath}/load{$wgScriptExtension}".
* @since 1.17
*/
$wgLoadScript = false;
/**
* The URL path of the skins directory.
* Defaults to "{$wgScriptPath}/skins".
* @since 1.3
*/
$wgStylePath = false;
$wgStyleSheetPath = &$wgStylePath;
/**
* 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 "{$wgScriptPath}/extensions".
* @since 1.16
*/
$wgExtensionAssetsPath = false;
/**
* Filesystem stylesheets directory.
* Defaults to "{$IP}/skins".
* @since 1.3
*/
$wgStyleDirectory = false;
/**
* 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 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 "{$wgStylePath}/common/images/wiki.png".
*/
$wgLogo = 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;
/**
* The local filesystem path to a temporary directory. This is not required to
* be web accessible.
*
* When this setting is set to false, its value will be set through a call
* to wfTempDir(). See that methods implementation for the actual detection
* logic.
*
* Developers should use the global function wfTempDir() instead of this
* variable.
*
* @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.
* If $wgUploadStashScalerBaseUrl is set to 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 = array();
/**@}*/
/************************************************************************//**
* @name Files and file uploads
* @{
*/
/**
* Uploads have to be specially set up to be secure
*/
$wgEnableUploads = false;
/**
* The maximum age of temporary (incomplete) uploaded files
*/
$wgUploadStashMaxAge = 6 * 3600; // 6 hours
/**
* Allows to move images and other media files
*/
$wgAllowImageMoving = true;
/**
* 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;
/**
* These are additional characters that should be replaced with '-' in filenames
*/
$wgIllegalFileChars = ":";
/**
* @deprecated since 1.17 use $wgDeletedDirectory
*/
$wgFileStore = array();
/**
* 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;
/**
* If this is enabled, img_auth.php will not allow image access unless the wiki
* is private. This improves security when image uploads are hosted on a
* separate domain.
*/
$wgImgAuthPublicTest = true;
/**
* 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 = array();
/**
* 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.
* FSRepo is also supported for backwards compatibility.
*
* - name A unique name for the repository (but $wgLocalFileRepo should be 'local').
* The name should consist of alpha-numeric characters.
* - backend A file backend name (see $wgFileBackends).
*
* 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)
* handlerUrl : base script-handled URL to the root of the zone
* (see FileRepo::getZoneHandlerUrl() function)
* 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
* - 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.
* - 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.
*
* 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. http://en.wikipedia.org/wiki/File:
* - scriptDirUrl URL of the MediaWiki installation, equivalent to $wgScriptPath, e.g.
* http://en.wikipedia.org/w
* - scriptExtension Script extension of the MediaWiki installation, equivalent to
* $wgScriptExtension, e.g. .php5 defaults to .php
*
* - articleUrl Equivalent to $wgArticlePath, e.g. http://en.wikipedia.org/wiki/$1
* - fetchDescription Fetch the text of the remote file description page. Equivalent to
* $wgFetchCommonsDescriptions.
* - 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 True if the wiki's shared cache is accessible via the local $wgMemc
*
* 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 Setup.php for an example usage and default initialization.
*/
$wgLocalFileRepo = false;
/**
* @see $wgLocalFileRepo
*/
$wgForeignFileRepos = array();
/**
* Use Commons as a remote file repository. Essentially a wrapper, when this
* is enabled $wgForeignFileRepos will point at Commons with a set of default
* settings
*/
$wgUseInstantCommons = false;
/**
* 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)
*
* 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.
*
* 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 'wikiId' 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();
/**
* 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 = array();
/**
* Show Exif data, on by default if available.
* Requires PHP's Exif extension: http://www.php.net/manual/en/ref.exif.php
*
* @note FOR WINDOWS USERS:
* To enable Exif functions, add the following lines to the "Windows
* extensions" section of php.ini:
* @code{.ini}
* extension=extensions/php_mbstring.dll
* extension=extensions/php_exif.dll
* @endcode
*/
$wgShowEXIF = function_exists( 'exif_read_data' );
/**
* If to automatically update the img_metadata field
* if the metadata field is outdated but compatible with the current version.
* Defaults to false.
*/
$wgUpdateCompatibleMetadata = false;
/**
* If you operate multiple wikis, you can define a shared upload path here.
* Uploads to this wiki will NOT be put there - they will be put into
* $wgUploadDirectory.
* If $wgUseSharedUploads is set, the wiki will look in the shared repository if
* no file of the given name is found in the local repository (for [[File:..]],
* [[Media:..]] links). Thumbnails will also be looked for and generated in this
* directory.
*
* Note that these configuration settings can now be defined on a per-
* repository basis for an arbitrary number of file repositories, using the
* $wgForeignFileRepos variable.
*/
$wgUseSharedUploads = false;
/**
* Full path on the web server where shared uploads can be found
*/
$wgSharedUploadPath = "http://commons.wikimedia.org/shared/images";
/**
* Fetch commons image description pages and display them on the local wiki?
*/
$wgFetchCommonsDescriptions = false;
/**
* Path on the file system where shared uploads can be found.
*/
$wgSharedUploadDirectory = "/var/www/wiki3/images";
/**
* DB name with metadata about shared directory.
* Set this to false if the uploads do not come from a wiki.
*/
$wgSharedUploadDBname = false;
/**
* Optional table prefix used in database.
*/
$wgSharedUploadDBprefix = '';
/**
* Cache shared metadata in memcached.
* Don't do this if the commons wiki is in a different memcached domain
*/
$wgCacheSharedUploads = true;
/**
* 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;
/**
* Allow asynchronous copy uploads.
* This feature is experimental and broken as of r81612.
*/
$wgAllowAsyncCopyUploads = false;
/**
* A list of domains copy uploads can come from
*
* @since 1.20
*/
$wgCopyUploadsDomains = array();
/**
* Enable copy uploads from Special:Upload. $wgAllowCopyUploads must also be
* true. If $wgAllowCopyUploads is true, but this is false, you will only be
* able to perform copy uploads from the API or extensions (e.g. UploadWizard).
*/
$wgCopyUploadsFromSpecialUpload = false;
/**
* Proxy to use for copy upload requests.
* @since 1.20
*/
$wgCopyUploadProxy = false;
/**
* Different timeout for upload by url
* This could be useful since when fetching large files, you may want a
* timeout longer than the default $wgHTTPTimeout. False means fallback
* to default.
*
* @since 1.22
*/
$wgCopyUploadTimeout = false;
/**
* Different timeout for upload by url when run as a background job
* This could be useful since when fetching large files via job queue,
* you may want a different timeout, especially because there is no
* http request being kept alive.
*
* false means fallback to $wgCopyUploadTimeout.
* @since 1.22
*/
$wgCopyUploadAsyncTimeout = false;
/**
* Max size for uploads, in bytes. If not set to an array, applies to all
* uploads. If set to an array, per upload type maximums can be set, using the
* file and url keys. If the * key is set this value will be used as maximum
* for non-specified types.
*
* @par Example:
* @code
* $wgMaxUploadSize = array(
* '*' => 250 * 1024,
* 'url' => 500 * 1024,
* );
* @endcode
* Sets the maximum for all uploads to 250 kB except for upload-by-url, which
* will have a maximum of 500 kB.
*/
$wgMaxUploadSize = 1024 * 1024 * 100; # 100MB
/**
* Point the upload navigation link to an external URL
* Useful if you want to use a shared repository by default
* without disabling local uploads (use $wgEnableUploads = false for that).
*
* @par Example:
* @code
* $wgUploadNavigationUrl = 'http://commons.wikimedia.org/wiki/Special:Upload';
* @endcode
*/
$wgUploadNavigationUrl = false;
/**
* Point the upload link for missing files to an external URL, as with
* $wgUploadNavigationUrl. The URL will get "(?|&)wpDestFile=<filename>"
* appended to it as appropriate.
*/
$wgUploadMissingFileUrl = false;
/**
* Give a path here to use thumb.php for thumbnail generation on client
* request, instead of generating them on render and outputting a static URL.
* This is necessary if some of your apache servers don't have read/write
* access to the thumbnail path.
*
* @par Example:
* @code
* $wgThumbnailScriptPath = "{$wgScriptPath}/thumb{$wgScriptExtension}";
* @endcode
*/
$wgThumbnailScriptPath = false;
/**
* @see $wgThumbnailScriptPath
*/
$wgSharedThumbnailScriptPath = false;
/**
* Set this to false if you do not want MediaWiki to divide your images
* directory into many subdirectories, for improved performance.
*
* It's almost always good 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 simply copying them into $wgUploadDirectory and then running
* maintenance/rebuildImages.php to register them in the database. This is no
* longer recommended, use maintenance/importImages.php instead.
*
* @note That this variable may be ignored if $wgLocalFileRepo is set.
* @todo Deprecate the setting and ultimately remove it from Core.
*/
$wgHashedUploadDirectory = true;
/**
* Set the following to false especially if you have a set of files that need to
* be accessible by all wikis, and you do not want to use the hash (path/a/aa/)
* directory layout.
*/
$wgHashedSharedUploadDirectory = true;
/**
* Base URL for a repository wiki. Leave this blank if uploads are just stored
* in a shared directory and not meant to be accessible through a separate wiki.
* Otherwise the image description pages on the local wiki will link to the
* image description page on this wiki.
*
* Please specify the namespace, as in the example below.
*/
$wgRepositoryBaseUrl = "http://commons.wikimedia.org/wiki/File:";
/**
* This is the list of preferred extensions for uploading files. Uploading files
* with extensions not in this list will trigger a warning.
*
* @warning If you add any OpenOffice or Microsoft Office file formats here,
* such as odt or doc, and untrusted users are allowed to upload files, then
* your wiki will be vulnerable to cross-site request forgery (CSRF).
*/
$wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg' );
/**
* Files with these extensions will never be allowed as uploads.
* An array of file extensions to blacklist. You should append to this array
* if you want to blacklist additional files.
*/
$wgFileBlacklist = array(
# HTML may contain cookie-stealing JavaScript and web bugs
'html', 'htm', 'js', 'jsb', 'mhtml', 'mht', 'xhtml', 'xht',
# PHP scripts may execute arbitrary code on the server
'php', 'phtml', 'php3', 'php4', 'php5', 'phps',
# Other types that may be interpreted by some servers
'shtml', 'jhtml', 'pl', 'py', 'cgi',
# May contain harmful executables for Windows victims
'exe', 'scr', 'dll', 'msi', 'vbs', 'bat', 'com', 'pif', 'cmd', 'vxd', 'cpl' );
/**
* Files with these mime types will never be allowed as uploads
* if $wgVerifyMimeType is enabled.
*/
$wgMimeTypeBlacklist = array(
# HTML may contain cookie-stealing JavaScript and web bugs
'text/html', 'text/javascript', 'text/x-javascript', 'application/x-shellscript',
# PHP scripts may execute arbitrary code on the server
'application/x-php', 'text/x-php',
# Other types that may be interpreted by some servers
'text/x-python', 'text/x-perl', 'text/x-bash', 'text/x-sh', 'text/x-csh',
# Client-side hazards on Internet Explorer
'text/scriptlet', 'application/x-msdownload',
# Windows metafile, client-side vulnerability on some systems
'application/x-msmetafile',
);
/**
* Allow Java archive uploads.
* This is not recommended for public wikis since a maliciously-constructed
* applet running on the same domain as the wiki can steal the user's cookies.
*/
$wgAllowJavaUploads = false;
/**
* This is a flag to determine whether or not to check file extensions on upload.
*
* @warning Setting this to false is insecure for public wikis.
*/
$wgCheckFileExtensions = true;
/**
* If this is turned off, users may override the warning for files not covered
* by $wgFileExtensions.
*
* @warning Setting this to false is insecure for public wikis.
*/
$wgStrictFileExtensions = true;
/**
* Setting this to true will disable the upload system's checks for HTML/JavaScript.
*
* @warning THIS IS VERY DANGEROUS on a publicly editable site, so USE
* $wgGroupPermissions TO RESTRICT UPLOADING to only those that you trust
*/
$wgDisableUploadScriptChecks = false;
/**
* Warn if uploaded files are larger than this (in bytes), or false to disable
*/
$wgUploadSizeWarning = false;
/**
* list of trusted media-types and mime types.
* Use the MEDIATYPE_xxx constants to represent media types.
* This list is used by File::isSafeFile
*
* Types not listed here will have a warning about unsafe content
* displayed on the images description page. It would also be possible
* to use this for further restrictions, like disabling direct
* [[media:...]] links for non-trusted formats.
*/
$wgTrustedMediaFormats = array(
MEDIATYPE_BITMAP, //all bitmap formats
MEDIATYPE_AUDIO, //all audio formats
MEDIATYPE_VIDEO, //all plain video formats
"image/svg+xml", //svg (only needed if inline rendering of svg is not supported)
"application/pdf", //PDF files
#"application/x-shockwave-flash", //flash/shockwave movie
);
/**
* Plugins for media file type handling.
* Each entry in the array maps a MIME type to a class name
*/
$wgMediaHandlers = array(
'image/jpeg' => 'JpegHandler',
'image/png' => 'PNGHandler',
'image/gif' => 'GIFHandler',
'image/tiff' => 'TiffHandler',
'image/x-ms-bmp' => 'BmpHandler',
'image/x-bmp' => 'BmpHandler',
'image/x-xcf' => 'XCFHandler',
'image/svg+xml' => 'SvgHandler', // official
'image/svg' => 'SvgHandler', // compat
'image/vnd.djvu' => 'DjVuHandler', // official
'image/x.djvu' => 'DjVuHandler', // compat
'image/x-djvu' => 'DjVuHandler', // compat
);
/**
* Plugins for page content model handling.
* Each entry in the array maps a model id to a class name.
*
* @since 1.21
*/
$wgContentHandlers = array(
// the usual case
CONTENT_MODEL_WIKITEXT => 'WikitextContentHandler',
// dumb version, no syntax highlighting
CONTENT_MODEL_JAVASCRIPT => 'JavaScriptContentHandler',
// dumb version, no syntax highlighting
CONTENT_MODEL_CSS => 'CssContentHandler',
// plain text, for use by extensions etc
CONTENT_MODEL_TEXT => 'TextContentHandler',
);
/**
* Whether to enable server-side image thumbnailing. If false, images will
* always be sent to the client in full resolution, with appropriate width= and
* height= attributes on the <img> tag for the client to do its own scaling.
*/
$wgUseImageResize = true;
/**
* Resizing can be done using PHP's internal image libraries or using
* ImageMagick or another third-party converter, e.g. GraphicMagick.
* These support more file formats than PHP, which only supports PNG,
* GIF, JPG, XBM and WBMP.
*
* Use Image Magick instead of PHP builtin functions.
*/
$wgUseImageMagick = false;
/**
* The convert command shipped with ImageMagick
*/
$wgImageMagickConvertCommand = '/usr/bin/convert';
/**
* Sharpening parameter to ImageMagick
*/
$wgSharpenParameter = '0x0.4';
/**
* Reduction in linear dimensions below which sharpening will be enabled
*/
$wgSharpenReductionThreshold = 0.85;
/**
* Temporary directory used for ImageMagick. The directory must exist. Leave
* this set to false to let ImageMagick decide for itself.
*/
$wgImageMagickTempDir = false;
/**
* Use another resizing converter, e.g. GraphicMagick
* %s will be replaced with the source path, %d with the destination
* %w and %h will be replaced with the width and height.
*
* @par Example for GraphicMagick:
* @code
* $wgCustomConvertCommand = "gm convert %s -resize %wx%h %d"
* @endcode
*
* Leave as false to skip this.
*/
$wgCustomConvertCommand = false;
/**
* used for lossless jpeg rotation
*
* @since 1.21
*/
$wgJpegTran = '/usr/bin/jpegtran';
/**
* Some tests and extensions use exiv2 to manipulate the Exif metadata in some
* image formats.
*/
$wgExiv2Command = '/usr/bin/exiv2';
/**
* Scalable Vector Graphics (SVG) may be uploaded as images.
* Since SVG support is not yet standard in browsers, it is
* necessary to rasterize SVGs to PNG as a fallback format.
*
* An external program is required to perform this conversion.
* If set to an array, the first item is a PHP callable and any further items
* are passed as parameters after $srcPath, $dstPath, $width, $height
*/
$wgSVGConverters = array(
'ImageMagick' => '$path/convert -background white -thumbnail $widthx$height\! $input PNG:$output',
'sodipodi' => '$path/sodipodi -z -w $width -f $input -e $output',
'inkscape' => '$path/inkscape -z -w $width -f $input -e $output',
'batik' => 'java -Djava.awt.headless=true -jar $path/batik-rasterizer.jar -w $width -d '
. '$output $input',
'rsvg' => '$path/rsvg -w $width -h $height $input $output',
'imgserv' => '$path/imgserv-wrapper -i svg -o png -w$width $input $output',
'ImagickExt' => array( 'SvgHandler::rasterizeImagickExt' ),
);
/**
* Pick a converter defined in $wgSVGConverters
*/
$wgSVGConverter = 'ImageMagick';
/**
* If not in the executable PATH, specify the SVG converter path.
*/
$wgSVGConverterPath = '';
/**
* Don't scale a SVG larger than this
*/
$wgSVGMaxSize = 2048;
/**
* Don't read SVG metadata beyond this point.
* Default is 1024*256 bytes
*/
$wgSVGMetadataCutoff = 262144;
/**
* Disallow <title> element in SVG files.
*
* MediaWiki will reject HTMLesque tags in uploaded files due to idiotic
* browsers which can not perform basic stuff like MIME detection and which are
* vulnerable to further idiots uploading crap files as images.
*
* When this directive is on, "<title>" will be allowed in files with an
* "image/svg+xml" MIME type. You should leave this disabled if your web server
* is misconfigured and doesn't send appropriate MIME types for SVG images.
*/
$wgAllowTitlesInSVG = false;
/**
* The maximum number of pixels a source image can have if it is to be scaled
* down by a scaler that requires the full source image to be decompressed
* and stored in decompressed form, before the thumbnail is generated.
*
* This provides a limit on memory usage for the decompression side of the
* image scaler. The limit is used when scaling PNGs with any of the
* built-in image scalers, such as ImageMagick or GD. It is ignored for