From 0bb294edc58d5d767f5bc579ca9ec7608dce2676 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Thu, 24 Aug 2023 12:01:34 +0800 Subject: [PATCH] qqq --- Connection.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Connection.php b/Connection.php index 6191c15..7968255 100644 --- a/Connection.php +++ b/Connection.php @@ -191,7 +191,6 @@ class Connection extends Component } - /** * @return $this * @throws Exception @@ -339,7 +338,7 @@ class Connection extends Component */ public function newConnect(): array { - $options = [ + $options = array_merge($this->attributes, [ PDO::ATTR_CASE => PDO::CASE_NATURAL, PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_ORACLE_NULLS => PDO::NULL_NATURAL, @@ -347,11 +346,8 @@ class Connection extends Component PDO::ATTR_EMULATE_PREPARES => true, PDO::ATTR_TIMEOUT => $this->timeout, PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES ' . $this->charset - ]; + ]); $link = new PDO('mysql:dbname=' . $this->database . ';host=' . $this->cds, $this->username, $this->password, $options); - foreach ($this->attributes as $key => $attribute) { - $link->setAttribute($key, $attribute); - } return [$link, time()]; }