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 
73 
74 // Set almost infinite rate limits. This allows integration tests to run unthrottled
75 // in CI and for devs locally (T225796), but doesn't turn a large chunk of production
76 // code completely off during testing (T284804)
77 foreach ( $wgRateLimits as $right => &$limit ) {
78  foreach ( $limit as $group => &$groupLimit ) {
79  $groupLimit[0] = PHP_INT_MAX;
80  }
81 }
82 
83 // Enable Special:JavaScriptTest and allow `npm run qunit` to work
84 // https://www.mediawiki.org/wiki/Manual:JavaScript_unit_testing
86 
87 // Enable development/experimental endpoints
88 $wgRestAPIAdditionalRouteFiles = [ 'includes/Rest/coreDevelopmentRoutes.json' ];
89 
90 // Greatly raise the limits on short/long term login attempts,
91 // so that automated tests run in parallel don't error.
93  [ 'count' => 1000, 'seconds' => 300 ],
94  [ 'count' => 100000, 'seconds' => 60 * 60 * 48 ],
95 ];
96 
97 // Run deferred updates before sending a response to the client.
98 // This ensures that in end-to-end tests, a GET request will see the
99 // effect of all previous POST requests (T230211).
100 // Caveat: this does not wait for jobs to be executed, and it does
101 // not wait for database replication to complete.
103 
111 
112 // Enable MariaDB/MySQL strict mode (T108255)
113 $wgSQLMode = 'STRICT_ALL_TABLES,ONLY_FULL_GROUP_BY';
114 
115 // Localisation Cache to StaticArray (T218207)
116 $wgLocalisationCacheConf['store'] = 'array';
117 
118 // Experimental Book Referencing feature (T236255)
120 
121 // The default value is false, but for development it is useful to set this to the system temp
122 // directory by default (T218207)
124  DIRECTORY_SEPARATOR .
125  rawurlencode( WikiMap::getCurrentWikiId() );
126 
127 // Enable uploads for FileImporter browser tests (T190829)
128 $wgEnableUploads = true;
129 
130 // Enable the new wikitext mode for browser testing (T270240)
132 // Currently the default, but repeated here for safety since it would break many source editor tests.
133 $wgDefaultUserOptions['visualeditor-newwikitext'] = 0;
$wgDefaultUserOptions['visualeditor-newwikitext']
global $wgCacheDirectory
global $wgSQLMode
Experimental changes that may later become the default.
global $wgDebugLogGroups
global $wgShowHostnames
$wgPasswordAttemptThrottle
global $wgEnableJavaScriptTest
global $wgDebugLogFile
global $wgCommandLineMode
global $wgRestAPIAdditionalRouteFiles
global $wgDeferredUpdateStrategy
global $wgDBerrorLog
global $wgCiteBookReferencing
global $wgLocalisationCacheConf
global $wgShowExceptionDetails
global $wgEnableUploads
$wgVisualEditorEnableWikitext
global $wgDevelopmentWarnings
Debugging for MediaWiki.
$wgForceDeferredUpdatesPreSend
global $wgRateLimits
Make testing possible (or easier)
static getUsableTempDirectory()
Definition: TempFSFile.php:80
static getCurrentWikiId()
Definition: WikiMap.php:303