public function connect(bool
$persistent = false
) { if (empty($this->DSN
)) { $this->
buildDSN();
} // Convert DSN string
if (mb_strpos($this->DSN, 'pgsql:'
) === 0
) { $this->
convertDSN();
} $this->connID =
$persistent === true ?
pg_pconnect($this->DSN
) :
pg_connect($this->DSN
);
if ($this->connID !== false
) { if ($persistent === true &&
pg_connection_status($this->connID
) === PGSQL_CONNECTION_BAD &&
pg_ping($this->connID
) === false
) { return false;
} if (!
empty($this->schema
)) {