PageRenderTime 25ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/LocalSettings.php

https://github.com/hexmode/mediawiki-vagrant-rh
PHP | 101 lines | 62 code | 17 blank | 22 comment | 6 complexity | 5c300d2acf866381d67ab9cc513514fa MD5 | raw file
Possible License(s): JSON, Apache-2.0
  1. <?php
  2. /**
  3. * MediaWiki configuration
  4. *
  5. * To customize your MediaWiki instance, you may change the content of this
  6. * file. See settings.d/README for an alternate way of managing small snippets
  7. * of configuration data, such as extension invocations.
  8. *
  9. * This file is part of Mediawiki-Vagrant.
  10. */
  11. // Enable error reporting
  12. error_reporting( -1 );
  13. ini_set( 'display_errors', 1 );
  14. if ( isset( $_SERVER['HTTP_HOST'] ) ) {
  15. $wgServer = '//' . $_SERVER['HTTP_HOST'];
  16. }
  17. $wgUploadDirectory = '/srv/images';
  18. $wgUploadPath = '/images';
  19. $wgArticlePath = "/wiki/$1";
  20. $wgMaxShellMemory = 1024 * 512;
  21. // Show the debug toolbar if 'debug' is set on the request, either as a
  22. // parameter or a cookie.
  23. if ( !empty( $_REQUEST['debug'] ) ) {
  24. $wgDebugToolbar = true;
  25. }
  26. // Expose debug info for PHP errors.
  27. $wgShowExceptionDetails = true;
  28. $wgDebugLogFile = '/vagrant/logs/mediawiki-debug.log';
  29. // Calls to deprecated methods will trigger E_USER_DEPRECATED errors
  30. // in the PHP error log.
  31. $wgDevelopmentWarnings = true;
  32. // Expose debug info for SQL errors.
  33. $wgDebugDumpSql = true;
  34. $wgShowDBErrorBacktrace = true;
  35. $wgShowSQLErrors = true;
  36. // Profiling
  37. $wgDebugProfiling = false;
  38. // Images
  39. $wgLogo = '/mediawiki-vagrant.png';
  40. $wgUseInstantCommons = true;
  41. $wgEnableUploads = true;
  42. // User settings and permissions
  43. $wgAllowUserJs = true;
  44. $wgGroupPermissions['*']['createpage'] = false;
  45. // Caching
  46. $wgObjectCaches['redis'] = array(
  47. 'class' => 'RedisBagOStuff',
  48. 'servers' => array( '127.0.0.1:6379' ),
  49. 'persistent' => true,
  50. );
  51. $wgMainCacheType = 'redis';
  52. $wgSessionCacheType = 'redis';
  53. $wgDisableCounters = true;
  54. $wgLegacyJavaScriptGlobals = false;
  55. $wgEnableJavaScriptTest = true;
  56. $wgProfilerParams = array(
  57. 'forceprofile' => 'ProfilerSimpleText',
  58. 'forcetrace' => 'ProfilerSimpleTrace'
  59. );
  60. foreach( $wgProfilerParams as $param => $cls ) {
  61. if ( array_key_exists( $param, $_REQUEST ) ) {
  62. $wgProfiler['class'] = $cls;
  63. }
  64. }
  65. if ( getenv( 'MULTIWIKI' ) ) {
  66. require_once __DIR__ . '/settings.d/multiwiki/CommonSettings.php';
  67. } else {
  68. // Load configuration fragments from /vagrant/settings.d
  69. foreach(
  70. array_merge(
  71. glob( __DIR__ . '/settings.d/puppet-managed/*.php' ),
  72. glob( __DIR__ . '/settings.d/*.php' )
  73. ) as $conffile
  74. ) {
  75. include_once $conffile;
  76. }
  77. }
  78. // XXX: Is this a bug in core? (ori-l, 27-Aug-2013)
  79. $wgHooks['GetIP'][] = function ( &$ip ) {
  80. if ( PHP_SAPI === 'cli' ) {
  81. $ip = '127.0.0.1';
  82. }
  83. return true;
  84. };