diff options
author | Andrei Zmievski <andrei@php.net> | 2000-10-20 18:25:16 +0000 |
---|---|---|
committer | Andrei Zmievski <andrei@php.net> | 2000-10-20 18:25:16 +0000 |
commit | 7b4983c8f82c4f361df787f58c6f5cf88d5def0b (patch) | |
tree | e38e8ffceb65a0f2492b28e2b07c8668fcddeda4 /ext/oracle/oracle.c | |
parent | a0cfab65ea72963f81a3440a3587d11bd7800337 (diff) | |
download | php-git-7b4983c8f82c4f361df787f58c6f5cf88d5def0b.tar.gz |
Mega-patch to get better resource information for modules.
* Fixed a bug in zend_rsrc_list_get_rsrc_type()
* Switched register_list_destructors() to use
zend_register_list_destructors_ex() instead
* Updated all relevant modules to provide the resource type name
to register_list_destructors() call
* Updated var_dump() to output resource type name instead of number
@- Made resource type names visible, e.g. var_dump() and
@ get_resource_type() display "file" for file resources. (Andrei)
Diffstat (limited to 'ext/oracle/oracle.c')
-rw-r--r-- | ext/oracle/oracle.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/ext/oracle/oracle.c b/ext/oracle/oracle.c index b354b26a80..a0f03b1a73 100644 --- a/ext/oracle/oracle.c +++ b/ext/oracle/oracle.c @@ -65,7 +65,7 @@ PHP_ORA_API php_ora_globals ora_globals; static oraCursor *ora_get_cursor(HashTable *, pval **); static char *ora_error(Cda_Def *); static int ora_describe_define(oraCursor *); -static int _close_oraconn(oraConnection *conn); +static int _close_oraconn(zend_rsrc_list_entry *rsrc); static int _close_oracur(oraCursor *cur); static int _ora_ping(oraConnection *conn); int ora_set_param_values(oraCursor *cursor, int isout); @@ -181,8 +181,9 @@ static const text *ora_func_tab[] = ZEND_GET_MODULE(oracle) #endif -static int _close_oraconn(oraConnection *conn) +static int _close_oraconn(zend_rsrc_list_entry *rsrc) { + oraConnection *conn = (oraConnection *)rsrc->ptr; ORALS_FETCH(); conn->open = 0; @@ -248,6 +249,12 @@ static int _close_oracur(oraCursor *cur) return 1; } +static void php_close_ora_cursor(zend_rsrc_list_entry *rsrc) +{ + oraCursor *cur = (oraCursor *)rsrc->ptr; + _close_oracur(cur); +} + static void php_ora_init_globals(ORALS_D) { if (cfg_get_long("oracle.allow_persistent", @@ -283,9 +290,9 @@ PHP_MINIT_FUNCTION(oracle) php_ora_init_globals(ORALS_C); #endif - le_cursor = register_list_destructors(_close_oracur, NULL); - le_conn = register_list_destructors(_close_oraconn, NULL); - le_pconn = register_list_destructors(NULL, _close_oraconn); + le_cursor = register_list_destructors(php_close_ora_cursor, NULL, "oracle cursor"); + le_conn = register_list_destructors(_close_oraconn, NULL, "oracle link"); + le_pconn = register_list_destructors(NULL, _close_oraconn, "oracle link persistent"); REGISTER_LONG_CONSTANT("ORA_BIND_INOUT", 0, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("ORA_BIND_IN", 1, CONST_CS | CONST_PERSISTENT); |