X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_curl_client_datashare.c;h=11856be3d36d81e255d03a98ccc45b3e768d3251;hp=1b47eb56e786163debe707816a8269bbaac3638b;hb=305ac2f007710b684d96b05f33964b4f6a4e3e4d;hpb=2769c041b77a0aaba7acbee4ae469571eaeb2b0a diff --git a/php_http_curl_client_datashare.c b/php_http_curl_client_datashare.c index 1b47eb5..11856be 100644 --- a/php_http_curl_client_datashare.c +++ b/php_http_curl_client_datashare.c @@ -136,11 +136,6 @@ static php_http_resource_factory_ops_t php_http_curlsh_resource_factory_ops = { php_http_curlsh_dtor }; -static zend_class_entry *get_class_entry(void) -{ - return php_http_curl_client_datashare_class_entry; -} - static php_http_client_datashare_ops_t php_http_curl_client_datashare_ops = { &php_http_curlsh_resource_factory_ops, php_http_curl_client_datashare_init, @@ -151,7 +146,7 @@ static php_http_client_datashare_ops_t php_http_curl_client_datashare_ops = { php_http_curl_client_datashare_detach, php_http_curl_client_datashare_setopt, (php_http_new_t) php_http_curl_client_datashare_object_new_ex, - get_class_entry + php_http_curl_client_datashare_get_class_entry }; PHP_HTTP_API php_http_client_datashare_ops_t *php_http_curl_client_datashare_get_ops(void) @@ -163,8 +158,14 @@ PHP_HTTP_API php_http_client_datashare_ops_t *php_http_curl_client_datashare_get #define PHP_HTTP_EMPTY_ARGS(method) PHP_HTTP_EMPTY_ARGS_EX(HttpClientDataShare, method, 0) #define PHP_HTTP_RSHARE_ME(method, visibility) PHP_ME(HttpClientDataShare, method, PHP_HTTP_ARGS(HttpClientDataShare, method), visibility) -zend_class_entry *php_http_curl_client_datashare_class_entry; -zend_function_entry php_http_curl_client_datashare_method_entry[] = { +static zend_class_entry *php_http_curl_client_datashare_class_entry; + +zend_class_entry *php_http_curl_client_datashare_get_class_entry(void) +{ + return php_http_curl_client_datashare_class_entry; +} + +static zend_function_entry php_http_curl_client_datashare_method_entry[] = { EMPTY_FUNCTION_ENTRY }; @@ -180,7 +181,11 @@ zend_object_value php_http_curl_client_datashare_object_new_ex(zend_class_entry o = ecalloc(1, sizeof(*o)); zend_object_std_init((zend_object *) o, ce TSRMLS_CC); +#if PHP_VERSION_ID < 50339 + zend_hash_copy(((zend_object *) o)->properties, &(ce->default_properties), (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval*)); +#else object_properties_init((zend_object *) o, ce); +#endif if (share) { o->share = share;