For some reason I wasn't allowed to attach a file to ticket #87, so here
is the patch intended for it.
--- PDODatabase.class.php.orig	2006-01-16 16:32:55.000000000 +1300
+++ PDODatabase.class.php	2006-01-16 16:32:50.000000000 +1300
@@ -68,7 +68,17 @@
 
 			$pdo_username = $this->getParameter('username');
 			$pdo_password = $this->getParameter('password');
-			$this->connection = new PDO($dsn, $pdo_username, $pdo_password);
+
+			// let's see if we need a persistent connection
+			$persistent = $this->getParameter('persistent', false);
+
+			if (defined('PDO::ATTR_PERSISTENT')) {
+				$pdo_options = array(PDO::ATTR_PERSISTENT => $persistent);
+			} else {
+				$pdo_options = array(PDO_ATTR_PERSISTENT => $persistent);
+			}
+
+			$this->connection = new PDO($dsn, $pdo_username, $pdo_password, $pdo_options);
 
 		} catch (PDOException $e)	{
 
_______________________________________________
agavi-dev mailing list
[email protected]
http://labworkz.com/cgi-bin/mailman/listinfo/agavi-dev

Reply via email to