Skip to content

Commit 5c54419

Browse files
author
dlobo
committed
Merge pull request civicrm#165 from mlutfy/6.x-4.4-crm15331
CRM-15331 [6.x-4.4] Backport for drush civicrm-install: check for the civicrm.settings.template file.
2 parents fcde5b7 + 0026de9 commit 5c54419

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

drush/civicrm.drush.inc

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,19 @@ function _civicrm_generate_settings_file($dbuser, $dbpass, $dbhost, $dbname, $mo
361361
$siteRoot = drush_get_context('DRUSH_DRUPAL_SITE_ROOT', FALSE);
362362
$crmPath = "$modPath/civicrm";
363363

364-
$settingsTplFile = "$crmPath/templates/CRM/common/civicrm.settings.php.tpl";
365-
if (!file_exists($settingsTplFile)) {
364+
$files = array(
365+
"$crmPath/templates/CRM/common/civicrm.settings.php.template",
366+
"$crmPath/templates/CRM/common/civicrm.settings.php.tpl"
367+
);
368+
369+
$settingsTplFile = NULL;
370+
foreach ($files as $file) {
371+
if (file_exists($file)) {
372+
$settingsTplFile = $file;
373+
}
374+
}
375+
376+
if (!$settingsTplFile) {
366377
drush_die(dt("Could not find CiviCRM settings template and therefore could not create settings file."));
367378
}
368379

0 commit comments

Comments
 (0)