DevelopmentSettings.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. * Debugging for PHP
  17. */
  18. // Enable showing of errors
  19. error_reporting( -1 );
  20. ini_set( 'display_errors', 1 );
  21. /**
  22. * Debugging for MediaWiki
  23. */
  24. global $wgDevelopmentWarnings, $wgShowExceptionDetails, $wgShowHostnames,
  25. $wgDebugRawPage, $wgCommandLineMode, $wgDebugLogFile,
  26. $wgDBerrorLog, $wgDebugLogGroups, $wgLocalisationCacheConf;
  27. // Use of wfWarn() should cause tests to fail
  28. $wgDevelopmentWarnings = true;
  29. // Enable showing of errors
  30. $wgShowExceptionDetails = true;
  31. $wgShowHostnames = true;
  32. $wgDebugRawPage = true; // T49960
  33. // Enable log files
  34. $logDir = getenv( 'MW_LOG_DIR' );
  35. if ( $logDir ) {
  36. if ( $wgCommandLineMode ) {
  37. $wgDebugLogFile = "$logDir/mw-debug-cli.log";
  38. } else {
  39. $wgDebugLogFile = "$logDir/mw-debug-www.log";
  40. }
  41. $wgDBerrorLog = "$logDir/mw-dberror.log";
  42. $wgDebugLogGroups['ratelimit'] = "$logDir/mw-ratelimit.log";
  43. $wgDebugLogGroups['exception'] = "$logDir/mw-exception.log";
  44. $wgDebugLogGroups['error'] = "$logDir/mw-error.log";
  45. }
  46. unset( $logDir );
  47. /**
  48. * Make testing possible (or easier)
  49. */
  50. global $wgRateLimits;
  51. // Disable rate-limiting to allow integration tests to run unthrottled
  52. // in CI and for devs locally (T225796)
  53. $wgRateLimits = [];
  54. /**
  55. * Experimental changes that may later become the default.
  56. * (Must reference a Phabricator ticket)
  57. */
  58. global $wgSQLMode, $wgLegacyJavaScriptGlobals;
  59. // Enable MariaDB/MySQL strict mode (T108255)
  60. $wgSQLMode = 'TRADITIONAL';
  61. // Disable legacy javascript globals in CI and for devs (T72470)
  62. $wgLegacyJavaScriptGlobals = false;
  63. // Localisation Cache to StaticArray (T218207)
  64. $wgLocalisationCacheConf['store'] = 'array';