I, moron
[m6w6/ext-http] / http_util_object.c
1 /*
2 +----------------------------------------------------------------------+
3 | PECL :: http |
4 +----------------------------------------------------------------------+
5 | This source file is subject to version 3.0 of the PHP license, that |
6 | is bundled with this package in the file LICENSE, and is available |
7 | through the world-wide-web at http://www.php.net/license/3_0.txt. |
8 | If you did not receive a copy of the PHP license and are unable to |
9 | obtain it through the world-wide-web, please send a note to |
10 | license@php.net so we can mail you a copy immediately. |
11 +----------------------------------------------------------------------+
12 | Copyright (c) 2004-2005 Michael Wallner <mike@php.net> |
13 +----------------------------------------------------------------------+
14 */
15
16 /* $Id$ */
17
18
19 #ifdef HAVE_CONFIG_H
20 # include "config.h"
21 #endif
22
23 #include "php.h"
24 #include "php_http.h"
25 #include "php_http_std_defs.h"
26 #include "php_http_util_object.h"
27
28 #ifdef ZEND_ENGINE_2
29
30 #ifdef HTTP_HAVE_CURL
31 static
32 ZEND_BEGIN_ARG_INFO(http_request_info_ref_3, 0)
33 ZEND_ARG_PASS_INFO(0)
34 ZEND_ARG_PASS_INFO(0)
35 ZEND_ARG_PASS_INFO(1)
36 ZEND_END_ARG_INFO();
37
38 static
39 ZEND_BEGIN_ARG_INFO(http_request_info_ref_4, 0)
40 ZEND_ARG_PASS_INFO(0)
41 ZEND_ARG_PASS_INFO(0)
42 ZEND_ARG_PASS_INFO(0)
43 ZEND_ARG_PASS_INFO(1)
44 ZEND_END_ARG_INFO();
45
46 static
47 ZEND_BEGIN_ARG_INFO(http_request_info_ref_5, 0)
48 ZEND_ARG_PASS_INFO(0)
49 ZEND_ARG_PASS_INFO(0)
50 ZEND_ARG_PASS_INFO(0)
51 ZEND_ARG_PASS_INFO(0)
52 ZEND_ARG_PASS_INFO(1)
53 ZEND_END_ARG_INFO();
54 #endif /* HTTP_HAVE_CURL */
55
56 zend_class_entry *http_util_object_ce;
57 zend_function_entry http_util_object_fe[] = {
58 #define HTTP_UTIL_ME(me, al, ai) ZEND_FENTRY(me, ZEND_FN(al), ai, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
59 HTTP_UTIL_ME(date, http_date, NULL)
60 HTTP_UTIL_ME(absoluteURI, http_absolute_uri, NULL)
61 HTTP_UTIL_ME(negotiateLanguage, http_negotiate_language, NULL)
62 HTTP_UTIL_ME(negotiateCharset, http_negotiate_charset, NULL)
63 HTTP_UTIL_ME(redirect, http_redirect, NULL)
64 HTTP_UTIL_ME(sendStatus, http_send_status, NULL)
65 HTTP_UTIL_ME(sendLastModified, http_send_last_modified, NULL)
66 HTTP_UTIL_ME(sendContentType, http_send_content_type, NULL)
67 HTTP_UTIL_ME(sendContentDisposition, http_send_content_disposition, NULL)
68 HTTP_UTIL_ME(matchModified, http_match_modified, NULL)
69 HTTP_UTIL_ME(matchEtag, http_match_etag, NULL)
70 HTTP_UTIL_ME(cacheLastModified, http_cache_last_modified, NULL)
71 HTTP_UTIL_ME(cacheEtag, http_cache_etag, NULL)
72 HTTP_UTIL_ME(chunkedDecode, http_chunked_decode, NULL)
73 HTTP_UTIL_ME(splitResponse, http_split_response, NULL)
74 HTTP_UTIL_ME(parseHeaders, http_parse_headers, NULL)
75 HTTP_UTIL_ME(getRequestHeaders, http_get_request_headers, NULL)
76 #ifdef HTTP_HAVE_CURL
77 HTTP_UTIL_ME(get, http_get, http_request_info_ref_3)
78 HTTP_UTIL_ME(head, http_head, http_request_info_ref_3)
79 HTTP_UTIL_ME(postData, http_post_data, http_request_info_ref_4)
80 HTTP_UTIL_ME(postFields, http_post_fields, http_request_info_ref_5)
81 #endif /* HTTP_HAVE_CURL */
82 HTTP_UTIL_ME(authBasic, http_auth_basic, NULL)
83 HTTP_UTIL_ME(authBasicCallback, http_auth_basic_cb, NULL)
84 {NULL, NULL, NULL}
85 };
86
87 void _http_util_object_init(INIT_FUNC_ARGS)
88 {
89 HTTP_REGISTER_CLASS(HttpUtil, http_util_object, NULL, ZEND_ACC_FINAL_CLASS);
90 }
91
92 #endif /* ZEND_ENGINE_2 */
93
94 /*
95 * Local variables:
96 * tab-width: 4
97 * c-basic-offset: 4
98 * End:
99 * vim600: noet sw=4 ts=4 fdm=marker
100 * vim<600: noet sw=4 ts=4
101 */
102