X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_request_object.c;h=f4f27cf0718892e48c918e6b5685c3ee28d1165e;hp=f06157a4e2c4f96fd3209bf4e5f126dc02b39b5f;hb=375522dcffba5c1f2d99ff70afb2a8f8788063cd;hpb=ad5f896b03adaa073134a00108a9cdf00720673a diff --git a/http_request_object.c b/http_request_object.c index f06157a..f4f27cf 100644 --- a/http_request_object.c +++ b/http_request_object.c @@ -492,12 +492,13 @@ zend_object_value _http_request_object_new_ex(zend_class_entry *ce, CURL *ch, ht *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_request_object, o); @@ -682,7 +683,7 @@ STATUS _http_request_object_requesthandler(http_request_object *obj, zval *this_ if ( (Z_TYPE_P(options) != IS_ARRAY) || (SUCCESS != zend_hash_find(Z_ARRVAL_P(options), "onprogress", sizeof("onprogress"), (void *) &entry) - || (!IS_CALLABLE(*entry, 0, NULL)))) { + || (!HTTP_IS_CALLABLE(*entry, 0, NULL)))) { MAKE_STD_ZVAL(pcb); array_init(pcb); ZVAL_ADDREF(getThis()); @@ -787,8 +788,12 @@ STATUS _http_request_object_responsehandler(http_request_object *obj, zval *this return ret; } - -static int apply_pretty_key(void *pDest, int num_args, va_list args, zend_hash_key *hash_key) +#ifdef ZEND_ENGINE_2_4 +# define APK_DC TSRMLS_DC +#else +# define APK_DC +#endif +static int apply_pretty_key(void *pDest APK_DC, int num_args, va_list args, zend_hash_key *hash_key) { if (hash_key->arKey && hash_key->nKeyLength > 1) { hash_key->h = zend_hash_func(pretty_key(hash_key->arKey, hash_key->nKeyLength - 1, 1, 0), hash_key->nKeyLength);