From: Andrey Kutejko Date: Mon, 3 Jun 2013 19:48:15 +0000 (+0300) Subject: allow persistant connection to DB X-Git-Tag: 0.6~126 X-Git-Url: https://git.andy128k.dev/?a=commitdiff_plain;h=cd10fb2ce9de3441d95d6fd3bd86f839f0d34623;p=ipf-legacy-orm.git allow persistant connection to DB --- diff --git a/ipf/orm/manager.php b/ipf/orm/manager.php index 1c1b78a..ee2f721 100644 --- a/ipf/orm/manager.php +++ b/ipf/orm/manager.php @@ -84,7 +84,7 @@ class IPF_ORM_Manager extends IPF_ORM_Configurable implements Countable, Iterato } } - public function openConnection($adapter, $name = null, $setCurrent = true) + public function openConnection($adapter, $name = null, $setCurrent = true, $persistent = false) { if (is_object($adapter)) { if ( ! ($adapter instanceof PDO) && ! in_array('IPF_ORM_Adapter_Interface', class_implements($adapter))) { @@ -156,6 +156,8 @@ class IPF_ORM_Manager extends IPF_ORM_Configurable implements Countable, Iterato $className = $drivers[$driverName]; $conn = new $className($this, $adapter); + if ($persistent) + $conn->setOption(IPF_ORM::ATTR_PERSISTENT, true); $conn->setName($name); $conn->setCharset('utf8');