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