From d0ea27b802a6b878865eddd896142aae0135f0b0 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Mon, 28 Nov 2005 05:23:22 +0000 Subject: [PATCH] API for connection dependent objects to add/del refs to dbh's. --- ext/pdo/pdo_dbh.c | 10 ++++++++++ ext/pdo/php_pdo_driver.h | 5 ++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index 883f98defc..23c852553a 100755 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -1371,6 +1371,16 @@ static void dbh_free(pdo_dbh_t *dbh TSRMLS_DC) pefree(dbh, dbh->is_persistent); } +PDO_API void php_pdo_dbh_addref(pdo_dbh_t *dbh TSRMLS_DC) +{ + dbh->refcount++; +} + +PDO_API void php_pdo_dbh_delref(pdo_dbh_t *dbh TSRMLS_DC) +{ + dbh_free(dbh TSRMLS_CC); +} + static void pdo_dbh_free_storage(pdo_dbh_t *dbh TSRMLS_DC) { if (dbh->in_txn && dbh->methods && dbh->methods->rollback) { diff --git a/ext/pdo/php_pdo_driver.h b/ext/pdo/php_pdo_driver.h index ad754e7736..38f65d6af2 100755 --- a/ext/pdo/php_pdo_driver.h +++ b/ext/pdo/php_pdo_driver.h @@ -44,7 +44,7 @@ PDO_API char *php_pdo_int64_to_str(pdo_int64_t i64 TSRMLS_DC); # define FALSE 0 #endif -#define PDO_DRIVER_API 20051031 +#define PDO_DRIVER_API 20051128 enum pdo_param_type { PDO_PARAM_NULL, @@ -645,6 +645,9 @@ PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len, PDO_API void pdo_raise_impl_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *sqlstate, const char *supp TSRMLS_DC); +PDO_API void php_pdo_dbh_addref(pdo_dbh_t *dbh TSRMLS_DC); +PDO_API void php_pdo_dbh_delref(pdo_dbh_t *dbh TSRMLS_DC); + PDO_API void php_pdo_stmt_addref(pdo_stmt_t *stmt TSRMLS_DC); PDO_API void php_pdo_stmt_delref(pdo_stmt_t *stmt TSRMLS_DC); -- 2.50.1