MediaWiki master
DevelopmentSettings.php
Go to the documentation of this file.
1<?php
24// $wgDebugDumpSql = true;
25// $wgDebugRawPage = true;
26// $wgDebugToolbar = true;
27
32// Enable logging of all errors
33error_reporting( -1 );
34
35// Enable showing of errors, but avoid breaking non-HTML responses
36if ( MW_ENTRY_POINT === 'index' ) {
37 ini_set( 'display_errors', '1' );
38}
39
47
48// Use of wfWarn() should cause tests to fail
50
51// Enable showing of errors
53$wgShowHostnames = true;
54
55// Enable log files
56$logDir = getenv( 'MW_LOG_DIR' );
57if ( $logDir ) {
58 if ( $wgCommandLineMode ) {
59 $wgDebugLogFile = "$logDir/mw-debug-cli.log";
60 } else {
61 $wgDebugLogFile = "$logDir/mw-debug-www.log";
62 }
63 $wgDBerrorLog = "$logDir/mw-dberror.log";
64 $wgDebugLogGroups['ratelimit'] = "$logDir/mw-ratelimit.log";
65 $wgDebugLogGroups['error'] = "$logDir/mw-error.log";
66 $wgDebugLogGroups['exception'] = "$logDir/mw-error.log";
67}
68unset( $logDir );
69
77
78// Set almost infinite rate limits. This allows integration tests to run unthrottled
79// in CI and for devs locally (T225796), but doesn't turn a large chunk of production
80// code completely off during testing (T284804)
81foreach ( $wgRateLimits as $right => &$limit ) {
82 foreach ( $limit as $group => &$groupLimit ) {
83 $groupLimit[0] = PHP_INT_MAX;
84 }
85}
86
87// Enable Special:JavaScriptTest and allow `npm run qunit` to work
88// https://www.mediawiki.org/wiki/Manual:JavaScript_unit_testing
90
91// Enable development/experimental endpoints
92$wgRestAPIAdditionalRouteFiles[] = 'includes/Rest/coreDevelopmentRoutes.json';
93
94// Greatly raise the limits on short/long term login attempts,
95// so that automated tests run in parallel don't error.
97 [ 'count' => 1000, 'seconds' => 300 ],
98 [ 'count' => 100000, 'seconds' => 60 * 60 * 48 ],
99];
100
101// Run deferred updates before sending a response to the client.
102// This ensures that in end-to-end tests, a GET request will see the
103// effect of all previous POST requests (T230211).
104// Caveat: this does not wait for jobs to be executed, and it does
105// not wait for database replication to complete.
107
108// Set size limits for parsing small enough so we can test them,
109// but not so small that they interfere with other tests.
110$wgMaxArticleSize = 20; // in Kilobyte
111$wgParsoidSettings['wt2htmlLimits']['wikitextSize'] = 20 * 1024; // $wgMaxArticleSize, in byte
112$wgParsoidSettings['html2wtLimits']['htmlSize'] = 100 * 1024; // in characters!
113
114// Enable Vue dev mode by default, so that Vue devtools are functional.
116
125
126// Enable MariaDB/MySQL strict mode (T108255)
127$wgSQLMode = 'STRICT_ALL_TABLES,ONLY_FULL_GROUP_BY';
128
129// Localisation Cache to StaticArray (T218207)
130$wgLocalisationCacheConf['store'] = 'array';
131
132// Experimental Book Referencing feature (T236255)
134
135// The default value is false, but for development it is useful to set this to the system temp
136// directory by default (T218207)
137$wgCacheDirectory = TempFSFile::getUsableTempDirectory() .
138 DIRECTORY_SEPARATOR .
139 rawurlencode( MediaWiki\WikiMap\WikiMap::getCurrentWikiId() );
140
141// Enable uploads for FileImporter browser tests (T190829)
142$wgEnableUploads = true;
143
144// Enable en-x-piglatin variant conversion for testing
146// Enable x-xss language code for testing correct message escaping
148
149// Enable the new wikitext mode for browser testing (T270240)
151// Currently the default, but repeated here for safety since it would break many source editor tests.
152$wgDefaultUserOptions['visualeditor-newwikitext'] = 0;
global $wgRestAPIAdditionalRouteFiles
global $wgMaxArticleSize
global $wgCacheDirectory
global $wgSQLMode
Experimental changes that may later become the default.
if(MW_ENTRY_POINT==='index') global $wgShowHostnames
global $wgPasswordAttemptThrottle
global $wgEnableJavaScriptTest
$wgVueDevelopmentMode
if(MW_ENTRY_POINT==='index') global $wgCommandLineMode
global $wgCiteBookReferencing
global $wgLocalisationCacheConf
global $wgUsePigLatinVariant
if(MW_ENTRY_POINT==='index') global $wgShowExceptionDetails
global $wgEnableUploads
global $wgVisualEditorEnableWikitext
if(MW_ENTRY_POINT==='index') global $wgDebugLogGroups
if(MW_ENTRY_POINT==='index') global $wgDevelopmentWarnings
Debugging for MediaWiki.
if(MW_ENTRY_POINT==='index') global $wgDBerrorLog
if(MW_ENTRY_POINT==='index') global $wgDebugLogFile
global $wgForceDeferredUpdatesPreSend
global $wgParsoidSettings
global $wgDefaultUserOptions
global $wgRateLimits
Make testing possible (or easier)
const MW_ENTRY_POINT
Definition api.php:44
A helper class for throttling authentication attempts.