1
0
mirror of https://github.com/php/php-src.git synced 2026-04-10 09:33:06 +02:00

Multiple DB::connect or DB::factory calls using the same backend

should work now.
This commit is contained in:
Stig Bakken
2000-07-26 09:57:06 +00:00
parent 718b7308c3
commit c63410f6be

View File

@@ -163,11 +163,12 @@ class DB {
* 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 @@ class DB {
$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;