- http_request_object_handlers.clone_obj = NULL; /* http_request_object_clone_obj; */
- return SUCCESS;
-}
-
-zend_object_value _http_request_object_new(zend_class_entry *ce TSRMLS_DC)
-{
- return http_request_object_new_ex(ce, NULL);
-}
-
-zend_object_value _http_request_object_new_ex(zend_class_entry *ce, CURL* ch TSRMLS_DC)
-{
- zend_object_value ov;
- http_request_object *o;
-
- o = ecalloc(1, sizeof(http_request_object));
- o->zo.ce = ce;
-
- if (ch) {
- o->ch = ch;
- } else {
- o->ch = curl_easy_init();
- }
-
- phpstr_init(&o->history);
- phpstr_init(&o->request);
- phpstr_init_ex(&o->response, HTTP_CURLBUF_SIZE, 0);
-
- ALLOC_HASHTABLE(OBJ_PROP(o));
- zend_hash_init(OBJ_PROP(o), 0, NULL, ZVAL_PTR_DTOR, 0);
- zend_hash_copy(OBJ_PROP(o), &ce->default_properties, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *));
-
- ov.handle = putObject(http_request_object, o);
- ov.handlers = &http_request_object_handlers;
-
- return ov;
-}
-
-zend_object_value _http_request_object_clone(zval *object TSRMLS_DC)
-{
- return http_request_object_clone_obj(object TSRMLS_CC);
-}
-
-static inline zend_object_value _http_request_object_clone_obj(zval *object TSRMLS_DC)
-{
- zval clone;
- getObjectEx(http_request_object, obj, object);
-
- INIT_PZVAL(&clone);
- clone.value.obj = http_request_object_new_ex(Z_OBJCE_P(object), curl_easy_duphandle(obj->ch));
- {
- getObjectEx(http_request_object, cobj, &clone);
-
- /* copy history */
- phpstr_append(&cobj->history, PHPSTR_VAL(&obj->history), PHPSTR_LEN(&obj->history));
- /*
- phpstr_append(&cobj->request, PHPSTR_VAL(&obj->request), PHPSTR_LEN(&obj->request));
- phpstr_append(&obj->response, PHPSTR_VAL(&obj->response), PHPSTR_ÖEN(&obj->response));
- */
- /* copy properties */
- zend_hash_copy(OBJ_PROP(cobj), OBJ_PROP(obj), (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *));
-
- /* attach to pool */
- if (obj->pool) {
- http_request_pool_attach(obj->pool, &clone);
- }
- }
-
- return clone.value.obj;
-}
-
-static inline void _http_request_object_declare_default_properties(TSRMLS_D)
-{
- zend_class_entry *ce = http_request_object_ce;
-
- DCL_PROP_N(PROTECTED, options);
- DCL_PROP_N(PROTECTED, responseInfo);
- DCL_PROP_N(PROTECTED, responseData);
- DCL_PROP_N(PROTECTED, responseCode);
- DCL_PROP_N(PROTECTED, responseMessage);
- DCL_PROP_N(PROTECTED, postFields);
- DCL_PROP_N(PROTECTED, postFiles);
-
- DCL_PROP(PROTECTED, long, method, HTTP_GET);
-
- DCL_PROP(PROTECTED, string, url, "");
- DCL_PROP(PROTECTED, string, contentType, "");
- DCL_PROP(PROTECTED, string, rawPostData, "");
- DCL_PROP(PROTECTED, string, queryData, "");
- DCL_PROP(PROTECTED, string, putFile, "");
-
- DCL_PROP(PUBLIC, bool, recordHistory, 1);
+ http_request_object_handlers.clone_obj = _http_request_object_clone_obj;
+
+ DCL_PROP_N(PRIVATE, options);
+ DCL_PROP_N(PRIVATE, postFields);
+ DCL_PROP_N(PRIVATE, postFiles);
+ DCL_PROP_N(PRIVATE, responseInfo);
+ DCL_PROP_N(PRIVATE, responseMessage);
+ DCL_PROP(PRIVATE, long, responseCode, 0);
+ DCL_PROP(PRIVATE, string, responseStatus, "");
+ DCL_PROP(PRIVATE, long, method, HTTP_GET);
+ DCL_PROP(PRIVATE, string, url, "");
+ DCL_PROP(PRIVATE, string, contentType, "");
+ DCL_PROP(PRIVATE, string, rawPostData, "");
+ DCL_PROP(PRIVATE, string, queryData, "");
+ DCL_PROP(PRIVATE, string, putFile, "");
+ DCL_PROP(PRIVATE, string, putData, "");
+ DCL_PROP_N(PRIVATE, history);
+ DCL_PROP(PUBLIC, bool, recordHistory, 0);