Merge pull request #6793 from Stoob/patch-2
[civicrm-core.git] / templates / CRM / common / civicrm.settings.php.template
CommitLineData
eb049397
DL
1<?php
2/*
3 +--------------------------------------------------------------------+
3435af9a 4 | CiviCRM version 4.7 |
eb049397 5 +--------------------------------------------------------------------+
e7112fa7 6 | Copyright CiviCRM LLC (c) 2004-2015 |
eb049397
DL
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
13 | |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
18 | |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
26*/
27
28/**
29 * CiviCRM Configuration File.
30 */
31
32/**
33 * Content Management System (CMS) Host:
34 *
35 * CiviCRM can be hosted in either Drupal 6 or 7, Joomla or WordPress.
36 *
37 * Settings for Drupal 7.x:
38 * define( 'CIVICRM_UF' , 'Drupal' );
39 *
40 * Settings for Drupal 6.x:
23b5a711 41 * define( 'CIVICRM_UF' , 'Drupal6');
eb049397
DL
42 *
43 * Settings for Joomla 1.7.x - 2.5.x:
23b5a711 44 * define( 'CIVICRM_UF' , 'Joomla');
eb049397
DL
45 *
46 * Settings for WordPress 3.3.x:
23b5a711 47 * define( 'CIVICRM_UF' , 'WordPress');
eb049397
DL
48 *
49 * You may have issues with images in CiviCRM. If this is the case, be sure
50 * to update the CiviCRM Resource URL field to your CiviCRM root directory
51 * (Administer::System Settings::Resource URLs).
52 */
8d133ef2 53if (!defined('CIVICRM_UF')) {
23b5a711 54 define( 'CIVICRM_UF', '%%cms%%');
8d133ef2 55}
eb049397
DL
56
57/**
58 * Content Management System (CMS) Datasource:
59 *
60 * Update this setting with your CMS (Drupal or Joomla) database username, server and DB name.
61 * Datasource (DSN) format:
62 * define( 'CIVICRM_UF_DSN', 'mysql://cms_db_username:cms_db_password@db_server/cms_database?new_link=true');
63 */
8d133ef2 64if (!defined('CIVICRM_UF_DSN')) {
23b5a711 65 define( 'CIVICRM_UF_DSN' , 'mysql://%%CMSdbUser%%:%%CMSdbPass%%@%%CMSdbHost%%/%%CMSdbName%%?new_link=true');
8d133ef2 66}
eb049397
DL
67
68/**
69 * CiviCRM Database Settings
70 *
71 * Database URL (CIVICRM_DSN) for CiviCRM Data:
72 * Database URL format:
73 * define( 'CIVICRM_DSN', 'mysql://crm_db_username:crm_db_password@db_server/crm_database?new_link=true');
74 *
75 * Drupal and CiviCRM can share the same database, or can be installed into separate databases.
76 *
77 * EXAMPLE: Drupal and CiviCRM running in the same database...
78 * DB Name = drupal, DB User = drupal
23b5a711 79 * define( 'CIVICRM_DSN' , 'mysql://drupal:YOUR_PASSWORD@localhost/drupal?new_link=true');
eb049397
DL
80 *
81 * EXAMPLE: Drupal and CiviCRM running in separate databases...
82 * Drupal DB Name = drupal, DB User = drupal
83 * CiviCRM DB Name = civicrm, CiviCRM DB User = civicrm
23b5a711 84 * define( 'CIVICRM_DSN' , 'mysql://civicrm:YOUR_PASSWORD@localhost/civicrm?new_link=true');
eb049397
DL
85 *
86 */
8d133ef2 87if (!defined('CIVICRM_DSN')) {
23b5a711 88 define( 'CIVICRM_DSN' , 'mysql://%%dbUser%%:%%dbPass%%@%%dbHost%%/%%dbName%%?new_link=true');
8d133ef2 89}
eb049397
DL
90
91/**
92 * CiviCRM Logging Database
93 *
94 * Used to point to a different database to use for logging (if desired). If unset defaults to equal CIVICRM_DSN.
95 * The CIVICRM_DSN user needs to have the rights to modify the below database schema and be able to write to it.
96 */
8d133ef2
TO
97if (!defined('CIVICRM_LOGGING_DSN')) {
98 define('CIVICRM_LOGGING_DSN', CIVICRM_DSN);
99}
eb049397
DL
100
101/**
102 * File System Paths:
103 *
104 * $civicrm_root is the file system path on your server where the civicrm
105 * code is installed. Use an ABSOLUTE path (not a RELATIVE path) for this setting.
106 *
107 * CIVICRM_TEMPLATE_COMPILEDIR is the file system path where compiled templates are stored.
108 * These sub-directories and files are temporary caches and will be recreated automatically
109 * if deleted.
110 *
111 * IMPORTANT: The COMPILEDIR directory must exist,
112 * and your web server must have read/write access to these directories.
113 *
114 *
115 * EXAMPLE - Drupal:
116 * If the path to the Drupal home directory is /var/www/htdocs/drupal
117 * the $civicrm_root setting would be:
118 * $civicrm_root = '/var/www/htdocs/drupal/sites/all/modules/civicrm/';
119 *
120 * the CIVICRM_TEMPLATE_COMPILEDIR would be:
23b5a711 121 * define( 'CIVICRM_TEMPLATE_COMPILEDIR', '/var/www/htdocs/drupal/sites/default/files/civicrm/templates_c/');
eb049397
DL
122 *
123 * EXAMPLE - Joomla Installations:
124 * If the path to the Joomla home directory is /var/www/htdocs/joomla
125 * the $civicrm_root setting would be:
126 * $civicrm_root = '/var/www/htdocs/joomla/administrator/components/com_civicrm/civicrm/';
127 *
128 * the CIVICRM_TEMPLATE_COMPILEDIR would be:
23b5a711 129 * define( 'CIVICRM_TEMPLATE_COMPILEDIR', '/var/www/htdocs/joomla/media/civicrm/templates_c/');
eb049397
DL
130 *
131 * EXAMPLE - WordPress Installations:
132 * If the path to the WordPress home directory is /var/www/htdocs/wordpress
133 * the $civicrm_root setting would be:
134 * $civicrm_root = '/var/www/htdocs/wordpress/wp-content/plugins/civicrm/civicrm/';
135 *
136 * the CIVICRM_TEMPLATE_COMPILEDIR would be:
23b5a711 137 * define( 'CIVICRM_TEMPLATE_COMPILEDIR', '/var/www/htdocs/wordpress/wp-content/plugins/files/civicrm/templates_c/');
eb049397
DL
138 *
139 */
140
141global $civicrm_root;
142
143$civicrm_root = '%%crmRoot%%';
8d133ef2 144if (!defined('CIVICRM_TEMPLATE_COMPILEDIR')) {
23b5a711 145 define( 'CIVICRM_TEMPLATE_COMPILEDIR', '%%templateCompileDir%%');
8d133ef2 146}
eb049397
DL
147
148/**
149 * Site URLs:
150 *
151 * This section defines absolute and relative URLs to access the host CMS (Drupal or Joomla) resources.
152 *
153 * IMPORTANT: Trailing slashes should be used on all URL settings.
154 *
155 *
156 * EXAMPLE - Drupal Installations:
157 * If your site's home url is http://www.example.com/drupal/
158 * these variables would be set as below. Modify as needed for your install.
159 *
160 * CIVICRM_UF_BASEURL - home URL for your site:
23b5a711 161 * define( 'CIVICRM_UF_BASEURL' , 'http://www.example.com/drupal/');
eb049397
DL
162 *
163 * EXAMPLE - Joomla Installations:
164 * If your site's home url is http://www.example.com/joomla/
165 *
166 * CIVICRM_UF_BASEURL - home URL for your site:
167 * Administration site:
23b5a711 168 * define( 'CIVICRM_UF_BASEURL' , 'http://www.example.com/joomla/administrator/');
eb049397 169 * Front-end site:
23b5a711 170 * define( 'CIVICRM_UF_BASEURL' , 'http://www.example.com/joomla/');
eb049397
DL
171 *
172 */
8d133ef2 173if (!defined('CIVICRM_UF_BASEURL')) {
23b5a711 174 define( 'CIVICRM_UF_BASEURL' , '%%baseURL%%');
8d133ef2 175}
eb049397 176
32799d94
EM
177/**
178 * Define any CiviCRM Settings Overrides per http://wiki.civicrm.org/confluence/display/CRMDOC/Override+CiviCRM+Settings
179 *
180 * Uncomment and edit the below as appropriate.
181 */
182 // Add this line only once above any settings overrides.
183 // global $civicrm_setting;
184
185 // Override the Temporary Files directory.
186 // $civicrm_setting['Directory Preferences']['customFileUploadDir'] = '/path/to/upload';
187
188 // Override the custom files upload directory.
189 // $civicrm_setting['Directory Preferences']['uploadDir'] = '/path/to/upload-dir' ;
190
191 // Override the images directory.
192 // $civicrm_setting['Directory Preferences']['imageUploadDir'] = '/path/to/image-upload-dir' ;
193
194 // Override the custom templates directory.
195 // $civicrm_setting['Directory Preferences']['customTemplateDir'] = '/path/to/template-dir';
196
197 // Override the Custom php path directory.
198 // $civicrm_setting['Directory Preferences']['customPHPPathDir'] = '/path/to/custom-php-dir';
199
200 // Override the extensions directory.
201 // $civicrm_setting['Directory Preferences']['extensionsDir'] = '/path/to/extensions-dir';
202
203 // Override the resource url
204 // $civicrm_setting['URL Preferences']['userFrameworkResourceURL'] = 'http://example.com/example-resource-url/';
205
206 // Override the Image Upload URL (System Settings > Resource URLs)
207 // $civicrm_setting['URL Preferences']['imageUploadURL'] = 'http://example.com/example-image-upload-url';
208
209 // Override the Custom CiviCRM CSS URL
210 // $civicrm_setting['URL Preferences']['customCSSURL'] = 'http://example.com/example-css-url' ;
211
212 // Override the extensions resource URL
213 // $civicrm_setting['URL Preferences']['extensionsURL'] = 'http://example.com/pathtoextensiondir'
214
215 // Disable display of Community Messages on home dashboard
216 // $civicrm_setting['CiviCRM Preferences']['communityMessagesUrl'] = false;
217
218 // Disable automatic download / installation of extensions
219 // $civicrm_setting['Extension Preferences']['ext_repo_url'] = false;
220
221 // Disable version update alerts.
222 // $civicrm_setting['CiviCRM Preferences']['versionAlert']; = false;
223
224
225/**
eb049397
DL
226 * If you are using any CiviCRM script in the bin directory that
227 * requires authentication, then you also need to set this key.
228 * We recommend using a 16-32 bit alphanumeric/punctuation key.
229 * More info at http://wiki.civicrm.org/confluence/display/CRMDOC/Command-line+Script+Configuration
230 */
8d133ef2 231if (!defined('CIVICRM_SITE_KEY')) {
23b5a711 232 define( 'CIVICRM_SITE_KEY', '%%siteKey%%');
8d133ef2 233}
eb049397
DL
234
235/**
236 * Enable this constant, if you want to send your email through the smarty
237 * templating engine(allows you to do conditional and more complex logic)
238 *
239 */
8d133ef2
TO
240if (!defined('CIVICRM_MAIL_SMARTY')) {
241 define( 'CIVICRM_MAIL_SMARTY', 0 );
242}
eb049397
DL
243
244/**
245 * This setting logs all emails to a file. Useful for debugging any mail (or civimail) issues.
246 * Enabling this setting will not send any email, ensure this is commented out in production
247 * The CIVICRM_MAIL_LOG is a debug option which disables MTA (mail transport agent) interaction.
248 * You must disable CIVICRM_MAIL_LOG before CiviCRM will talk to your MTA.
249 */
8d133ef2 250// if (!defined('CIVICRM_MAIL_LOG')) {
23b5a711 251// define( 'CIVICRM_MAIL_LOG', '%%templateCompileDir%%/mail.log');
8d133ef2 252// }
eb049397 253
8d133ef2
TO
254
255if (!defined('CIVICRM_DOMAIN_ID')) {
23b5a711 256 define( 'CIVICRM_DOMAIN_ID', 1);
8d133ef2 257}
eb049397
DL
258
259/**
260 * Settings to enable external caching using a Memcache server. This is an
261 * advanced feature, and you should read and understand the documentation
262 * before you turn it on. We cannot store these settings in the DB since the
263 * config could potentially also be cached and we need to avoid an infinite
264 * recursion scenario.
265 *
266 * @see http://civicrm.org/node/126
267 */
268
269/**
270 * If you have a memcache server configured and want CiviCRM to make use of it,
271 * set the following constant. You should only set this once you have your memcache
272 * server up and working, because CiviCRM will not start up if your server is
273 * unavailable on the host and port that you specify. By default CiviCRM will use
274 * an in-memory array cache
275 *
276 * To use the php extension memcache use a value of 'Memcache'
277 * To use the php extension memcached use a value of 'Memcached'
278 * To use the php extension apc use a value of 'APCcache'
279 * To not use any caching (not recommended), use a value of 'NoCache'
280 *
281 */
8d133ef2 282if (!defined('CIVICRM_DB_CACHE_CLASS')) {
23b5a711 283 define('CIVICRM_DB_CACHE_CLASS', 'ArrayCache');
8d133ef2 284}
eb049397
DL
285
286/**
287 * Change this to the IP address of your cache server if it is not on the
288 * same machine (Unix).
289 */
8d133ef2 290if (!defined('CIVICRM_DB_CACHE_HOST')) {
23b5a711 291 define('CIVICRM_DB_CACHE_HOST', 'localhost');
8d133ef2 292}
eb049397
DL
293
294/**
295 * Change this if you are not using the standard port for memcache or apccache (11211)
296 */
8d133ef2 297if (!defined('CIVICRM_DB_CACHE_PORT')) {
23b5a711 298 define('CIVICRM_DB_CACHE_PORT', 11211 );
8d133ef2 299}
eb049397
DL
300
301/**
302 * Items in cache will expire after the number of seconds specified here.
303 * Default value is 3600 (i.e., after an hour)
304 */
8d133ef2 305if (!defined('CIVICRM_DB_CACHE_TIMEOUT')) {
23b5a711 306 define('CIVICRM_DB_CACHE_TIMEOUT', 3600 );
8d133ef2 307}
eb049397
DL
308
309/**
310 * If you are sharing the same memcache instance with more than one CiviCRM
311 * database, you will need to set a different value for the following argument
312 * so that each copy of CiviCRM will not interfere with other copies. If you only
313 * have one copy of CiviCRM, you may leave this set to ''. A good value for
314 * this if you have two servers might be 'server1_' for the first server, and
315 * 'server2_' for the second server.
316 */
8d133ef2 317if (!defined('CIVICRM_MEMCACHE_PREFIX')) {
23b5a711 318 define('CIVICRM_MEMCACHE_PREFIX', '');
8d133ef2 319}
eb049397
DL
320
321/**
322 * If you have multilingual site and you are using the "inherit CMS language"
323 * configuration option, but wish to, for example, use fr_CA instead of the
324 * default fr_FR (for French), set one or more of the constants below to an
325 * appropriate regional value.
326 */
327// define('CIVICRM_LANGUAGE_MAPPING_FR', 'fr_CA');
328// define('CIVICRM_LANGUAGE_MAPPING_EN', 'en_CA');
329// define('CIVICRM_LANGUAGE_MAPPING_ES', 'es_MX');
330// define('CIVICRM_LANGUAGE_MAPPING_PT', 'pt_BR');
331// define('CIVICRM_LANGUAGE_MAPPING_ZH', 'zh_TW');
332
de67bc86
ML
333/**
334 * Native gettext improves performance of localized CiviCRM installations
335 * significantly. However, your host must enable the locale (language).
336 * On most GNU/Linux, Unix or MacOSX systems, you may view them with
337 * the command line by typing: "locale -a".
338 *
339 * On Debian or Ubuntu, you may reconfigure locales with:
340 * # dpkg-reconfigure locales
341 *
342 * For more information:
343 * http://wiki.civicrm.org/confluence/x/YABFBQ
344 */
8d133ef2 345// if (!defined('CIVICRM_GETTEXT_NATIVE')) {
de67bc86 346// define('CIVICRM_GETTEXT_NATIVE', 1);
8d133ef2 347// }
de67bc86 348
eb049397
DL
349/**
350 * Configure MySQL to throw more errors when encountering unusual SQL expressions.
351 *
352 * If undefined, the value is determined automatically. For CiviCRM tarballs, it defaults
353 * to FALSE; for SVN checkouts, it defaults to TRUE.
354 */
8d133ef2 355// if (!defined('CIVICRM_MYSQL_STRICT')) {
23b5a711 356// define('CIVICRM_MYSQL_STRICT', TRUE );
8d133ef2 357// }
eb049397
DL
358
359/**
360 *
361 * Do not change anything below this line. Keep as is
362 *
363 */
364
365$include_path = '.' . PATH_SEPARATOR .
366 $civicrm_root . PATH_SEPARATOR .
367 $civicrm_root . DIRECTORY_SEPARATOR . 'packages' . PATH_SEPARATOR .
368 get_include_path( );
369if ( set_include_path( $include_path ) === false ) {
370 echo "Could not set the include path<p>";
371 exit( );
372}
373
8d133ef2 374if (!defined('CIVICRM_CLEANURL')) {
23b5a711
EM
375 if ( function_exists('variable_get') && variable_get('clean_url', '0') != '0') {
376 define('CIVICRM_CLEANURL', 1 );
377 }
378 else {
379 define('CIVICRM_CLEANURL', 0);
8d133ef2 380 }
eb049397
DL
381}
382
383// force PHP to auto-detect Mac line endings
384ini_set('auto_detect_line_endings', '1');
385
386// make sure the memory_limit is at least 64 MB
387$memLimitString = trim(ini_get('memory_limit'));
388$memLimitUnit = strtolower(substr($memLimitString, -1));
389$memLimit = (int) $memLimitString;
390switch ($memLimitUnit) {
391 case 'g': $memLimit *= 1024;
392 case 'm': $memLimit *= 1024;
393 case 'k': $memLimit *= 1024;
394}
395if ($memLimit >= 0 and $memLimit < 134217728) {
396 ini_set('memory_limit', '128M');
397}
398
399require_once 'CRM/Core/ClassLoader.php';
400CRM_Core_ClassLoader::singleton()->register();