Commit cbf48793 authored by Christoph Tietz's avatar Christoph Tietz

Replacing spaces in the pgsql dsn string with semicolons as this is more...

Replacing spaces in the pgsql dsn string with semicolons as this is more consistent with the other drivers and makes the PDOPgSQL driver work in hhvm 3.15.2 as well.
parent ec8fc166
...@@ -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