cvs: pear /MDB pear_wrapper.php

From: Date: Mon, 12 Aug 2002 19:33:20 +0000
Subject: cvs: pear /MDB pear_wrapper.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-5715@lists.php.net to get a copy of this message
lsmith Mon Aug 12 15:33:20 2002 EDT Modified files: /pear/MDB pear_wrapper.php Log: improvements to the connection handling Index: pear/MDB/pear_wrapper.php diff -u pear/MDB/pear_wrapper.php:1.19 pear/MDB/pear_wrapper.php:1.20 --- pear/MDB/pear_wrapper.php:1.19 Mon Aug 12 13:33:24 2002 +++ pear/MDB/pear_wrapper.php Mon Aug 12 15:33:20 2002 @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@dybnet.de> | // +----------------------------------------------------------------------+ // -// $Id: pear_wrapper.php,v 1.19 2002/08/12 17:33:24 lsmith Exp $ +// $Id: pear_wrapper.php,v 1.20 2002/08/12 19:33:20 lsmith Exp $ // require_once (dirname(__FILE__).'/MDB.php'); @@ -58,7 +58,12 @@ { function &factory($type) { - return MDB::factory($type); + $db =& MDB::factory($type); + if(PEAR::isError($db)) { + return $db; + } + $obj =& new MDB_PEAR_PROXY($db); + return $obj; } function &connect($dsn, $options = FALSE) @@ -66,9 +71,8 @@ if (!is_array($options) && $options) { $options['persistent'] = TRUE; } - $db = MDB::connect($dsn, $options); - if(PEAR::isError($db)) - { + $db =& MDB::connect($dsn, $options); + if(PEAR::isError($db)) { return $db; } $obj =& new MDB_PEAR_PROXY($db);

« previous php.pear.cvs (#5715) next »