- Changed error handler to send HTTP 500 instead of blank page on PHP errors.
(Dmitry, Andrei Nigmatulin)
+- Added persistent connection status checker to pdo_pgsql (Elvis
+ Pranskevichus, Ilia)
- Added php_ini_loaded_file() function which returns the path to the actual
php.ini in use. (Jani)
- Added GD version constants GD_MAJOR_VERSION, GD_MINOR_VERSION
return 1;
}
+/* {{{ */
+static int pdo_pgsql_check_liveness(pdo_dbh_t *dbh TSRMLS_DC)
+{
+ pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
+ if (PQstatus(H->server) == CONNECTION_BAD) {
+ PQreset(H->server);
+ }
+ return (PQstatus(H->server) == CONNECTION_OK) ? SUCCESS : FAILURE;
+}
+/* }}} */
+
static int pdo_pgsql_transaction_cmd(const char *cmd, pdo_dbh_t *dbh TSRMLS_DC)
{
pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
pdo_pgsql_last_insert_id,
pdo_pgsql_fetch_error_func,
pdo_pgsql_get_attribute,
- NULL, /* check_liveness */
+ pdo_pgsql_check_liveness, /* check_liveness */
pdo_pgsql_get_driver_methods /* get_driver_methods */
};