Commit 3916ca43 authored by Seamus Lee's avatar Seamus Lee

Further Install errors following testing locally

parent 9043c4bf
......@@ -108,8 +108,15 @@ class Requirements {
* @return object mysqli connection
*/
protected function connect($db_config) {
$conn = @mysqli_connect($db_config['host'], $db_config['username'], $db_config['password'], $db_config['database'], isset($db_config['port']) ? $db_config['port'] : NULL);
return $donn;
$host = NULL;
if (!empty($db_config['host'])) {
$host = $db_config['host'];
}
elseif (!empty($db_config['server'])) {
$host = $db_config['server'];
}
$conn = @mysqli_connect($host, $db_config['username'], $db_config['password'], $db_config['database'], !empty($db_config['port']) ? $db_config['port'] : NULL);
return $conn;
}
/**
......
......@@ -97,8 +97,13 @@ function civicrm_main(&$config) {
civicrm_setup($files_dirname);
}
$dsn = "mysql://{$config['mysql']['username']}:{$config['mysql']['password']}@{$config['mysql']['server']}/{$config['mysql']['database']}?new_link=true";
$parts = explode(':', $config['mysql']['server']);
if (empty($parts[1])) {
$parts[1] = 3306;
}
$config['mysql']['server'] = implode(':', $parts);
$dsn = "mysql://{$config['mysql']['username']}:{$config['mysql']['password']}@{$config['mysql']['server']}/{$config['mysql']['database']}?new_link=true";
civicrm_source($dsn, $sqlPath . DIRECTORY_SEPARATOR . 'civicrm.mysql');
if (!empty($config['loadGenerated'])) {
......@@ -224,7 +229,14 @@ function civicrm_config(&$config) {
$params['baseURL'] = isset($config['base_url']) ? $config['base_url'] : civicrm_cms_base();
if ($installType == 'drupal' && defined('VERSION')) {
if (version_compare(VERSION, '7.0-rc1') >= 0) {
if (version_compare(VERSION, '8.0') >= 0) {
$params['cms'] = 'Drupal';
$params['CMSdbUser'] = addslashes($config['drupal']['username']);
$params['CMSdbPass'] = addslashes($config['drupal']['password']);
$params['CMSdbHost'] = $config['drupal']['host'] . ":" . !empty($config['drupal']['port']) ? $config['drupal']['port'] : "3306";
$params['CMSdbName'] = addslashes($config['drupal']['database']);
}
elseif (version_compare(VERSION, '7.0-rc1') >= 0) {
$params['cms'] = 'Drupal';
$params['CMSdbUser'] = addslashes($config['drupal']['username']);
$params['CMSdbPass'] = addslashes($config['drupal']['password']);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment