Skip to content

Commit 4355bdb

Browse files
committed
Fix bad pdo_options merge
We need this e.g. to be able to open a sqlite connection with ATTR_PERSISTENT = true. array_merge was re-keying the array and using the wrong attributes. Change-Id: I1d272377b5142785ab17a91d7664d121241a565f
1 parent 3b9b4db commit 4355bdb

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/PHPQueue/Backend/PDO.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ public function __construct($options=array())
3939
$this->db_table = $options['db_table'];
4040
}
4141
if (!empty($options['pdo_options']) && is_array($options['pdo_options'])) {
42-
$this->pdo_options = array_merge($this->pdo_options, $options['pdo_options']);
42+
// Use + operator instead of array_merge to preserve integer keys
43+
$this->pdo_options = $options['pdo_options'] + $this->pdo_options;
4344
}
4445
}
4546

0 commit comments

Comments
 (0)