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-2005, 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.20.0dev"
21 #include "php_http_std_defs.h"
22 #include "phpstr/phpstr.h"
26 #ifdef HTTP_WANT_NETDB
28 # include <winsock2.h>
29 # elif defined(HAVE_NETDB_H)
34 #if defined(HTTP_WANT_CURL) && defined(HTTP_HAVE_CURL)
36 # include <winsock2.h>
38 # include <curl/curl.h>
41 #if defined(HTTP_WANT_MAGIC) && defined(HTTP_HAVE_MAGIC)
42 # if defined(PHP_WIN32) && !defined(USE_MAGIC_DLL) && !defined(USE_MAGIC_STATIC)
43 # define USE_MAGIC_STATIC
48 #if defined(HTTP_WANT_ZLIB) && defined(HTTP_HAVE_ZLIB)
54 extern zend_module_entry http_module_entry
;
55 #define phpext_http_ptr &http_module_entry
57 extern int http_module_number
;
59 ZEND_BEGIN_MODULE_GLOBALS(http
)
61 struct _http_globals_etag
{
67 struct _http_globals_log
{
70 char *allowed_methods
;
74 struct _http_globals_send
{
75 double throttle_delay
;
83 struct _http_globals_request
{
84 struct _http_globals_request_methods
{
90 struct _http_globals_request_copies
{
96 # ifndef HAVE_CURL_EASY_STRERROR
97 char error
[CURL_ERROR_SIZE
+ 1];
99 #endif /* HTTP_HAVE_CURL */
103 zend_bool only_exceptions
;
106 zend_bool force_exit
;
108 ZEND_END_MODULE_GLOBALS(http
)
112 # define HTTP_G(v) TSRMG(http_globals_id, zend_http_globals *, v)
113 # define HTTP_GLOBALS ((zend_http_globals *) (*((void ***) tsrm_ls))[TSRM_UNSHUFFLE_RSRC_ID(http_globals_id)])
115 # define HTTP_G(v) (http_globals.v)
116 # define HTTP_GLOBALS (&http_globals)
118 #define getGlobals(G) zend_http_globals *G = HTTP_GLOBALS;
120 PHP_FUNCTION(http_test
);
121 PHP_FUNCTION(http_date
);
122 PHP_FUNCTION(http_build_uri
);
123 PHP_FUNCTION(http_negotiate_language
);
124 PHP_FUNCTION(http_negotiate_charset
);
125 PHP_FUNCTION(http_negotiate_content_type
);
126 PHP_FUNCTION(http_redirect
);
127 PHP_FUNCTION(http_throttle
);
128 PHP_FUNCTION(http_send_status
);
129 PHP_FUNCTION(http_send_last_modified
);
130 PHP_FUNCTION(http_send_content_type
);
131 PHP_FUNCTION(http_send_content_disposition
);
132 PHP_FUNCTION(http_match_modified
);
133 PHP_FUNCTION(http_match_etag
);
134 PHP_FUNCTION(http_cache_last_modified
);
135 PHP_FUNCTION(http_cache_etag
);
136 PHP_FUNCTION(http_send_data
);
137 PHP_FUNCTION(http_send_file
);
138 PHP_FUNCTION(http_send_stream
);
139 PHP_FUNCTION(http_chunked_decode
);
140 PHP_FUNCTION(http_parse_message
);
141 PHP_FUNCTION(http_parse_headers
);
142 PHP_FUNCTION(http_get_request_headers
);
143 PHP_FUNCTION(http_get_request_body
);
144 PHP_FUNCTION(http_match_request_header
);
145 #ifdef HTTP_HAVE_CURL
146 PHP_FUNCTION(http_get
);
147 PHP_FUNCTION(http_head
);
148 PHP_FUNCTION(http_post_data
);
149 PHP_FUNCTION(http_post_fields
);
150 PHP_FUNCTION(http_put_file
);
151 PHP_FUNCTION(http_put_stream
);
152 #endif /* HTTP_HAVE_CURL */
153 PHP_FUNCTION(http_request_method_register
);
154 PHP_FUNCTION(http_request_method_unregister
);
155 PHP_FUNCTION(http_request_method_exists
);
156 PHP_FUNCTION(http_request_method_name
);
157 #ifndef ZEND_ENGINE_2
158 PHP_FUNCTION(http_build_query
);
159 #endif /* ZEND_ENGINE_2 */
160 PHP_FUNCTION(ob_etaghandler
);
161 #ifdef HTTP_HAVE_ZLIB
162 PHP_FUNCTION(http_gzencode
);
163 PHP_FUNCTION(http_gzdecode
);
164 PHP_FUNCTION(http_deflate
);
165 PHP_FUNCTION(http_inflate
);
166 PHP_FUNCTION(http_compress
);
167 PHP_FUNCTION(http_uncompress
);
169 PHP_FUNCTION(http_support
);
171 PHP_MINIT_FUNCTION(http
);
172 PHP_MSHUTDOWN_FUNCTION(http
);
173 PHP_RINIT_FUNCTION(http
);
174 PHP_RSHUTDOWN_FUNCTION(http
);
175 PHP_MINFO_FUNCTION(http
);
177 #endif /* PHP_HTTP_H */
184 * vim600: noet sw=4 ts=4 fdm=marker
185 * vim<600: noet sw=4 ts=4