FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Plugins and Code Hacks » Database host:port support
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Database host:port support [message #163964] Fri, 17 December 2010 12:57 Go to previous message
mguillaume is currently offline  mguillaume   France
Messages: 13
Registered: December 2010
Karma:
Junior Member
Right now we don't have support for non-standard db ports (at least in PostgreSQL) though the GLOBALS_HELP suggest we should be able to use the "host:port" notation for the db host.

Suggestion: in data/sql/pgsql/db.inc, replace:
if ($GLOBALS['DBHOST']) {
    $connect_str .= 'host='. $GLOBALS['DBHOST'];
}

with:
if ($GLOBALS['DBHOST']) {
    $hostport=explode(":",$GLOBALS['DBHOST']);
    if (count($hostport)==1) {
        $connect_str .= 'host='. $GLOBALS['DBHOST'];
    } else {
        $connect_str .= 'host='.$hostport[0].' port='.$hostport[1];
    }
}


Note that this probably should be improved upon to support IPv6 addresses (which include ':' in their notation).
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Suggestion for the "rebuild search index" page
Next Topic: Logging Group Manager actions
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 23:31:35 GMT 2024

Total time taken to generate the page: 0.03593 seconds