From 844b94bda95e6bd41db5fe027982bb583e0040c8 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 22 Jan 2016 01:48:43 -0800 Subject: [PATCH] CRM-17860 - civicrm.settings.php.template - One settings for normal+headless cfg If `CIVICRM_UF` is set before we load `civicrm.settings.php`, it can be used to switch to headless mode. All but two settings should be the same. --- templates/CRM/common/civicrm.settings.php.template | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/templates/CRM/common/civicrm.settings.php.template b/templates/CRM/common/civicrm.settings.php.template index 29d4cdfdbd..f5f4cc2cdf 100644 --- a/templates/CRM/common/civicrm.settings.php.template +++ b/templates/CRM/common/civicrm.settings.php.template @@ -64,7 +64,7 @@ if (!defined('CIVICRM_UF')) { * Datasource (DSN) format: * define( 'CIVICRM_UF_DSN', 'mysql://cms_db_username:cms_db_password@db_server/cms_database?new_link=true'); */ -if (!defined('CIVICRM_UF_DSN')) { +if (!defined('CIVICRM_UF_DSN') && CIVICRM_UF !== 'UnitTests') { define( 'CIVICRM_UF_DSN' , 'mysql://%%CMSdbUser%%:%%CMSdbPass%%@%%CMSdbHost%%/%%CMSdbName%%?new_link=true'); } @@ -89,7 +89,12 @@ if (!defined('CIVICRM_UF_DSN')) { * */ if (!defined('CIVICRM_DSN')) { - define( 'CIVICRM_DSN' , 'mysql://%%dbUser%%:%%dbPass%%@%%dbHost%%/%%dbName%%?new_link=true'); + if (CIVICRM_UF !== 'UnitTests') { + define('CIVICRM_DSN', 'mysql://%%dbUser%%:%%dbPass%%@%%dbHost%%/%%dbName%%?new_link=true'); + } + else { + define('CIVICRM_DSN', 'mysql://%%testUser%%:%%testPass%%@%%testHost%%/%%testName%%?new_link=true'); + } } /** -- 2.25.1