oh dammit
[m6w6/ext-http] / http_request_object.c
index 479e0b699978fcffd017a281be207d28ad1995af..c3efaa904fe9282d2d3072ff18559974fe900e5f 100644 (file)
@@ -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;