Skip to content

Commit a461105

Browse files
committed
Add connection attributes to pdb config.
1 parent 60501ec commit a461105

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/Pdb.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,9 @@ public static function connect($config, array $options = [])
318318
}
319319

320320
try {
321+
$options = array_merge($config->attributes, $options);
322+
323+
// This is essential to how Pdb works, so it's never overridden.
321324
$options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
322325

323326
if ($config->timeout) {

src/PdbConfig.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,14 @@ class PdbConfig extends Collection
240240
*/
241241
public $session = [];
242242

243+
244+
/**
245+
* Connection attributes.
246+
*
247+
* @var array [ PDO::ATTR_* => value ]
248+
*/
249+
public $attributes = [];
250+
243251
/**
244252
* Driver specific hacks.
245253
*

0 commit comments

Comments
 (0)