Commit | Line | Data |
---|---|---|
eb049397 DL |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
fee14197 | 4 | | CiviCRM version 5 | |
eb049397 | 5 | +--------------------------------------------------------------------+ |
adc7fffe | 6 | | Copyright CiviCRM LLC (c) 2004-2020 | |
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 | */ | |
f553d1ea | 31 | global $civicrm_root, $civicrm_setting, $civicrm_paths; |
eb049397 DL |
32 | |
33 | /** | |
34 | * Content Management System (CMS) Host: | |
35 | * | |
36 | * CiviCRM can be hosted in either Drupal 6 or 7, Joomla or WordPress. | |
37 | * | |
83cac775 | 38 | * Settings for Backdrop CMS: |
92b1c24f | 39 | * define( 'CIVICRM_UF' , 'Backdrop'); |
83cac775 | 40 | * |
eb049397 | 41 | * Settings for Drupal 7.x: |
92b1c24f | 42 | * define( 'CIVICRM_UF' , 'Drupal'); |
eb049397 DL |
43 | * |
44 | * Settings for Drupal 6.x: | |
23b5a711 | 45 | * define( 'CIVICRM_UF' , 'Drupal6'); |
eb049397 DL |
46 | * |
47 | * Settings for Joomla 1.7.x - 2.5.x: | |
23b5a711 | 48 | * define( 'CIVICRM_UF' , 'Joomla'); |
eb049397 DL |
49 | * |
50 | * Settings for WordPress 3.3.x: | |
23b5a711 | 51 | * define( 'CIVICRM_UF' , 'WordPress'); |
eb049397 DL |
52 | * |
53 | * You may have issues with images in CiviCRM. If this is the case, be sure | |
54 | * to update the CiviCRM Resource URL field to your CiviCRM root directory | |
55 | * (Administer::System Settings::Resource URLs). | |
56 | */ | |
8d133ef2 | 57 | if (!defined('CIVICRM_UF')) { |
0a4cd490 TO |
58 | if (getenv('CIVICRM_UF')) { |
59 | define('CIVICRM_UF', getenv('CIVICRM_UF')); | |
60 | } | |
61 | else { | |
62 | define('CIVICRM_UF', '%%cms%%'); | |
63 | } | |
8d133ef2 | 64 | } |
eb049397 DL |
65 | |
66 | /** | |
67 | * Content Management System (CMS) Datasource: | |
68 | * | |
9beff2cf NM |
69 | * Update this setting with your CMS (Drupal, Backdrop CMS, or Joomla) database username, password, server and DB name. |
70 | * If any of these contain a single quote or backslash, escape those characters with a backslash: \' and \\, respectively. | |
71 | * | |
eb049397 | 72 | * Datasource (DSN) format: |
171b6dc9 | 73 | * define( 'CIVICRM_UF_DSN', 'mysql://cms_db_username:cms_db_password@db_server/cms_database?new_link=true'); |
eb049397 | 74 | */ |
844b94bd | 75 | if (!defined('CIVICRM_UF_DSN') && CIVICRM_UF !== 'UnitTests') { |
fc2b5ff8 | 76 | define( 'CIVICRM_UF_DSN' , 'mysql://%%CMSdbUser%%:%%CMSdbPass%%@%%CMSdbHost%%/%%CMSdbName%%?new_link=true%%CMSdbSSL%%'); |
8d133ef2 | 77 | } |
eb049397 | 78 | |
f553d1ea KC |
79 | // %%extraSettings%% |
80 | ||
eb049397 DL |
81 | /** |
82 | * CiviCRM Database Settings | |
83 | * | |
84 | * Database URL (CIVICRM_DSN) for CiviCRM Data: | |
85 | * Database URL format: | |
171b6dc9 | 86 | * define( 'CIVICRM_DSN', 'mysql://crm_db_username:crm_db_password@db_server/crm_database?new_link=true'); |
eb049397 DL |
87 | * |
88 | * Drupal and CiviCRM can share the same database, or can be installed into separate databases. | |
92b1c24f | 89 | * Backdrop CMS and CiviCRM can also share the same database, or can be installed into separate databases. |
eb049397 | 90 | * |
92b1c24f JL |
91 | * EXAMPLE: Drupal/Backdrop and CiviCRM running in the same database... |
92 | * DB Name = cms, DB User = cms | |
171b6dc9 | 93 | * define( 'CIVICRM_DSN' , 'mysql://cms:YOUR_PASSWORD@localhost/cms?new_link=true'); |
eb049397 | 94 | * |
92b1c24f JL |
95 | * EXAMPLE: Drupal/Backdrop and CiviCRM running in separate databases... |
96 | * CMS DB Name = cms, DB User = cms | |
eb049397 | 97 | * CiviCRM DB Name = civicrm, CiviCRM DB User = civicrm |
171b6dc9 | 98 | * define( 'CIVICRM_DSN' , 'mysql://civicrm:YOUR_PASSWORD@localhost/civicrm?new_link=true'); |
eb049397 | 99 | * |
9beff2cf NM |
100 | * If your username, password, server or DB name contain a single quote or backslash, escape those characters |
101 | * with a backslash: \' and \\, respectively. | |
102 | * | |
eb049397 | 103 | */ |
8d133ef2 | 104 | if (!defined('CIVICRM_DSN')) { |
2b045ddd TO |
105 | if (CIVICRM_UF === 'UnitTests' && isset($GLOBALS['_CV']['TEST_DB_DSN'])) { |
106 | define('CIVICRM_DSN', $GLOBALS['_CV']['TEST_DB_DSN']); | |
844b94bd TO |
107 | } |
108 | else { | |
04b1abad | 109 | define('CIVICRM_DSN', 'mysql://%%dbUser%%:%%dbPass%%@%%dbHost%%/%%dbName%%?new_link=true%%dbSSL%%'); |
844b94bd | 110 | } |
8d133ef2 | 111 | } |
eb049397 | 112 | |
a8219e90 SL |
113 | /** |
114 | * CiviCRM DSN Mode | |
115 | * Used to determine if you want CiviCRM to automatically change the dsn to mysqli if its avaliable. | |
116 | * Uncomment and edit below as necessary | |
117 | */ | |
118 | // define ('DB_DSN_MODE', 'auto'); | |
119 | ||
120 | ||
eb049397 DL |
121 | /** |
122 | * CiviCRM Logging Database | |
123 | * | |
124 | * Used to point to a different database to use for logging (if desired). If unset defaults to equal CIVICRM_DSN. | |
125 | * The CIVICRM_DSN user needs to have the rights to modify the below database schema and be able to write to it. | |
126 | */ | |
8d133ef2 TO |
127 | if (!defined('CIVICRM_LOGGING_DSN')) { |
128 | define('CIVICRM_LOGGING_DSN', CIVICRM_DSN); | |
129 | } | |
eb049397 DL |
130 | |
131 | /** | |
132 | * File System Paths: | |
133 | * | |
134 | * $civicrm_root is the file system path on your server where the civicrm | |
135 | * code is installed. Use an ABSOLUTE path (not a RELATIVE path) for this setting. | |
136 | * | |
137 | * CIVICRM_TEMPLATE_COMPILEDIR is the file system path where compiled templates are stored. | |
138 | * These sub-directories and files are temporary caches and will be recreated automatically | |
139 | * if deleted. | |
140 | * | |
141 | * IMPORTANT: The COMPILEDIR directory must exist, | |
142 | * and your web server must have read/write access to these directories. | |
143 | * | |
144 | * | |
145 | * EXAMPLE - Drupal: | |
146 | * If the path to the Drupal home directory is /var/www/htdocs/drupal | |
147 | * the $civicrm_root setting would be: | |
148 | * $civicrm_root = '/var/www/htdocs/drupal/sites/all/modules/civicrm/'; | |
149 | * | |
150 | * the CIVICRM_TEMPLATE_COMPILEDIR would be: | |
23b5a711 | 151 | * define( 'CIVICRM_TEMPLATE_COMPILEDIR', '/var/www/htdocs/drupal/sites/default/files/civicrm/templates_c/'); |
eb049397 | 152 | * |
92b1c24f JL |
153 | * EXAMPLE - Backdrop CMS: |
154 | * If the path to the Backdrop home directory is /var/www/htdocs/backdrop | |
155 | * the $civicrm_root setting would be: | |
156 | * $civicrm_root = '/var/www/htdocs/backdrop/modules/civicrm/'; | |
157 | * | |
158 | * the CIVICRM_TEMPLATE_COMPILEDIR would be: | |
159 | * define( 'CIVICRM_TEMPLATE_COMPILEDIR', '/var/www/htdocs/backdrop/files/civicrm/templates_c/'); | |
160 | * | |
eb049397 DL |
161 | * EXAMPLE - Joomla Installations: |
162 | * If the path to the Joomla home directory is /var/www/htdocs/joomla | |
163 | * the $civicrm_root setting would be: | |
164 | * $civicrm_root = '/var/www/htdocs/joomla/administrator/components/com_civicrm/civicrm/'; | |
165 | * | |
166 | * the CIVICRM_TEMPLATE_COMPILEDIR would be: | |
23b5a711 | 167 | * define( 'CIVICRM_TEMPLATE_COMPILEDIR', '/var/www/htdocs/joomla/media/civicrm/templates_c/'); |
eb049397 DL |
168 | * |
169 | * EXAMPLE - WordPress Installations: | |
750752f2 | 170 | * If the path to the WordPress home directory is /var/www/htdocs/wordpress and the path to the plugin directory is /var/www/htdocs/wordpress/wp-content/plugins |
eb049397 DL |
171 | * the $civicrm_root setting would be: |
172 | * $civicrm_root = '/var/www/htdocs/wordpress/wp-content/plugins/civicrm/civicrm/'; | |
173 | * | |
174 | * the CIVICRM_TEMPLATE_COMPILEDIR would be: | |
750752f2 | 175 | * define( 'CIVICRM_TEMPLATE_COMPILEDIR', '/var/www/htdocs/wordpress/wp-content/uploads/civicrm/templates_c/'); |
eb049397 DL |
176 | * |
177 | */ | |
178 | ||
eb049397 | 179 | $civicrm_root = '%%crmRoot%%'; |
8d133ef2 | 180 | if (!defined('CIVICRM_TEMPLATE_COMPILEDIR')) { |
23b5a711 | 181 | define( 'CIVICRM_TEMPLATE_COMPILEDIR', '%%templateCompileDir%%'); |
8d133ef2 | 182 | } |
eb049397 | 183 | |
d938f496 LS |
184 | /** |
185 | * SMARTY Compile Check: | |
186 | * | |
187 | * This tells Smarty whether to check for recompiling or not. Recompiling | |
188 | * does not need to happen unless a template or config file is changed. | |
189 | * Typically you enable this during development, and disable for production. | |
190 | * | |
191 | * Related issue: | |
192 | * https://lab.civicrm.org/dev/core/issues/1073 | |
193 | * | |
194 | */ | |
195 | //if (!defined('CIVICRM_TEMPLATE_COMPILE_CHECK')) { | |
737a7783 EM |
196 | // define('CIVICRM_TEMPLATE_COMPILE_CHECK', FALSE); |
197 | //} | |
198 | ||
199 | /** | |
200 | * Smarty escape on output. | |
201 | * | |
202 | * This tells smarty to pass all variables through the escape function | |
203 | * unless they are piped to smarty:nodefaults (eg. {$myScript|smarty:nodefaults} | |
204 | * At this stage it should only be enabled on development sites. | |
205 | * @see https://github.com/civicrm/civicrm-core/pull/21935 | |
206 | */ | |
207 | //if (!defined('CIVICRM_SMARTY_DEFAULT_ESCAPE')) { | |
208 | // define('CIVICRM_SMARTY_DEFAULT_ESCAPE', TRUE); | |
d938f496 LS |
209 | //} |
210 | ||
eb049397 DL |
211 | /** |
212 | * Site URLs: | |
213 | * | |
92b1c24f | 214 | * This section defines absolute and relative URLs to access the host CMS (Backdrop, Drupal, or Joomla) resources. |
eb049397 DL |
215 | * |
216 | * IMPORTANT: Trailing slashes should be used on all URL settings. | |
217 | * | |
218 | * | |
219 | * EXAMPLE - Drupal Installations: | |
220 | * If your site's home url is http://www.example.com/drupal/ | |
221 | * these variables would be set as below. Modify as needed for your install. | |
222 | * | |
223 | * CIVICRM_UF_BASEURL - home URL for your site: | |
23b5a711 | 224 | * define( 'CIVICRM_UF_BASEURL' , 'http://www.example.com/drupal/'); |
eb049397 | 225 | * |
92b1c24f JL |
226 | * EXAMPLE - Backdrop CMS Installations: |
227 | * If your site's home url is http://www.example.com/backdrop/ | |
228 | * these variables would be set as below. Modify as needed for your install. | |
229 | * | |
230 | * CIVICRM_UF_BASEURL - home URL for your site: | |
231 | * define( 'CIVICRM_UF_BASEURL' , 'http://www.example.com/backdrop/'); | |
232 | * | |
eb049397 DL |
233 | * EXAMPLE - Joomla Installations: |
234 | * If your site's home url is http://www.example.com/joomla/ | |
235 | * | |
236 | * CIVICRM_UF_BASEURL - home URL for your site: | |
237 | * Administration site: | |
23b5a711 | 238 | * define( 'CIVICRM_UF_BASEURL' , 'http://www.example.com/joomla/administrator/'); |
eb049397 | 239 | * Front-end site: |
23b5a711 | 240 | * define( 'CIVICRM_UF_BASEURL' , 'http://www.example.com/joomla/'); |
eb049397 DL |
241 | * |
242 | */ | |
8d133ef2 | 243 | if (!defined('CIVICRM_UF_BASEURL')) { |
23b5a711 | 244 | define( 'CIVICRM_UF_BASEURL' , '%%baseURL%%'); |
8d133ef2 | 245 | } |
eb049397 | 246 | |
32799d94 | 247 | /** |
6f55e2a8 | 248 | * Define any CiviCRM Settings Overrides per https://docs.civicrm.org/sysadmin/en/latest/customize/settings/ |
32799d94 EM |
249 | * |
250 | * Uncomment and edit the below as appropriate. | |
251 | */ | |
32799d94 EM |
252 | |
253 | // Override the Temporary Files directory. | |
496f6c63 | 254 | // $civicrm_setting['domain']['uploadDir'] = '/path/to/upload-dir' ; |
32799d94 EM |
255 | |
256 | // Override the custom files upload directory. | |
496f6c63 | 257 | // $civicrm_setting['domain']['customFileUploadDir'] = '/path/to/custom-dir'; |
32799d94 EM |
258 | |
259 | // Override the images directory. | |
496f6c63 | 260 | // $civicrm_setting['domain']['imageUploadDir'] = '/path/to/image-upload-dir' ; |
32799d94 EM |
261 | |
262 | // Override the custom templates directory. | |
496f6c63 | 263 | // $civicrm_setting['domain']['customTemplateDir'] = '/path/to/template-dir'; |
32799d94 EM |
264 | |
265 | // Override the Custom php path directory. | |
496f6c63 | 266 | // $civicrm_setting['domain']['customPHPPathDir'] = '/path/to/custom-php-dir'; |
32799d94 EM |
267 | |
268 | // Override the extensions directory. | |
496f6c63 | 269 | // $civicrm_setting['domain']['extensionsDir'] = '/path/to/extensions-dir'; |
32799d94 EM |
270 | |
271 | // Override the resource url | |
496f6c63 | 272 | // $civicrm_setting['domain']['userFrameworkResourceURL'] = 'http://example.com/example-resource-url/'; |
32799d94 EM |
273 | |
274 | // Override the Image Upload URL (System Settings > Resource URLs) | |
496f6c63 | 275 | // $civicrm_setting['domain']['imageUploadURL'] = 'http://example.com/example-image-upload-url'; |
32799d94 EM |
276 | |
277 | // Override the Custom CiviCRM CSS URL | |
496f6c63 | 278 | // $civicrm_setting['domain']['customCSSURL'] = 'http://example.com/example-css-url' ; |
32799d94 EM |
279 | |
280 | // Override the extensions resource URL | |
496f6c63 | 281 | // $civicrm_setting['domain']['extensionsURL'] = 'http://example.com/pathtoextensiondir' |
32799d94 EM |
282 | |
283 | // Disable display of Community Messages on home dashboard | |
496f6c63 | 284 | // $civicrm_setting['domain']['communityMessagesUrl'] = false; |
32799d94 EM |
285 | |
286 | // Disable automatic download / installation of extensions | |
496f6c63 | 287 | // $civicrm_setting['domain']['ext_repo_url'] = false; |
32799d94 | 288 | |
f76ec559 | 289 | // set triggers to be managed offline per CRM-18212 |
496f6c63 | 290 | // $civicrm_setting['domain']['logging_no_trigger_permission'] = 1; |
f76ec559 | 291 | |
f7732cb7 KC |
292 | // Override the CMS root path defined by cmsRootPath. |
293 | // define('CIVICRM_CMSDIR', '/path/to/install/root/'); | |
294 | ||
89732521 CW |
295 | // Opt-out of announcements by the CiviCRM core team for releases, paid services, events, etc. Separate each preferred optout category with a comma: |
296 | // "offers": paid service offers | |
297 | // "asks": requests for donations or membership signup/renewal to CiviCRM | |
298 | // "releases": major release announcements | |
299 | // "events": announcements of local/national upcoming events | |
496f6c63 | 300 | // $civicrm_setting['domain']['communityMessagesUrl'] = 'https://alert.civicrm.org/alert?prot=1&ver={ver}&uf={uf}&sid={sid}&lang={lang}&co={co}&optout=offers,asks'; |
89732521 | 301 | |
f7732cb7 | 302 | |
32799d94 | 303 | /** |
eb049397 DL |
304 | * If you are using any CiviCRM script in the bin directory that |
305 | * requires authentication, then you also need to set this key. | |
306 | * We recommend using a 16-32 bit alphanumeric/punctuation key. | |
033af979 | 307 | * More info at https://docs.civicrm.org/sysadmin/en/latest/setup/site-key/ |
eb049397 | 308 | */ |
8d133ef2 | 309 | if (!defined('CIVICRM_SITE_KEY')) { |
23b5a711 | 310 | define( 'CIVICRM_SITE_KEY', '%%siteKey%%'); |
8d133ef2 | 311 | } |
eb049397 | 312 | |
71110177 TO |
313 | /** |
314 | * If credentials are stored in the database, the CIVICRM_CRED_KEYS will be | |
315 | * used to encrypt+decrypt them. This is a space-delimited list of keys (ordered by | |
316 | * priority). Put the preferred key first. Any old/deprecated keys may be | |
317 | * listed after. | |
318 | * | |
319 | * Each key is in format "<cipher-suite>:<key-encoding>:<key-content>", as in: | |
320 | * | |
321 | * Ex: define('CIVICRM_CRED_KEYS', 'aes-cbc:hkdf-sha256:RANDOM_1') | |
322 | * Ex: define('CIVICRM_CRED_KEYS', 'aes-ctr-hs:b64:RANDOM_2 aes-ctr-hs:b64:RANDOM_3') | |
323 | * Ex: define('CIVICRM_CRED_KEYS', '::MY_NEW_KEY ::MY_OLD_KEY') | |
324 | * | |
325 | * If cipher-suite or key-encoding is blank, they will use defaults ("aes-cbc" | |
326 | * and "hkdf-sha256", respectively). | |
327 | * | |
328 | * More info at https://docs.civicrm.org/sysadmin/en/latest/setup/cred-key/ | |
329 | */ | |
330 | if (!defined('CIVICRM_CRED_KEYS') ) { | |
331 | define( '_CIVICRM_CRED_KEYS', '%%credKeys%%'); | |
332 | define( 'CIVICRM_CRED_KEYS', _CIVICRM_CRED_KEYS === '%%' . 'credKeys' . '%%' ? '' : _CIVICRM_CRED_KEYS ); | |
333 | // Some old installers may not set a decent value, and this extra complexity is a failsafe. | |
334 | // Feel free to simplify post-install. | |
335 | } | |
336 | ||
8846c128 TO |
337 | /** |
338 | * The signing key is used to generate and verify shareable tokens. | |
339 | * | |
340 | * This is a space-delimited list of keys (ordered by priority). Put the preferred | |
341 | * key first. Any old/deprecated keys may be listed after. | |
342 | * | |
343 | * Each key is in format "<cipher-suite>:<key-encoding>:<key-content>", as in: | |
344 | * | |
345 | * Ex: define('CIVICRM_SIGN_KEYS', 'jwt-hs256:hkdf-sha256:RANDOM_1') | |
346 | * Ex: define('CIVICRM_SIGN_KEYS', 'jwt-hs256::RANDOM_2 jwt-hs256::RANDOM_3') | |
347 | * Ex: define('CIVICRM_SIGN_KEYS', 'jwt-hs256:b64:RANDOM_4 jwt-hs256:b64:RANDOM_5') | |
348 | * | |
349 | * If key-encoding is blank, it will default to "hkdf-sha256". | |
350 | */ | |
351 | if (!defined('CIVICRM_SIGN_KEYS') ) { | |
352 | define( '_CIVICRM_SIGN_KEYS', '%%signKeys%%'); | |
353 | define( 'CIVICRM_SIGN_KEYS', _CIVICRM_SIGN_KEYS === '%%' . 'signKeys' . '%%' ? '' : _CIVICRM_SIGN_KEYS ); | |
354 | // Some old installers may not set a decent value, and this extra complexity is a failsafe. | |
355 | // Feel free to simplify post-install. | |
356 | } | |
357 | ||
eb049397 DL |
358 | /** |
359 | * Enable this constant, if you want to send your email through the smarty | |
360 | * templating engine(allows you to do conditional and more complex logic) | |
361 | * | |
362 | */ | |
8d133ef2 TO |
363 | if (!defined('CIVICRM_MAIL_SMARTY')) { |
364 | define( 'CIVICRM_MAIL_SMARTY', 0 ); | |
365 | } | |
eb049397 DL |
366 | |
367 | /** | |
368 | * This setting logs all emails to a file. Useful for debugging any mail (or civimail) issues. | |
369 | * Enabling this setting will not send any email, ensure this is commented out in production | |
370 | * The CIVICRM_MAIL_LOG is a debug option which disables MTA (mail transport agent) interaction. | |
371 | * You must disable CIVICRM_MAIL_LOG before CiviCRM will talk to your MTA. | |
372 | */ | |
8d133ef2 | 373 | // if (!defined('CIVICRM_MAIL_LOG')) { |
23b5a711 | 374 | // define( 'CIVICRM_MAIL_LOG', '%%templateCompileDir%%/mail.log'); |
8d133ef2 | 375 | // } |
eb049397 | 376 | |
2ddaef97 MW |
377 | /** |
378 | * This setting will only work if CIVICRM_MAIL_LOG is defined. Mail will be logged and then sent. | |
379 | */ | |
380 | //if (!defined('CIVICRM_MAIL_LOG_AND_SEND')) { | |
381 | // define( 'CIVICRM_MAIL_LOG_AND_SEND', 1); | |
382 | //} | |
383 | ||
8d133ef2 TO |
384 | |
385 | if (!defined('CIVICRM_DOMAIN_ID')) { | |
23b5a711 | 386 | define( 'CIVICRM_DOMAIN_ID', 1); |
8d133ef2 | 387 | } |
eb049397 | 388 | |
594efcac TO |
389 | /** |
390 | * Setting to define the environment in which this CiviCRM instance is running. | |
391 | * Note the setting here must be value from the option group 'Environment', | |
392 | * (see Administration > System Settings > Option Groups, Options beside Environment) | |
393 | * which by default has three option values: 'Production', 'Staging', 'Development'. | |
8a078f99 | 394 | * NB: defining a value for environment here prevents it from being set |
594efcac TO |
395 | * via the browser. |
396 | */ | |
397 | // $civicrm_setting['domain']['environment'] = 'Production'; | |
f008885c | 398 | |
eb049397 | 399 | /** |
59e56021 | 400 | * Settings to enable external caching using a cache server. This is an |
eb049397 DL |
401 | * advanced feature, and you should read and understand the documentation |
402 | * before you turn it on. We cannot store these settings in the DB since the | |
403 | * config could potentially also be cached and we need to avoid an infinite | |
404 | * recursion scenario. | |
405 | * | |
406 | * @see http://civicrm.org/node/126 | |
407 | */ | |
408 | ||
409 | /** | |
59e56021 H |
410 | * If you have a cache server configured and want CiviCRM to make use of it, |
411 | * set the following constant. You should only set this once you have your cache | |
eb049397 DL |
412 | * server up and working, because CiviCRM will not start up if your server is |
413 | * unavailable on the host and port that you specify. By default CiviCRM will use | |
414 | * an in-memory array cache | |
415 | * | |
416 | * To use the php extension memcache use a value of 'Memcache' | |
417 | * To use the php extension memcached use a value of 'Memcached' | |
418 | * To use the php extension apc use a value of 'APCcache' | |
59e56021 | 419 | * To use the php extension redis use a value of 'Redis' |
eb049397 DL |
420 | * To not use any caching (not recommended), use a value of 'NoCache' |
421 | * | |
422 | */ | |
8d133ef2 | 423 | if (!defined('CIVICRM_DB_CACHE_CLASS')) { |
23b5a711 | 424 | define('CIVICRM_DB_CACHE_CLASS', 'ArrayCache'); |
8d133ef2 | 425 | } |
eb049397 DL |
426 | |
427 | /** | |
428 | * Change this to the IP address of your cache server if it is not on the | |
429 | * same machine (Unix). | |
430 | */ | |
8d133ef2 | 431 | if (!defined('CIVICRM_DB_CACHE_HOST')) { |
23b5a711 | 432 | define('CIVICRM_DB_CACHE_HOST', 'localhost'); |
8d133ef2 | 433 | } |
eb049397 DL |
434 | |
435 | /** | |
9d2f1acb | 436 | * Change this if you are not using the standard port for your cache server. |
437 | * | |
438 | * The standard port for Memcache & APCCache is 11211. For Redis it is 6379. | |
eb049397 | 439 | */ |
8d133ef2 | 440 | if (!defined('CIVICRM_DB_CACHE_PORT')) { |
044e2410 | 441 | if (CIVICRM_DB_CACHE_CLASS === 'Redis') { |
442 | define('CIVICRM_DB_CACHE_PORT', 6379 ); | |
443 | } | |
444 | else { | |
445 | define('CIVICRM_DB_CACHE_PORT', 11211); | |
446 | } | |
8d133ef2 | 447 | } |
eb049397 | 448 | |
59e56021 | 449 | /** |
9d2f1acb | 450 | * Change this if your cache server requires a password (currently only works |
59e56021 H |
451 | * with Redis) |
452 | */ | |
453 | if (!defined('CIVICRM_DB_CACHE_PASSWORD')) { | |
454 | define('CIVICRM_DB_CACHE_PASSWORD', '' ); | |
455 | } | |
456 | ||
eb049397 DL |
457 | /** |
458 | * Items in cache will expire after the number of seconds specified here. | |
459 | * Default value is 3600 (i.e., after an hour) | |
460 | */ | |
8d133ef2 | 461 | if (!defined('CIVICRM_DB_CACHE_TIMEOUT')) { |
23b5a711 | 462 | define('CIVICRM_DB_CACHE_TIMEOUT', 3600 ); |
8d133ef2 | 463 | } |
eb049397 DL |
464 | |
465 | /** | |
59e56021 | 466 | * If you are sharing the same cache instance with more than one CiviCRM |
eb049397 DL |
467 | * database, you will need to set a different value for the following argument |
468 | * so that each copy of CiviCRM will not interfere with other copies. If you only | |
469 | * have one copy of CiviCRM, you may leave this set to ''. A good value for | |
470 | * this if you have two servers might be 'server1_' for the first server, and | |
471 | * 'server2_' for the second server. | |
472 | */ | |
59e56021 H |
473 | if (!defined('CIVICRM_DB_CACHE_PREFIX')) { |
474 | define('CIVICRM_DB_CACHE_PREFIX', ''); | |
8d133ef2 | 475 | } |
eb049397 | 476 | |
cdee59f7 TO |
477 | /** |
478 | * The cache system traditionally allowed a wide range of cache-keys, but some | |
479 | * cache-keys are prohibited by PSR-16. | |
480 | */ | |
481 | if (!defined('CIVICRM_PSR16_STRICT')) { | |
482 | define('CIVICRM_PSR16_STRICT', FALSE); | |
483 | } | |
484 | ||
eb049397 DL |
485 | /** |
486 | * If you have multilingual site and you are using the "inherit CMS language" | |
487 | * configuration option, but wish to, for example, use fr_CA instead of the | |
488 | * default fr_FR (for French), set one or more of the constants below to an | |
489 | * appropriate regional value. | |
fddd5fca SL |
490 | * |
491 | * Note that since 5.26.0 specifically https://github.com/civicrm/civicrm-core/pull/16700 | |
492 | * This generally doesn't get used by WordPress especially if using the Polylang plugin. | |
493 | * The reason is that the WordPress implementation has been changed to get the full locale | |
494 | * from the WordPress plugin rather than just the 2 string language code. | |
eb049397 DL |
495 | */ |
496 | // define('CIVICRM_LANGUAGE_MAPPING_FR', 'fr_CA'); | |
497 | // define('CIVICRM_LANGUAGE_MAPPING_EN', 'en_CA'); | |
498 | // define('CIVICRM_LANGUAGE_MAPPING_ES', 'es_MX'); | |
499 | // define('CIVICRM_LANGUAGE_MAPPING_PT', 'pt_BR'); | |
500 | // define('CIVICRM_LANGUAGE_MAPPING_ZH', 'zh_TW'); | |
8c72611d | 501 | // define('CIVICRM_LANGUAGE_MAPPING_NL', 'nl_BE'); |
eb049397 | 502 | |
de67bc86 ML |
503 | /** |
504 | * Native gettext improves performance of localized CiviCRM installations | |
505 | * significantly. However, your host must enable the locale (language). | |
506 | * On most GNU/Linux, Unix or MacOSX systems, you may view them with | |
507 | * the command line by typing: "locale -a". | |
508 | * | |
509 | * On Debian or Ubuntu, you may reconfigure locales with: | |
510 | * # dpkg-reconfigure locales | |
511 | * | |
512 | * For more information: | |
033af979 | 513 | * https://lab.civicrm.org/dev/translation/-/wikis/Administrator-Guide#native-gettext |
de67bc86 | 514 | */ |
8d133ef2 | 515 | // if (!defined('CIVICRM_GETTEXT_NATIVE')) { |
de67bc86 | 516 | // define('CIVICRM_GETTEXT_NATIVE', 1); |
8d133ef2 | 517 | // } |
de67bc86 | 518 | |
0ba49657 | 519 | /** |
520 | * Define how many times to retry a transaction when the DB hits a deadlock | |
521 | * (ie. the database is locked by another transaction). This is an | |
522 | * advanced setting intended for high-traffic databases & experienced developers/ admins. | |
523 | */ | |
524 | define('CIVICRM_DEADLOCK_RETRIES', 3); | |
525 | ||
3b2c20b7 TO |
526 | if (CIVICRM_UF === 'UnitTests') { |
527 | if (!defined('CIVICRM_CONTAINER_CACHE')) define('CIVICRM_CONTAINER_CACHE', 'auto'); | |
3b2c20b7 TO |
528 | } |
529 | ||
9e618bf2 DH |
530 | /** |
531 | * Whether to include the hash in config log filenames. Defaults to TRUE. | |
532 | * Disable only if you have configured the logfiles to be outside the docroot | |
533 | * using the civicrm.log path setting. | |
534 | * | |
535 | */ | |
536 | // if (!defined('CIVICRM_LOG_HASH')) { | |
537 | // define('CIVICRM_LOG_HASH', FALSE ); | |
538 | // } | |
539 | ||
540 | /** | |
541 | * The maximum size a log file may be before it's rotated, in bytes. | |
542 | * Set to 0 to disable rotation (only recommended if you have an | |
543 | * external logrotate configuration). | |
544 | */ | |
545 | // if (!defined('CIVICRM_LOG_ROTATESIZE')) { | |
546 | // define('CIVICRM_LOG_ROTATESIZE', 0 ); | |
547 | // } | |
548 | ||
ba89bdbd RLAR |
549 | /** |
550 | * Which directories should we exclude when scanning the codebase for things | |
551 | * like extension .info files, or .html partials or .xml files etc. This needs | |
552 | * to be a valid preg_match() pattern. | |
553 | * | |
554 | * If you do not define it, a pattern that excludes dirs starting with a dot is | |
555 | * used, e.g. to exclude .git/). Adding suitable patterns here can vastly speed | |
556 | * up your container rebuilds and cache flushes. The pattern is matched against | |
557 | * the absolute path. Remember to use your system's DIRECTORY_SEPARATOR the | |
558 | * examples below assume / | |
559 | * | |
5f5b01da | 560 | * The default excludes node_modules (can be huge), various CiviCRM dirs that |
ba89bdbd | 561 | * are unlikely to have anything we need to scan inside, and (what could be |
5f5b01da | 562 | * your) Drupal's private file storage area. It does not exclude |
563 | * vendor but you are likely to see an improvement by adding it. | |
ba89bdbd | 564 | * |
5f5b01da | 565 | * See https://docs.civicrm.org/sysadmin/en/latest/setup/optimizations/#exclude-dirs-that-do-not-need-to-be-scanned |
566 | * and also discussion on including vendor (excluded) in https://lab.civicrm.org/dev/core/-/issues/2031 | |
ba89bdbd | 567 | */ |
5f5b01da | 568 | if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN' && !defined('CIVICRM_EXCLUDE_DIRS_PATTERN')) { |
569 | define('CIVICRM_EXCLUDE_DIRS_PATTERN', '@/(\.|node_modules|js/|css/|bower_components|packages/|sites/default/files/private)@'); | |
570 | } | |
ba89bdbd | 571 | |
eb049397 DL |
572 | /** |
573 | * | |
574 | * Do not change anything below this line. Keep as is | |
575 | * | |
576 | */ | |
577 | ||
578 | $include_path = '.' . PATH_SEPARATOR . | |
579 | $civicrm_root . PATH_SEPARATOR . | |
580 | $civicrm_root . DIRECTORY_SEPARATOR . 'packages' . PATH_SEPARATOR . | |
581 | get_include_path( ); | |
582 | if ( set_include_path( $include_path ) === false ) { | |
583 | echo "Could not set the include path<p>"; | |
584 | exit( ); | |
585 | } | |
586 | ||
8d133ef2 | 587 | if (!defined('CIVICRM_CLEANURL')) { |
5f5b01da | 588 | if (function_exists('variable_get') && variable_get('clean_url', '0') != '0') { |
23b5a711 EM |
589 | define('CIVICRM_CLEANURL', 1 ); |
590 | } | |
2aad87fa | 591 | elseif ( function_exists('config_get') && config_get('system.core', 'clean_url') != 0) { |
48538a6f HD |
592 | define('CIVICRM_CLEANURL', 1 ); |
593 | } | |
d32a2b16 KC |
594 | elseif( function_exists('get_option') && get_option('permalink_structure') != '' ) { |
595 | define('CIVICRM_CLEANURL', 1 ); | |
596 | } | |
23b5a711 EM |
597 | else { |
598 | define('CIVICRM_CLEANURL', 0); | |
8d133ef2 | 599 | } |
eb049397 DL |
600 | } |
601 | ||
602 | // force PHP to auto-detect Mac line endings | |
603 | ini_set('auto_detect_line_endings', '1'); | |
604 | ||
605 | // make sure the memory_limit is at least 64 MB | |
606 | $memLimitString = trim(ini_get('memory_limit')); | |
607 | $memLimitUnit = strtolower(substr($memLimitString, -1)); | |
608 | $memLimit = (int) $memLimitString; | |
609 | switch ($memLimitUnit) { | |
610 | case 'g': $memLimit *= 1024; | |
611 | case 'm': $memLimit *= 1024; | |
612 | case 'k': $memLimit *= 1024; | |
613 | } | |
614 | if ($memLimit >= 0 and $memLimit < 134217728) { | |
615 | ini_set('memory_limit', '128M'); | |
616 | } | |
617 | ||
618 | require_once 'CRM/Core/ClassLoader.php'; | |
619 | CRM_Core_ClassLoader::singleton()->register(); |