]> git.wh0rd.org Git - tt-rss.git/commitdiff
patch (from h3) to connect to PGSQL through unix socket
authorAndrew Dolgov <fox@bah.spb.su>
Wed, 14 Sep 2005 02:41:44 +0000 (03:41 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Wed, 14 Sep 2005 02:41:44 +0000 (03:41 +0100)
db.php

diff --git a/db.php b/db.php
index d739aa9b2ac5271efa5c8293cbc99ed7fdaa4849..8614436beec948392e8e3840535cdcbb1b69cfaf 100644 (file)
--- a/db.php
+++ b/db.php
@@ -5,7 +5,14 @@ require_once "config.php";
 function db_connect($host, $user, $pass, $db) {
        if (DB_TYPE == "pgsql") {       
                          
-               return pg_connect("host=$host dbname=$db user=$user password=$pass");
+               $string = "dbname=$db user=$user password=$pass";
+               
+               if ($host) {
+               
+                       $stripng .= "host=$host";
+               }
+
+               return pg_connect($string);
 
        } else if (DB_TYPE == "mysql") {
                $link = mysql_connect($host, $user, $pass);