DB.php->parseDSN problem (bug?)
| From: | Tomas V.V.Cox | Date: | Wed, 28 Feb 2001 23:54:36 +0000 |
| Subject: | DB.php->parseDSN problem (bug?) | ||
| Groups: | php.pear | ||
| Request: | Send a blank email to php-pear+get-1514@lists.php.net to get a copy of this message | ||
Hi all again,
During the tests of the ifx.php (informix pear DB class) I found one
problem with the actual parseDSN function. One example for informix
connect data is:
user: foo
pass: bar
hostspec: host.com
database: /usr/test/general.db
So the DSN for that is:
ifx://foo:bar@host.com/usr/test/general.db
The problem is that the actual regex:
if (preg_match("|^(.*)/([^/]+)/?$|", $dsn, $arr)) {
$parsed["database"] = $arr[2];
$dsn = $arr[1];
}
Gets: general.db as the database and host.com/usr/test as the host, that
is obviuosly wrong. Just for notice, probably in other evironments,
database names could be: c:\dbs\foo.db.
Tomas V.V.Cox