irm-1.6-b3/MDB/pgsql.php
/**
     * Does the grunt work of connecting to the database
     *
     * @return mixed connection resource on success, MDB_Error on failure
     * @access private
     **/
Does the grunt work of connecting to the database
@return mixed connection resource on success, MDB_Error on failure
@access private
Does the grunt work of connecting to the database @return mixed connection resource on success MDB_Error on failure @access private
function _doConnect($database_name, $persistent)
    {
        $function = ($persistent ? 'pg_pconnect' : 'pg_connect');
        if (!function_exists($function)) {
            return($this->raiseError(MDB_ERROR_UNSUPPORTED, NULL, NULL, 'doConnect: PostgreSQL support is not available in this PHP configuration'));
        }
        $port = (isset($this->port) ? $this->port : '');
        if ($database_name == '') {
            $database_name = 'template1';
        }
        $connect_string = 'dbname='.$database_name;
        if ($this->host != '') {
            $connect_string .= ' host='.$this->host;
        }
        if ($port != '') {
            $connect_string .= ' port='.strval($port);
        }
        if ($this->user != '') {
            $connect_string .= ' user='.$this->user;
        }
        if ($this->password != '') {
            $connect_string .= ' password='.$this->password;
        }
        putenv('PGDATESTYLE=ISO');
        if (($connection = @$function($connect_string)) > 0) {
            return($connection);
        }
        if (isset($php_errormsg)) {
            $error_msg = $php_errormsg;
        } else {
            $error_msg = 'Could not connect to PostgreSQL server';
        }
        return($this->raiseError(MDB_ERROR_CONNECT_FAILED, NULL, NULL, 'doConnect: '.$error_msg));
    }
function _doConnect ( $ database_name , $ persistent ) { $ function = ( $ persistent ? 'pg_pconnect' : 'pg_connect' ) ; if ( ! function_exists ( $ function ) ) { return ( $ this -> raiseError ( MDB_ERROR_UNSUPPORTED , NULL , NULL , 'doConnect: PostgreSQL support is not available in this PHP configuration' ) ) ; } $ port = ( isset ( $ this -> port ) ? $ this -> port : '' ) ; if ( $ database_name == '' ) { $ database_name = 'template1' ; } $ connect_string = 'dbname=' . $ database_name ; if ( $ this -> host != '' ) { $ connect_string .= ' host=' . $ this -> host ; } if ( $ port != '' ) { $ connect_string .= ' port=' . strval ( $ port ) ; } if ( $ this -> user != '' ) { $ connect_string .= ' user=' . $ this -> user ; } if ( $ this -> password != '' ) { $ connect_string .= ' password=' . $ this -> password ; } putenv ( 'PGDATESTYLE=ISO' ) ; if ( ( $ connection = @ $ function ( $ connect_string ) ) > 0 ) { return ( $ connection ) ; } if ( isset ( $ php_errormsg ) ) { $ error_msg = $ php_errormsg ; } else { $ error_msg = 'Could not connect to PostgreSQL server' ; } return ( $ this -> raiseError ( MDB_ERROR_CONNECT_FAILED , NULL , NULL , 'doConnect: ' . $ error_msg ) ) ; }
Does the grunt work of connecting to the database
 @return mixed connection resource on success, MDB_Error on failure
 @access private
Does the grunt work of connecting to the database @return mixed connection resource on success MDB_Error on failure @access private