break;
}
- msql = (int) zend_fetch_resource_ex(&msql_link, id, "mSQL link", 2, msql_globals.le_link, msql_globals.le_plink);
- ZEND_VERIFY_RESOURCE(msql);
+ ZEND_FETCH_RESOURCE2(msql, int, &msql_link, id, "mSQL-Link", msql_globals.le_link, msql_globals.le_plink);
zend_list_delete(id);
RETURN_TRUE;
}
- msql = (int) zend_fetch_resource_ex(&msql_link, id, "mSQL link", 2, msql_globals.le_link, msql_globals.le_plink);
- ZEND_VERIFY_RESOURCE(msql);
+ ZEND_FETCH_RESOURCE2(msql, int, &msql_link, id, "mSQL-Link", msql_globals.le_link, msql_globals.le_plink);
convert_to_string(db);
break;
}
- msql = (int) zend_fetch_resource_ex(&msql_link, id, "mSQL link", 2, msql_globals.le_link, msql_globals.le_plink);
- ZEND_VERIFY_RESOURCE(msql);
+ ZEND_FETCH_RESOURCE2(msql, int, &msql_link, id, "mSQL-Link", msql_globals.le_link, msql_globals.le_plink);
convert_to_string(db);
if (msqlCreateDB(msql,db->value.str.val)<0) {
break;
}
- msql = (int) zend_fetch_resource_ex(&msql_link, id, "mSQL link", 2, msql_globals.le_link, msql_globals.le_plink);
- ZEND_VERIFY_RESOURCE(msql);
+ ZEND_FETCH_RESOURCE2(msql, int, &msql_link, id, "mSQL-Link", msql_globals.le_link, msql_globals.le_plink);
convert_to_string(db);
if (msqlDropDB(msql,db->value.str.val)<0) {
break;
}
- msql = (int) zend_fetch_resource_ex(&msql_link, id, "mSQL link", 2, msql_globals.le_link, msql_globals.le_plink);
- ZEND_VERIFY_RESOURCE(msql);
+ ZEND_FETCH_RESOURCE2(msql, int, &msql_link, id, "mSQL-Link", msql_globals.le_link, msql_globals.le_plink);
convert_to_string(query);
if ((af_rows = msqlQuery(msql,query->value.str.val))==-1) {
break;
}
- msql = (int) zend_fetch_resource_ex(&msql_link, id, "mSQL link", 2, msql_globals.le_link, msql_globals.le_plink);
- ZEND_VERIFY_RESOURCE(msql);
+ ZEND_FETCH_RESOURCE2(msql, int, &msql_link, id, "mSQL-Link", msql_globals.le_link, msql_globals.le_plink);
convert_to_string(db);
if (msqlSelectDB(msql,db->value.str.val)==-1) {
break;
}
- msql = (int) zend_fetch_resource_ex(&msql_link, id, "mSQL link", 2, msql_globals.le_link, msql_globals.le_plink);
- ZEND_VERIFY_RESOURCE(msql);
+ ZEND_FETCH_RESOURCE2(msql, int, &msql_link, id, "mSQL-Link", msql_globals.le_link, msql_globals.le_plink);
if ((msql_result=msqlListDBs(msql))==NULL) {
php_error(E_WARNING,"Unable to save mSQL query result");
break;
}
- msql = (int) zend_fetch_resource_ex(&msql_link, id, "mSQL link", 2, msql_globals.le_link, msql_globals.le_plink);
- ZEND_VERIFY_RESOURCE(msql);
+ ZEND_FETCH_RESOURCE2(msql, int, &msql_link, id, "mSQL-Link", msql_globals.le_link, msql_globals.le_plink);
convert_to_string(db);
if (msqlSelectDB(msql,db->value.str.val)==-1) {
break;
}
- msql = (int) zend_fetch_resource_ex(&msql_link, id, "mSQL link", 2, msql_globals.le_link, msql_globals.le_plink);
- ZEND_VERIFY_RESOURCE(msql);
+ ZEND_FETCH_RESOURCE2(msql, int, &msql_link, id, "mSQL-Link", msql_globals.le_link, msql_globals.le_plink);
convert_to_string(db);
if (msqlSelectDB(msql,db->value.str.val)==-1) {
break;
}
- mysql = (MYSQL *) zend_fetch_resource_ex(mysql_link, id, "MySQL link", 2, le_link, le_plink);
- ZEND_VERIFY_RESOURCE(mysql);
+ ZEND_FETCH_RESOURCE2(mysql, MYSQL *, mysql_link, id, "MySQL-Link", le_link, le_plink);
zend_list_delete(id);
RETURN_TRUE;
}
- mysql = (MYSQL *) zend_fetch_resource_ex(mysql_link, id, "MySQL link", 2, le_link, le_plink);
- ZEND_VERIFY_RESOURCE(mysql);
+ ZEND_FETCH_RESOURCE2(mysql, MYSQL *, mysql_link, id, "MySQL-Link", le_link, le_plink);
convert_to_string_ex(db);
break;
}
- mysql = (MYSQL *) zend_fetch_resource_ex(mysql_link, id, "MySQL link", 2, le_link, le_plink);
- ZEND_VERIFY_RESOURCE(mysql);
+ ZEND_FETCH_RESOURCE2(mysql, MYSQL *, mysql_link, id, "MySQL-Link", le_link, le_plink);
convert_to_string_ex(db);
if (mysql_create_db(mysql, (*db)->value.str.val)==0) {
}
- mysql = (MYSQL *) zend_fetch_resource_ex(mysql_link, id, "MySQL link", 2, le_link, le_plink);
- ZEND_VERIFY_RESOURCE(mysql);
+ ZEND_FETCH_RESOURCE2(mysql, MYSQL *, mysql_link, id, "MySQL-Link", le_link, le_plink);
convert_to_string_ex(db);
if (mysql_drop_db(mysql, (*db)->value.str.val)==0) {
break;
}
- mysql = (MYSQL *) zend_fetch_resource_ex(mysql_link, id, "MySQL link", 2, le_link, le_plink);
- ZEND_VERIFY_RESOURCE(mysql);
+ ZEND_FETCH_RESOURCE2(mysql, MYSQL *, mysql_link, id, "MySQL-Link", le_link, le_plink);
convert_to_string_ex(query);
/* mysql_query binary unsafe, use mysql_real_query */
break;
}
- mysql = (MYSQL *) zend_fetch_resource_ex(mysql_link, id, "MySQL link", 2, le_link, le_plink);
- ZEND_VERIFY_RESOURCE(mysql);
+ ZEND_FETCH_RESOURCE2(mysql, MYSQL *, mysql_link, id, "MySQL-Link", le_link, le_plink);
convert_to_string_ex(db);
if (mysql_select_db(mysql, (*db)->value.str.val)!=0) {
break;
}
- mysql = (MYSQL *) zend_fetch_resource_ex(mysql_link, id, "MySQL link", 2, le_link, le_plink);
- ZEND_VERIFY_RESOURCE(mysql);
+ ZEND_FETCH_RESOURCE2(mysql, MYSQL *, mysql_link, id, "MySQL-Link", le_link, le_plink);
if ((mysql_result=mysql_list_dbs(mysql, NULL))==NULL) {
php_error(E_WARNING,"Unable to save MySQL query result");
break;
}
- mysql = (MYSQL *) zend_fetch_resource_ex(mysql_link, id, "MySQL link", 2, le_link, le_plink);
- ZEND_VERIFY_RESOURCE(mysql);
+ ZEND_FETCH_RESOURCE2(mysql, MYSQL *, mysql_link, id, "MySQL-Link", le_link, le_plink);
convert_to_string_ex(db);
if (mysql_select_db(mysql, (*db)->value.str.val)!=0) {
break;
}
- mysql = (MYSQL *) zend_fetch_resource_ex(mysql_link, id, "MySQL link", 2, le_link, le_plink);
- ZEND_VERIFY_RESOURCE(mysql);
+ ZEND_FETCH_RESOURCE2(mysql, MYSQL *, mysql_link, id, "MySQL-Link", le_link, le_plink);
convert_to_string_ex(db);
if (mysql_select_db(mysql, (*db)->value.str.val)!=0) {
break;
}
- mysql = (MYSQL *) zend_fetch_resource_ex(mysql_link, id, "MySQL link", 2, le_link, le_plink);
- ZEND_VERIFY_RESOURCE(mysql);
+ ZEND_FETCH_RESOURCE2(mysql, MYSQL *, mysql_link, id, "MySQL-Link", le_link, le_plink);
RETURN_STRING(mysql_error(mysql),1);
}
break;
}
- mysql = (MYSQL *) zend_fetch_resource_ex(mysql_link, id, "MySQL link", 2, le_link, le_plink);
- ZEND_VERIFY_RESOURCE(mysql);
+ ZEND_FETCH_RESOURCE2(mysql, MYSQL *, mysql_link, id, "MySQL-Link", le_link, le_plink);
RETURN_LONG(mysql_errno(mysql));
}
break;
}
- mysql = (MYSQL *) zend_fetch_resource_ex(mysql_link, id, "MySQL link", 2, le_link, le_plink);
- ZEND_VERIFY_RESOURCE(mysql);
+ ZEND_FETCH_RESOURCE2(mysql, MYSQL *, mysql_link, id, "MySQL-Link", le_link, le_plink);
/* conversion from int64 to long happing here */
return_value->value.lval = (long) mysql_affected_rows(mysql);
break;
}
- mysql = (MYSQL *) zend_fetch_resource_ex(mysql_link, id, "MySQL link", 2, le_link, le_plink);
- ZEND_VERIFY_RESOURCE(mysql);
+ ZEND_FETCH_RESOURCE2(mysql, MYSQL *, mysql_link, id, "MySQL-Link", le_link, le_plink);
/* conversion from int64 to long happing here */
return_value->value.lval = (long) mysql_insert_id(mysql);
{
oci_connection *connection;
- connection = (oci_connection *) zend_fetch_resource_ex(conn, -1, "OCI8-Connection", 1, le_conn);
+ connection = (oci_connection *) zend_fetch_resource(conn, -1, "OCI8-Connection", NULL, 1, le_conn);
if (connection && connection->open) {
return connection;
{
oci_statement *statement;
- statement = (oci_statement *) zend_fetch_resource_ex(stmt, -1, "OCI8-Connection", 1, le_stmt);
+ statement = (oci_statement *) zend_fetch_resource(stmt, -1, "OCI8-Connection", NULL, 1, le_stmt);
if (statement && statement->conn->open) {
return statement;
OCILS_FETCH();
if (getParametersEx(1, &arg) == SUCCESS) {
- statement = (oci_statement *) zend_fetch_resource_ex(arg, -1, NULL, 1, le_stmt);
+ statement = (oci_statement *) zend_fetch_resource(arg, -1, NULL, NULL, 1, le_stmt);
if (statement) {
errh = statement->pError;
error = statement->error;
} else {
- connection = (oci_connection *) zend_fetch_resource_ex(arg, -1, NULL, 1, le_conn);
+ connection = (oci_connection *) zend_fetch_resource(arg, -1, NULL, NULL, 1, le_conn);
if (connection) {
errh = connection->pError;
error = connection->error;
WRONG_PARAM_COUNT;
}
- conn = (odbc_connection *) zend_fetch_resource_ex(pv_conn, -1, "ODBC connection", 2, le_conn, le_pconn);
- ZEND_VERIFY_RESOURCE(conn);
+ ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn);
rc = SQLTransact(conn->henv, conn->hdbc, (UWORD)((type)?SQL_COMMIT:SQL_ROLLBACK));
if(rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO){
WRONG_PARAM_COUNT;
}
- conn = (odbc_connection *)zend_fetch_resource_ex(pv_conn, -1, "ODBC connection", 2, le_conn, le_pconn);
- ZEND_VERIFY_RESOURCE(conn);
+ ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn);
convert_to_string_ex(pv_query);
query = (*pv_query)->value.str.val;
WRONG_PARAM_COUNT;
}
- conn = (odbc_connection *)zend_fetch_resource_ex(pv_conn, -1, "ODBC connection", 2, le_conn, le_pconn);
- ZEND_VERIFY_RESOURCE(conn);
+ ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn);
convert_to_string_ex(pv_query);
query = (*pv_query)->value.str.val;
WRONG_PARAM_COUNT;
}
- conn = (odbc_connection *) zend_fetch_resource_ex(pv_conn, -1, "ODBC connection", 2, le_conn, le_pconn);
- ZEND_VERIFY_RESOURCE(conn);
+ ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn);
zend_list_delete((*pv_conn)->value.lval);
}
WRONG_PARAM_COUNT;
}
- conn = (odbc_connection *) zend_fetch_resource_ex(pv_conn, -1, "ODBC connection", 2, le_conn, le_pconn);
- ZEND_VERIFY_RESOURCE(conn);
+ ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn);
if((*pv_onoff)){
convert_to_long_ex(pv_onoff);
switch ((*pv_which)->value.lval) {
case 1: /* SQLSetConnectOption */
- conn = (odbc_connection *) zend_fetch_resource_ex(pv_handle, -1, "ODBC connection",
- 2, le_conn, le_pconn);
- ZEND_VERIFY_RESOURCE(conn);
+ ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_handle, -1, "ODBC-Link", le_conn, le_pconn);
if(conn->persistent){
php_error(E_WARNING, "Can't set option for persistent connection");
RETURN_FALSE;
WRONG_PARAM_COUNT;
}
- conn = (odbc_connection *)zend_fetch_resource_ex(pv_conn, -1, "ODBC connection", 2, le_conn, le_pconn);
- ZEND_VERIFY_RESOURCE(conn);
+ ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn);
result = (odbc_result *)emalloc(sizeof(odbc_result));
if(result == NULL){
WRONG_PARAM_COUNT;
}
- conn = (odbc_connection *)zend_fetch_resource_ex(pv_conn, -1, "ODBC connection", 2, le_conn, le_pconn);
- ZEND_VERIFY_RESOURCE(conn);
+ ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn);
result = (odbc_result *)emalloc(sizeof(odbc_result));
if(result == NULL){
WRONG_PARAM_COUNT;
}
- conn = (odbc_connection *)zend_fetch_resource_ex(pv_conn, -1, "ODBC connection", 2, le_conn, le_pconn);
- ZEND_VERIFY_RESOURCE(conn);
+ ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn);
result = (odbc_result *)emalloc(sizeof(odbc_result));
if(result == NULL){
WRONG_PARAM_COUNT;
}
- conn = (odbc_connection *)zend_fetch_resource_ex(pv_conn, -1, "ODBC connection", 2, le_conn, le_pconn);
- ZEND_VERIFY_RESOURCE(conn);
+ ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn);
result = (odbc_result *)emalloc(sizeof(odbc_result));
if(result == NULL){
WRONG_PARAM_COUNT;
}
- conn = (odbc_connection *)zend_fetch_resource_ex(pv_conn, -1, "ODBC connection", 2, le_conn, le_pconn);
- ZEND_VERIFY_RESOURCE(conn);
+ ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn);
result = (odbc_result *)emalloc(sizeof(odbc_result));
if(result == NULL){
WRONG_PARAM_COUNT;
}
- conn = (odbc_connection *)zend_fetch_resource_ex(pv_conn, -1, "ODBC connection", 2, le_conn, le_pconn);
- ZEND_VERIFY_RESOURCE(conn);
+ ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn);
result = (odbc_result *)emalloc(sizeof(odbc_result));
if(result == NULL){
WRONG_PARAM_COUNT;
}
- conn = (odbc_connection *)zend_fetch_resource_ex(pv_conn, -1, "ODBC connection", 2, le_conn, le_pconn);
- ZEND_VERIFY_RESOURCE(conn);
+ ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn);
result = (odbc_result *)emalloc(sizeof(odbc_result));
if(result == NULL){
WRONG_PARAM_COUNT;
}
- conn = (odbc_connection *)zend_fetch_resource_ex(pv_conn, -1, "ODBC connection", 2, le_conn, le_pconn);
- ZEND_VERIFY_RESOURCE(conn);
+ ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn);
result = (odbc_result *)emalloc(sizeof(odbc_result));
if(result == NULL){
WRONG_PARAM_COUNT;
}
- conn = (odbc_connection *)zend_fetch_resource_ex(pv_conn, -1, "ODBC connection", 2, le_conn, le_pconn);
- ZEND_VERIFY_RESOURCE(conn);
+ ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn);
result = (odbc_result *)emalloc(sizeof(odbc_result));
if(result == NULL){
WRONG_PARAM_COUNT;
}
- conn = (odbc_connection *)zend_fetch_resource_ex(pv_conn, -1, "ODBC connection", 2, le_conn, le_pconn);
- ZEND_VERIFY_RESOURCE(conn);
+ ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn);
result = (odbc_result *)emalloc(sizeof(odbc_result));
if(result == NULL){
WRONG_PARAM_COUNT;
}
- conn = (odbc_connection *)zend_fetch_resource_ex(pv_conn, -1, "ODBC connection", 2, le_conn, le_pconn);
- ZEND_VERIFY_RESOURCE(conn);
+ ZEND_FETCH_RESOURCE2(conn, odbc_connection *, pv_conn, -1, "ODBC-Link", le_conn, le_pconn);
result = (odbc_result *)emalloc(sizeof(odbc_result));
if(result == NULL){
if (getParametersEx(1, &arg) == FAILURE) {
WRONG_PARAM_COUNT;
}
-
- conn = (oraConnection *) zend_fetch_resource_ex(arg, -1, "Oracle-Connection", 2, le_conn, le_pconn);
- ZEND_VERIFY_RESOURCE(conn);
+ ZEND_FETCH_RESOURCE2(conn, oraConnection *, arg, -1, "Oracle-Connection", le_conn, le_pconn);
zend_list_delete((*arg)->value.lval);
}
if (ARG_COUNT(ht) != 1 || getParametersEx(1, &arg) == FAILURE) {
WRONG_PARAM_COUNT;
}
-
- conn = (oraConnection *) zend_fetch_resource_ex(arg, -1, "Oracle-Connection", 2, le_conn, le_pconn);
- ZEND_VERIFY_RESOURCE(conn);
+ ZEND_FETCH_RESOURCE2(conn, oraConnection *, arg, -1, "Oracle-Connection", le_conn, le_pconn);
if ((cursor = (oraCursor *)emalloc(sizeof(oraCursor))) == NULL){
php_error(E_WARNING, "Out of memory");
if (getParametersEx(1, &arg) == FAILURE) {
WRONG_PARAM_COUNT;
}
-
- cursor = (oraCursor *) zend_fetch_resource_ex(arg, -1, "Oracle-Cursor", 1, le_cursor);
- if (! cursor) {
- RETURN_FALSE;
- }
+ ZEND_FETCH_RESOURCE(cursor, oraCursor *, arg, -1, "Oracle-Cursor", le_cursor);
zend_list_delete((*arg)->value.lval);
if (getParametersEx(1, &arg) == FAILURE) {
WRONG_PARAM_COUNT;
}
-
- conn = (oraConnection *) zend_fetch_resource_ex(arg, -1, "Oracle-Connection", 2, le_conn, le_pconn);
- ZEND_VERIFY_RESOURCE(conn);
+ ZEND_FETCH_RESOURCE2(conn, oraConnection *, arg, -1, "Oracle-Connection", le_conn, le_pconn);
if (ocof(&conn->lda)) {
php_error(E_WARNING, "Unable to turn off auto-commit (%s)",
if (getParametersEx(1, &arg) == FAILURE) {
WRONG_PARAM_COUNT;
}
- conn = (oraConnection *) zend_fetch_resource_ex(arg, -1, "Oracle-Connection", 2, le_conn, le_pconn);
- ZEND_VERIFY_RESOURCE(conn);
+ ZEND_FETCH_RESOURCE2(conn, oraConnection *, arg, -1, "Oracle-Connection", le_conn, le_pconn);
if (ocon(&conn->lda)) {
php_error(E_WARNING, "Unable to turn on auto-commit (%s)",
if (getParametersEx(1, &arg) == FAILURE) {
WRONG_PARAM_COUNT;
}
- conn = (oraConnection *) zend_fetch_resource_ex(arg, -1, "Oracle-Connection", 2, le_conn, le_pconn);
- ZEND_VERIFY_RESOURCE(conn);
+ ZEND_FETCH_RESOURCE2(conn, oraConnection *, arg, -1, "Oracle-Connection", le_conn, le_pconn);
if (ocom(&conn->lda)) {
php_error(E_WARNING, "Unable to commit transaction (%s)",
if (getParametersEx(1, &arg) == FAILURE) {
WRONG_PARAM_COUNT;
}
- conn = (oraConnection *) zend_fetch_resource_ex(arg, -1, "Oracle-Connection", 2, le_conn, le_pconn);
- ZEND_VERIFY_RESOURCE(conn);
+ ZEND_FETCH_RESOURCE2(conn, oraConnection *, arg, -1, "Oracle-Connection", le_conn, le_pconn);
if (orol(&conn->lda)) {
php_error(E_WARNING, "Unable to roll back transaction (%s)",
if (ARG_COUNT(ht) != 2 || getParametersEx(2, &con,&sql) == FAILURE) {
WRONG_PARAM_COUNT;
}
-
- conn = (oraConnection *) zend_fetch_resource_ex(con, -1, "Oracle-Connection", 2, le_conn, le_pconn);
- ZEND_VERIFY_RESOURCE(conn);
+ ZEND_FETCH_RESOURCE2(conn, oraConnection *, con, -1, "Oracle-Connection", le_conn, le_pconn);
convert_to_string_ex(sql);
pval **arg;
oraCursor *cursor;
oraConnection *conn;
+ void *res;
+ int what;
if (ARG_COUNT(ht) != 1 || getParametersEx(1, &arg) == FAILURE) {
WRONG_PARAM_COUNT;
}
+ res = zend_fetch_resource(arg, -1,"Oracle-Connection/Cursor",&what,3,le_conn, le_pconn, le_cursor);
+ ZEND_VERIFY_RESOURCE(res);
- conn = (oraConnection *) zend_fetch_resource_ex(arg, -1, NULL, 2, le_conn, le_pconn);
- if (conn) {
- RETURN_STRING(ora_error(&conn->lda),1);
+ if (what == le_cursor) {
+ cursor = (oraCursor *) res;
+ RETURN_STRING(ora_error(&cursor->cda),1);
} else {
- cursor = (oraCursor *) zend_fetch_resource_ex(arg, -1, NULL, 1, le_cursor);
- if (cursor) {
- RETURN_STRING(ora_error(&cursor->cda),1);
- }
+ conn = (oraConnection *) res;
+ RETURN_STRING(ora_error(&conn->lda),1);
}
- RETURN_FALSE;
}
/* }}} */
pval **arg;
oraCursor *cursor;
oraConnection *conn;
+ void *res;
+ int what;
if (ARG_COUNT(ht) != 1 || getParametersEx(1, &arg) == FAILURE) {
WRONG_PARAM_COUNT;
}
+ res = zend_fetch_resource(arg, -1,"Oracle-Connection/Cursor",&what,3,le_conn, le_pconn, le_cursor);
+ ZEND_VERIFY_RESOURCE(res);
- conn = (oraConnection *) zend_fetch_resource_ex(arg, -1, NULL, 2, le_conn, le_pconn);
- if (conn) {
- RETURN_LONG(conn->lda.rc);
+ if (what == le_cursor) {
+ cursor = (oraCursor *) res;
+ RETURN_LONG(cursor->cda.rc);
} else {
- cursor = (oraCursor *) zend_fetch_resource_ex(arg, -1, NULL, 1, le_cursor);
- if (cursor) {
- RETURN_LONG(cursor->cda.rc);
- }
+ conn = (oraConnection *) res;
+ RETURN_LONG(conn->lda.rc);
}
- RETURN_FALSE;
}
/* }}} */
oraConnection *db_conn;
ORALS_FETCH();
- cursor = (oraCursor *) zend_fetch_resource_ex(ind, -1, "Oracle-Cursor", 1, le_cursor);
+ cursor = (oraCursor *) zend_fetch_resource(ind, -1, "Oracle-Cursor", NULL, 1, le_cursor);
if (! cursor) {
return NULL;
}
break;
}
- sybase_ptr = (sybase_link *) zend_fetch_resource_ex(&sybase_link_index, id, "Sybase link", 2, sybase_globals.le_link, sybase_globals.le_plink);
- ZEND_VERIFY_RESOURCE(sybase_ptr);
- zend_list_delete(id);
+ ZEND_FETCH_RESOURCE2(sybase_ptr, sybase_link *, &sybase_link_index, id, "Sybase-Link", sybase_globals.le_link, sybase_globals.le_plink);
+
+ zend_list_delete(id); /* XXX this IS A BUG!!!! */
RETURN_TRUE;
}
break;
}
- sybase_ptr = (sybase_link *) zend_fetch_resource_ex(&sybase_link_index, id, "Sybase link", 2, sybase_globals.le_link, sybase_globals.le_plink);
- ZEND_VERIFY_RESOURCE(sybase_ptr);
+ ZEND_FETCH_RESOURCE2(sybase_ptr, sybase_link *, &sybase_link_index, id, "Sybase-Link", sybase_globals.le_link, sybase_globals.le_plink);
convert_to_string(db);
cmdbuf = (char *) emalloc(sizeof("use ")+db->value.str.len+1);
break;
}
- sybase_ptr = (sybase_link *) zend_fetch_resource_ex(&sybase_link_index, id, "Sybase link", 2, sybase_globals.le_link, sybase_globals.le_plink);
- ZEND_VERIFY_RESOURCE(sybase_ptr);
+ ZEND_FETCH_RESOURCE2(sybase_ptr, sybase_link *, &sybase_link_index, id, "Sybase-Link", sybase_globals.le_link, sybase_globals.le_plink);
convert_to_string(query);
- sybase_ptr = (sybase_link *) zend_fetch_resource_ex(&sybase_link_index, id, "Sybase link", 2, sybase_globals.le_link, sybase_globals.le_plink);
- ZEND_VERIFY_RESOURCE(sybase_ptr);
+ ZEND_FETCH_RESOURCE2(sybase_ptr, sybase_link *, &sybase_link_index, id, "Sybase-Link", sybase_globals.le_link, sybase_globals.le_plink);
return_value->value.lval = sybase_ptr->affected_rows;
return_value->type = IS_LONG;