X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_request_method_api.c;h=37895d7d916b3da0f4917b32c93c80180d2b625b;hp=a2197c6425324305a4bfb6b15c10d14b48bb2048;hb=c9a41488faf406e62675ebc75c3abf1c50725852;hpb=100b5ff381fe93e7ac4d7b0ea68f9b7256615e68 diff --git a/http_request_method_api.c b/http_request_method_api.c index a2197c6..37895d7 100644 --- a/http_request_method_api.c +++ b/http_request_method_api.c @@ -35,7 +35,7 @@ ZEND_EXTERN_MODULE_GLOBALS(http); /* {{{ char *http_request_methods[] */ static const char *const http_request_methods[] = { - "UNKOWN", + "UNKNOWN", /* HTTP/1.1 */ "GET", "HEAD", @@ -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) {