Merge "Use MediaWiki\SuppressWarnings around trigger_error('') instead @"
[lhc/web/wiklou.git] / includes / DevelopmentSettings.php
1 <?php
2 /**
3 * Extra settings useful for MediaWiki development.
4 *
5 * To enable built-in debug and development settings, add the
6 * following to your LocalSettings.php file.
7 *
8 * require "$IP/includes/DevelopmentSettings.php";
9 *
10 * Alternatively, if running phpunit.php (or another Maintenance script),
11 * you can use the --mwdebug option to automatically load these settings.
12 *
13 * @file
14 */
15
16 /**
17 * Debugging: PHP
18 */
19
20 // Enable showing of errors
21 error_reporting( -1 );
22 ini_set( 'display_errors', 1 );
23
24 /**
25 * Debugging: MediaWiki
26 */
27 global $wgDevelopmentWarnings, $wgShowExceptionDetails, $wgShowHostnames,
28 $wgDebugRawPage, $wgDebugComments, $wgDebugDumpSql, $wgDebugTimestamps,
29 $wgCommandLineMode, $wgDebugLogFile, $wgDBerrorLog, $wgDebugLogGroups;
30
31 // Use of wfWarn() should cause tests to fail
32 $wgDevelopmentWarnings = true;
33
34 // Enable showing of errors
35 $wgShowExceptionDetails = true;
36 $wgShowHostnames = true;
37 $wgDebugRawPage = true; // T49960
38
39 // Enable log files
40 $logDir = getenv( 'MW_LOG_DIR' );
41 if ( $logDir ) {
42 if ( $wgCommandLineMode ) {
43 $wgDebugLogFile = "$logDir/mw-debug-cli.log";
44 } else {
45 $wgDebugLogFile = "$logDir/mw-debug-www.log";
46 }
47 $wgDBerrorLog = "$logDir/mw-dberror.log";
48 $wgDebugLogGroups['ratelimit'] = "$logDir/mw-ratelimit.log";
49 $wgDebugLogGroups['exception'] = "$logDir/mw-exception.log";
50 $wgDebugLogGroups['error'] = "$logDir/mw-error.log";
51 }
52 unset( $logDir );