Skip to content

Commit

Permalink
Merge pull request #9279 from ping-yee/9043_pg_ping()
Browse files Browse the repository at this point in the history
fix: `Postgre\Connection::reconnect()` `TypeError` in `pg_ping()`
  • Loading branch information
paulbalandan authored Nov 30, 2024
2 parents d81f4c5 + 0c9799f commit 17fa4d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions system/Database/Postgre/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,9 @@ private function convertDSN()
*/
public function reconnect()
{
if (pg_ping($this->connID) === false) {
$this->connID = false;
if ($this->connID === false || pg_ping($this->connID) === false) {
$this->close();
$this->initialize();
}
}

Expand Down
1 change: 1 addition & 0 deletions user_guide_src/source/changelogs/v4.5.6.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Bugs Fixed

- **Validation:** Fixed a bug where complex language strings were not properly handled.
- **CURLRequest:** Added support for handling proxy responses using HTTP versions other than 1.1.
- **Database:** Fixed a bug that caused ``Postgre\Connection::reconnect()`` method to throw an error when the connection had not yet been established.

See the repo's
`CHANGELOG.md <https://github.com/codeigniter4/CodeIgniter4/blob/develop/CHANGELOG.md>`_
Expand Down

0 comments on commit 17fa4d0

Please sign in to comment.