projects
/
m6w6
/
ext-http
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
- use PHP macros, so that it is obvious when to call what
[m6w6/ext-http]
/
http_request_method_api.c
diff --git
a/http_request_method_api.c
b/http_request_method_api.c
index a2197c6425324305a4bfb6b15c10d14b48bb2048..37895d7d916b3da0f4917b32c93c80180d2b625b 100644
(file)
--- 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[] = {
/* {{{ char *http_request_methods[] */
static const char *const http_request_methods[] = {
- "UNKOWN",
+ "UNK
N
OWN",
/* HTTP/1.1 */
"GET",
"HEAD",
/* 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);
{
/* 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;
}
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)
{
/* {{{ char *http_request_method_name(http_request_method) */
PHP_HTTP_API const char *_http_request_method_name(http_request_method m TSRMLS_DC)
{