cvs: php4 /pear/DB pgsql.php
| From: | Rui Hirokawa | Date: | Tue, 26 Sep 2000 14:23:54 +0000 |
| Subject: | cvs: php4 /pear/DB pgsql.php | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-1840@lists.php.net to get a copy of this message | ||
hirokawa Tue Sep 26 07:23:54 2000 EDT
Modified files:
/php4/pear/DB pgsql.php
Log:
correct the problem configure script doesn't output Makefile as shared extension.
Index: php4/pear/DB/pgsql.php
diff -u php4/pear/DB/pgsql.php:1.13 php4/pear/DB/pgsql.php:1.14
--- php4/pear/DB/pgsql.php:1.13 Wed Sep 13 04:27:59 2000
+++ php4/pear/DB/pgsql.php Tue Sep 26 07:23:54 2000
@@ -98,6 +98,7 @@
return $this->raiseError(); // XXX ERRORMSG
}
$dbhost = $dsninfo['hostspec'] ? $dsninfo['hostspec'] :
'localhost';
+ $protocol = $dsninfo['protocol'] ? $dsninfo['protocol'] : 'tcp';
$user = $dsninfo['username'];
$pw = $dsninfo['password'];
$dbname = $dsninfo['database'];
@@ -106,7 +107,17 @@
$port = $dsninfo['port'] ? $dsninfo['port'] : '5432';
$connect_function = $persistent ? 'pg_pconnect' : 'pg_connect';
- if ($dbhost && $user && $pw && $dbname) {
+
+ if (($protocol == 'unix') && $dbname) {
+ $connect_params = "dbname=$dbname";
+ if ($user) {
+ $connect_params .= " user=$user";
+ }
+ if ($pw) {
+ $connect_params .= " password=$pw";
+ }
+ $conn = $connect_function($connect_params);
+ } elseif ($dbhost && $user && $pw && $dbname) {
$conn = $connect_function(
"host=$dbhost port=$port dbname=$dbname user=$user password=$pw");
} elseif ($dbhost && $dbname && $options && $tty) {