cvs: php4 /pear DB.php

From: Date: Wed, 26 Jul 2000 09:57:06 +0000
Subject: cvs: php4 /pear DB.php
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-930@lists.php.net to get a copy of this message
ssb Wed Jul 26 02:57:06 2000 EDT Modified files: /php4/pear DB.php Log: Multiple DB::connect or DB::factory calls using the same backend should work now. Index: php4/pear/DB.php diff -u php4/pear/DB.php:1.24 php4/pear/DB.php:1.25 --- php4/pear/DB.php:1.24 Mon Jul 24 01:24:14 2000 +++ php4/pear/DB.php Wed Jul 26 02:57:06 2000 @@ -17,7 +17,7 @@ // | | // +----------------------------------------------------------------------+ // -// $Id: DB.php,v 1.24 2000/07/24 08:24:14 ssb Exp $ +// $Id: DB.php,v 1.25 2000/07/26 09:57:06 ssb Exp $ // // Database independent query interface. // @@ -163,11 +163,12 @@ * error */ function &factory($type) { - if (!@include_once("DB/${type}.php")) { - return DB_ERROR_NOT_FOUND; - } + @include_once("DB/${type}.php"); $classname = 'DB_' . $type; - $obj = new $classname; + $obj = @new $classname; + if (!$obj) { + return new DB_Error(DB_ERROR_NOT_FOUND); + } return $obj; } @@ -192,11 +193,12 @@ $dsninfo = DB::parseDSN($dsn); $type = $dsninfo['phptype']; - if (!@include_once("DB/${type}.php")) { - return DB_ERROR_NOT_FOUND; - } + @include_once("DB/${type}.php"); $classname = 'DB_' . $type; - $obj = new $classname; + $obj = @new $classname; + if (!$obj) { + return new DB_Error(DB_ERROR_NOT_FOUND); + } $err = $obj->connect(&$dsninfo, $persistent); if (DB::isError($err)) { return $err;

« previous php.cvs (#930) next »