}
ALLOC_HASHTABLE(OBJ_PROP(o));
- zend_hash_init(OBJ_PROP(o), 0, NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_init(OBJ_PROP(o), zend_hash_num_elements(&ce->default_properties), 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_deflatestream_object, o);
ov.handlers = &http_deflatestream_object_handlers;
zend_object_value _http_deflatestream_object_clone_obj(zval *this_ptr TSRMLS_DC)
{
http_encoding_stream *s;
- getObject(http_deflatestream_object, obj);
+ zend_object_value new_ov;
+ http_deflatestream_object *new_obj = NULL;
+ getObject(http_deflatestream_object, old_obj);
s = ecalloc(1, sizeof(http_encoding_stream));
- s->flags = obj->stream->flags;
- deflateCopy(&s->stream, &obj->stream->stream);
+ s->flags = old_obj->stream->flags;
+ deflateCopy(&s->stream, &old_obj->stream->stream);
s->stream.opaque = phpstr_dup(s->stream.opaque);
- return http_deflatestream_object_new_ex(Z_OBJCE_P(this_ptr), s, NULL);
+ new_ov = http_deflatestream_object_new_ex(old_obj->zo.ce, s, &new_obj);
+ zend_objects_clone_members(&new_obj->zo, new_ov, &old_obj->zo, Z_OBJ_HANDLE_P(this_ptr) TSRMLS_CC);
+
+ return new_ov;
}
void _http_deflatestream_object_free(zend_object *object TSRMLS_DC)
}
ALLOC_HASHTABLE(OBJ_PROP(o));
- zend_hash_init(OBJ_PROP(o), 0, NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_init(OBJ_PROP(o), zend_hash_num_elements(&ce->default_properties), 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_inflatestream_object, o);
ov.handlers = &http_inflatestream_object_handlers;
zend_object_value _http_inflatestream_object_clone_obj(zval *this_ptr TSRMLS_DC)
{
http_encoding_stream *s;
- getObject(http_inflatestream_object, obj);
+ zend_object_value new_ov;
+ http_inflatestream_object *new_obj = NULL;
+ getObject(http_inflatestream_object, old_obj);
s = ecalloc(1, sizeof(http_encoding_stream));
- s->flags = obj->stream->flags;
- inflateCopy(&s->stream, &obj->stream->stream);
+ s->flags = old_obj->stream->flags;
+ inflateCopy(&s->stream, &old_obj->stream->stream);
s->stream.opaque = phpstr_dup(s->stream.opaque);
- return http_inflatestream_object_new_ex(Z_OBJCE_P(this_ptr), s, NULL);
+ new_ov = http_inflatestream_object_new_ex(old_obj->zo.ce, s, &new_obj);
+ zend_objects_clone_members(&new_obj->zo, new_ov, &old_obj->zo, Z_OBJ_HANDLE_P(this_ptr) TSRMLS_CC);
+
+ return new_ov;
}
void _http_inflatestream_object_free(zend_object *object TSRMLS_DC)
}
ALLOC_HASHTABLE(OBJ_PROP(o));
- zend_hash_init(OBJ_PROP(o), 0, NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_init(OBJ_PROP(o), zend_hash_num_elements(&ce->default_properties), 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_message_object, o);
ov.handlers = &http_message_object_handlers;
zend_object_value _http_message_object_clone_obj(zval *this_ptr TSRMLS_DC)
{
- getObject(http_message_object, obj);
- return http_message_object_new_ex(Z_OBJCE_P(this_ptr), http_message_dup(obj->message), NULL);
+ zend_object_value new_ov;
+ http_message_object *new_obj = NULL;
+ getObject(http_message_object, old_obj);
+
+ new_ov = http_message_object_new_ex(old_obj->zo.ce, http_message_dup(old_obj->message), &new_obj);
+ zend_objects_clone_members(&new_obj->zo, new_ov, &old_obj->zo, Z_OBJ_HANDLE_P(this_ptr) TSRMLS_CC);
+
+ return new_ov;
}
void _http_message_object_free(zend_object *object TSRMLS_DC)
zend_object_value _http_request_object_clone_obj(zval *this_ptr TSRMLS_DC)
{
- zend_object *old_zo;
zend_object_value new_ov;
http_request_object *new_obj;
getObject(http_request_object, old_obj);
- old_zo = zend_objects_get_address(this_ptr TSRMLS_CC);
- new_ov = http_request_object_new_ex(old_zo->ce, NULL, &new_obj);
+ new_ov = http_request_object_new_ex(old_obj->zo.ce, NULL, &new_obj);
if (old_obj->request->ch) {
http_curl_init_ex(curl_easy_duphandle(old_obj->request->ch), new_obj->request);
}
- zend_objects_clone_members(&new_obj->zo, new_ov, old_zo, Z_OBJ_HANDLE_P(this_ptr) TSRMLS_CC);
+ zend_objects_clone_members(&new_obj->zo, new_ov, &old_obj->zo, Z_OBJ_HANDLE_P(this_ptr) TSRMLS_CC);
phpstr_append(&new_obj->request->conv.request, old_obj->request->conv.request.data, old_obj->request->conv.request.used);
phpstr_append(&new_obj->request->conv.response, old_obj->request->conv.response.data, old_obj->request->conv.response.used);
<email>mike@php.net</email>
<active>yes</active>
</lead>
- <date>2006-08-18</date>
+ <date>2006-08-00</date>
<version>
- <release>1.2.0</release>
+ <release>1.2.1</release>
<api>1.2.0</api>
</version>
<stability>
</stability>
<license>BSD, revised</license>
<notes><![CDATA[
-+ Improved response performance (HttpResponse, http_send API)
-* Fixed http_parse_cookie() allowed_extras and flags parameters
-* Added http_build_cookie() function
-* Fixed configuration with shared dependencies
+* Fixed issues with inheritance and cloning of HttpDeflateStream, HttpInflateStream and HttpMessage
+ (Extending classes lose default properties on instantiation; Complex members ignored during cloning)
]]></notes>
<contents>
<dir name="/">
#ifndef PHP_EXT_HTTP_H
#define PHP_EXT_HTTP_H
-#define PHP_EXT_HTTP_VERSION "1.2.0"
+#define PHP_EXT_HTTP_VERSION "1.2.1dev"
#ifdef HAVE_CONFIG_H
# include "config.h"
object(HttpMessage)#%d (%d) {
["type:protected"]=>
int(2)
- ["httpVersion:protected"]=>
- float(1.1)
- ["responseCode:protected"]=>
- int(200)
- ["responseStatus:protected"]=>
- string(2) "Ok"
+ ["body:protected"]=>
+ string(0) ""
["requestMethod:protected"]=>
string(0) ""
["requestUrl:protected"]=>
string(0) ""
+ ["responseStatus:protected"]=>
+ string(2) "Ok"
+ ["responseCode:protected"]=>
+ int(200)
+ ["httpVersion:protected"]=>
+ float(1.1)
["headers:protected"]=>
array(1) {
["Server"]=>
string(9) "Funky/1.0"
}
- ["body:protected"]=>
- string(0) ""
["parentMessage:protected"]=>
NULL
}
<?php
include 'skip.inc';
checkcls('HttpRequestPool');
+checkurl('ch.php.net');
+checkurl('at.php.net');
+checkurl('de.php.net');
+checkurl('www.php.net');
?>
--FILE--
<?php
object(HttpMessage)#%d (%d) {
["type:protected"]=>
int(2)
- ["httpVersion:protected"]=>
- float(1.1)
- ["responseCode:protected"]=>
- int(200)
- ["responseStatus:protected"]=>
- string(2) "OK"
- ["requestMethod:protected"]=>
- string(0) ""
- ["requestUrl:protected"]=>
- string(0) ""
- ["headers:protected"]=>
- array(6) {
- %s
- }
["body:protected"]=>
string(309) "string(294) "<?xml version="1.0" encoding="iso-8859-1"?>
<methodCall>
</methodCall>
"
"
- ["parentMessage:protected"]=>
- NULL
-}
-object(HttpMessage)#%d (%d) {
- ["type:protected"]=>
- int(2)
- ["httpVersion:protected"]=>
- float(1.1)
- ["responseCode:protected"]=>
- int(200)
- ["responseStatus:protected"]=>
- string(2) "OK"
["requestMethod:protected"]=>
string(0) ""
["requestUrl:protected"]=>
string(0) ""
+ ["responseStatus:protected"]=>
+ string(2) "OK"
+ ["responseCode:protected"]=>
+ int(200)
+ ["httpVersion:protected"]=>
+ float(1.1)
["headers:protected"]=>
array(6) {
%s
}
+ ["parentMessage:protected"]=>
+ NULL
+}
+object(HttpMessage)#%d (%d) {
+ ["type:protected"]=>
+ int(2)
["body:protected"]=>
string(309) "string(294) "<?xml version="1.0" encoding="iso-8859-1"?>
<methodCall>
</methodCall>
"
"
- ["parentMessage:protected"]=>
- NULL
-}
-object(HttpMessage)#%d (%d) {
- ["type:protected"]=>
- int(2)
- ["httpVersion:protected"]=>
- float(1.1)
- ["responseCode:protected"]=>
- int(200)
- ["responseStatus:protected"]=>
- string(2) "OK"
["requestMethod:protected"]=>
string(0) ""
["requestUrl:protected"]=>
string(0) ""
+ ["responseStatus:protected"]=>
+ string(2) "OK"
+ ["responseCode:protected"]=>
+ int(200)
+ ["httpVersion:protected"]=>
+ float(1.1)
["headers:protected"]=>
array(6) {
%s
}
+ ["parentMessage:protected"]=>
+ NULL
+}
+object(HttpMessage)#%d (%d) {
+ ["type:protected"]=>
+ int(2)
["body:protected"]=>
string(309) "string(294) "<?xml version="1.0" encoding="iso-8859-1"?>
<methodCall>
</methodCall>
"
"
+ ["requestMethod:protected"]=>
+ string(0) ""
+ ["requestUrl:protected"]=>
+ string(0) ""
+ ["responseStatus:protected"]=>
+ string(2) "OK"
+ ["responseCode:protected"]=>
+ int(200)
+ ["httpVersion:protected"]=>
+ float(1.1)
+ ["headers:protected"]=>
+ array(6) {
+ %s
+ }
["parentMessage:protected"]=>
NULL
}