From beb522a8bf22ed1d4b7fc2f67eb9f45ca3378250 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Mon, 6 Dec 2021 16:07:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Connection.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Connection.php b/src/Connection.php index 4aa2a13..4c1c1b2 100644 --- a/src/Connection.php +++ b/src/Connection.php @@ -11,7 +11,6 @@ declare(strict_types=1); namespace Database; -use Note\Inject; use Database\Affair\BeginTransaction; use Database\Affair\Commit; use Database\Affair\Rollback; @@ -23,6 +22,7 @@ use Kiri\Abstracts\Config; use Kiri\Events\EventProvider; use Kiri\Exception\NotFindClassException; use Kiri\Kiri; +use Note\Inject; use ReflectionException; use Server\Events\OnWorkerExit; use Server\Events\OnWorkerStop; @@ -61,6 +61,7 @@ class Connection extends Component * @var array */ public array $slaveConfig = []; + public array $attributes = []; /** @@ -197,10 +198,11 @@ class Connection extends Component public function masterInstance(): PDO { return $this->connections()->get([ - 'cds' => $this->cds, - 'username' => $this->username, - 'password' => $this->password, - 'database' => $this->database + 'cds' => $this->cds, + 'username' => $this->username, + 'password' => $this->password, + 'attributes' => $this->attributes, + 'dbname' => $this->database ], true); }