Skip to content

Commit 6abd17d

Browse files
authored
Update DB.php
Фикс передачи опций в конструктор
1 parent 9897e55 commit 6abd17d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/DB.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class DB extends \PDO {
1111

1212
public function __construct($dsn, $username = null, $passwd = null, $options = null) {
1313
if (is_array($options))
14-
$options = array_merge([PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION], $options);
14+
$options = array_replace([PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION], $options);
1515
else
1616
$options = [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION];
1717
$this->dsn = $dsn;
@@ -123,4 +123,4 @@ public function deleteByIds($table, $column, $ids) {
123123
public function truncate($table) {
124124
return $this->exec("TRUNCATE TABLE ?f", [$table]);
125125
}
126-
}
126+
}

0 commit comments

Comments
 (0)