Applied the latest changes to MDB2 wrapper

release-0.6
thomascube 18 years ago
parent 53ed1e32d8
commit bad419cc4b

@ -59,13 +59,14 @@ class rcube_db
* @param string DSN for read/write operations * @param string DSN for read/write operations
* @param string Optional DSN for read only operations * @param string Optional DSN for read only operations
*/ */
function __construct($db_dsnw, $db_dsnr='') function __construct($db_dsnw, $db_dsnr='', $pconn=false)
{ {
if ($db_dsnr=='') if ($db_dsnr=='')
$db_dsnr=$db_dsnw; $db_dsnr=$db_dsnw;
$this->db_dsnw = $db_dsnw; $this->db_dsnw = $db_dsnw;
$this->db_dsnr = $db_dsnr; $this->db_dsnr = $db_dsnr;
$this->db_pconn = $pconn;
$dsn_array = MDB2::parseDSN($db_dsnw); $dsn_array = MDB2::parseDSN($db_dsnw);
$this->db_provider = $dsn_array['phptype']; $this->db_provider = $dsn_array['phptype'];
@ -93,7 +94,7 @@ class rcube_db
function dsn_connect($dsn) function dsn_connect($dsn)
{ {
// Use persistent connections if available // Use persistent connections if available
$dbh = MDB2::connect($dsn, array('persistent' => TRUE, 'portability' => MDB2_PORTABILITY_ALL ^ MDB2_PORTABILITY_EMPTY_TO_NULL)); $dbh = MDB2::connect($dsn, array('persistent' => $this->db_pconn, 'portability' => MDB2_PORTABILITY_ALL ^ MDB2_PORTABILITY_EMPTY_TO_NULL));
if (PEAR::isError($dbh)) if (PEAR::isError($dbh))
{ {
@ -285,7 +286,7 @@ class rcube_db
if (!$this->db_handle) if (!$this->db_handle)
return FALSE; return FALSE;
return $result; return $this->_get_result($result);
} }

Loading…
Cancel
Save