This repository has been archived by the owner on Sep 11, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathLocalSettings.php
810 lines (675 loc) · 29.2 KB
/
LocalSettings.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
<?php
# Protect against web entry
if ( !defined( 'MEDIAWIKI' ) ) {
exit;
}
/** @see RedisBagOStuff for a ful explanation of these options. **/
$wgObjectCaches['redis'] = array(
'class' => 'RedisBagOStuff',
'servers' => array( '192.168.189.13:6379' )
);
# Set defaults for all wikis
$wgScriptPath = "/w";
$wgScriptExtension = ".php";
$wgUsePathInfo = true;
$wgArticlePath = "/wiki/$1";
$wgStylePath = "$wgScriptPath/skins";
$wgLogo = "$wgStylePath/common/images/wiki.png";
$wgFavicon = "/favicon.ico";
$wgDBtype = "mysql";
$wgDBserver = "db-local";
$wgDBprefix = "";
# Settings to tweak database performance
# http://www.mediawiki.org/wiki/Manual:$wgAntiLockFlags
$wgAntiLockFlags = ALF_NO_LINK_LOCK | ALF_NO_BLOCK_LOCK;
# http://www.mediawiki.org/wiki/Manual:$wgSQLMode
$wgSQLMode = null;
$wgDefaultSkin = "vector";
$wgVectorUseIconWatch = true;
$wgAllowUserCss = true;
$wgAllowUserJs = true;
$wgAllowSiteCSSOnRestrictedPages = true;
# Uncommnent this is Mediawiki is crashing and you need a stack trace
$wgShowExceptionDetails = true;
$wgShowSQLErrors = true;
#$wgDebugToolbar = true;
#$wgDebugLogFile = "/srv/www/mediawiki/tmp/debug-log";
#$wgDebugDumpSql = True;
# Set this value to put the Wiki in read-only mode for maintenance
#$wgReadOnly = "MediaWiki upgrade in process...";
#$wgSiteNotice = "in process...";
if ( ! $wgCommandLineMode ) {
$myInstance=$_SERVER['SERVER_NAME'];
} else {
$myInstance = getenv("MW_INSTANCE");
}
# Load the configuration for the wiki being requested
$my_config = $IP.'/LocalSettings/wiki/'.$myInstance.'.php';
$my_secrets = $IP.'/LocalSettings/secrets/'.$myInstance.'.php';
if (file_exists ($my_config) && file_exists($my_secrets)) {
include $my_secrets;
include $my_config;
} else {
# No configuration was found for this wiki, do something about that
echo "This request was sent to MediaWiki, and there is no configuration for $myInstance.\n";
exit(0);
}
# Skin specific extensions
require_once "$IP/skins/Vector/Vector.php";
if ( $wgDefaultSkin == 'filament' ) {
require_once($IP.'/skins/filament/filament.php');
}
if ( $wgDefaultSkin == 'foreground' ) {
require_once($IP.'/skins/foreground/foreground.php');
}
# set email addresses using the instance variable
$wgEmergencyContact = "admin@" . $myEmailDomain;
$wgPasswordSender = "admin@" . $myEmailDomain;
# Set upload directory per wiki
$wgUploadDirectory = "{$IP}/images/$myWikiToken";
$wgUploadPath = "/w/images/$myWikiToken";
# Override the cookie names, I don't like database tokens in there
$wgCookiePrefix = $myWikiToken;
# Allow microdata
$wgAllowMicrodataAttributes = true;
# Set miser mode for a little more speed
# This depends on running updateSpecialPages which is done every day at 10:05p via cron
$wgMiserMode = true;
# Set domains that we do want search engines to follow. This is global for all wikis and includes
# subdomains of each domain.
# TODO: This needs to be moved to the site configurations!
# consider just setting $wgNoFollowLinks to false
$wgNoFollowDomainExceptions = array( 'roadsignmath.com',
'mediawiki.org', 'semantic-mediawiki.org', 'wikiquote.org',
'wikipedia.org', 'wiktionary.org', 'thingelstad.com', 'jjt.me',
'creativecommons.org', 'flickr.com', 'eff.org', 'pinboard.in',
'wikinosh.com' );
# Enable subpages
# User namespace and all talk namespaces are enabled by default
$wgNamespacesWithSubpages[NS_MAIN] = true;
$wgNamespacesWithSubpages[NS_PROJECT] = true;
$wgNamespacesWithSubpages[NS_TEMPLATE] = true;
# Set global job run rate, this should be done out of process with RunJobs
$wgJobRunRate = 0;
## UPO means: this is also a user preference option
$wgEnableEmail = true;
$wgEnableUserEmail = true; # UPO
$wgEnotifUserTalk = true; # UPO
$wgEnotifWatchlist = true; # UPO
$wgEmailAuthentication = true;
# Use the job queue to batch and send emails
$wgEnotifUseJobQ = true;
# Require email authentication before someone can edit
$wgEmailConfirmToEdit = true;
# MySQL table options to use during installation or update
$wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=binary";
$wgDBmysql5 = true;
$wgDBtransactions = true;
## Shared memory settings
$wgMainCacheType = 'redis';
$wgSessionCacheType = 'redis';
$wgSessionsInObjectCache = true;
$wgEnableParserCache = true;
$wgParserCacheExpireTime = 60 * 60;
# Job queue in redis
/*
$wgJobTypeConf['default'] = array(
'class' => 'JobQueueRedis',
'redisServer' => '192.168.189.13:6379',
'redisConfig' => array(),
'claimTTL' => 3600
);
*/
## To enable image uploads, make sure the 'images' directory
## is writable, then set this to true:
$wgEnableUploads = true;
$wgUseImageMagick = true;
$wgImageMagickConvertCommand = "/usr/bin/convert";
$wgMaxShellMemory = 409600;
$wgSVGConverter = 'ImageMagick';
## allow uploading from a URL
$wgGroupPermissions['autoconfirmed']['upload_by_url'] = true;
$wgAllowCopyUploads = true;
$wgVerifyMimeType = false;
$wgFileExtensions = array_merge($wgFileExtensions, array('svg', 'pdf', 'eps', 'ai', 'psd', 'graffle', 'zip', 'kml', 'kmz', 'mp3', 'm4v', 'mp4', 'm4a', 'mov', 'wav', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'key', 'pages', 'gz', 'tgz', 'numbers', 'ttf', 'eot', 'gpx', 'otf', 'woff', 'csv' ) );
if ($myLocalTime) {
#Set Default Timezone to localtime
$wgLocaltimezone = "America/Chicago";
$oldtz = getenv("TZ");
putenv("TZ=$wgLocaltimezone");
# Versions before 1.7.0 used $wgLocalTZoffset as hours.
# After 1.7.0 offset as minutes
$wgLocalTZoffset = date("Z") / 60;
putenv("TZ=$oldtz");
# Set date formatting to American
$wgAmericanDates = true;
} else {
$wgLocaltimezone = "UTC";
$oldtz = getenv("TZ");
putenv("TZ=$wgLocaltimezone");
$wgLocalTZoffset = date("Z") / 60;
putenv("TZ=$oldtz");
$wgAmericanDates = false;
}
# InstantCommons allows wiki to use images from http://commons.wikimedia.org
# Some of my wikis use it
switch ($myInstance) {
case "wiki.planetkubb.com":
case "roadsignmath.com":
case "wikinosh.com":
case "bodwiki.com":
$wgUseInstantCommons = true;
break;
default:
$wgUseInstantCommons = false;
}
## If you use ImageMagick (or any other shell command) on a
## Linux server, this will need to be set to the name of an
## available UTF-8 locale
$wgShellLocale = "en_US.utf8";
## If you have the appropriate support software installed
## you can enable inline LaTeX equations:
# In Mediawiki 1.18.0 this was moved out of trunk, we need an extension for it now
# http://www.mediawiki.org/wiki/Extension:Math
require_once("$IP/extensions/Math/Math.php");
$wgUseMathJax = true;
$wgDefaultUserOptions['math'] = MW_MATH_MATHJAX; // setting MathJax as default rendering option (optional)
#'/srv/www/mediawiki/public_html/w/extensions/Math/math/texvc';
## Set $wgCacheDirectory to a writable directory on the web server
## to make your wiki go slightly faster. The directory should not
## be publically accessible from the web.
$wgCacheDirectory = "/srv/www/mediawiki/cache/$myWikiToken/";
# $wgUseFileCache = true;
# $wgFileCacheDirectory = "{$wgCacheDirectory}/html";
$wgUseETag = true;
$wgCachePages = true;
# Disabling counters, front end caching in nginx makes it incorrect
$wgDisableCounters = true;
$wgUseGzip = true;
$wgEnableSidebarCache = true;
# Site language code, should be one of ./languages/Language(.*).php
$wgLanguageCode = "en";
## For attaching licensing metadata to pages, and displaying an
## appropriate copyright notice / icon. GNU Free Documentation
## License and Creative Commons licenses are supported so far.
switch ($myInstance) {
case "wiki.thingelstad.com":
case "scrapbook.thingelstad.com":
# These wikis are not for sharing
$wgRightsPage = ""; # Set to the title of a wiki page that describes your license/copyright
$wgRightsUrl = "";
$wgRightsText = "";
$wgRightsIcon = "";
# $wgRightsCode = ""; # Not yet used
break;
case "wiki.minnestar.org":
# $wgEnableCreativeCommonsRdf = true;
$wgRightsPage = ""; # Set to the title of a wiki page that describes your license/copyright
$wgRightsUrl = "http://creativecommons.org/licenses/by-nc/3.0/us/";
$wgRightsText = "Creative Commons Attribution-NonCommercial 3.0 United States License";
$wgRightsIcon = "http://i.creativecommons.org/l/by-nc/3.0/us/88x31.png";
# $wgRightsCode = ""; # Not yet used
# If using CC we need to include this extension. This was moved out
# of core in 1.18.0
# require_once("$IP/extensions/CreativeCommonsRdf/CreativeCommonsRdf.php");
break;
default:
# Default is CC-BY_SA
# $wgEnableCreativeCommonsRdf = true;
$wgRightsPage = ""; # Set to the title of a wiki page that describes your license/copyright
$wgRightsUrl = "http://creativecommons.org/licenses/by-sa/3.0/";
$wgRightsText = "Creative Commons Attribution Share Alike";
$wgRightsIcon = "{$wgStylePath}/common/images/cc-by-sa.png";
# $wgRightsCode = ""; # Not yet used
# If using CC we need to include this extension. This was moved out
# of core in 1.18.0
# require_once("$IP/extensions/CreativeCommonsRdf/CreativeCommonsRdf.php");
}
# Path to the GNU diff3 utility. Used for conflict resolution.
$wgDiff = "/usr/bin/diff";
$wgDiff3 = "/usr/bin/diff3";
$wgShowIPinHeader = false;
$wgMinimalPasswordLength = 8;
# Set permissions for the wiki
# Default case is that anonymous users cannot edit, but can register
switch ($myInstance) {
case "rwbookclub.com":
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['*']['delete'] = false;
$wgGroupPermissions['*']['createaccount'] = false;
$wgGroupPermissions['bot']['upload_by_url'] = true;
$wgGroupPermissions['Alumni'] = $wgGroupPermissions['user'];
break;
case "roadsignmath.com":
# Disable anonymous editing
$wgGroupPermissions['*']['edit'] = false;
# Create group for elevated permissions
$wgRestrictionLevels[] = 'editors';
$wgGroupPermissions['editors']['autopatrol'] = true;
$wgGroupPermissions['editors']['autoconfirmed'] = true;
$wgGroupPermissions['editors']['skipcaptcha'] = true;
$wgGroupPermissions['editors']['editors'] = true;
$wgGroupPermissions['editors']['replacetext'] = true;
$wgGroupPermissions['editors']['suppressredirect'] = true;
$wgGroupPermissions['editors']['delete'] = true;
# Make sure sysop are granted these rights as well
$wgGroupPermissions['sysop']['editors'] = true;
break;
case "scrapbook.thingelstad.com":
# You must be registered to even see this wiki, private
$wgGroupPermissions['*']['read'] = false;
case "wiki.thingelstad.com":
# Permit only registered users to edit and add users
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['*']['delete'] = false;
$wgGroupPermissions['*']['createaccount'] = false;
break;
case "filament.thingelstad.com":
# Permit only registered users to edit and add users
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['*']['delete'] = false;
$wgGroupPermissions['*']['createaccount'] = false;
# Setup editor group
$wgGroupPermissions['editors']['autopatrol'] = true;
$wgGroupPermissions['editors']['autoconfirmed'] = true;
$wgGroupPermissions['editors']['skipcaptcha'] = true;
$wgGroupPermissions['editors']['editors'] = true;
$wgGroupPermissions['editors']['replacetext'] = true;
break;
case "wiki.minnestar.org":
$wgGroupPermissions['board']['board-edit'] = true; // allow members of board group to edit pages in Board namespace
$wgGroupPermissions['*']['board-talk-edit'] = true; // allow any registered user to edit talk pages for board space
break;
case "wikiapiary.com":
# Disable anonymous editing
$wgGroupPermissions['*']['edit'] = false;
# Create new restriction levels for protecting pages
$wgRestrictionLevels[] = 'editors';
$wgRestrictionLevels[] = 'operators';
# Regular users
$wgGroupPermissions['user']['move'] = false;
# Trusted users
$wgGroupPermissions['trusted-users']['autopatrol'] = true;
$wgGroupPermissions['trusted-users']['autoconfirmed'] = true;
$wgGroupPermissions['trusted-users']['skipcaptcha'] = true;
# Setup editor group
$wgGroupPermissions['editors']['autopatrol'] = true;
$wgGroupPermissions['editors']['autoconfirmed'] = true;
$wgGroupPermissions['editors']['skipcaptcha'] = true;
$wgGroupPermissions['editors']['editors'] = true;
$wgGroupPermissions['editors']['replacetext'] = true;
$wgGroupPermissions['editors']['delete'] = true;
$wgGroupPermissions['editors']['move'] = true;
$wgGroupPermissions['editors']['suppressredirect'] = true;
# Setup operator group
$wgGroupPermissions['operators']['autopatrol'] = true;
$wgGroupPermissions['operators']['operators'] = true;
$wgGroupPermissions['operators']['suppressredirect'] = true;
# Make sure sysop are granted these rights as well
$wgGroupPermissions['sysop']['editors'] = true;
$wgGroupPermissions['sysop']['operators'] = true;
break;
case "wiki.planetkubb.com":
case "foreground.thingelstad.com":
# Disable anonymous editing
$wgGroupPermissions['*']['edit'] = false;
# Create new restriction levels for protecting pages
$wgRestrictionLevels[] = 'editors';
$wgRestrictionLevels[] = 'coders';
# Autochecked users
$wgGroupPermissions['trusted-users']['autopatrol'] = true;
$wgGroupPermissions['trusted-users']['autoconfirmed'] = true;
$wgGroupPermissions['trusted-users']['skipcaptcha'] = true;
# Setup editor group
$wgGroupPermissions['editors']['autopatrol'] = true;
$wgGroupPermissions['editors']['autoconfirmed'] = true;
$wgGroupPermissions['editors']['skipcaptcha'] = true;
$wgGroupPermissions['editors']['editors'] = true;
$wgGroupPermissions['editors']['replacetext'] = true;
$wgGroupPermissions['editors']['suppressredirect'] = true;
$wgGroupPermissions['editors']['delete'] = true;
# Setup editor group
$wgGroupPermissions['Coders']['coders'] = true;
# Make sure sysop are granted these rights as well
$wgGroupPermissions['sysop']['editors'] = true;
$wgGroupPermissions['sysop']['coders'] = true;
break;
default:
$wgGroupPermissions['*']['edit'] = false;
}
# Query string length limit for ResourceLoader. You should only set this if
# your web server has a query string length limit (then set it to that limit),
# or if you have suhosin.get.max_value_length set in php.ini (then set it to
# that value)
$wgResourceLoaderMaxQueryLength = -1;
# Enable adminlinks
include_once("$IP/extensions/AdminLinks/AdminLinks.php");
# There may be some SMW specific config we need to deal with
$smwgRSSWithPages = false; # In RSS feeds only display the link, don't encode the content of the wiki page
$smwgAdminRefreshStore = false; # Do not allow a refresh to be requested via the web interface
$smwgPageSpecialProperties[] = '_CDAT';
$smwgPageSpecialProperties[] = '_LEDT';
$smwgQUpperbound = 30000;
$smwgQMaxLimit = 30000;
$smwgQueryProfiler = array(
'smwgQueryDurationEnabled' => true,
);
# TODO: Commenting this out, seems to put too much stress on redis and cause it to crash
#$smwgValueLookupCacheType = 'redis';
switch ($myInstance) {
case "rwbookclub.com":
$smwgNamespacesWithSemanticLinks[NS_MEETING] = true;
$smwgQEqualitySupport = SMW_EQ_NONE;
break;
case "wikiapiary.com":
$sfgAutoCreateUser = 'Bumble Bee';
$smwgQEqualitySupport = SMW_EQ_NONE;
$smwgNamespacesWithSemanticLinks[NS_EXTENSION] = true;
$smwgNamespacesWithSemanticLinks[NS_FARM] = true;
$smwgNamespacesWithSemanticLinks[NS_SKIN] = true;
#$smwgNamespacesWithSemanticLinks[NS_ISSUE] = true;
$smwgNamespacesWithSemanticLinks[NS_GENERATOR] = true;
$smwgNamespacesWithSemanticLinks[NS_HOST] = true;
$smwgNamespacesWithSemanticLinks[NS_LIBRARY] = true;
# Set Semantic Tags configuration
$GLOBALS['smtgTagsPropertyFallbackUsage'] = true;
$GLOBALS['smtgTagsProperties'] = array(
// Standard meta tags
'keywords' => 'Has tag',
'description' => array('Has description', 'Has tagline'),
'author' => 'Page author',
// Twitter Cards
'twitter:title' => 'Has name',
'twitter:image' => 'Has image URL',
'twitter:description' => array('Has description', 'Has tagline'),
// Open Graph protocol supported tags
'og:title' => 'Has name',
'og:image' => 'Has image URL',
'og:description' => array('Has description', 'Has tagline'),
);
$GLOBALS['smtgTagsStrings'] = array(
// Static tags
'twitter:card' => 'summary',
'twitter:site' => '@WikiApiary',
'og:site_name' => 'WikiApiary'
);
break;
case "tosredux.org":
$smwgNamespacesWithSemanticLinks[NS_ORGANIZATION] = true;
$smwgNamespacesWithSemanticLinks[NS_TOPIC] = true;
break;
case "wiki.planetkubb.com":
$sfgAutoCreateUser = 'KubbBot';
$smwgNamespacesWithSemanticLinks[NS_PLAYER] = true;
$smwgNamespacesWithSemanticLinks[NS_TEAM] = true;
$smwgNamespacesWithSemanticLinks[NS_GAME] = true;
$smwgNamespacesWithSemanticLinks[NS_CLUB] = true;
$smwgNamespacesWithSemanticLinks[NS_EVENT] = true;
#$smwgNamespacesWithSemanticLinks[NS_ISSUE] = true;
break;
case "wiki.minnestar.org":
$sfgAutoCreateUser = 'Minnebot';
$smwgNamespacesWithSemanticLinks[NS_BOARD] = true;
break;
}
enableSemantics("$myInstance");
# Now with composer: require_once( "$IP/extensions/SemanticExtraSpecialProperties/SemanticExtraSpecialProperties.php" );
$GLOBALS['sespSpecialProperties'] = array(
'_PAGEID', // Let's get a Page ID
'_CUSER', // Creating user
'_EUSER', // All contributing users
'_NREV', // Number of revisions to page
'_TNREV', // Number of revisions to talk page
'_SUBP', // Add properties for subpages as well
'_USERREG' // Add the date the user registered
);
$sespUseAsFixedTables = True; // Use fixed properties
$wgSESPExcludeBots = true; // Exclude bots from user stuff, except for creating user
$wgUseAjax = true;
include_once("$IP/extensions/SemanticForms/SemanticForms.php");
#$sfgRenameEditTabs = true;
$sfgRenameMainEditTab = true;
require_once("$IP/extensions/SemanticFormsInputs/SemanticFormsInputs.php");
$sdgNamespaceIndex = 170;
$srfgArraySep = "\n";
$srfgArrayPropSep = ',';
# Enable Semantic Compound Queries
include_once( "$IP/extensions/SemanticCompoundQueries/SemanticCompoundQueries.php" );
include_once("$IP/extensions/ExternalData/ExternalData.php");
switch ($myInstance) {
case "wikiapiary.com":
$edgDBServer['apiary'] = "db-local";
$edgDBServerType['apiary'] = "mysql";
$edgDBName['apiary'] = "apiary";
$edgDBUser['apiary'] = "apiary";
$edgDBPass['apiary'] = $SECRET_EXTDATADBPASSWORD;
break;
}
require_once("$IP/extensions/ApprovedRevs/ApprovedRevs.php");
include_once("$IP/extensions/DataTransfer/DataTransfer.php");
require_once("$IP/extensions/ReplaceText/ReplaceText.php" );
require_once( "$IP/extensions/Arrays/Arrays.php" );
# HashTables
require_once( "$IP/extensions/HashTables/HashTables.php" );
# Loops
require_once( "$IP/extensions/Loops/Loops.php" );
ExtLoops::$maxLoops = 1000;
# Bundled in core in 1.23
require_once("$IP/extensions/CSS/CSS.php");
require_once("$IP/extensions/ParserFunctions/ParserFunctions.php" );
$wgPFEnableStringFunctions = true;
# Regex Fun
require_once( "$IP/extensions/RegexFun/RegexFun.php" );
require_once( "$IP/extensions/Variables/Variables.php" );
$wgVectorFeatures['vector-collapsiblenav']['global'] = true;
$wgVectorFeatures['expandablesearch']['global'] = false;
$wgVectorUseSimpleSearch = true;
require_once("$IP/extensions/Nuke/Nuke.php");
# We only load these spam prevention extensions if the wiki allows open registration
# Wikis that are invite only don't really need this.
# TODO: Move to a module
function DenyRegistrationByEmail( $user, &$message ) {
$emailAddr = $user->getEmail();
if (preg_match( '/@yopmail\.com$/', $emailAddr ) OR
preg_match( '/@mailinator\.com$/', $emailAddr ) OR
preg_match( '/@emailmiser\.com$/', $emailAddr ) ) {
$message = 'The email address ' . $emailAddr . ' is banned on this wiki. Please register with a different address.';
return false;
}
return true;
}
function DenyRegistrationByUsername( $user, &$message ) {
$username = $user->getName();
if (preg_match( '/^Rayban/', $username ) OR preg_match( '/^Oakley/', $username ) ) {
$message = 'The username ' . $username . ' is banned on this wiki.';
return false;
}
return true;
}
if ( !$myClosedWiki) {
# Block certain email addresses from registering
$wgHooks['AbortNewAccount'][] = 'DenyRegistrationByEmail';
$wgHooks['AbortNewAccount'][] = 'DenyRegistrationByUsername';
# main thing to deal with spammers
require_once( "$IP/extensions/ConfirmEdit/ConfirmEdit.php" );
require_once("$IP/extensions/ConfirmEdit/QuestyCaptcha.php");
$wgCaptchaClass = 'QuestyCaptcha';
# Set number question for questy
# sudo pear install channel://pear.php.net/Numbers_Words-0.16.2
# http://pear.php.net/package-info.php?package=Numbers_Words
require_once("Numbers/Words.php");
$myChallengeNumber = rand(0, 899999999) + 100000000;
$myChallengeString = (string)$myChallengeNumber;
$num_words = new Numbers_Words();
$myChallengeStringLong = $num_words->toWords($myChallengeNumber);
$myChallengeIndex = rand(0, 8) + 1;
$myChallengePositions = array (
'first',
'second',
'third',
'fourth',
'fifth',
'sixth',
'seventh',
'eighth',
'ninth'
);
$myChallengePositionName = $myChallengePositions[$myChallengeIndex - 1];
$wgCaptchaQuestions[] = array (
'question' => "What is the $myChallengePositionName digit of the number <strong>$myChallengeStringLong</strong>?",
'answer' => $myChallengeString[$myChallengeIndex - 1]
);
# $wgCaptchaQuestions[] = array( 'question' => "", 'answer' => "" );
# Skip CAPTCHA for people who have confirmed emails
$wgGroupPermissions['emailconfirmed']['skipcaptcha'] = true;
$ceAllowConfirmedEmail = true;
}
# Setup the contact page extension
require_once( "$IP/extensions/ContactPage/ContactPage.php" );
$wgContactConfig['default'] = array(
'RecipientUser' => 'thingles', // Must be the name of a valid account
'SenderEmail' => $wgPasswordSender,
'SenderName' => $wgSitename . ' contact form', // "Contact Form on" needs to be localised
'RequireDetails' => true,
'IncludeIP' => true,
'AdditionalFields' => array(
'Text' => array(
'label-message' => 'emailmessage',
'type' => 'textarea',
'rows' => 20,
'cols' => 80,
'required' => true,
),
),
);
# Now lets put a link in the bottom to the contact page
# docs on this at http://www.mediawiki.org/wiki/Manual:Footer
$wgHooks['SkinTemplateOutputPageBeforeExec'][] = 'lfFeedbackLink';
function lfFeedbackLink( $sk, &$tpl ) {
$tpl->set( 'feedback', $sk->footerLink( 'feedback', 'feedbackpage' ) );
$tpl->data['footerlinks']['places'][] = 'feedback';
return true;
}
require_once("$IP/extensions/UserMerge/UserMerge.php" );
$wgGroupPermissions['bureaucrat']['usermerge'] = true;
$wgUserMergeProtectedGroups = array( 'sysop' );
require_once("$IP/extensions/Number2Words/Number2Words.php");
require_once("$IP/extensions/ParseURL/ParseURL.php");
# Add HeaderTabs
# http://www.mediawiki.org/wiki/Extension:Header_Tabs
# First declare some configuration params
require_once("$IP/extensions/HeaderTabs/HeaderTabs.php");
$htRenderSingleTab = true;
$htEditTabLink = false;
require_once("$IP/extensions/Poem/Poem.php");
require_once("$IP/extensions/Interwiki/Interwiki.php");
$wgGroupPermissions['*']['interwiki'] = false;
$wgGroupPermissions['sysop']['interwiki'] = true;
require_once("$IP/extensions/Cite/Cite.php");
require_once("$IP/extensions/DynamicPageList/DynamicPageList.php");
require_once("{$IP}/extensions/CategoryTree/CategoryTree.php");
$wgCategoryTreeMaxDepth = array(CT_MODE_PAGES => 2, CT_MODE_ALL => 2, CT_MODE_CATEGORIES => 5);
# enable more robust PDF handling
# DISABLE due to bug when using 1.21
# https://bugzilla.wikimedia.org/show_bug.cgi?id=48834
require_once("$IP/extensions/PdfHandler/PdfHandler.php");
$wgPdfProcessor = 'gs';
$wgPdfPostProcessor = $wgImageMagickConvertCommand;
$wgPdfInfo = 'pdfinfo';
require_once( "$IP/extensions/Gadgets/Gadgets.php" );
require_once( "$IP/extensions/WikiEditor/WikiEditor.php" );
$wgDefaultUserOptions['usebetatoolbar'] = 1;
$wgDefaultUserOptions['usebetatoolbar-cgd'] = 1;
$wgDefaultUserOptions['wikieditor-preview'] = 1;
require_once("$IP/extensions/Renameuser/Renameuser.php");
require_once("$IP/extensions/InputBox/InputBox.php");
require_once( "$IP/extensions/MyVariables/MyVariables.php" );
if ( !$myClosedWiki) {
# Activate NewUserMessage
# https://www.mediawiki.org/wiki/Extension:NewUserMessage
# http://wikiapiary.com/wiki/Extension:NewUserMessage
require_once( "$IP/extensions/NewUserMessage/NewUserMessage.php" );
}
# Activate UrlGetParameters
# http://www.mediawiki.org/wiki/Extension:UrlGetParameters
# http://wikiapiary.com/wiki/Extension:UrlGetParameters
require_once( "$IP/extensions/UrlGetParameters/UrlGetParameters.php" );
require_once("$IP/extensions/Widgets/Widgets.php");
$wgGroupPermissions['sysop']['editwidgets'] = true;
# Enable NOCACHE magic word extension
# http://www.mediawiki.org/wiki/Extension:MagicNoCache
require_once("$IP/extensions/MagicNoCache/MagicNoCache.php");
$wgFooterIcons['servedby']['linode'] = array(
"src" => "/served-by-linode.png",
"url" => "http://www.linode.com/?r=d246dc8e9e305eefce68376a1a7a0b3e73dfa992",
"alt" => "Served by Linode",
);
$wgFooterIcons['servedby']['mariadb'] = array(
"src" => "/mariadb-badge-88x31.png",
"url" => "https://mariadb.org",
"alt" => "Powered by MariaDB",
);
# If a WikiApiary URL is set, add it to the footer
if (isset($myWikiApiaryURL)) {
$wgFooterIcons['monitoredby']['wikiapiary'] = array(
"src" => "https://wikiapiary.com/w/images/wikiapiary/b/b4/Monitored_by_WikiApiary.png",
"url" => "$myWikiApiaryURL?pk_campaign=FooterIcon&pk_kwd=$myInstance",
"alt" => "Monitored by WikiApiary"
);
}
require_once("$IP/extensions/ApiSandbox/ApiSandbox.php");
# Enable Echo notifications
require_once( "$IP/extensions/Echo/Echo.php" );
$wgEchoUseJobQueue = True;
require_once( "$IP/extensions/Thanks/Thanks.php" );
# Enable the Thank interface for bot edits (disabled by default)
$wgThanksSendToBots = true;
require_once("$IP/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php");
require_once( "$IP/extensions/CodeEditor/CodeEditor.php" );
require_once("$IP/extensions/Disambiguator/Disambiguator.php");
# Enable Lua scripting
# TODO: PK wiki currently uses the 828/829 namespaces. Scribunto is hardcoded to use those namespaces.
if ($myWikiToken != 'planetkubb') {
require_once( "$IP/extensions/Scribunto/Scribunto.php" );
$wgScribuntoDefaultEngine = 'luastandalone';
$wgScribuntoUseGeSHi = true;
$wgScribuntoUseCodeEditor = true;
}
# Only enable this when needed
require_once("$IP/extensions/BlockandNuke/BlockandNuke.php");
#$wgWhitelist = "$IP/extensions/BlockandNuke/whitelist.txt";
$wgWhitelist = "http://wikinosh.com/w/extensions/BlockandNuke/whitelist.txt";
$wgBaNSpamUser = "Spammer";
# ParserHooks
# required by SubPageList
require_once( "$IP/extensions/ParserHooks/ParserHooks.php" );
# SubPageList
require_once( "$IP/extensions/SubPageList/SubPageList.php" );
# pChart
require_once( "$IP/extensions/pChart4mw/pChart4mw.php" );
require_once( "$IP/extensions/Babel/Babel.php" );
require_once( "$IP/extensions/cldr/cldr.php" );
require_once( "$IP/extensions/CleanChanges/CleanChanges.php" );
$wgCCTrailerFilter = true;
$wgCCUserFilter = false;
$wgDefaultUserOptions['usenewrc'] = 1;
# Turn i18 tags into real words
require_once( "$IP/extensions/I18nTags/I18nTags.php" );
# Translate extension setup
require_once( "$IP/extensions/Translate/Translate.php" );
$wgGroupPermissions['translator']['translate'] = true;
$wgGroupPermissions['user']['translate'] = true;
$wgGroupPermissions['user']['translate-messagereview'] = true;
$wgGroupPermissions['user']['translate-groupreview'] = true;
$wgGroupPermissions['user']['translate-import'] = true;
$wgGroupPermissions['sysop']['pagetranslation'] = true;
$wgGroupPermissions['sysop']['translate-manage'] = true;
$wgTranslateDocumentationLanguageCode = 'qqq';
$wgExtraLanguageNames['qqq'] = 'Message documentation'; # No linguistic content. Used for documenting messages
require_once( "$IP/extensions/UniversalLanguageSelector/UniversalLanguageSelector.php" );
# Localisation Update (part of MLEB)
require_once( "$IP/extensions/LocalisationUpdate/LocalisationUpdate.php" );
$wgLocalisationUpdateDirectory = "$IP/cache";
# Activate Semantic Rating
require_once( "$IP/extensions/SemanticRating/SemanticRating.php" );
# END