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 "0.23.0dev"
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
53 #if defined(HTTP_WANT_CURL) && defined(HTTP_HAVE_CURL)
55 # include <winsock2.h>
56 # define CURL_STATICLIB
58 # include <curl/curl.h>
61 #if defined(HTTP_WANT_MAGIC) && defined(HTTP_HAVE_MAGIC)
62 # if defined(PHP_WIN32) && !defined(USE_MAGIC_DLL) && !defined(USE_MAGIC_STATIC)
63 # define USE_MAGIC_STATIC
68 #if defined(HTTP_WANT_ZLIB) && defined(HTTP_HAVE_ZLIB)
74 extern zend_module_entry http_module_entry
;
75 #define phpext_http_ptr &http_module_entry
77 extern int http_module_number
;
79 ZEND_BEGIN_MODULE_GLOBALS(http
)
81 struct _http_globals_etag
{
87 struct _http_globals_log
{
90 char *allowed_methods
;
94 struct _http_globals_send
{
95 double throttle_delay
;
100 struct _http_globals_send_deflate
{
101 zend_bool start_auto
;
106 struct _http_globals_send_inflate
{
107 zend_bool start_auto
;
113 struct _http_globals_request
{
114 struct _http_globals_request_methods
{
116 struct _http_globals_request_methods_custom
{
123 #ifndef HTTP_HAVE_SAPI_RTIME
127 zend_bool only_exceptions
;
130 zend_bool force_exit
;
131 zend_bool read_post_data
;
133 ZEND_END_MODULE_GLOBALS(http
)
135 ZEND_EXTERN_MODULE_GLOBALS(http
);
139 # define HTTP_G(v) TSRMG(http_globals_id, zend_http_globals *, v)
140 # define HTTP_GLOBALS ((zend_http_globals *) (*((void ***) tsrm_ls))[TSRM_UNSHUFFLE_RSRC_ID(http_globals_id)])
142 # define HTTP_G(v) (http_globals.v)
143 # define HTTP_GLOBALS (&http_globals)
145 #define getGlobals(G) zend_http_globals *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_get_request_headers
);
172 PHP_FUNCTION(http_get_request_body
);
173 PHP_FUNCTION(http_get_request_body_stream
);
174 PHP_FUNCTION(http_match_request_header
);
175 #ifdef HTTP_HAVE_CURL
176 PHP_FUNCTION(http_get
);
177 PHP_FUNCTION(http_head
);
178 PHP_FUNCTION(http_post_data
);
179 PHP_FUNCTION(http_post_fields
);
180 PHP_FUNCTION(http_put_file
);
181 PHP_FUNCTION(http_put_stream
);
182 #endif /* HTTP_HAVE_CURL */
183 PHP_FUNCTION(http_request_method_register
);
184 PHP_FUNCTION(http_request_method_unregister
);
185 PHP_FUNCTION(http_request_method_exists
);
186 PHP_FUNCTION(http_request_method_name
);
187 PHP_FUNCTION(ob_etaghandler
);
188 #ifdef HTTP_HAVE_ZLIB
189 PHP_FUNCTION(http_deflate
);
190 PHP_FUNCTION(http_inflate
);
191 PHP_FUNCTION(ob_deflatehandler
);
192 PHP_FUNCTION(ob_inflatehandler
);
194 PHP_FUNCTION(http_support
);
196 PHP_MINIT_FUNCTION(http
);
197 PHP_MSHUTDOWN_FUNCTION(http
);
198 PHP_RINIT_FUNCTION(http
);
199 PHP_RSHUTDOWN_FUNCTION(http
);
200 PHP_MINFO_FUNCTION(http
);
202 #endif /* PHP_HTTP_H */
209 * vim600: noet sw=4 ts=4 fdm=marker
210 * vim<600: noet sw=4 ts=4