From c6330b2766fec18784d6395b0bbafbe56a4c6197 Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Tue, 18 Feb 2025 16:39:05 +0100 Subject: Cleanup round to make indentation style consistent across files --- it_dbi_postgres.class | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'it_dbi_postgres.class') diff --git a/it_dbi_postgres.class b/it_dbi_postgres.class index 6b60fb4..1190f2c 100644 --- a/it_dbi_postgres.class +++ b/it_dbi_postgres.class @@ -95,13 +95,15 @@ function _escape_name($str) return pg_escape_identifier($this->_link, $str); } -function _connect_db($p) { +function _connect_db($p) +{ $result = @pg_connect("host=$p[server] user=$p[user] dbname=$p[db] password=$p[pw]", PGSQL_CONNECT_FORCE_NEW); if ($result) { # set charset used for this connection (also change mariadb specific default utf8mb4 to utf8) - if ($p['charset']) { + if ($p['charset']) + { $charset = $p['charset'] == 'utf8mb4' ? 'UNICODE' : $p['charset']; if (pg_set_client_encoding($result, $charset) < 0) $this->_fatal("_connect(): can't set charset \"$charset\""); @@ -117,7 +119,8 @@ function __query($query, $p) { $starttime = microtime(true); pg_send_query($this->_link, $query); - while (pg_connection_busy($this->_link)) { + while (pg_connection_busy($this->_link)) + { if ($p['timeout'] && (microtime(true) - $starttime) > $p['timeout']) return false; $read = $error = [pg_socket($this->_link)]; -- cgit v1.2.3