settings.example.php 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <?php
  2. /**
  3. * Defines database credentials.
  4. *
  5. * Most of Elgg's configuration is stored in the database. This file contains the
  6. * credentials to connect to the database, as well as a few optional configuration
  7. * values.
  8. *
  9. * The Elgg installation attempts to populate this file with the correct settings
  10. * and then rename it to settings.php.
  11. *
  12. * @todo Turn this into something we handle more automatically.
  13. * @package Elgg.Core
  14. * @subpackage Configuration
  15. */
  16. global $CONFIG;
  17. if (!isset($CONFIG)) {
  18. $CONFIG = new \stdClass;
  19. }
  20. /*
  21. * Standard configuration
  22. *
  23. * You will use the same database connection for reads and writes.
  24. * This is the easiest configuration, and will suit 99.99% of setups. However, if you're
  25. * running a really popular site, you'll probably want to spread out your database connections
  26. * and implement database replication. That's beyond the scope of this configuration file
  27. * to explain, but if you know you need it, skip past this section.
  28. */
  29. /**
  30. * The database username
  31. *
  32. * @global string $CONFIG->dbuser
  33. */
  34. $CONFIG->dbuser = '{{dbuser}}';
  35. /**
  36. * The database password
  37. *
  38. * @global string $CONFIG->dbpass
  39. */
  40. $CONFIG->dbpass = '{{dbpassword}}';
  41. /**
  42. * The database name
  43. *
  44. * @global string $CONFIG->dbname
  45. */
  46. $CONFIG->dbname = '{{dbname}}';
  47. /**
  48. * The database host.
  49. *
  50. * For most installations, this is 'localhost'
  51. *
  52. * @global string $CONFIG->dbhost
  53. */
  54. $CONFIG->dbhost = '{{dbhost}}';
  55. /**
  56. * The database prefix
  57. *
  58. * This prefix will be appended to all Elgg tables. If you're sharing
  59. * a database with other applications, use a database prefix to namespace tables
  60. * in order to avoid table name collisions.
  61. *
  62. * @global string $CONFIG->dbprefix
  63. */
  64. $CONFIG->dbprefix = '{{dbprefix}}';
  65. /**
  66. * Multiple database connections
  67. *
  68. * Elgg supports master/slave MySQL configurations. The master should be set as
  69. * the 'write' connection and the slave(s) as the 'read' connection(s).
  70. *
  71. * To use, uncomment the below configuration and update for your site.
  72. */
  73. //$CONFIG->db['split'] = true;
  74. //$CONFIG->db['write']['dbuser'] = "";
  75. //$CONFIG->db['write']['dbpass'] = "";
  76. //$CONFIG->db['write']['dbname'] = "";
  77. //$CONFIG->db['write']['dbhost'] = "";
  78. //$CONFIG->db['read'][0]['dbuser'] = "";
  79. //$CONFIG->db['read'][0]['dbpass'] = "";
  80. //$CONFIG->db['read'][0]['dbname'] = "";
  81. //$CONFIG->db['read'][0]['dbhost'] = "";
  82. //$CONFIG->db['read'][1]['dbuser'] = "";
  83. //$CONFIG->db['read'][1]['dbpass'] = "";
  84. //$CONFIG->db['read'][1]['dbname'] = "";
  85. //$CONFIG->db['read'][1]['dbhost'] = "";
  86. /**
  87. * Memcache setup (optional)
  88. * This is where you may optionally set up memcache.
  89. *
  90. * Requirements:
  91. * 1) One or more memcache servers (http://www.danga.com/memcached/)
  92. * 2) PHP memcache wrapper (http://php.net/manual/en/memcache.setup.php)
  93. *
  94. * Note: Multiple server support is only available on server 1.2.1
  95. * or higher with PECL library > 2.0.0
  96. */
  97. //$CONFIG->memcache = true;
  98. //
  99. //$CONFIG->memcache_servers = array (
  100. // array('server1', 11211),
  101. // array('server2', 11211)
  102. //);
  103. /**
  104. * Better caching performance
  105. *
  106. * Configuring the location of your data directory and enabling simplecache in
  107. * the settings.php file improves caching performance. It allows Elgg to skip
  108. * connecting to the database when serving cached JavaScript and CSS files. If
  109. * you uncomment and configure these settings, you will not be able to change
  110. * them from the Elgg advanced settings page.
  111. */
  112. //$CONFIG->dataroot = "";
  113. //$CONFIG->simplecache_enabled = true;
  114. /**
  115. * Cookie configuration
  116. *
  117. * Elgg uses 2 cookies: a PHP session cookie and an extended login cookie
  118. * (also called the remember me cookie). See the PHP manual for documentation on
  119. * each of these parameters. Possible options:
  120. *
  121. * - Set the session name to share the session across applications.
  122. * - Set the path because Elgg is not installed in the root of the web directory.
  123. * - Set the secure option to true if you only serve the site over HTTPS.
  124. * - Set the expire option on the remember me cookie to change its lifetime
  125. *
  126. * To use, uncomment the appropriate sections below and update for your site.
  127. *
  128. * @global array $CONFIG->cookies
  129. */
  130. // get the default parameters from php.ini
  131. //$CONFIG->cookies['session'] = session_get_cookie_params();
  132. //$CONFIG->cookies['session']['name'] = "Elgg";
  133. // optionally overwrite the defaults from php.ini below
  134. //$CONFIG->cookies['session']['path'] = "/";
  135. //$CONFIG->cookies['session']['domain'] = "";
  136. //$CONFIG->cookies['session']['secure'] = false;
  137. //$CONFIG->cookies['session']['httponly'] = false;
  138. // extended session cookie
  139. //$CONFIG->cookies['remember_me'] = session_get_cookie_params();
  140. //$CONFIG->cookies['remember_me']['name'] = "elggperm";
  141. //$CONFIG->cookies['remember_me']['expire'] = strtotime("+30 days");
  142. // optionally overwrite the defaults from php.ini below
  143. //$CONFIG->cookies['remember_me']['path'] = "/";
  144. //$CONFIG->cookies['remember_me']['domain'] = "";
  145. //$CONFIG->cookies['remember_me']['secure'] = false;
  146. //$CONFIG->cookies['remember_me']['httponly'] = false;
  147. /**
  148. * Use non-standard headers for broken MTAs.
  149. *
  150. * The default header EOL for headers is \r\n. This causes problems
  151. * on some broken MTAs. Setting this to true will cause Elgg to use
  152. * \n, which will fix some problems sending email on broken MTAs.
  153. *
  154. * @global bool $CONFIG->broken_mta
  155. */
  156. $CONFIG->broken_mta = false;
  157. /**
  158. * Disable the database query cache
  159. *
  160. * Elgg stores each query and its results in a query cache.
  161. * On large sites or long-running scripts, this cache can grow to be
  162. * large. To disable query caching, set this to true.
  163. *
  164. * @global bool $CONFIG->db_disable_query_cache
  165. */
  166. $CONFIG->db_disable_query_cache = false;
  167. /**
  168. * Minimum password length
  169. *
  170. * This value is used when validating a user's password during registration.
  171. *
  172. * @global int $CONFIG->min_password_length
  173. */
  174. $CONFIG->min_password_length = 6;
  175. /**
  176. * This is an optional script used to override Elgg's default handling of
  177. * uncaught exceptions.
  178. *
  179. * This should be an absolute file path to a php script that will be called
  180. * any time an uncaught exception is thrown.
  181. *
  182. * The script will have access to the following variables as part of the scope
  183. * global $CONFIG
  184. * $exception - the unhandled exception
  185. *
  186. * @warning - the database may not be available
  187. *
  188. * @global string $CONFIG->exception_include
  189. */
  190. $CONFIG->exception_include = '';