jon             Mon Apr  2 20:33:58 2001 EDT

  Modified files:              
    /php4/pear/DB       pgsql.php 
  Log:
  Style and whitespace.
  
  
Index: php4/pear/DB/pgsql.php
diff -u php4/pear/DB/pgsql.php:1.35 php4/pear/DB/pgsql.php:1.36
--- php4/pear/DB/pgsql.php:1.35 Mon Apr  2 20:27:46 2001
+++ php4/pear/DB/pgsql.php      Mon Apr  2 20:33:58 2001
@@ -82,20 +82,31 @@
         $protocol = (isset($dsninfo['protocol'])) ? $dsninfo['protocol'] : '';
         $connstr = '';
         if (($host !== false) && ($protocol != 'unix')){
-            if (($pos=strpos(':', $host)) !== false) {
+            if (($pos = strpos(':', $host)) !== false) {
                 $dbhost = substr($host, 0, $pos);
-                $port = substr($host, $pos+1);
+                $port = substr($host, $pos + 1);
             } else {
                 $dbhost = $host;
                 $port = '5432';
             }
-            $connstr="host=".$dsninfo['hostspec']." port=".$port;
+            $connstr = 'host=' . $dsninfo['hostspec'] . ' port=' . $port;
         }
-        $connstr .= $dsninfo['database'] ? " dbname=".$dsninfo['database'] : NULL;
-        $connstr .= $dsninfo['username'] ? " user=".$dsninfo['username'] : NULL;
-        $connstr .= $dsninfo['password'] ? " password=".$dsninfo['password'] : NULL;
-        $connstr .= (!empty($dsninfo['options'])) ? " options=".$dsninfo['options'] : 
NULL;
-        $connstr .= (!empty($dsninfo['tty'])) ? " tty=".$dsninfo['tty'] : NULL;
+        
+        if (isset($dsninfo['database'])) {
+            $connstr .= ' dbname=' . $dsninfo['database'];
+        }
+        if (isset($dsninfo['username'])) {
+            $connstr .= ' user=' . $dsninfo['username'];
+        }
+        if (isset($dsninfo['password'])) {
+            $connstr .= ' password=' . $dsninfo['password'];
+        }
+        if (!empty($dsninfo['options'])) {
+            $connstr .= ' options=' . $dsninfo['options'];
+        }
+        if (!empty($dsninfo['tty'])) {
+            $connstr .= ' tty=' . $dsninfo['tty'];
+        }
 
         $connect_function = $persistent ? 'pg_pconnect' : 'pg_connect';
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to