diff options
author | Dmitry Stogov <dmitry@zend.com> | 2017-11-01 15:19:31 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2017-11-01 15:19:31 +0300 |
commit | 67d5f39a47b15e28293d9d6558b80ded049179fe (patch) | |
tree | e8f11a2a68bb06f259e8e3eeed5b102884df9fa6 /ext/mysqli/mysqli_nonapi.c | |
parent | f5664a149260ed4a83aa5cfb13ad11ed18c56af6 (diff) | |
download | php-git-67d5f39a47b15e28293d9d6558b80ded049179fe.tar.gz |
Persistent resources are "thread-local".
Register persistent resources through new functions zend_register_persistent_resource()/zend_register_persistent_resource_ex().
Diffstat (limited to 'ext/mysqli/mysqli_nonapi.c')
-rw-r--r-- | ext/mysqli/mysqli_nonapi.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c index 6d4f648a7f..9384b9355a 100644 --- a/ext/mysqli/mysqli_nonapi.c +++ b/ext/mysqli/mysqli_nonapi.c @@ -196,12 +196,10 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne } while (0); } } else { - zend_resource le; - le.type = php_le_pmysqli(); - le.ptr = plist = calloc(1, sizeof(mysqli_plist_entry)); + plist = calloc(1, sizeof(mysqli_plist_entry)); zend_ptr_stack_init_ex(&plist->free_links, 1); - zend_hash_str_update_mem(&EG(persistent_list), ZSTR_VAL(hash_key), ZSTR_LEN(hash_key), &le, sizeof(le)); + zend_register_persistent_resource(ZSTR_VAL(hash_key), ZSTR_LEN(hash_key), plist, php_le_pmysqli()); } } } |