diff options
author | Christian Schneider | 2025-02-18 16:39:05 +0100 |
---|---|---|
committer | Christian Schneider | 2025-02-18 16:39:05 +0100 |
commit | c6330b2766fec18784d6395b0bbafbe56a4c6197 (patch) | |
tree | 66aa27bf43dea8471a165560433d1db053d1ab59 /it_dbi_postgres.class | |
parent | 2a4e493468d5337e7cfd2b3d04f9bb0943b56775 (diff) | |
download | itools-c6330b2766fec18784d6395b0bbafbe56a4c6197.tar.gz itools-c6330b2766fec18784d6395b0bbafbe56a4c6197.tar.bz2 itools-c6330b2766fec18784d6395b0bbafbe56a4c6197.zip |
Cleanup round to make indentation style consistent across files
Diffstat (limited to 'it_dbi_postgres.class')
-rw-r--r-- | it_dbi_postgres.class | 9 |
1 files changed, 6 insertions, 3 deletions
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)]; |