Repair 2
This commit is contained in:
@@ -213,14 +213,21 @@ final class Database
|
||||
|
||||
$host = (string)($db['host'] ?? 'localhost');
|
||||
$port = (int)($db['port'] ?? 5432);
|
||||
$connectTimeout = isset($db['connect_timeout']) ? max(1, (int) $db['connect_timeout']) : null;
|
||||
|
||||
// Hinweis: charset gehört bei pgsql nicht in den DSN
|
||||
return sprintf(
|
||||
$dsn = sprintf(
|
||||
'pgsql:host=%s;port=%d;dbname=%s',
|
||||
$host,
|
||||
$port,
|
||||
(string)$db['dbname']
|
||||
);
|
||||
|
||||
if ($connectTimeout !== null) {
|
||||
$dsn .= ';connect_timeout=' . $connectTimeout;
|
||||
}
|
||||
|
||||
return $dsn;
|
||||
}
|
||||
|
||||
private static function buildSqliteDsn(array $db): string
|
||||
|
||||
Reference in New Issue
Block a user