Skip to content

Commit 3c658c8

Browse files
committed
Merge branch '3.10.x' into 4.3.x
2 parents fee8a1e + c9011eb commit 3c658c8

File tree

2 files changed

+5
-22
lines changed

2 files changed

+5
-22
lines changed

docs/en/reference/configuration.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ pdo_mysql
227227
- ``dbname`` (string): Name of the database/schema to connect to.
228228
- ``unix_socket`` (string): Name of the socket used to connect to
229229
the database.
230+
- ``persistent`` (boolean): Whether to establish a persistent connection.
230231
- ``charset`` (string): The charset used when connecting to the
231232
database.
232233

@@ -283,6 +284,7 @@ pdo_pgsql / pgsql
283284
See `www.postgresql.org/docs/9.4/static/libpq-connect.html#LIBPQ-CONNECT-SSLCRL <https://www.postgresql.org/docs/9.4/static/libpq-connect.html#LIBPQ-CONNECT-SSLCRL>`_
284285
- ``gssencmode`` (string): Optional GSS-encrypted channel/GSSEncMode configuration.
285286
See `www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-GSSENCMODE <https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-GSSENCMODE>`_
287+
- ``persistent`` (boolean): Whether to establish a persistent connection (currently supported only by ``pdo_pgsql``).
286288
- ``application_name`` (string): Name of the application that is
287289
connecting to database. Optional. It will be displayed at ``pg_stat_activity``.
288290

tests/TestUtil.php

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -199,31 +199,12 @@ private static function mapConnectionParameters(array $configuration, string $pr
199199
{
200200
$parameters = [];
201201

202-
foreach (
203-
[
204-
'driver',
205-
'user',
206-
'password',
207-
'host',
208-
'dbname',
209-
'memory',
210-
'port',
211-
'server',
212-
'ssl_key',
213-
'ssl_cert',
214-
'ssl_ca',
215-
'ssl_capath',
216-
'ssl_cipher',
217-
'unix_socket',
218-
'path',
219-
'charset',
220-
] as $parameter
221-
) {
222-
if (! isset($configuration[$prefix . $parameter])) {
202+
foreach ($configuration as $key => $value) {
203+
if (! str_starts_with($key, $prefix)) {
223204
continue;
224205
}
225206

226-
$parameters[$parameter] = $configuration[$prefix . $parameter];
207+
$parameters[substr($key, strlen($prefix))] = $value;
227208
}
228209

229210
if (isset($parameters['port'])) {

0 commit comments

Comments
 (0)