Re: DB.php->parseDSN problem (bug?)
| From: | Joao Prado Maia | Date: | Thu, 01 Mar 2001 00:45:51 +0000 |
| Subject: | Re: DB.php->parseDSN problem (bug?) | ||
| References: | 1 | Groups: | php.pear |
| Request: | Send a blank email to php-pear+get-1515@lists.php.net to get a copy of this message | ||
On Thu, 1 Mar 2001, Tomas V.V.Cox wrote:
> 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.
>
You could make a work around this problem by sending the dsn as an array
instead of a string like you are doing now. Read DB.php for more on the
structure of this array.
Of course, the string method of passing dsn's is still a problem, but at
least you can code some stuff while this problem is being fixed.
Regards,
Joao
--
João Prado Maia <jpm@phpbrasil.com>
http://phpbrasil.com - php com um jeitinho brasileiro
--
Contribua com o projeto de tradução do manual online do PHP
http://phpbrasil.com/traducao.php
--