X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;ds=sidebyside;f=http_requestdatashare_object.c;h=eed7d6b8ef125ecfb08c36e2a2f70c0a52b02d10;hb=31f063a5727317d1939c0cbf074520b48a4534da;hp=060493556807323dce2e14c4e02f5eb9ca1cc74e;hpb=ad5f896b03adaa073134a00108a9cdf00720673a;p=m6w6%2Fext-http diff --git a/http_requestdatashare_object.c b/http_requestdatashare_object.c index 0604935..eed7d6b 100644 --- a/http_requestdatashare_object.c +++ b/http_requestdatashare_object.c @@ -125,12 +125,13 @@ zend_object_value _http_requestdatashare_object_new_ex(zend_class_entry *ce, htt *ptr = o; } -#if PHP_VERSION_ID < 50399 +#ifdef ZEND_ENGINE_2_4 + zend_object_std_init(o, ce TSRMLS_CC); + object_properties_init(o, ce); +#else ALLOC_HASHTABLE(OBJ_PROP(o)); 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 *)); -#else - object_properties_init(&o->zo, ce); #endif ov.handle = putObject(http_requestdatashare_object, o); @@ -152,11 +153,11 @@ void _http_requestdatashare_object_free(zend_object *object TSRMLS_DC) static zval *_http_requestdatashare_object_read_prop(zval *object, zval *member, int type ZEND_LITERAL_KEY_DC TSRMLS_DC) { if (type == BP_VAR_W && -#if PHP_VERSION_ID < 50399 - zend_hash_exists(&THIS_CE->default_properties, Z_STRVAL_P(member), Z_STRLEN_P(member)+1) +#ifdef ZEND_ENGINE_2_4 + zend_hash_exists(&THIS_CE->properties_info, Z_STRVAL_P(member), Z_STRLEN_P(member)+1) #else - zend_get_property_info(THIS_CE, member, 1 TSRMLS_CC) -#endif + zend_hash_exists(&THIS_CE->default_properties, Z_STRVAL_P(member), Z_STRLEN_P(member)+1) +#endif ) { zend_error(E_ERROR, "Cannot access HttpRequestDataShare default properties by reference or array key/index"); return NULL; @@ -167,11 +168,13 @@ static zval *_http_requestdatashare_object_read_prop(zval *object, zval *member, static void _http_requestdatashare_object_write_prop(zval *object, zval *member, zval *value ZEND_LITERAL_KEY_DC TSRMLS_DC) { -#if PHP_VERSION_ID < 50399 - if (zend_hash_exists(&THIS_CE->default_properties, Z_STRVAL_P(member), Z_STRLEN_P(member)+1)) { + if ( +#ifdef ZEND_ENGINE_2_4 + zend_hash_exists(&THIS_CE->properties_info, Z_STRVAL_P(member), Z_STRLEN_P(member)+1) #else - if (zend_get_property_info(THIS_CE, member, 1 TSRMLS_CC)) { + zend_hash_exists(&THIS_CE->default_properties, Z_STRVAL_P(member), Z_STRLEN_P(member)+1) #endif + ) { int status; getObjectEx(http_requestdatashare_object, obj, object);