The civicrm.settings.php file is similar to Drupal's settings.php in that it is where settings CiviCRM needs are stored. Also like Drupal's settings.php, the civicrm.settings.php is normally created when installing CiviCRM based on values added to a form during the install process. When installing CiviCRM, the lack of a civicrm.settings.php causes CiviCRM to tell Drupal that not all dependencies have been met for CiviCRM to be installed. Because the CiviCRM Starter Kit install profile lists the CiviCRM "module" as a dependency, the CiviCRM Starter Kit install cannot continue until CiviCRM is installed. The result is this screen...
Depending on the environment, once the CiviCRM is install is complete the Drupal install will resume where you've left off or start over (Pantheon starts over).
Once the civicrm.settings.php file is created, it can not be modified by updates to CiviCRM in the CiviCRM Starter Kit. You can update the code/sites/default/civicrm.settings.php file manually using SFTP or Git on the Dev instance of the site. Because Pantheon considers these settings files code, the same file settings.php and civicrm.settings.php files are pushed to the Test and Live instances. Because of this, Pantheon specific code is included in the civicrm.settings.php along with the normal CiviCRM settings. Instead of using hard coded settings, in a Pantheon environment the settings are pulled from $_SERVER['PRESSFLOW_SETTINGS'])...
if (!empty($_SERVER['PRESSFLOW_SETTINGS'])) {
$env = json_decode($_SERVER['PRESSFLOW_SETTINGS'], TRUE);
if (!empty($env['conf']['pantheon_binding'])) {
$pantheon_db = $env['databases']['default']['default'];
$pantheon_conf = $env['conf'];
//user name and password
$db_string = $pantheon_db['driver'] . '://' . $pantheon_db['username'] . ':' . $pantheon_db['password'] . '@';
//host
$db_string .= 'dbserver.' . $pantheon_conf['pantheon_environment'] . '.' . $pantheon_conf['pantheon_site_uuid'] . '.drush.in' . ':' . $pantheon_db['port'];
// database
$db_string .= '/' . $pantheon_db['database'] . '?new_link=true';
// define the database strings
define('CIVICRM_UF_DSN', $db_string);
define('CIVICRM_DSN', $db_string);
// define the file paths
global $civicrm_root;
//$civicrm_root = '/srv/bindings/' . $pantheon_conf['pantheon_binding'] . '/code/' . str_replace('drupal', '', drupal_get_path('module', 'civicrm'));
$civicrm_root = '/srv/bindings/' . $pantheon_conf['pantheon_binding'] . '/code/profiles/civicrm_starterkit/modules/civicrm';
define('CIVICRM_TEMPLATE_COMPILEDIR', '/srv/bindings/' . $pantheon_conf['pantheon_binding'] . '/files/civicrm/templates_c/');
// Use Drupal base url and path
global $base_url, $base_path;
define('CIVICRM_UF_BASEURL', $base_url . '/');
define( 'CIVICRM_IDS_ENABLE', 0);
define( 'CIVICRM_SITE_KEY', '2391f678908b90245f6306c04d3e3b09' );
if ( $pantheon_conf['pantheon_environment'] == 'dev' || $pantheon_conf['pantheon_environment'] == 'test' ){
/**
* This setting logs all emails to a file. Useful for debugging any mail (or civimail) issues.
* This will not send any email, so ensure this is commented out in production
*/
define( 'CIVICRM_MAIL_LOG', '/srv/bindings/' . $pantheon_conf['pantheon_binding'] . '/code/sites/default/files/civicrm/templates_c/mail.log' );
}
}
} else {
If you want to completely rebuild you civicrm.settings.php file with the most recent version included in the kit, replace the content of your file with the contents of the attached civicrm.settings.txt file.
Attachment | Size |
---|---|
civicrm.settings.txt | 14.31 KB |