From 68c3beb43e79605848213810ee623244ced23525 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Mon, 11 Sep 2017 11:40:26 -0700 Subject: [PATCH 1/3] CRM-18231 - civicrm.settings.php.template - Fix broken `environment` example The expression `CRM_Core_BAO_Setting::DEVELOPER_PREFERENCES_NAME` does not work within `civicrm.settings.php` because the classloader has not been initialized yet. This file is just supposed to store the data needed for bootstrap. --- templates/CRM/common/civicrm.settings.php.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/CRM/common/civicrm.settings.php.template b/templates/CRM/common/civicrm.settings.php.template index b221f33f6e3b..e201f0294cad 100644 --- a/templates/CRM/common/civicrm.settings.php.template +++ b/templates/CRM/common/civicrm.settings.php.template @@ -316,7 +316,7 @@ if (!defined('CIVICRM_DOMAIN_ID')) { * NB: defining a value for environment here prevents it from being set * via the browser. */ -// $civicrm_setting[CRM_Core_BAO_Setting::DEVELOPER_PREFERENCES_NAME]['environment'] = 'Production'; +// $civicrm_setting['domain']['environment'] = 'Production'; /** * Settings to enable external caching using a cache server. This is an From 2f8edd6613780deab137f98d5b2c7344a183095a Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Mon, 11 Sep 2017 11:42:34 -0700 Subject: [PATCH 2/3] CRM-18231 - civicrm.settings.php.template - Move `global` declaration When using the example snippets in the settings file, it's easy to accidentally leave `global $civicrm_setting` commented out -- which is fairly confusing/mysterious way to have your settings ignored. There's no cost to declaring `global $civicrm_setting` by default in new config files. --- templates/CRM/common/civicrm.settings.php.template | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/templates/CRM/common/civicrm.settings.php.template b/templates/CRM/common/civicrm.settings.php.template index e201f0294cad..00070a4e382f 100644 --- a/templates/CRM/common/civicrm.settings.php.template +++ b/templates/CRM/common/civicrm.settings.php.template @@ -28,6 +28,7 @@ /** * CiviCRM Configuration File. */ +global $civicrm_setting; /** * Content Management System (CMS) Host: @@ -221,8 +222,6 @@ if (!defined('CIVICRM_UF_BASEURL')) { * * Uncomment and edit the below as appropriate. */ - // Add this line only once above any settings overrides. - // global $civicrm_setting; // Override the Temporary Files directory. // $civicrm_setting['Directory Preferences']['uploadDir'] = '/path/to/upload-dir' ; From 594efcacd641df5d878dd4e1049b115df6cfbeaf Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Mon, 11 Sep 2017 11:45:35 -0700 Subject: [PATCH 3/3] CRM-18231 - civicrm.settings.php.template - Remove extra whitespace --- .../CRM/common/civicrm.settings.php.template | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/templates/CRM/common/civicrm.settings.php.template b/templates/CRM/common/civicrm.settings.php.template index 00070a4e382f..b580e27638bf 100644 --- a/templates/CRM/common/civicrm.settings.php.template +++ b/templates/CRM/common/civicrm.settings.php.template @@ -307,15 +307,15 @@ if (!defined('CIVICRM_DOMAIN_ID')) { define( 'CIVICRM_DOMAIN_ID', 1); } -/** - * Setting to define the environment in which this CiviCRM instance is running. - * Note the setting here must be value from the option group 'Environment', - * (see Administration > System Settings > Option Groups, Options beside Environment) - * which by default has three option values: 'Production', 'Staging', 'Development'. +/** + * Setting to define the environment in which this CiviCRM instance is running. + * Note the setting here must be value from the option group 'Environment', + * (see Administration > System Settings > Option Groups, Options beside Environment) + * which by default has three option values: 'Production', 'Staging', 'Development'. * NB: defining a value for environment here prevents it from being set - * via the browser. - */ -// $civicrm_setting['domain']['environment'] = 'Production'; + * via the browser. + */ +// $civicrm_setting['domain']['environment'] = 'Production'; /** * Settings to enable external caching using a cache server. This is an