Commit f048314c authored by Steve Müller's avatar Steve Müller Committed by GitHub

Merge pull request #2547 from Chrisissorry/pgsql-dsn-with-semicolons

Replacing spaces in the pgsql dsn string with semicolons as this is m…
parents 56d20557 cbf48793
...@@ -79,34 +79,34 @@ class Driver extends AbstractPostgreSQLDriver ...@@ -79,34 +79,34 @@ class Driver extends AbstractPostgreSQLDriver
$dsn = 'pgsql:'; $dsn = 'pgsql:';
if (isset($params['host']) && $params['host'] != '') { if (isset($params['host']) && $params['host'] != '') {
$dsn .= 'host=' . $params['host'] . ' '; $dsn .= 'host=' . $params['host'] . ';';
} }
if (isset($params['port']) && $params['port'] != '') { if (isset($params['port']) && $params['port'] != '') {
$dsn .= 'port=' . $params['port'] . ' '; $dsn .= 'port=' . $params['port'] . ';';
} }
if (isset($params['dbname'])) { if (isset($params['dbname'])) {
$dsn .= 'dbname=' . $params['dbname'] . ' '; $dsn .= 'dbname=' . $params['dbname'] . ';';
} elseif (isset($params['default_dbname'])) { } elseif (isset($params['default_dbname'])) {
$dsn .= 'dbname=' . $params['default_dbname'] . ' '; $dsn .= 'dbname=' . $params['default_dbname'] . ';';
} else { } else {
// Used for temporary connections to allow operations like dropping the database currently connected to. // Used for temporary connections to allow operations like dropping the database currently connected to.
// Connecting without an explicit database does not work, therefore "postgres" database is used // Connecting without an explicit database does not work, therefore "postgres" database is used
// as it is mostly present in every server setup. // as it is mostly present in every server setup.
$dsn .= 'dbname=postgres' . ' '; $dsn .= 'dbname=postgres' . ';';
} }
if (isset($params['sslmode'])) { if (isset($params['sslmode'])) {
$dsn .= 'sslmode=' . $params['sslmode'] . ' '; $dsn .= 'sslmode=' . $params['sslmode'] . ';';
} }
if (isset($params['sslrootcert'])) { if (isset($params['sslrootcert'])) {
$dsn .= 'sslrootcert=' . $params['sslrootcert'] . ' '; $dsn .= 'sslrootcert=' . $params['sslrootcert'] . ';';
} }
if (isset($params['application_name'])) { if (isset($params['application_name'])) {
$dsn .= 'application_name=' . $params['application_name'] . ' '; $dsn .= 'application_name=' . $params['application_name'] . ';';
} }
return $dsn; return $dsn;
......
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