This repository has been archived by the owner on Nov 16, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
LocalSettings.php
281 lines (237 loc) · 8.77 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
<?php
# Protect against web entry
if ( !defined( 'MEDIAWIKI' ) ) {
exit;
}
## Uncomment this to disable output compression
# $wgDisableOutputCompression = true;
## The URL base path to the directory containing the wiki;
## defaults for all runtime URL paths are based off of this.
## For more information on customizing the URLs
## (like /w/index.php/Page_title to /wiki/Page_title) please see:
## http://www.mediawiki.org/wiki/Manual:Short_URL
$wgScriptPath = "";
$wgScriptExtension = ".php";
$wgArticlePath = "/wiki/$1";
$wgUsePathInfo = true;
## The relative URL path to the skins directory
$wgStylePath = "$wgScriptPath/skins";
## The relative URL path to the logo. Make sure you change this from the default,
## or else you'll overwrite your logo when you upgrade!
$wgLogo = "$wgStylePath/common/images/wiki.png";
## UPO means: this is also a user preference option
$wgEnableEmail = true;
$wgEnableUserEmail = true; # UPO
$wgEmergencyContact = "[email protected]";
$wgEnotifUserTalk = false; # UPO
$wgEnotifWatchlist = false; # UPO
$wgEmailAuthentication = true;
## Database settings
$wgDBtype = "mysql";
$wgDBserver = "localhost";
require_once( __DIR__ . '/LocalSettings_private.php' );
# MySQL specific settings
$wgDBprefix = "";
# MySQL table options to use during installation or update
$wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=binary";
# Experimental charset support for MySQL 5.0.
$wgDBmysql5 = false;
## Shared memory settings
$wgMainCacheType = CACHE_MEMCACHED;
$wgMemCachedServers = array( "127.0.0.1:11211" );
## 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 = "$IP/cache";
# Site language code, should be one of the list in ./languages/Names.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.
$wgRightsUrl = "http://creativecommons.org/licenses/by-sa/3.0/";
$wgRightsText = "a Creative Commons Attribution-ShareAlike 3.0 license";
$wgRightsIcon = "http://meta.brickimedia.org/skins/common/images/cc-by-sa.png";
# Path to the GNU diff3 utility. Used for conflict resolution.
$wgDiff3 = "/usr/bin/diff3";
# 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 = 512;
# PROJECT CONFIGURATION
if( $wgCommandLineMode ) {
$_SERVER["SERVER_NAME"] = getenv("WIKI") . ".brickimedia.org";
$_SERVER["HTTP_HOST"] = getenv("WIKI") . ".brickimedia.org";
} else {
$_SERVER["SERVER_NAME"] = $_SERVER["HTTP_HOST"];
}
$bmSmallWiki = false; // overridden when needed
$host = explode( ".", $_SERVER["HTTP_HOST"] );
switch ( $host[0] ) {
case "meta":
$ls_path = "LocalSettings_meta.php";
$bmProject = "meta";
$wgServer = "http://meta.brickimedia.org";
$wgDBname = "meta";
break;
case "en":
$ls_path = "LocalSettings_en.php";
$bmProject = "en";
$wgServer = "http://en.brickimedia.org";
$wgDBname = "en";
break;
case "greatballcontraption":
case "gbc":
$ls_path = "LocalSettings_gbc.php";
$bmProject = "gbc";
$wgServer = "http://greatballcontraption.com";
$wgDBname = "gbc";
$bmSmallWiki = true;
if ( $host[1] === "brickimedia" ) {
header( "Location: http://greatballcontraption.com{$_SERVER['REQUEST_URI']}" );
}
break;
default:
header( "Location: http://www.brickimedia.org/notfound.html" );
exit( 0 );
break;
}
//SiteConfiguration - this is for GlobaUsage
$bmAllProjects = array( 'meta', 'en', 'gbc' );
$wgLocalDatabases = $bmAllProjects;
$wgConf->wikis = $wgLocalDatabases;
function wikiCallback( SiteConfiguration $conf, $wiki ){
return array(
'suffix' => $wiki,
'lang' => 'en', // all wikis en atm
'params' => array(
'lang' => 'en', // all wikis en atm
'site' => $wiki,
'wiki' => $wiki,
),
);
}
$wgConf->siteParamsCallback = 'wikiCallback';
$wgConf->settings = array(
'wgArticlePath' => array(
'default' => '/wiki/$1'
),
'wgServer' => array(
'meta' => 'http://meta.brickimedia.org',
'en' => 'http://en.brickimedia.org',
'gbc' => 'http://gbc.brickimedia.org',
)
);
//GLOBAL TABLES
$wgSharedDB = 'shared';
$wgSharedTables = array(
'user',
'global_user_groups',
'interwiki',
'user_profile',
'user_properties',
'user_relationship',
'user_relationship_request',
'abuse_filter',
'abuse_filter_action',
'abuse_filter_history',
'abuse_filter_log',
'spoofuser',
'sites'
);
// SKINS
wfLoadSkin( 'Refreshed' );
$wgDefaultSkin = 'refreshed';
function showRefreshedAdvert( &$footerExtra ) {
$footerExtra = '
<div id="advert">
<p>' . wfMessage( 'refreshed-advert' )->plain() . '</p>
<iframe height="90" width="728" src="/showAdSenseAds.php?size=728" frameborder="0" allowtransparency="true" scrolling="no"></iframe>
</div>';
return true;
}
$wgHooks['RefreshedFooter'][] = 'showRefreshedAdvert';
$refreshedImagePath = "$wgStylePath/Refreshed/refreshed/images";
$refreshedMeta = "<img src=\"$refreshedImagePath/brickimedia.svg\" width=\"144\" height=\"30\" alt=\"Meta\" />";
$refreshedEn = "<img src=\"$refreshedImagePath/brickipedia.svg\" width=\"144\" height=\"30\" alt=\"Brickipedia\" />";
$refreshedGBC = "<img src=\"$refreshedImagePath/gbc.svg\" width=\"140\" height=\"40\" alt=\"Great Ball Contraption Wiki\" />";
require_once( "$IP/skins/Custard/Custard.php" );
require_once( "$IP/skins/Lia/Lia.php");
$wgSkipSkin = "custard"; //hiding it from user prefs until it's working
// GLOBAL USER RIGHTS
$wgGroupPermissions['*']['edit'] = true;
$wgGroupPermissions['user']['edit'] = true;
$wgGroupPermissions['*']['createaccount'] = true;
// IMAGE CONFIGURATION
// Thumbnailing
$wgUseImageMagick = true;
$wgImageMagickConvertCommand = "/usr/bin/convert";
$wgShellLocale = "en_US.utf8";
$wgTmpDirectory = '/var/www/images/temp';
// Uploading to meta
$wgUseSharedUploads = true;
$wgSharedUploadPath = 'http://images.brickimedia.org';
$wgSharedUploadDirectory = '/var/www/images';
$wgHashedSharedUploadDirectory = true;
$wgUploadDirectory = '/var/www/images'; // these 2 must also be set for SocialProfile
$wgUploadPath = 'http://images.brickimedia.org';
// Fetching images from meta
if ( $bmProject != 'meta' ) { // don't want this on meta, otherwise it thinks it has 2 versions of all files
$wgFetchCommonsDescriptions = true;
$wgSharedUploadDBname = 'meta';
$wgSharedUploadDBprefix = '';
$wgRepositoryBaseUrl = "http://meta.brickimedia.org/wiki/File:";
}
// Special:Upload links to meta
$wgUploadNavigationUrl = "http://meta.brickimedia.org/wiki/Special:Upload";
$wgUploadMissingFileUrl = "http://meta.brickimedia.org/wiki/Special:Upload";
// And redirects to meta from other projects
function redirectSpecialsToMeta( &$title, &$article, &$output, &$user, $request, $mediaWiki ) {
global $bmProject;
if (
(
$title->isSpecial( 'Upload' ) ||
$title->isSpecial( 'UploadAvatar' )
) &&
$bmProject != 'meta'
) {
// not pretty, but redirects special:upload on projects to meta
header( "Location: http://meta.brickimedia.org/wiki/{$title->getBaseTitle()}" );
exit();
}
}
$wgHooks['BeforeInitialize'][] = 'redirectSpecialsToMeta';
// Other image setup
$wgUseInstantCommons = false;
$wgFileExtensions = array( 'png','gif','jpg','jpeg','svg','mp4','mov','flv','psd','ogg','pdf','ogv','odt','bmp','bmp.png' );
$wgSVGConverters = array(
'ImageMagick' => '$path/convert -background transparent -thumbnail $widthx$height\! $input PNG:$output'
);
// SPAM PREVENTION
$wgEnableDnsBlacklist = true;
$wgDnsBlacklistUrls = array( 'xbl.spamhaus.org', 'opm.tornevall.org' );
// OTHER CONFIGURATION
$wgLocaltimezone = "UTC";
$wgEnableScaryTranscluding = true;
// Cache
$wgCacheDirectory = "$IP/cache/$bmProject";
$wgParserCacheExpireTime = 60 * 60 * 24 * 7; // cache parsed articles for 7 days
$wgResourceLoaderMaxage['unversioned']['server'] = 60 * 60 * 24;
$wgResourceLoaderMaxage['unversioned']['client'] = 60 * 60 * 24; // cache uncached resourceloader requests for 1 day
$wgEnableSidebarCache = false; // don't cache the sidebar (MediaWikiChat adds a module)
$wgUseFileCache = true;
$wgFileCacheDirectory = "$IP/cache/$bmProject"; // show IPs fully cached html pages
$wgDBerrorLog = "$IP/DB.log";
// Splash page ajax access
$wgCrossSiteAJAXdomains = array( '*' );
$wgDisableCounters = true; // Pages (therefore hit counters) are cached, we have analytics anyway and helps performance.
// Trying to solve white pages
$wgMemoryLimit = "128M";
// Stop running a job per page load
$wgJobRunRate = 0;
$wgMiserMode = true;
// MUST BE AT BOTTOM OF THIS FILE!!!!
if( !getenv("noext") ){
require_once( __DIR__ . '/LocalSettings_ext.php' );
}
require_once( $ls_path );