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.0-dev"
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
41 #ifdef HTTP_WANT_NETDB
43 # define HTTP_HAVE_NETDB
44 # include <winsock2.h>
45 # elif defined(HAVE_NETDB_H)
46 # define HTTP_HAVE_NETDB
54 #if defined(HTTP_WANT_CURL) && defined(HTTP_HAVE_CURL)
56 # include <winsock2.h>
57 # define CURL_STATICLIB
59 # include <curl/curl.h>
60 # define HTTP_CURL_VERSION(x, y, z) (LIBCURL_VERSION_NUM >= (((x)<<16) + ((y)<<8) + (z)))
63 #if defined(HTTP_WANT_MAGIC) && defined(HTTP_HAVE_MAGIC)
64 # if defined(PHP_WIN32) && !defined(USE_MAGIC_DLL) && !defined(USE_MAGIC_STATIC)
65 # define USE_MAGIC_STATIC
70 #if defined(HTTP_WANT_ZLIB) && defined(HTTP_HAVE_ZLIB)
76 extern zend_module_entry http_module_entry
;
77 #define phpext_http_ptr &http_module_entry
79 extern int http_module_number
;
81 ZEND_BEGIN_MODULE_GLOBALS(http
)
83 struct _http_globals_etag
{
89 struct _http_globals_log
{
93 char *allowed_methods
;
97 struct _http_globals_send
{
98 double throttle_delay
;
102 time_t last_modified
;
103 struct _http_globals_send_deflate
{
104 zend_bool start_auto
;
109 struct _http_globals_send_inflate
{
110 zend_bool start_auto
;
114 zend_bool not_found_404
;
117 struct _http_globals_request
{
119 struct _http_globals_request_methods
{
121 struct _http_globals_request_methods_custom
{
130 zend_bool only_exceptions
;
133 zend_bool force_exit
;
134 zend_bool read_post_data
;
136 ZEND_END_MODULE_GLOBALS(http
)
138 ZEND_EXTERN_MODULE_GLOBALS(http
);
142 # define HTTP_G ((zend_http_globals *) (*((void ***) tsrm_ls))[TSRM_UNSHUFFLE_RSRC_ID(http_globals_id)])
144 # define HTTP_G (&http_globals)
147 PHP_FUNCTION(http_test
);
148 PHP_FUNCTION(http_date
);
149 PHP_FUNCTION(http_build_url
);
150 PHP_FUNCTION(http_build_str
);
151 PHP_FUNCTION(http_negotiate_language
);
152 PHP_FUNCTION(http_negotiate_charset
);
153 PHP_FUNCTION(http_negotiate_content_type
);
154 PHP_FUNCTION(http_redirect
);
155 PHP_FUNCTION(http_throttle
);
156 PHP_FUNCTION(http_send_status
);
157 PHP_FUNCTION(http_send_last_modified
);
158 PHP_FUNCTION(http_send_content_type
);
159 PHP_FUNCTION(http_send_content_disposition
);
160 PHP_FUNCTION(http_match_modified
);
161 PHP_FUNCTION(http_match_etag
);
162 PHP_FUNCTION(http_cache_last_modified
);
163 PHP_FUNCTION(http_cache_etag
);
164 PHP_FUNCTION(http_send_data
);
165 PHP_FUNCTION(http_send_file
);
166 PHP_FUNCTION(http_send_stream
);
167 PHP_FUNCTION(http_chunked_decode
);
168 PHP_FUNCTION(http_parse_message
);
169 PHP_FUNCTION(http_parse_headers
);
170 PHP_FUNCTION(http_parse_cookie
);
171 PHP_FUNCTION(http_parse_params
);
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 #ifdef HAVE_CURL_GETFORMDATA
186 PHP_FUNCTION(http_request_body_encode
);
187 #endif /* HAVE_CURL_GETFORMDATA */
188 #endif /* HTTP_HAVE_CURL */
189 PHP_FUNCTION(http_request_method_register
);
190 PHP_FUNCTION(http_request_method_unregister
);
191 PHP_FUNCTION(http_request_method_exists
);
192 PHP_FUNCTION(http_request_method_name
);
193 PHP_FUNCTION(ob_etaghandler
);
194 #ifdef HTTP_HAVE_ZLIB
195 PHP_FUNCTION(http_deflate
);
196 PHP_FUNCTION(http_inflate
);
197 PHP_FUNCTION(ob_deflatehandler
);
198 PHP_FUNCTION(ob_inflatehandler
);
200 PHP_FUNCTION(http_support
);
202 #endif /* PHP_HTTP_H */
209 * vim600: noet sw=4 ts=4 fdm=marker
210 * vim<600: noet sw=4 ts=4