[patch] Make PostgreSQL parameters more optional

[email protected] (Jon Parise) Wed, 7 Mar 2001 13:28:49 -0500
Newsgroups php.pear
Message-ID <[email protected]>
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 ([email protected])  .  Rochester Inst. of Technology
http://www.csh.rit.edu/~jon/  :  Computer Science House Member