Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "modified cubrid_close, fetch_cubrid_connect, and php_cubrid_fetch_has…" #20

Merged
merged 1 commit into from
Dec 20, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions php_cubrid7.c
Original file line number Diff line number Diff line change
@@ -1083,6 +1083,11 @@ T_CUBRID_CONNECT* fetch_cubrid_connect(zval* conn_id)
} else {
link = FETCH_DEFAULT_LINK();
}
CHECK_DEFAULT_LINK(link);

if (link == NULL) {
return NULL;
}

return (T_CUBRID_CONNECT*)zend_fetch_resource2(link, "CUBRID Connect", le_connect, le_pconnect);
}
@@ -1565,7 +1570,8 @@ ZEND_FUNCTION(cubrid_close)
res_id = conn_id ? Z_RES_P(conn_id) : CUBRID_G(default_link);

if (res_id) {
zend_list_close(res_id);
GC_REFCOUNT(res_id)--;
GC_REFCOUNT(res_id)--;
}
// On an explicit close of the default connection it had a refcount of 2,
// so we need one more call
@@ -6754,12 +6760,12 @@ static void php_cubrid_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, long type, int i
if (ctor_params && Z_TYPE_P(ctor_params) != IS_NULL) {
if (Z_TYPE_P(ctor_params) == IS_ARRAY) {
HashTable *ht = Z_ARRVAL_P(ctor_params);
zend_ulong num_idx;
zend_string *fld;
zend_ulong num_idx;
zend_string *fld;
zval *val;

fci.param_count = 0;
fci.params = (zval *)safe_emalloc(ht->nNumOfElements, sizeof(zval), 0);
fci.params = (zval *)safe_emalloc(sizeof(zval*), ht->nNumOfElements, 0);
ZEND_HASH_FOREACH_KEY_VAL(ht, num_idx, fld, val) {
fci.params[fci.param_count++] = *val;
}ZEND_HASH_FOREACH_END();
@@ -6779,7 +6785,7 @@ static void php_cubrid_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, long type, int i
fcc.initialized = 1;
fcc.function_handler = ce->constructor;
//fcc.calling_scope = EG(scope);
fcc.called_scope = Z_OBJCE_P(return_value);
fcc.called_scope = Z_OBJCE_P(return_value);
fcc.object = Z_OBJ_P(return_value);

if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) {