X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_request_method_api.c;h=37895d7d916b3da0f4917b32c93c80180d2b625b;hp=595a1de5bfb7e39b01e93eb8d8e1447ee1826fb0;hb=c9a41488faf406e62675ebc75c3abf1c50725852;hpb=c0cc1b8be318ca09e272a84b1cf7f589ad166773 diff --git a/http_request_method_api.c b/http_request_method_api.c index 595a1de..37895d7 100644 --- a/http_request_method_api.c +++ b/http_request_method_api.c @@ -71,7 +71,7 @@ static const char *const http_request_methods[] = { }; /* }}} */ -STATUS _http_request_method_global_init(INIT_FUNC_ARGS) +PHP_MINIT_FUNCTION(http_request_method) { /* HTTP/1.1 */ HTTP_LONG_CONSTANT("HTTP_METH_GET", HTTP_GET); @@ -108,6 +108,17 @@ STATUS _http_request_method_global_init(INIT_FUNC_ARGS) return SUCCESS; } +PHP_RSHUTDOWN_FUNCTION(http_request_method) +{ + int i, c = zend_hash_num_elements(&HTTP_G(request).methods.custom); + + for (i = 0; i < c; ++i) { + http_request_method_unregister(HTTP_MAX_REQUEST_METHOD + i); + } + + return SUCCESS; +} + /* {{{ char *http_request_method_name(http_request_method) */ PHP_HTTP_API const char *_http_request_method_name(http_request_method m TSRMLS_DC) {