diff options
| author | Wez Furlong <wez@php.net> | 2005-06-10 05:47:55 +0000 |
|---|---|---|
| committer | Wez Furlong <wez@php.net> | 2005-06-10 05:47:55 +0000 |
| commit | 49e7b3da4cb5de5d88c24a4e7a8399cef21a1c71 (patch) | |
| tree | b559209b8bae3df4e62c93bdd780ab54090a7435 /ext/pdo/php_pdo_driver.h | |
| parent | 3ff717812643d50fd5383a2dddfc87cb24e71bee (diff) | |
| download | php-git-49e7b3da4cb5de5d88c24a4e7a8399cef21a1c71.tar.gz | |
Fix a dumb bug that would effecively ignore persistent connections and create a
new one each time.
Add a hook for persistent connections: it is called when the object goes out of
scope, and offers the driver an opportunity to release per-request scoped data
at the right time.
This hook is used by pdo_sqlite to unregister UDFs, which are dangerous to keep
registered between requests.
Diffstat (limited to 'ext/pdo/php_pdo_driver.h')
| -rwxr-xr-x | ext/pdo/php_pdo_driver.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ext/pdo/php_pdo_driver.h b/ext/pdo/php_pdo_driver.h index 2036a1381d..4d86cdeb59 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 20050227 +#define PDO_DRIVER_API 20050610 enum pdo_param_type { PDO_PARAM_NULL, @@ -262,6 +262,11 @@ typedef int (*pdo_dbh_get_attr_func)(pdo_dbh_t *dbh, long attr, zval *val TSRMLS * You may set this handler to NULL, which is equivalent to returning SUCCESS. */ typedef int (*pdo_dbh_check_liveness_func)(pdo_dbh_t *dbh TSRMLS_DC); +/* called at request end for each persistent dbh; this gives the driver + * the opportunity to safely release resources that only have per-request + * scope */ +typedef void (*pdo_dbh_request_shutdown)(pdo_dbh_t *dbh TSRMLS_DC); + /* for adding methods to the dbh or stmt objects pointer to a list of driver specific functions. The convention is to prefix the function names using the PDO driver name; this will @@ -290,6 +295,7 @@ struct pdo_dbh_methods { pdo_dbh_get_attr_func get_attribute; pdo_dbh_check_liveness_func check_liveness; pdo_dbh_get_driver_methods_func get_driver_methods; + pdo_dbh_request_shutdown persistent_shutdown; }; /* }}} */ @@ -473,7 +479,7 @@ struct pdo_column_data { unsigned long precision; /* don't touch this unless your name is dbdo */ - void *dbdo_stuff; + void *dbdo_data; }; /* describes a bound parameter */ |
