[patch] Make PostgreSQL parameters more optional
| From: | Jon Parise | Date: | Wed, 07 Mar 2001 18:28:49 +0000 |
| Subject: | [patch] Make PostgreSQL parameters more optional | ||
| Groups: | php.pear | ||
| Request: | Send a blank email to php-pear+get-1676@lists.php.net to get a copy of this message | ||
Does anyone object to the following patch? It makes certain
PostgreSQL-specific parameters more optional. It's been working fine
here for about a month.
If no one objects, I'll commit it over the weekend.
Index: pgsql.php
===================================================================
RCS file: /repository/php4/pear/DB/pgsql.php,v
retrieving revision 1.30
diff -u -r1.30 pgsql.php
--- pgsql.php 2001/02/19 12:22:26 1.30
+++ pgsql.php 2001/03/07 18:22:43
@@ -97,9 +97,9 @@
$user = $dsninfo['username'];
$pw = $dsninfo['password'];
$dbname = $dsninfo['database'];
- $options = $dsninfo['options'];
- $tty = $dsninfo['tty'];
- $port = $dsninfo['port'] ? $dsninfo['port'] : '5432';
+ $options = (!empty($dsninfo['options'])) ? $dsninfo['options'] : NULL;
+ $tty = (!empty($dsninfo['tty'])) ? $dsninfo['tty'] : NULL;
+ $port = (!empty($dsninfo['port'])) ? $dsninfo['port'] :
'5432';
$connect_function = $persistent ? 'pg_pconnect' : 'pg_connect';
--
Jon Parise (jon@csh.rit.edu) . Rochester Inst. of Technology
http://www.csh.rit.edu/~jon/ : Computer Science House
Member