dev/core#2120 Do not attempt to obsolete primary key on log tables
[civicrm-core.git] / templates / CRM / common / civicrm.settings.php.template
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 5 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2020 |
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 global $civicrm_root, $civicrm_setting, $civicrm_paths;
32
33 /**
34 * Content Management System (CMS) Host:
35 *
36 * CiviCRM can be hosted in either Drupal 6 or 7, Joomla or WordPress.
37 *
38 * Settings for Backdrop CMS:
39 * define( 'CIVICRM_UF' , 'Backdrop');
40 *
41 * Settings for Drupal 7.x:
42 * define( 'CIVICRM_UF' , 'Drupal');
43 *
44 * Settings for Drupal 6.x:
45 * define( 'CIVICRM_UF' , 'Drupal6');
46 *
47 * Settings for Joomla 1.7.x - 2.5.x:
48 * define( 'CIVICRM_UF' , 'Joomla');
49 *
50 * Settings for WordPress 3.3.x:
51 * define( 'CIVICRM_UF' , 'WordPress');
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 */
57 if (!defined('CIVICRM_UF')) {
58 if (getenv('CIVICRM_UF')) {
59 define('CIVICRM_UF', getenv('CIVICRM_UF'));
60 }
61 else {
62 define('CIVICRM_UF', '%%cms%%');
63 }
64 }
65
66 /**
67 * Content Management System (CMS) Datasource:
68 *
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 *
72 * Datasource (DSN) format:
73 * define( 'CIVICRM_UF_DSN', 'mysql://cms_db_username:cms_db_password@db_server/cms_database?new_link=true');
74 */
75 if (!defined('CIVICRM_UF_DSN') && CIVICRM_UF !== 'UnitTests') {
76 define( 'CIVICRM_UF_DSN' , 'mysql://%%CMSdbUser%%:%%CMSdbPass%%@%%CMSdbHost%%/%%CMSdbName%%?new_link=true%%CMSdbSSL%%');
77 }
78
79 // %%extraSettings%%
80
81 /**
82 * CiviCRM Database Settings
83 *
84 * Database URL (CIVICRM_DSN) for CiviCRM Data:
85 * Database URL format:
86 * define( 'CIVICRM_DSN', 'mysql://crm_db_username:crm_db_password@db_server/crm_database?new_link=true');
87 *
88 * Drupal and CiviCRM can share the same database, or can be installed into separate databases.
89 * Backdrop CMS and CiviCRM can also share the same database, or can be installed into separate databases.
90 *
91 * EXAMPLE: Drupal/Backdrop and CiviCRM running in the same database...
92 * DB Name = cms, DB User = cms
93 * define( 'CIVICRM_DSN' , 'mysql://cms:YOUR_PASSWORD@localhost/cms?new_link=true');
94 *
95 * EXAMPLE: Drupal/Backdrop and CiviCRM running in separate databases...
96 * CMS DB Name = cms, DB User = cms
97 * CiviCRM DB Name = civicrm, CiviCRM DB User = civicrm
98 * define( 'CIVICRM_DSN' , 'mysql://civicrm:YOUR_PASSWORD@localhost/civicrm?new_link=true');
99 *
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 *
103 */
104 if (!defined('CIVICRM_DSN')) {
105 if (CIVICRM_UF === 'UnitTests' && isset($GLOBALS['_CV']['TEST_DB_DSN'])) {
106 define('CIVICRM_DSN', $GLOBALS['_CV']['TEST_DB_DSN']);
107 }
108 else {
109 define('CIVICRM_DSN', 'mysql://%%dbUser%%:%%dbPass%%@%%dbHost%%/%%dbName%%?new_link=true%%dbSSL%%');
110 }
111 }
112
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
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 */
127 if (!defined('CIVICRM_LOGGING_DSN')) {
128 define('CIVICRM_LOGGING_DSN', CIVICRM_DSN);
129 }
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:
151 * define( 'CIVICRM_TEMPLATE_COMPILEDIR', '/var/www/htdocs/drupal/sites/default/files/civicrm/templates_c/');
152 *
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 *
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:
167 * define( 'CIVICRM_TEMPLATE_COMPILEDIR', '/var/www/htdocs/joomla/media/civicrm/templates_c/');
168 *
169 * EXAMPLE - WordPress Installations:
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
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:
175 * define( 'CIVICRM_TEMPLATE_COMPILEDIR', '/var/www/htdocs/wordpress/wp-content/uploads/civicrm/templates_c/');
176 *
177 */
178
179 global $civicrm_root;
180
181 $civicrm_root = '%%crmRoot%%';
182 if (!defined('CIVICRM_TEMPLATE_COMPILEDIR')) {
183 define( 'CIVICRM_TEMPLATE_COMPILEDIR', '%%templateCompileDir%%');
184 }
185
186 /**
187 * SMARTY Compile Check:
188 *
189 * This tells Smarty whether to check for recompiling or not. Recompiling
190 * does not need to happen unless a template or config file is changed.
191 * Typically you enable this during development, and disable for production.
192 *
193 * Related issue:
194 * https://lab.civicrm.org/dev/core/issues/1073
195 *
196 */
197 //if (!defined('CIVICRM_TEMPLATE_COMPILE_CHECK')) {
198 // define( 'CIVICRM_TEMPLATE_COMPILE_CHECK', FALSE);
199 //}
200
201 /**
202 * Site URLs:
203 *
204 * This section defines absolute and relative URLs to access the host CMS (Backdrop, Drupal, or Joomla) resources.
205 *
206 * IMPORTANT: Trailing slashes should be used on all URL settings.
207 *
208 *
209 * EXAMPLE - Drupal Installations:
210 * If your site's home url is http://www.example.com/drupal/
211 * these variables would be set as below. Modify as needed for your install.
212 *
213 * CIVICRM_UF_BASEURL - home URL for your site:
214 * define( 'CIVICRM_UF_BASEURL' , 'http://www.example.com/drupal/');
215 *
216 * EXAMPLE - Backdrop CMS Installations:
217 * If your site's home url is http://www.example.com/backdrop/
218 * these variables would be set as below. Modify as needed for your install.
219 *
220 * CIVICRM_UF_BASEURL - home URL for your site:
221 * define( 'CIVICRM_UF_BASEURL' , 'http://www.example.com/backdrop/');
222 *
223 * EXAMPLE - Joomla Installations:
224 * If your site's home url is http://www.example.com/joomla/
225 *
226 * CIVICRM_UF_BASEURL - home URL for your site:
227 * Administration site:
228 * define( 'CIVICRM_UF_BASEURL' , 'http://www.example.com/joomla/administrator/');
229 * Front-end site:
230 * define( 'CIVICRM_UF_BASEURL' , 'http://www.example.com/joomla/');
231 *
232 */
233 if (!defined('CIVICRM_UF_BASEURL')) {
234 define( 'CIVICRM_UF_BASEURL' , '%%baseURL%%');
235 }
236
237 /**
238 * Define any CiviCRM Settings Overrides per https://docs.civicrm.org/sysadmin/en/latest/customize/settings/
239 *
240 * Uncomment and edit the below as appropriate.
241 */
242
243 // Override the Temporary Files directory.
244 // $civicrm_setting['domain']['uploadDir'] = '/path/to/upload-dir' ;
245
246 // Override the custom files upload directory.
247 // $civicrm_setting['domain']['customFileUploadDir'] = '/path/to/custom-dir';
248
249 // Override the images directory.
250 // $civicrm_setting['domain']['imageUploadDir'] = '/path/to/image-upload-dir' ;
251
252 // Override the custom templates directory.
253 // $civicrm_setting['domain']['customTemplateDir'] = '/path/to/template-dir';
254
255 // Override the Custom php path directory.
256 // $civicrm_setting['domain']['customPHPPathDir'] = '/path/to/custom-php-dir';
257
258 // Override the extensions directory.
259 // $civicrm_setting['domain']['extensionsDir'] = '/path/to/extensions-dir';
260
261 // Override the resource url
262 // $civicrm_setting['domain']['userFrameworkResourceURL'] = 'http://example.com/example-resource-url/';
263
264 // Override the Image Upload URL (System Settings > Resource URLs)
265 // $civicrm_setting['domain']['imageUploadURL'] = 'http://example.com/example-image-upload-url';
266
267 // Override the Custom CiviCRM CSS URL
268 // $civicrm_setting['domain']['customCSSURL'] = 'http://example.com/example-css-url' ;
269
270 // Override the extensions resource URL
271 // $civicrm_setting['domain']['extensionsURL'] = 'http://example.com/pathtoextensiondir'
272
273 // Disable display of Community Messages on home dashboard
274 // $civicrm_setting['domain']['communityMessagesUrl'] = false;
275
276 // Disable automatic download / installation of extensions
277 // $civicrm_setting['domain']['ext_repo_url'] = false;
278
279 // set triggers to be managed offline per CRM-18212
280 // $civicrm_setting['domain']['logging_no_trigger_permission'] = 1;
281
282 // Override the CMS root path defined by cmsRootPath.
283 // define('CIVICRM_CMSDIR', '/path/to/install/root/');
284
285 // Opt-out of announcements by the CiviCRM core team for releases, paid services, events, etc. Separate each preferred optout category with a comma:
286 // "offers": paid service offers
287 // "asks": requests for donations or membership signup/renewal to CiviCRM
288 // "releases": major release announcements
289 // "events": announcements of local/national upcoming events
290 // $civicrm_setting['domain']['communityMessagesUrl'] = 'https://alert.civicrm.org/alert?prot=1&ver={ver}&uf={uf}&sid={sid}&lang={lang}&co={co}&optout=offers,asks';
291
292
293 /**
294 * If you are using any CiviCRM script in the bin directory that
295 * requires authentication, then you also need to set this key.
296 * We recommend using a 16-32 bit alphanumeric/punctuation key.
297 * More info at https://docs.civicrm.org/sysadmin/en/latest/setup/site-key/
298 */
299 if (!defined('CIVICRM_SITE_KEY')) {
300 define( 'CIVICRM_SITE_KEY', '%%siteKey%%');
301 }
302
303 /**
304 * Enable this constant, if you want to send your email through the smarty
305 * templating engine(allows you to do conditional and more complex logic)
306 *
307 */
308 if (!defined('CIVICRM_MAIL_SMARTY')) {
309 define( 'CIVICRM_MAIL_SMARTY', 0 );
310 }
311
312 /**
313 * This setting logs all emails to a file. Useful for debugging any mail (or civimail) issues.
314 * Enabling this setting will not send any email, ensure this is commented out in production
315 * The CIVICRM_MAIL_LOG is a debug option which disables MTA (mail transport agent) interaction.
316 * You must disable CIVICRM_MAIL_LOG before CiviCRM will talk to your MTA.
317 */
318 // if (!defined('CIVICRM_MAIL_LOG')) {
319 // define( 'CIVICRM_MAIL_LOG', '%%templateCompileDir%%/mail.log');
320 // }
321
322 /**
323 * This setting will only work if CIVICRM_MAIL_LOG is defined. Mail will be logged and then sent.
324 */
325 //if (!defined('CIVICRM_MAIL_LOG_AND_SEND')) {
326 // define( 'CIVICRM_MAIL_LOG_AND_SEND', 1);
327 //}
328
329
330 if (!defined('CIVICRM_DOMAIN_ID')) {
331 define( 'CIVICRM_DOMAIN_ID', 1);
332 }
333
334 /**
335 * Setting to define the environment in which this CiviCRM instance is running.
336 * Note the setting here must be value from the option group 'Environment',
337 * (see Administration > System Settings > Option Groups, Options beside Environment)
338 * which by default has three option values: 'Production', 'Staging', 'Development'.
339 * NB: defining a value for environment here prevents it from being set
340 * via the browser.
341 */
342 // $civicrm_setting['domain']['environment'] = 'Production';
343
344 /**
345 * Settings to enable external caching using a cache server. This is an
346 * advanced feature, and you should read and understand the documentation
347 * before you turn it on. We cannot store these settings in the DB since the
348 * config could potentially also be cached and we need to avoid an infinite
349 * recursion scenario.
350 *
351 * @see http://civicrm.org/node/126
352 */
353
354 /**
355 * If you have a cache server configured and want CiviCRM to make use of it,
356 * set the following constant. You should only set this once you have your cache
357 * server up and working, because CiviCRM will not start up if your server is
358 * unavailable on the host and port that you specify. By default CiviCRM will use
359 * an in-memory array cache
360 *
361 * To use the php extension memcache use a value of 'Memcache'
362 * To use the php extension memcached use a value of 'Memcached'
363 * To use the php extension apc use a value of 'APCcache'
364 * To use the php extension redis use a value of 'Redis'
365 * To not use any caching (not recommended), use a value of 'NoCache'
366 *
367 */
368 if (!defined('CIVICRM_DB_CACHE_CLASS')) {
369 define('CIVICRM_DB_CACHE_CLASS', 'ArrayCache');
370 }
371
372 /**
373 * Change this to the IP address of your cache server if it is not on the
374 * same machine (Unix).
375 */
376 if (!defined('CIVICRM_DB_CACHE_HOST')) {
377 define('CIVICRM_DB_CACHE_HOST', 'localhost');
378 }
379
380 /**
381 * Change this if you are not using the standard port for your cache server.
382 *
383 * The standard port for Memcache & APCCache is 11211. For Redis it is 6379.
384 */
385 if (!defined('CIVICRM_DB_CACHE_PORT')) {
386 if (CIVICRM_DB_CACHE_CLASS === 'Redis') {
387 define('CIVICRM_DB_CACHE_PORT', 6379 );
388 }
389 else {
390 define('CIVICRM_DB_CACHE_PORT', 11211);
391 }
392 }
393
394 /**
395 * Change this if your cache server requires a password (currently only works
396 * with Redis)
397 */
398 if (!defined('CIVICRM_DB_CACHE_PASSWORD')) {
399 define('CIVICRM_DB_CACHE_PASSWORD', '' );
400 }
401
402 /**
403 * Items in cache will expire after the number of seconds specified here.
404 * Default value is 3600 (i.e., after an hour)
405 */
406 if (!defined('CIVICRM_DB_CACHE_TIMEOUT')) {
407 define('CIVICRM_DB_CACHE_TIMEOUT', 3600 );
408 }
409
410 /**
411 * If you are sharing the same cache instance with more than one CiviCRM
412 * database, you will need to set a different value for the following argument
413 * so that each copy of CiviCRM will not interfere with other copies. If you only
414 * have one copy of CiviCRM, you may leave this set to ''. A good value for
415 * this if you have two servers might be 'server1_' for the first server, and
416 * 'server2_' for the second server.
417 */
418 if (!defined('CIVICRM_DB_CACHE_PREFIX')) {
419 define('CIVICRM_DB_CACHE_PREFIX', '');
420 }
421
422 /**
423 * The cache system traditionally allowed a wide range of cache-keys, but some
424 * cache-keys are prohibited by PSR-16.
425 */
426 if (!defined('CIVICRM_PSR16_STRICT')) {
427 define('CIVICRM_PSR16_STRICT', FALSE);
428 }
429
430 /**
431 * If you have multilingual site and you are using the "inherit CMS language"
432 * configuration option, but wish to, for example, use fr_CA instead of the
433 * default fr_FR (for French), set one or more of the constants below to an
434 * appropriate regional value.
435 *
436 * Note that since 5.26.0 specifically https://github.com/civicrm/civicrm-core/pull/16700
437 * This generally doesn't get used by WordPress especially if using the Polylang plugin.
438 * The reason is that the WordPress implementation has been changed to get the full locale
439 * from the WordPress plugin rather than just the 2 string language code.
440 */
441 // define('CIVICRM_LANGUAGE_MAPPING_FR', 'fr_CA');
442 // define('CIVICRM_LANGUAGE_MAPPING_EN', 'en_CA');
443 // define('CIVICRM_LANGUAGE_MAPPING_ES', 'es_MX');
444 // define('CIVICRM_LANGUAGE_MAPPING_PT', 'pt_BR');
445 // define('CIVICRM_LANGUAGE_MAPPING_ZH', 'zh_TW');
446
447 /**
448 * Native gettext improves performance of localized CiviCRM installations
449 * significantly. However, your host must enable the locale (language).
450 * On most GNU/Linux, Unix or MacOSX systems, you may view them with
451 * the command line by typing: "locale -a".
452 *
453 * On Debian or Ubuntu, you may reconfigure locales with:
454 * # dpkg-reconfigure locales
455 *
456 * For more information:
457 * https://lab.civicrm.org/dev/translation/-/wikis/Administrator-Guide#native-gettext
458 */
459 // if (!defined('CIVICRM_GETTEXT_NATIVE')) {
460 // define('CIVICRM_GETTEXT_NATIVE', 1);
461 // }
462
463 /**
464 * Define how many times to retry a transaction when the DB hits a deadlock
465 * (ie. the database is locked by another transaction). This is an
466 * advanced setting intended for high-traffic databases & experienced developers/ admins.
467 */
468 define('CIVICRM_DEADLOCK_RETRIES', 3);
469
470 /**
471 * Configure MySQL to throw more errors when encountering unusual SQL expressions.
472 *
473 * If undefined, the value is determined automatically. For CiviCRM tarballs, it defaults
474 * to FALSE; for SVN checkouts, it defaults to TRUE.
475 */
476 // if (!defined('CIVICRM_MYSQL_STRICT')) {
477 // define('CIVICRM_MYSQL_STRICT', TRUE );
478 // }
479
480 if (CIVICRM_UF === 'UnitTests') {
481 if (!defined('CIVICRM_CONTAINER_CACHE')) define('CIVICRM_CONTAINER_CACHE', 'auto');
482 if (!defined('CIVICRM_MYSQL_STRICT')) define('CIVICRM_MYSQL_STRICT', true);
483 }
484
485 /**
486 * Whether to include the hash in config log filenames. Defaults to TRUE.
487 * Disable only if you have configured the logfiles to be outside the docroot
488 * using the civicrm.log path setting.
489 *
490 */
491 // if (!defined('CIVICRM_LOG_HASH')) {
492 // define('CIVICRM_LOG_HASH', FALSE );
493 // }
494
495 /**
496 * The maximum size a log file may be before it's rotated, in bytes.
497 * Set to 0 to disable rotation (only recommended if you have an
498 * external logrotate configuration).
499 */
500 // if (!defined('CIVICRM_LOG_ROTATESIZE')) {
501 // define('CIVICRM_LOG_ROTATESIZE', 0 );
502 // }
503
504 /**
505 * Which directories should we exclude when scanning the codebase for things
506 * like extension .info files, or .html partials or .xml files etc. This needs
507 * to be a valid preg_match() pattern.
508 *
509 * If you do not define it, a pattern that excludes dirs starting with a dot is
510 * used, e.g. to exclude .git/). Adding suitable patterns here can vastly speed
511 * up your container rebuilds and cache flushes. The pattern is matched against
512 * the absolute path. Remember to use your system's DIRECTORY_SEPARATOR the
513 * examples below assume /
514 *
515 * Example: This excludes node_modules (can be huge), various CiviCRM dirs that
516 * are unlikely to have anything we need to scan inside, and (what could be
517 * your) Drupal's private file storage area.
518 *
519 * '@/(\.|node_modules|js/|css/|bower_components|packages/|vendor/|sites/default/files/private)@'
520 */
521 // if (!defined('CIVICRM_EXCLUDE_DIRS_PATTERN')) {
522 // define('CIVICRM_EXCLUDE_DIRS_PATTERN', '@/\.@');
523 // }
524
525 /**
526 *
527 * Do not change anything below this line. Keep as is
528 *
529 */
530
531 $include_path = '.' . PATH_SEPARATOR .
532 $civicrm_root . PATH_SEPARATOR .
533 $civicrm_root . DIRECTORY_SEPARATOR . 'packages' . PATH_SEPARATOR .
534 get_include_path( );
535 if ( set_include_path( $include_path ) === false ) {
536 echo "Could not set the include path<p>";
537 exit( );
538 }
539
540 if (!defined('CIVICRM_CLEANURL')) {
541 if ( function_exists('variable_get') && variable_get('clean_url', '0') != '0') {
542 define('CIVICRM_CLEANURL', 1 );
543 }
544 elseif ( function_exists('config_get') && config_get('system.core', 'clean_url') != 0) {
545 define('CIVICRM_CLEANURL', 1 );
546 }
547 elseif( function_exists('get_option') && get_option('permalink_structure') != '' ) {
548 define('CIVICRM_CLEANURL', 1 );
549 }
550 else {
551 define('CIVICRM_CLEANURL', 0);
552 }
553 }
554
555 // force PHP to auto-detect Mac line endings
556 ini_set('auto_detect_line_endings', '1');
557
558 // make sure the memory_limit is at least 64 MB
559 $memLimitString = trim(ini_get('memory_limit'));
560 $memLimitUnit = strtolower(substr($memLimitString, -1));
561 $memLimit = (int) $memLimitString;
562 switch ($memLimitUnit) {
563 case 'g': $memLimit *= 1024;
564 case 'm': $memLimit *= 1024;
565 case 'k': $memLimit *= 1024;
566 }
567 if ($memLimit >= 0 and $memLimit < 134217728) {
568 ini_set('memory_limit', '128M');
569 }
570
571 require_once 'CRM/Core/ClassLoader.php';
572 CRM_Core_ClassLoader::singleton()->register();