Skip to content

Commit

Permalink
pgsql fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nticaric committed May 24, 2016
1 parent e613df9 commit b8db8fe
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/Indexer/TNTIndexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,18 @@ protected function getHostDsn(array $config)
}

if ($driver == 'pgsql') {
return "pgsql:{$host}dbname={$database}";
}
$host = isset($host) ? "host={$host};" : '';
$dsn = "pgsql:{$host}dbname={$database}";
if (isset($config['port'])) {
$dsn .= ";port={$port}";
}

if (isset($config['sslmode'])) {
$dsn .= ";sslmode={$sslmode}";
}

return $dsn;
}
}

public function query($query)
Expand Down

0 comments on commit b8db8fe

Please sign in to comment.