Tweak postgres connector.

This commit is contained in:
Taylor Otwell 2013-01-05 16:22:32 -06:00
parent f948801369
commit 23bdbd0834
1 changed files with 3 additions and 1 deletions

View File

@ -24,7 +24,9 @@ public function connect($config)
{ {
extract($config); extract($config);
$dsn = "pgsql:host={$host};dbname={$database}"; $host_dsn = isset($host) ? 'host='.$host.';' : '';
$dsn = "pgsql:{$host_dsn}dbname={$database}";
// The developer has the freedom of specifying a port for the PostgresSQL // The developer has the freedom of specifying a port for the PostgresSQL
// database or the default port (5432) will be used by PDO to create the // database or the default port (5432) will be used by PDO to create the