From cd10fb2ce9de3441d95d6fd3bd86f839f0d34623 Mon Sep 17 00:00:00 2001 From: Andrey Kutejko Date: Mon, 3 Jun 2013 22:48:15 +0300 Subject: [PATCH] allow persistant connection to DB --- ipf/orm/manager.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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'); -- 2.49.0