amphp / postgres

Async Postgres client for PHP based on Amp.
MIT License
97 stars 20 forks source link

The connection to the database has been closed (pgsql) #47

Closed mmasiukevich closed 3 years ago

mmasiukevich commented 3 years ago

There are a number of type checks in the code:

https://github.com/amphp/postgres/blob/master/src/PgSqlHandle.php#L254 https://github.com/amphp/postgres/blob/master/src/PgSqlHandle.php#L377 https://github.com/amphp/postgres/blob/master/src/PgSqlHandle.php#L391 https://github.com/amphp/postgres/blob/master/src/PgSqlHandle.php#L412 https://github.com/amphp/postgres/blob/master/src/PgSqlHandle.php#L548 https://github.com/amphp/postgres/blob/master/src/PgSqlHandle.php#L562

But the handle property doesnt store the resource (how is it checked), but the PgSql\Connection object. Is this some cunning plan, or just forgotten checks? Since it breaks the library.

p.s. https://www.php.net/manual/ru/function.pg-connect.php