Skip to content

Commit

Permalink
style: break long lines
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed May 25, 2024
1 parent 35dc642 commit 8b3e4e3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
13 changes: 11 additions & 2 deletions system/Database/BaseConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,11 @@ public function initialize()
$this->connID = $this->connect($this->pConnect);
} catch (Throwable $e) {
$this->connID = false;
$connectionErrors[] = sprintf('Main connection [%s]: %s', $this->DBDriver, $e->getMessage());
$connectionErrors[] = sprintf(
'Main connection [%s]: %s',
$this->DBDriver,
$e->getMessage()
);
log_message('error', 'Error connecting to the database: ' . $e);
}

Expand All @@ -442,7 +446,12 @@ public function initialize()
// Try to connect
$this->connID = $this->connect($this->pConnect);
} catch (Throwable $e) {
$connectionErrors[] = sprintf('Failover #%d [%s]: %s', ++$index, $this->DBDriver, $e->getMessage());
$connectionErrors[] = sprintf(
'Failover #%d [%s]: %s',
++$index,
$this->DBDriver,
$e->getMessage()
);
log_message('error', 'Error connecting to the database: ' . $e);
}

Expand Down
5 changes: 4 additions & 1 deletion system/Database/Postgre/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ public function connect(bool $persistent = false)
$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
if (
$persistent === true
&& pg_connection_status($this->connID) === PGSQL_CONNECTION_BAD
&& pg_ping($this->connID) === false
) {
$error = pg_last_error($this->connID);

Expand Down

0 comments on commit 8b3e4e3

Please sign in to comment.