Skip to content

Commit

Permalink
Merge branch '3.8.x' into 4.0.x
Browse files Browse the repository at this point in the history
* 3.8.x:
  Add gssencmode option to connection string for PgSQL & PDO PgSQL driver (doctrine#6320)
  • Loading branch information
derrabus committed Mar 3, 2024
2 parents c82a62e + b4329d5 commit 12bed06
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/en/reference/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ pdo_pgsql / pgsql
- ``sslcrl`` (string): specifies the filename of the SSL certificate
revocation list (CRL).
See `https://www.postgresql.org/docs/9.4/static/libpq-connect.html#LIBPQ-CONNECT-SSLCRL`
- ``gssencmode`` (string): Optional GSS-encrypted channel/GSSEncMode configuration.
See `https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-GSSENCMODE`
- ``application_name`` (string): Name of the application that is
connecting to database. Optional. It will be displayed at ``pg_stat_activity``.

Expand Down
4 changes: 4 additions & 0 deletions src/Driver/PDO/PgSQL/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ private function constructPdoDsn(array $params): string
$dsn .= 'application_name=' . $params['application_name'] . ';';
}

if (isset($params['gssencmode'])) {
$dsn .= 'gssencmode=' . $params['gssencmode'] . ';';
}

return $dsn;
}
}
1 change: 1 addition & 0 deletions src/Driver/PgSQL/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ private function constructConnectionString(
'user' => $params['user'] ?? null,
'password' => $params['password'] ?? null,
'sslmode' => $params['sslmode'] ?? null,
'gssencmode' => $params['gssencmode'] ?? null,
],
static fn (int|string|null $value) => $value !== '' && $value !== null,
);
Expand Down

0 comments on commit 12bed06

Please sign in to comment.