cvs: /php4/ext/oracle oracle.c
| From: | Thies C . Arntzen | Date: | Tue, 05 Oct 1999 12:11:22 +0000 |
| Subject: | cvs: /php4/ext/oracle oracle.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-5180@lists.php.net to get a copy of this message | ||
thies Tue Oct 5 08:11:22 1999 EDT
Modified files:
/php4/ext/oracle oracle.c
Log:
fixed ora_close again
Index: php4/ext/oracle/oracle.c
diff -u php4/ext/oracle/oracle.c:1.25 php4/ext/oracle/oracle.c:1.26
--- php4/ext/oracle/oracle.c:1.25 Tue Sep 28 07:09:02 1999
+++ php4/ext/oracle/oracle.c Tue Oct 5 08:10:51 1999
@@ -68,7 +68,6 @@
#define ORA_FETCHINTO_NULLS (1<<1)
static oraCursor *ora_get_cursor(HashTable *, pval **);
-static void ora_del_cursor(HashTable *, int);
static char *ora_error(Cda_Def *);
static int ora_describe_define(oraCursor *);
static int _close_oraconn(oraConnection *conn);
@@ -323,8 +322,7 @@
REGISTER_LONG_CONSTANT("ORA_FETCHINTO_NULLS",ORA_FETCHINTO_NULLS, CONST_CS |
CONST_PERSISTENT);
#ifdef ZTS
- opinit(OCI_EV_TSF); /* initialize threaded environment - must match the threaded mode
- of the oci8 driver if both are used at the same time!! */
+ opinit(OCI_EV_TSF);
#endif
return SUCCESS;
@@ -407,7 +405,6 @@
int hashed_details_length;
oraConnection *db_conn;
ORALS_FETCH();
- PLS_FETCH();
if (getParametersEx(2, &arg1, &arg2) == FAILURE) {
WRONG_PARAM_COUNT;
@@ -576,7 +573,6 @@
{ /* conn_index */
oraConnection *conn;
pval **arg;
- ORALS_FETCH();
if (getParametersEx(1, &arg) == FAILURE) {
WRONG_PARAM_COUNT;
@@ -585,7 +581,7 @@
conn = (oraConnection *) zend_fetch_resource_ex(arg, -1, "Oracle-Connection", 2,
le_conn, le_pconn);
ZEND_VERIFY_RESOURCE(conn);
- php3_list_delete((*arg)->value.lval);
+ zend_list_delete((*arg)->value.lval);
}
/* }}} */
@@ -629,16 +625,20 @@
PHP_FUNCTION(ora_close)
{ /* conn_index */
pval **arg;
+ oraCursor *cursor;
if (getParametersEx(1, &arg) == FAILURE) {
WRONG_PARAM_COUNT;
}
- convert_to_long_ex(arg);
+ cursor = (oraCursor *) zend_fetch_resource_ex(arg, -1, "Oracle-Cursor", 1, le_cursor);
+ if (! cursor) {
+ RETURN_FALSE;
+ }
- ora_del_cursor(list, (*arg)->value.lval);
+ zend_list_delete((*arg)->value.lval);
- RETVAL_TRUE;
+ RETURN_TRUE;
}
/* }}} */
@@ -1577,20 +1577,6 @@
}
return cursor;
-}
-
-void ora_del_cursor(HashTable *list, int ind)
-{
- oraCursor *cursor;
- int type;
- ORALS_FETCH();
-
- cursor = (oraCursor *) php3_list_find(ind, &type);
- if (!cursor || type != le_cursor) {
- php_error(E_WARNING,"Can't find cursor %d",ind);
- return;
- }
- php3_list_delete(ind);
}
static char *