- unset in http_curl_defaults() too
[m6w6/ext-http] / http_request_method_api.c
index a2197c6425324305a4bfb6b15c10d14b48bb2048..37895d7d916b3da0f4917b32c93c80180d2b625b 100644 (file)
@@ -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)
 {