postgresql DB::connect()
| From: | Walter A. Boring IV | Date: | Mon, 29 Mar 2004 20:23:40 +0000 |
| Subject: | postgresql DB::connect() | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-26858@lists.php.net to get a copy of this message | ||
Howdy,
I just upgraded to php 4.3.5 and upgraded all my pear classes, which included
DB/pgsql.php. I'm using horde on a colo'd box, and after the upgrade the new
pgsql.php's connect doesn't work.
It seems that in version 1.56 of pgsql.php changed the way it tests the $dsninfo
array for values. It now uses isset() instead of !empty(). This is borked.
isset() on an array key will return true if the value is empty, but the key
exists.
This the constructed connection string to contain something like " options=
tty= ". This causes pg_pconnect() to fail every time. isset() may be faster
then empty(), but empty() is the appropriate tool to use in this case.
http://cvs.php.net/annotate.php/pear/DB/DB/pgsql.php?login=2&rev=1.56
You can see the change/breakage on lines 113, 116 in the connect() method.
Can we get the changed back, so that I don't have to hack patch my version of
pgsql.php every time I upgrade PHP (PEAR) on my box?
Thanks
Walt