2 +--------------------------------------------------------------------+
4 +--------------------------------------------------------------------+
5 | Redistribution and use in source and binary forms, with or without |
6 | modification, are permitted provided that the conditions mentioned |
7 | in the accompanying LICENSE file are met. |
8 +--------------------------------------------------------------------+
9 | Copyright (c) 2004-2006, Michael Wallner <mike@php.net> |
10 +--------------------------------------------------------------------+
15 #ifndef PHP_EXT_HTTP_H
16 #define PHP_EXT_HTTP_H
18 #define PHP_EXT_HTTP_VERSION "1.0.0RC3"
24 # include "php_config.h"
29 #include "php_http_std_defs.h"
30 #include "phpstr/phpstr.h"
34 # if PHP_API_VERSION > 20041225
35 # define HTTP_HAVE_SAPI_RTIME
36 # define HTTP_GET_REQUEST_TIME() sapi_get_request_time(TSRMLS_C)
38 # define HTTP_GET_REQUEST_TIME() HTTP_G->request_time
43 #ifdef HTTP_WANT_NETDB
45 # define HTTP_HAVE_NETDB
46 # include <winsock2.h>
47 # elif defined(HAVE_NETDB_H)
48 # define HTTP_HAVE_NETDB
56 #if defined(HTTP_WANT_CURL) && defined(HTTP_HAVE_CURL)
58 # include <winsock2.h>
59 # define CURL_STATICLIB
61 # include <curl/curl.h>
62 # define HTTP_CURL_VERSION(x, y, z) (LIBCURL_VERSION_NUM >= (((x)<<16) + ((y)<<8) + (z)))
65 #if defined(HTTP_WANT_MAGIC) && defined(HTTP_HAVE_MAGIC)
66 # if defined(PHP_WIN32) && !defined(USE_MAGIC_DLL) && !defined(USE_MAGIC_STATIC)
67 # define USE_MAGIC_STATIC
72 #if defined(HTTP_WANT_ZLIB) && defined(HTTP_HAVE_ZLIB)
78 extern zend_module_entry http_module_entry
;
79 #define phpext_http_ptr &http_module_entry
81 extern int http_module_number
;
83 ZEND_BEGIN_MODULE_GLOBALS(http
)
85 struct _http_globals_etag
{
91 struct _http_globals_log
{
94 char *allowed_methods
;
98 struct _http_globals_send
{
99 double throttle_delay
;
103 time_t last_modified
;
104 struct _http_globals_send_deflate
{
105 zend_bool start_auto
;
110 struct _http_globals_send_inflate
{
111 zend_bool start_auto
;
117 struct _http_globals_request
{
118 struct _http_globals_request_methods
{
120 struct _http_globals_request_methods_custom
{
127 #ifndef HTTP_HAVE_SAPI_RTIME
131 zend_bool only_exceptions
;
134 zend_bool force_exit
;
135 zend_bool read_post_data
;
137 ZEND_END_MODULE_GLOBALS(http
)
139 ZEND_EXTERN_MODULE_GLOBALS(http
);
143 # define HTTP_G ((zend_http_globals *) (*((void ***) tsrm_ls))[TSRM_UNSHUFFLE_RSRC_ID(http_globals_id)])
145 # define HTTP_G (&http_globals)
148 PHP_FUNCTION(http_test
);
149 PHP_FUNCTION(http_date
);
150 PHP_FUNCTION(http_build_url
);
151 PHP_FUNCTION(http_build_str
);
152 PHP_FUNCTION(http_negotiate_language
);
153 PHP_FUNCTION(http_negotiate_charset
);
154 PHP_FUNCTION(http_negotiate_content_type
);
155 PHP_FUNCTION(http_redirect
);
156 PHP_FUNCTION(http_throttle
);
157 PHP_FUNCTION(http_send_status
);
158 PHP_FUNCTION(http_send_last_modified
);
159 PHP_FUNCTION(http_send_content_type
);
160 PHP_FUNCTION(http_send_content_disposition
);
161 PHP_FUNCTION(http_match_modified
);
162 PHP_FUNCTION(http_match_etag
);
163 PHP_FUNCTION(http_cache_last_modified
);
164 PHP_FUNCTION(http_cache_etag
);
165 PHP_FUNCTION(http_send_data
);
166 PHP_FUNCTION(http_send_file
);
167 PHP_FUNCTION(http_send_stream
);
168 PHP_FUNCTION(http_chunked_decode
);
169 PHP_FUNCTION(http_parse_message
);
170 PHP_FUNCTION(http_parse_headers
);
171 PHP_FUNCTION(http_parse_cookie
);
172 PHP_FUNCTION(http_get_request_headers
);
173 PHP_FUNCTION(http_get_request_body
);
174 PHP_FUNCTION(http_get_request_body_stream
);
175 PHP_FUNCTION(http_match_request_header
);
176 #ifdef HTTP_HAVE_CURL
177 PHP_FUNCTION(http_get
);
178 PHP_FUNCTION(http_head
);
179 PHP_FUNCTION(http_post_data
);
180 PHP_FUNCTION(http_post_fields
);
181 PHP_FUNCTION(http_put_data
);
182 PHP_FUNCTION(http_put_file
);
183 PHP_FUNCTION(http_put_stream
);
184 PHP_FUNCTION(http_request
);
185 PHP_FUNCTION(http_request_body_encode
);
186 #endif /* HTTP_HAVE_CURL */
187 PHP_FUNCTION(http_request_method_register
);
188 PHP_FUNCTION(http_request_method_unregister
);
189 PHP_FUNCTION(http_request_method_exists
);
190 PHP_FUNCTION(http_request_method_name
);
191 PHP_FUNCTION(ob_etaghandler
);
192 #ifdef HTTP_HAVE_ZLIB
193 PHP_FUNCTION(http_deflate
);
194 PHP_FUNCTION(http_inflate
);
195 PHP_FUNCTION(ob_deflatehandler
);
196 PHP_FUNCTION(ob_inflatehandler
);
198 PHP_FUNCTION(http_support
);
200 #endif /* PHP_HTTP_H */
207 * vim600: noet sw=4 ts=4 fdm=marker
208 * vim<600: noet sw=4 ts=4