From 86e8761a7a3594f6a02f6c6d901af3a418359b19 Mon Sep 17 00:00:00 2001 From: Muhammet SAFAK Date: Tue, 28 Mar 2023 05:09:55 +0300 Subject: [PATCH 1/2] =?UTF-8?q?PDO=20ba=C4=9Flant=C4=B1lar=C4=B1n=C4=B1=20?= =?UTF-8?q?kal=C4=B1c=C4=B1=20yapabilmek=20i=C3=A7in=20yap=C4=B1land=C4=B1?= =?UTF-8?q?rma=20eklendi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Database.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Database.php b/src/Database.php index d032133..cfb75f2 100644 --- a/src/Database.php +++ b/src/Database.php @@ -45,6 +45,7 @@ class Database extends QueryBuilder 'password' => null, 'charset' => 'utf8mb4', 'collation' => 'utf8mb4_unicode_ci', + 'persistent' => null, 'tableSchema' => null, 'tableSchemaID' => null, 'entity' => Entity::class, @@ -138,6 +139,9 @@ final public function getPDO(): PDO PDO::ATTR_PERSISTENT => true, PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, ]; + if (\is_bool($this->_credentials['persistent'])) { + $options[PDO::ATTR_PERSISTENT] = $this->_credentials['persistent']; + } switch ($this->_credentials['return']) { case null: case self::ARRAY: From bbeb932aa383e3832e19beab99e83a41edf4da99 Mon Sep 17 00:00:00 2001 From: Muhammet SAFAK Date: Tue, 28 Mar 2023 05:20:42 +0300 Subject: [PATCH 2/2] =?UTF-8?q?Ba=C4=9Flant=C4=B1=20bilgilerini=20=C3=B6ze?= =?UTF-8?q?lle=C5=9Ftirebilmek=20i=C3=A7in=20options=20se=C3=A7ene=C4=9Fi?= =?UTF-8?q?=20eklendi.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Database.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Database.php b/src/Database.php index cfb75f2..f8d9320 100644 --- a/src/Database.php +++ b/src/Database.php @@ -46,6 +46,7 @@ class Database extends QueryBuilder 'charset' => 'utf8mb4', 'collation' => 'utf8mb4_unicode_ci', 'persistent' => null, + 'options' => [], 'tableSchema' => null, 'tableSchemaID' => null, 'entity' => Entity::class, @@ -163,6 +164,10 @@ final public function getPDO(): PDO $options[PDO::ATTR_DEFAULT_FETCH_MODE] = PDO::FETCH_BOTH; } + if (\is_array($this->_credentials['options']) && !empty($this->_credentials['options'])) { + $options = \array_merge($options, $this->_credentials['options']); + } + $this->_pdo = new PDO($this->_credentials['dsn'], $this->_credentials['username'], $this->_credentials['password'], $options); if(!empty($this->_credentials['charset'])){ if(!empty($this->_credentials['collation'])) {