-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathLocalSettings.php
148 lines (119 loc) · 4.12 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
<?php
/**
* MediaWiki configuration
*
* To customize your MediaWiki instance, you may change the content of this
* file. See settings.d/README for an alternate way of managing small snippets
* of configuration data, such as extension invocations.
*
* This file is part of MediaWiki-Vagrant.
*/
// Enable error reporting
error_reporting( -1 );
ini_set( 'display_errors', 1 );
// WMF specific HHVM builds don't support unix socket connections to MySQL.
// Use IP address rather than default of 'localhost' to help runtime pick the
// right connection method.
$wgDBserver = '127.0.0.1';
$wgUploadDirectory = '/srv/images';
$wgUploadPath = '/images';
$wgArticlePath = "/wiki/$1";
$wgMaxShellMemory = 1024 * 512;
// Show the debug toolbar if 'debug' is set on the request, either as a
// parameter or a cookie.
if ( !empty( $_REQUEST['debug'] ) ) {
$wgDebugToolbar = true;
}
// Expose debug info for PHP errors.
$wgShowExceptionDetails = true;
$logDir = '/vagrant/logs';
foreach ( [ 'exception', 'runJobs', 'JobQueue' ] as $logGroup ) {
$wgDebugLogGroups[$logGroup] = "{$logDir}/mediawiki-{$logGroup}.log";
}
// Calls to deprecated methods will trigger E_USER_DEPRECATED errors
// in the PHP error log.
$wgDevelopmentWarnings = true;
// Expose debug info for SQL errors.
$wgDebugDumpSql = true;
// Disable RL caching that interferes with debugging
$wgResourceLoaderStorageEnabled = false;
// Profiling
$wgDebugProfiling = false;
// Images
$wgLogos = [
'1x' => '/mediawiki-vagrant.png',
'1.5x' => '/mediawiki-vagrant-1.5x.png',
'2x' => '/mediawiki-vagrant-2x.png',
'svg' => '/mediawiki-vagrant.svg',
'icon' => '/mediawiki-vagrant.50px.png',
];
$wgUseInstantCommons = true;
$wgEnableUploads = true;
// User settings and permissions
$wgAllowUserJs = true;
$wgAllowUserCss = true;
$wgEnotifWatchlist = true;
$wgEnotifUserTalk = true;
// Eligibility for autoconfirmed group
$wgAutoConfirmAge = 3600 * 24; // one day
$wgAutoConfirmCount = 5; // five edits
// Caching
$wgObjectCaches['redis'] = [
'class' => 'RedisBagOStuff',
'servers' => [ '127.0.0.1:6379' ],
'persistent' => true,
];
$wgMainCacheType = 'redis';
// This is equivalent to redis_local in production, since MediaWiki-Vagrant
// only has one data center.
$wgMainStash = 'redis';
// Avoid user request serialization and other slowness
$wgSessionCacheType = 'redis';
$wgSessionsInObjectCache = true;
// Jobqueue
$wgJobTypeConf['default'] = [
'class' => 'JobQueueRedis',
'daemonized' => true,
'redisServer' => '127.0.0.1',
'redisConfig' => [ 'connectTimeout' => 2, 'compression' => 'gzip' ],
];
$wgJobQueueAggregator = [
'class' => 'JobQueueAggregatorRedis',
'redisServers' => [ '127.0.0.1' ],
'redisConfig' => [ 'connectTimeout' => 2 ],
];
// Execute all jobs via standalone jobrunner service rather than
// piggybacking them on web requests.
$wgJobRunRate = 0;
$wgEnableJavaScriptTest = true;
// Bug 73037: handmade gzipping sometimes makes error messages impossible to
// see in HHVM
$wgDisableOutputCompression = true;
// Enable CORS between wikis. Ideally we'd limit this to wikis in the farm,
// but iterating resource names is super cumbersome in Puppet.
$wgCrossSiteAJAXdomains = [ '*' ];
// Process Puppet and user managed settings
require_once __DIR__ . '/settings.d/wikis/CommonSettings.php';
// ====================================================================
// NOTE: anything after this point is 'immutable' config that can not be
// overridden by a role or a user managed file in settings.d
// ====================================================================
// XXX: Is this a bug in core? (ori-l, 27-Aug-2013)
$wgHooks['GetIP'][] = function ( &$ip ) {
if ( PHP_SAPI === 'cli' ) {
$ip = '127.0.0.1';
}
return true;
};
// Allow 'vagrant' password for all users regardless of password
// policies that are configured.
$wgHooks['isValidPassword'][] = function ( $password, &$result, $user ) {
if ( $password === 'vagrant' ) {
$result = true;
}
return true;
};
// Ensure that full LoggerFactory configuration is applied
MediaWiki\Logger\LoggerFactory::registerProvider(
\Wikimedia\ObjectFactory\ObjectFactory::getObjectFromSpec( $wgMWLoggerDefaultSpi )
);