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 ( !file_exists( $logDir ) ) {
59 mkdir( $logDir );
60 }
61 if ( MW_ENTRY_POINT === 'cli' ) {
62 $wgDebugLogFile = "$logDir/mw-debug-cli.log";
63 } else {
64 $wgDebugLogFile = "$logDir/mw-debug-www.log";
65 }
66 $wgDBerrorLog = "$logDir/mw-dberror.log";
67 $wgDebugLogGroups['ratelimit'] = "$logDir/mw-ratelimit.log";
68 $wgDebugLogGroups['error'] = "$logDir/mw-error.log";
69 $wgDebugLogGroups['exception'] = "$logDir/mw-error.log";
70}
71unset( $logDir );
72
80
81// Set almost infinite rate limits. This allows integration tests to run unthrottled
82// in CI and for devs locally (T225796), but doesn't turn a large chunk of production
83// code completely off during testing (T284804)
84foreach ( $wgRateLimits as $right => &$limit ) {
85 foreach ( $limit as $group => &$groupLimit ) {
86 $groupLimit[0] = PHP_INT_MAX;
87 }
88}
89
90// Enable Special:JavaScriptTest and allow `npm run qunit` to work
91// https://www.mediawiki.org/wiki/Manual:JavaScript_unit_testing
93
94// Enable development/experimental endpoints
95$wgRestAPIAdditionalRouteFiles[] = 'includes/Rest/coreDevelopmentRoutes.json';
96
97// Greatly raise the limits on short/long term login attempts,
98// so that automated tests run in parallel don't error.
100 [ 'count' => 1000, 'seconds' => 300 ],
101 [ 'count' => 100000, 'seconds' => 60 * 60 * 48 ],
102];
103
104// Run deferred updates before sending a response to the client.
105// This ensures that in end-to-end tests, a GET request will see the
106// effect of all previous POST requests (T230211).
107// Caveat: this does not wait for jobs to be executed, and it does
108// not wait for database replication to complete.
110
111// Set size limits for parsing small enough so we can test them,
112// but not so small that they interfere with other tests.
113$wgMaxArticleSize = 20; // in Kilobyte
114$wgParsoidSettings['wt2htmlLimits']['wikitextSize'] = 20 * 1024; // $wgMaxArticleSize, in byte
115$wgParsoidSettings['html2wtLimits']['htmlSize'] = 100 * 1024; // in characters!
116
117// Enable Vue dev mode by default, so that Vue devtools are functional.
119
128
129// Enable MariaDB/MySQL strict mode (T108255)
130$wgSQLMode = 'STRICT_ALL_TABLES,ONLY_FULL_GROUP_BY';
132
133// Localisation Cache to StaticArray (T218207)
134$wgLocalisationCacheConf['store'] = 'array';
135
136// Experimental Book Referencing feature (T236255)
138
139// The default value is false, but for development it is useful to set this to the system temp
140// directory by default (T218207)
141$wgCacheDirectory = TempFSFile::getUsableTempDirectory() .
142 DIRECTORY_SEPARATOR .
143 rawurlencode( MediaWiki\WikiMap\WikiMap::getCurrentWikiId() );
144
145// Enable uploads for FileImporter browser tests (T190829)
146$wgEnableUploads = true;
147
148// Enable en-x-piglatin variant conversion for testing
150// Enable x-xss language code for testing correct message escaping
152
153// Enable the new wikitext mode for browser testing (T270240)
155// Currently the default, but repeated here for safety since it would break many source editor tests.
156$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
global $wgCiteBookReferencing
global $wgLocalisationCacheConf
global $wgUsePigLatinVariant
if(MW_ENTRY_POINT==='index') global $wgShowExceptionDetails
global $wgEnableUploads
global $wgDBStrictWarnings
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:35
A helper class for throttling authentication attempts.