function &factory($type) { $db =& MDB::factory($type); if (PEAR::isError($db)) { return $db; } $obj =& new MDB_PEAR_PROXY($db); return $obj; }