X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_request_method_api.c;h=8c1812965f5851a77d8b4933a455e6a66cfd59de;hp=57636d088b2b065e7e050bc3015a6859803ea2cf;hb=ffc893b125c6cc9b385a68a357b08ba2cc4e91f6;hpb=36fa8b05be7aaf8e7f9e503c3e82733022500c03 diff --git a/http_request_method_api.c b/http_request_method_api.c index 57636d0..8c18129 100644 --- a/http_request_method_api.c +++ b/http_request_method_api.c @@ -167,14 +167,14 @@ PHP_HTTP_API unsigned long _http_request_method_register(const char *method_name } method[method_len] = '\0'; - Z_ARRVAL(array) = &HTTP_G(request).methods.custom; + INIT_ZARR(array, &HTTP_G(request).methods.custom); add_next_index_stringl(&array, method, method_len, 0); method_len = spprintf(&http_method, 0, "HTTP_METH_%s", method); zend_register_long_constant(http_method, method_len + 1, meth_num, CONST_CS, http_module_number TSRMLS_CC); efree(http_method); -#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL) +#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL) && !defined(WONKY) method_len = spprintf(&http_method, 0, "METH_%s", method); zend_declare_class_constant_long(http_request_object_ce, http_method, method_len, meth_num TSRMLS_CC); efree(http_method); @@ -196,7 +196,7 @@ PHP_HTTP_API STATUS _http_request_method_unregister(unsigned long method TSRMLS_ return FAILURE; } -#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL) +#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL) && !defined(WONKY) method_len = spprintf(&http_method, 0, "METH_%s", Z_STRVAL_PP(zmethod)); if ((SUCCESS != zend_hash_del(&http_request_object_ce->constants_table, http_method, method_len + 1))) { http_error_ex(HE_NOTICE, HTTP_E_REQUEST_METHOD, "Could not unregister request method: HttpRequest::%s", http_method);