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