LocalSettings.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <?php
  2. /**
  3. * This is the main cli entry point for MediaWiki.
  4. *
  5. * See the README and INSTALL files for basic setup instructions
  6. * and pointers to the online documentation.
  7. *
  8. * ----------
  9. *
  10. * Copyright (C) 2010 Michael Nowak
  11. * Sean Moss-Pultz <sean@openmoko.com>
  12. * Christopher Hall <hsw@openmoko.com>
  13. *
  14. * This program is free software; you can redistribute it and/or modify
  15. * it under the terms of the GNU General Public License as published by
  16. * the Free Software Foundation; either version 2 of the License, or
  17. * (at your option) any later version.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU General Public License along
  25. * with this program; if not, write to the Free Software Foundation, Inc.,
  26. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  27. * http://www.gnu.org/copyleft/gpl.html
  28. **/
  29. if ( !isset( $IP ) ) {
  30. $IP = realpath( dirname(__FILE__) );
  31. }
  32. unset( $_SERVER['SERVER_NAME'] );
  33. unset( $_SERVER['HOSTNAME'] );
  34. unset( $_SERVER['HTTP_HOST'] );
  35. unset( $_SERVER['SERVER_ADDR'] );
  36. unset( $_SERVER['SERVER_PORT'] );
  37. require_once( "$IP/includes/DefaultSettings.php" );
  38. # Set some globals
  39. $wgSitename = 'MediaWikiStandAlone';
  40. $wgProto = 'woc';
  41. $wgServerName = 'woc';
  42. $wgServer = $wgProto .'://'. $wgServerName;
  43. #$wgScriptPath = '/wiki';
  44. #$wgArticlePath = "/article/$1";
  45. #$wgUploadPath = $IP .'/sa';
  46. $wgFileLinks = false;
  47. $wgCategoryLinks = false;
  48. $wgLanguageLinks = false;
  49. $wgParserConf['class'] = 'ParserStandAlone';
  50. $wgLBFactoryConf['class'] = 'LBFactory_No';
  51. $wgCommandLineMode = true;
  52. $wgStandAloneMode = true;
  53. $cliParserMode = true;
  54. $wgTemplateDB = getenv('TEMPLATE_DB');
  55. $wgTemplateFileID = 0;
  56. # Register parser hooks
  57. $wgHooks['SpecialPage_initList'][] = 'ParserStandAlone::disableSpecialPages';
  58. $wgHooks['LinkBegin'][] = 'ParserStandAlone::hookLinkBegin';
  59. #$wgHooks['LinkEnd'][] = 'ParserStandAlone::hookLinkEnd';
  60. $wgHooks['ParserBeforeStrip'][] = 'ParserStandAlone::hookParserBeforeStrip';
  61. $wgHooks['ParserBeforeTidy'][] = 'ParserStandAlone::hookParserBeforeTidy';
  62. # Extension-Fixes before require
  63. define('WH_IMG_DIR', $wgUploadDirectory .'/wikihiero/' ); # for WikiHiero
  64. # Activate installed extensions
  65. require_once( "$IP/extensions/Cite/Cite.php" );
  66. require_once( "$IP/extensions/ParserFunctions/ParserFunctions.php" );
  67. require_once( "$IP/extensions/Poem/Poem.php" );
  68. #require_once( "$IP/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php" );
  69. #require_once( "$IP/extensions/ImageMap/ImageMap.php" );
  70. #require_once( "$IP/extensions/timeline/Timeline.php" );
  71. require_once( "$IP/extensions/wikihiero/wikihiero.php" );
  72. # Extension-Fixes after require
  73. putenv("GDFONTPATH=/usr/share/fonts/truetype/freefont"); # for EasyTimeline
  74. # Settings for offline templates
  75. $wgTemplateExtension = '';
  76. $wgTemplatePath = getenv('WORKDIR') . "/templates";
  77. # MediaWiki settings
  78. $wgDBtype = 'mssql'; # select a different then mysql to make db-less parsing working
  79. $wgAllDBsAreLocalhost = true;
  80. $wgCheckDBSchema = false;
  81. $wgEnableEmail = false;
  82. $wgEnableUserEmail = false;
  83. $wgLanguageCode = getenv('LANGUAGE');
  84. if ('' === $wgLanguageCode) {
  85. $wgLanguageCode = 'en';
  86. }
  87. $wgUseTeX = true;
  88. $wgUseImageMagick = true;
  89. $wgUseTidy = true;
  90. $wgAlwaysUseTidy = true;
  91. $wgAllowUserSkin = false;
  92. $wgShowExceptionDetails = true;
  93. $wgBrowserBlackList = array();
  94. # For Math equations, (to activate, set $wgUseTeX is true )
  95. $WorkDirectory = getenv('WORKDIR');
  96. $wgMathDirectory = "{$WorkDirectory}/math";
  97. $wgMathPath = "$wgMathDirectory";
  98. $wgTmpDirectory = getenv('TEMPDIR');
  99. if ('' === $wgTmpDirectory) {
  100. $wgTmpDirectory = "{$WorkDirectory}/tmp";
  101. }
  102. # Uncomment for debugging
  103. #$wgDebugLogFile = "{$wgTmpDirectory}/wiki.log";
  104. # Disable all kinds of MediaWiki caching
  105. $wgMainCacheType = CACHE_ACCEL;
  106. $wgMessageCacheType = CACHE_ACCEL;
  107. $wgParserCacheType = CACHE_ACCEL;
  108. $wgMiserMode = true;
  109. $wgDisableQueryPages = true;