- now I know what to use TSRMLS_SET_CTX() and TSRMLS_FETCH_FROM_CTX() for...
[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 HTTP_STATIC_ME_ALIAS(date, http_date, NULL)
59 HTTP_STATIC_ME_ALIAS(absoluteURI, http_absolute_uri, NULL)
60 HTTP_STATIC_ME_ALIAS(negotiateLanguage, http_negotiate_language, NULL)
61 HTTP_STATIC_ME_ALIAS(negotiateCharset, http_negotiate_charset, NULL)
62 HTTP_STATIC_ME_ALIAS(redirect, http_redirect, NULL)
63 HTTP_STATIC_ME_ALIAS(sendStatus, http_send_status, NULL)
64 HTTP_STATIC_ME_ALIAS(sendLastModified, http_send_last_modified, NULL)
65 HTTP_STATIC_ME_ALIAS(sendContentType, http_send_content_type, NULL)
66 HTTP_STATIC_ME_ALIAS(sendContentDisposition, http_send_content_disposition, NULL)
67 HTTP_STATIC_ME_ALIAS(matchModified, http_match_modified, NULL)
68 HTTP_STATIC_ME_ALIAS(matchEtag, http_match_etag, NULL)
69 HTTP_STATIC_ME_ALIAS(cacheLastModified, http_cache_last_modified, NULL)
70 HTTP_STATIC_ME_ALIAS(cacheEtag, http_cache_etag, NULL)
71 HTTP_STATIC_ME_ALIAS(chunkedDecode, http_chunked_decode, NULL)
72 HTTP_STATIC_ME_ALIAS(splitResponse, http_split_response, NULL)
73 HTTP_STATIC_ME_ALIAS(parseHeaders, http_parse_headers, NULL)
74 HTTP_STATIC_ME_ALIAS(getRequestHeaders, http_get_request_headers, NULL)
75 #ifdef HTTP_HAVE_CURL
76 HTTP_STATIC_ME_ALIAS(get, http_get, http_request_info_ref_3)
77 HTTP_STATIC_ME_ALIAS(head, http_head, http_request_info_ref_3)
78 HTTP_STATIC_ME_ALIAS(postData, http_post_data, http_request_info_ref_4)
79 HTTP_STATIC_ME_ALIAS(postFields, http_post_fields, http_request_info_ref_5)
80 #endif /* HTTP_HAVE_CURL */
81 HTTP_STATIC_ME_ALIAS(authBasic, http_auth_basic, NULL)
82 HTTP_STATIC_ME_ALIAS(authBasicCallback, http_auth_basic_cb, NULL)
83 {NULL, NULL, NULL}
84 };
85
86 void _http_util_object_init(INIT_FUNC_ARGS)
87 {
88 HTTP_REGISTER_CLASS(HttpUtil, http_util_object, NULL, ZEND_ACC_FINAL_CLASS);
89 }
90
91 #endif /* ZEND_ENGINE_2 */
92
93 /*
94 * Local variables:
95 * tab-width: 4
96 * c-basic-offset: 4
97 * End:
98 * vim600: noet sw=4 ts=4 fdm=marker
99 * vim<600: noet sw=4 ts=4
100 */
101