X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=http_request_method_api.c;h=3359b28ad501f5fce3b474b7fbb0b80b7678f114;hb=1ec34f462819d4a10badd83d8493403b6c0c6e68;hp=1d73ddda5b4a447acea1b2f7ea54ebdfe4d9485a;hpb=2f39230d83bdf816dcae52c7e5a1b019347f0e7b;p=m6w6%2Fext-http diff --git a/http_request_method_api.c b/http_request_method_api.c index 1d73ddd..3359b28 100644 --- a/http_request_method_api.c +++ b/http_request_method_api.c @@ -103,6 +103,20 @@ PHP_RINIT_FUNCTION(http_request_method) { HTTP_G->request.methods.custom.entries = ecalloc(1, sizeof(http_request_method_entry *)); + if (HTTP_G->request.methods.custom.ini && *HTTP_G->request.methods.custom.ini) { + HashPosition pos; + HashTable methods; + zval **data; + + zend_hash_init(&methods, 0, NULL, ZVAL_PTR_DTOR, 0); + http_parse_params(HTTP_G->request.methods.custom.ini, HTTP_PARAMS_DEFAULT, &methods); + FOREACH_HASH_VAL(pos, &methods, data) { + if (Z_TYPE_PP(data) == IS_STRING) { + http_request_method_register(Z_STRVAL_PP(data), Z_STRLEN_PP(data)); + } + } + zend_hash_destroy(&methods); + } return SUCCESS; }