Ticket #2644: sfPODDatabase-persist.diff
| File sfPODDatabase-persist.diff, 0.9 kB (added by sugi, 1 year ago) |
|---|
-
sfPDODatabase.class.php
old new 51 51 $pdo_username = $this->getParameter('username'); 52 52 $pdo_password = $this->getParameter('password'); 53 53 $pdo_class = $this->getParameter('class', 'PDO'); 54 $pdo_persist = $this->getParameter('persistent'); 55 $pdo_opts = array(); 54 56 55 $this->connection = new $pdo_class($dsn, $pdo_username, $pdo_password); 57 if ($pdo_persist !== null) 58 { 59 if (defined('PDO::ATTR_PERSISTENT')) 60 { 61 $pdo_opts[PDO::ATTR_PERSISTENT] = $pdo_persist; 62 } 63 else 64 { 65 $pdo_opts[PDO_ATTR_PERSISTENT] = $pdo_persist; 66 } 67 } 68 69 $this->connection = new $pdo_class($dsn, $pdo_username, $pdo_password, $pdo_opts); 56 70 } 57 71 catch (PDOException $e) 58 72 {