X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=http_request_object.c;h=c3efaa904fe9282d2d3072ff18559974fe900e5f;hb=13d7acf7fe8b82162815e2047c9aedc9a149a3ae;hp=479e0b699978fcffd017a281be207d28ad1995af;hpb=e0d6c52bd402a3b89024512bab676504b7153ba9;p=m6w6%2Fext-http diff --git a/http_request_object.c b/http_request_object.c index 479e0b6..c3efaa9 100644 --- a/http_request_object.c +++ b/http_request_object.c @@ -222,6 +222,8 @@ HTTP_END_ARGS; #define http_request_object_declare_default_properties() _http_request_object_declare_default_properties(TSRMLS_C) static inline void _http_request_object_declare_default_properties(TSRMLS_D); +#define http_request_object_clone_obj _http_request_object_clone_obj +static inline zend_object_value _http_request_object_clone_obj(zval *object TSRMLS_DC); zend_class_entry *http_request_object_ce; zend_function_entry http_request_object_fe[] = { @@ -298,9 +300,11 @@ zend_function_entry http_request_object_fe[] = { }; static zend_object_handlers http_request_object_handlers; -void _http_request_object_init(INIT_FUNC_ARGS) +PHP_MINIT_FUNCTION(http_request_object) { HTTP_REGISTER_CLASS_EX(HttpRequest, http_request_object, NULL, 0); + http_request_object_handlers.clone_obj = NULL; + return SUCCESS; } zend_object_value _http_request_object_new(zend_class_entry *ce TSRMLS_DC) @@ -725,7 +729,7 @@ PHP_METHOD(HttpRequest, setOptions) zval *opts = NULL, *old_opts, **opt; getObject(http_request_object, obj); - if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|a/!", &opts)) { + if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|a!", &opts)) { RETURN_FALSE; } @@ -742,7 +746,7 @@ PHP_METHOD(HttpRequest, setOptions) if (!strcmp(key, "headers")) { zval **headers; if (SUCCESS == zend_hash_find(Z_ARRVAL_P(old_opts), "headers", sizeof("headers"), (void **) &headers)) { - convert_to_array(*opt); + convert_to_array_ex(opt); convert_to_array(*headers); array_merge(*opt, *headers); continue; @@ -750,7 +754,7 @@ PHP_METHOD(HttpRequest, setOptions) } else if (!strcmp(key, "cookies")) { zval **cookies; if (SUCCESS == zend_hash_find(Z_ARRVAL_P(old_opts), "cookies", sizeof("cookies"), (void **) &cookies)) { - convert_to_array(*opt); + convert_to_array_ex(opt); convert_to_array(*cookies); array_merge(*opt, *cookies); continue; @@ -758,7 +762,7 @@ PHP_METHOD(HttpRequest, setOptions) } else if (!strcmp(key, "ssl")) { zval **ssl; if (SUCCESS == zend_hash_find(Z_ARRVAL_P(old_opts), "ssl", sizeof("ssl"), (void **) &ssl)) { - convert_to_array(*opt); + convert_to_array_ex(opt); convert_to_array(*ssl); array_merge(*opt, *ssl); continue;