PageRenderTime 87ms CodeModel.GetById 38ms RepoModel.GetById 1ms app.codeStats 0ms

/install/Settings.php

https://github.com/Arantor/Elkarte
PHP | 194 lines | 46 code | 10 blank | 138 comment | 15 complexity | 607932f2516ae3e5c8f135f5bdab7043 MD5 | raw file
Possible License(s): BSD-3-Clause, LGPL-3.0
  1. <?php
  2. /**
  3. * @name ElkArte Forum
  4. * @copyright ElkArte Forum contributors
  5. * @license BSD http://opensource.org/licenses/BSD-3-Clause
  6. *
  7. * This software is a derived product, based on:
  8. *
  9. * Simple Machines Forum (SMF)
  10. * copyright: 2011 Simple Machines (http://www.simplemachines.org)
  11. * license: BSD, See included LICENSE.TXT for terms and conditions.
  12. *
  13. * @version 1.0 Alpha
  14. *
  15. */
  16. ########## Maintenance ##########
  17. /**
  18. * The maintenance "mode"
  19. * Set to 1 to enable Maintenance Mode, 2 to make the forum untouchable. (you'll have to make it 0 again manually!)
  20. * 0 is default and disables maintenance mode.
  21. * @var int 0, 1, 2
  22. * @global int $maintenance
  23. */
  24. $maintenance = 0;
  25. /**
  26. * Title for the Maintenance Mode message.
  27. * @var string
  28. * @global int $mtitle
  29. */
  30. $mtitle = 'Maintenance Mode';
  31. /**
  32. * Description of why the forum is in maintenance mode.
  33. * @var string
  34. * @global string $mmessage
  35. */
  36. $mmessage = 'Okay faithful users...we\'re attempting to restore an older backup of the database...news will be posted once we\'re back!';
  37. ########## Forum Info ##########
  38. /**
  39. * The name of your forum.
  40. * @var string
  41. */
  42. $mbname = 'My Community';
  43. /**
  44. * The default language file set for the forum.
  45. * @var string
  46. */
  47. $language = 'english';
  48. /**
  49. * URL to your forum's folder. (without the trailing /!)
  50. * @var string
  51. */
  52. $boardurl = 'http://127.0.0.1/elkarte';
  53. /**
  54. * Email address to send emails from. (like noreply@yourdomain.com.)
  55. * @var string
  56. */
  57. $webmaster_email = 'noreply@myserver.com';
  58. /**
  59. * Name of the cookie to set for authentication.
  60. * @var string
  61. */
  62. $cookiename = 'ELKARTECookie11';
  63. ########## Database Info ##########
  64. /**
  65. * The database type
  66. * Default options: mysql, sqlite, postgresql
  67. * @var string
  68. */
  69. $db_type = 'mysql';
  70. /**
  71. * The server to connect to (or a Unix socket)
  72. * @var string
  73. */
  74. $db_server = 'localhost';
  75. /**
  76. * The database name
  77. * @var string
  78. */
  79. $db_name = 'elkarte';
  80. /**
  81. * Database username
  82. * @var string
  83. */
  84. $db_user = 'root';
  85. /**
  86. * Database password
  87. * @var string
  88. */
  89. $db_passwd = '';
  90. /**
  91. * Database user for when connecting with SSI
  92. * @var string
  93. */
  94. $ssi_db_user = '';
  95. /**
  96. * Database password for when connecting with SSI
  97. * @var string
  98. */
  99. $ssi_db_passwd = '';
  100. /**
  101. * A prefix to put in front of your table names.
  102. * This helps to prevent conflicts
  103. * @var string
  104. */
  105. $db_prefix = 'elkarte_';
  106. /**
  107. * Use a persistent database connection
  108. * @var int|bool
  109. */
  110. $db_persist = 0;
  111. /**
  112. *
  113. * @var int|bool
  114. */
  115. $db_error_send = 0;
  116. ########## Cache Info ##########
  117. /**
  118. * Select a cache system. You want to leave this up to the cache area of the admin panel for
  119. * proper detection of apc, eaccelerator, memcache, mmcache, output_cache, xcache or filesystem-based
  120. * (you can add more with a mod).
  121. * @var string
  122. */
  123. $cache_accelerator = '';
  124. /**
  125. * The level at which you would like to cache. Between 0 (off) through 3 (cache a lot).
  126. * @var int
  127. */
  128. $cache_enable = 0;
  129. /**
  130. * This is only used for memcache / memcached. Should be a string of 'server:port,server:port'
  131. * @var array
  132. */
  133. $cache_memcached = '';
  134. /**
  135. * This is only for the 'filebased' cache system. It is the path to the cache directory.
  136. * It is also recommended that you place this in /tmp/ if you are going to use this.
  137. * @var string
  138. */
  139. $cachedir = dirname(__FILE__) . '/cache';
  140. ########## Directories/Files ##########
  141. # Note: These directories do not have to be changed unless you move things.
  142. /**
  143. * The absolute path to the forum's folder. (not just '.'!)
  144. * @var string
  145. */
  146. $boarddir = dirname(__FILE__);
  147. /**
  148. * Path to the sources directory.
  149. * @var string
  150. */
  151. $sourcedir = dirname(__FILE__) . '/sources';
  152. /**
  153. * Path to the external resources directory.
  154. * @var string
  155. */
  156. $extdir = dirname(__FILE__) . '/sources/lib';
  157. /**
  158. * Path to the languages directory.
  159. * @var string
  160. */
  161. $languagedir = dirname(__FILE__) . '/themes/default/languages';
  162. ########## Error-Catching ##########
  163. # Note: You shouldn't touch these settings.
  164. if (file_exists(dirname(__FILE__) . '/db_last_error.php'))
  165. include(dirname(__FILE__) . '/db_last_error.php');
  166. if (!isset($db_last_error))
  167. {
  168. // File does not exist so lets try to create it
  169. file_put_contents(dirname(__FILE__) . '/db_last_error.php', '<' . '?' . "php\n" . '$db_last_error = 0;');
  170. $db_last_error = 0;
  171. }
  172. if (file_exists(dirname(__FILE__) . '/install.php'))
  173. {
  174. header('Location: http' . (!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ? 's' : '') . '://' . (empty($_SERVER['HTTP_HOST']) ? $_SERVER['SERVER_NAME'] . (empty($_SERVER['SERVER_PORT']) || $_SERVER['SERVER_PORT'] == '80' ? '' : ':' . $_SERVER['SERVER_PORT']) : $_SERVER['HTTP_HOST']) . (strtr(dirname($_SERVER['PHP_SELF']), '\\', '/') == '/' ? '' : strtr(dirname($_SERVER['PHP_SELF']), '\\', '/')) . '/install.php'); exit;
  175. }
  176. # Make sure the paths are correct... at least try to fix them.
  177. if (!file_exists($boarddir) && file_exists(dirname(__FILE__) . '/agreement.txt'))
  178. $boarddir = dirname(__FILE__);
  179. if (!file_exists($sourcedir) && file_exists($boarddir . '/sources'))
  180. $sourcedir = $boarddir . '/sources';
  181. if (!file_exists($cachedir) && file_exists($boarddir . '/cache'))
  182. $cachedir = $boarddir . '/cache';
  183. if (!file_exists($extdir) && file_exists($sourcedir . '/ext'))
  184. $extdir = $sourcedir . '/ext';