- php_info_print_table_header(2, "Functionality", "Availability");
- php_info_print_table_row(2, "Miscellaneous Utilities:", HTTP_FUNC_AVAIL("HttpUtil, HttpMessage"));
- php_info_print_table_row(2, "Extended HTTP Responses:", HTTP_FUNC_AVAIL("HttpResponse"));
- php_info_print_table_row(2, "Extended HTTP Requests:", HTTP_CURL_AVAIL("HttpRequest"));
+ php_info_print_table_colspan_header(2, "Request Methods");
+ {
+ unsigned i;
+ HashPosition pos;
+ zval **custom_method;
+ phpstr *known_request_methods = phpstr_new();
+ phpstr *custom_request_methods = phpstr_new();
+
+ for (i = HTTP_NO_REQUEST_METHOD+1; i < HTTP_MAX_REQUEST_METHOD; ++i) {
+ phpstr_appendl(known_request_methods, http_request_method_name(i));
+ phpstr_appends(known_request_methods, ", ");
+ }
+ FOREACH_HASH_VAL(pos, &HTTP_G(request).methods.custom, custom_method) {
+ phpstr_append(custom_request_methods, Z_STRVAL_PP(custom_method), Z_STRLEN_PP(custom_method));
+ phpstr_appends(custom_request_methods, ", ");
+ }
+
+ phpstr_append(known_request_methods, PHPSTR_VAL(custom_request_methods), PHPSTR_LEN(custom_request_methods));
+ phpstr_fix(known_request_methods);
+ phpstr_fix(custom_request_methods);
+
+ php_info_print_table_row(2, "Known", PHPSTR_VAL(known_request_methods));
+ php_info_print_table_row(2, "Custom",
+ PHPSTR_LEN(custom_request_methods) ? PHPSTR_VAL(custom_request_methods) : "none registered");
+ php_info_print_table_row(2, "Allowed", strlen(HTTP_G(request).methods.allowed) ? HTTP_G(request).methods.allowed : "(ANY)");
+
+ phpstr_free(&known_request_methods);
+ phpstr_free(&custom_request_methods);
+ }