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-2010, Michael Wallner <mike@php.net> |
10 +--------------------------------------------------------------------+
13 /* $Id: php_http.h 300300 2010-06-09 07:29:35Z mike $ */
15 #ifndef PHP_EXT_HTTP_H
16 #define PHP_EXT_HTTP_H
18 #define PHP_HTTP_EXT_VERSION "2.0.0dev"
24 # include "php_config.h"
29 #if defined(PHP_WIN32)
30 # if defined(PHP_HTTP_EXPORTS)
31 # define PHP_HTTP_API __declspec(dllexport)
32 # elif defined(COMPILE_DL_HTTP)
33 # define PHP_HTTP_API __declspec(dllimport)
41 #include <main/SAPI.h>
42 #include <main/fopen_wrappers.h>
43 #include <main/php_streams.h>
44 #include <main/php_variables.h>
45 #include <Zend/zend_exceptions.h>
46 #include <Zend/zend_interfaces.h>
47 #include <ext/date/php_date.h>
48 #include <ext/spl/spl_array.h>
49 #include <ext/spl/spl_iterators.h>
50 #include <ext/standard/php_lcg.h>
51 #include <ext/standard/php_string.h>
52 #include <ext/standard/url.h>
54 /* make functions that return SUCCESS|FAILURE more obvious */
57 #include "php_http_buffer.h"
58 #include "php_http_strlist.h"
60 #if (defined(HAVE_ICONV) || defined(PHP_HTTP_HAVE_EXT_ICONV)) && (PHP_HTTP_SHARED_DEPS || !defined(COMPILE_DL_ICONV))
61 # define PHP_HTTP_HAVE_ICONV
63 # include <ext/iconv/php_iconv.h>
66 #if (defined(HAVE_HASH_EXT) || defined(PHP_HTTP_HAVE_EXT_HASH)) && (PHP_HTTP_SHARED_DEPS || !defined(COMPILE_DL_HASH)) && defined(PHP_HTTP_HAVE_PHP_HASH_H)
67 # define PHP_HTTP_HAVE_HASH
68 # include "php_hash.h"
72 # define CURL_STATICLIB
73 # define PHP_HTTP_HAVE_NETDB
74 # include <winsock2.h>
75 #elif defined(HAVE_NETDB_H)
76 # define PHP_HTTP_HAVE_NETDB
83 #ifdef PHP_HTTP_HAVE_EVENT
87 #include <curl/curl.h>
88 #define PHP_HTTP_CURL_VERSION(x, y, z) (LIBCURL_VERSION_NUM >= (((x)<<16) + ((y)<<8) + (z)))
90 #if defined(ZTS) && defined(PHP_HTTP_HAVE_SSL)
92 # define PHP_HTTP_NEED_OPENSSL_TSL
93 # include <openssl/crypto.h>
94 # else /* !PHP_WIN32 */
95 # if defined(PHP_HTTP_HAVE_OPENSSL)
96 # define PHP_HTTP_NEED_OPENSSL_TSL
97 # include <openssl/crypto.h>
98 # elif defined(PHP_HTTP_HAVE_GNUTLS)
99 # define PHP_HTTP_NEED_GNUTLS_TSL
103 "libcurl was compiled with SSL support, but configure could not determine which" \
104 "library was used; thus no SSL crypto locking callbacks will be set, which may " \
105 "cause random crashes on SSL requests"
106 # endif /* PHP_HTTP_HAVE_OPENSSL || PHP_HTTP_HAVE_GNUTLS */
107 # endif /* PHP_WIN32 */
108 #endif /* ZTS && PHP_HTTP_HAVE_SSL */
112 #define PHP_HTTP_IS_CTYPE(type, c) is##type((int) (unsigned char) (c))
113 #define PHP_HTTP_TO_CTYPE(type, c) to##type((int) (unsigned char) (c))
115 extern zend_module_entry http_module_entry
;
116 #define phpext_http_ptr &http_module_entry
118 extern int http_module_number
;
120 #include "php_http_misc.h"
122 #include "php_http_cookie.h"
123 #include "php_http_encoding.h"
124 #include "php_http_env.h"
125 #include "php_http_etag.h"
126 #include "php_http_exception.h"
127 #include "php_http_filter.h"
128 #include "php_http_headers.h"
129 #include "php_http_info.h"
130 #include "php_http_header_parser.h"
131 #include "php_http_message_body.h"
132 #include "php_http_message.h"
133 #include "php_http_message_parser.h"
134 #include "php_http_negotiate.h"
135 #include "php_http_object.h"
136 #include "php_http_params.h"
137 #include "php_http_persistent_handle.h"
138 #include "php_http_property_proxy.h"
139 #include "php_http_querystring.h"
140 #include "php_http_request_datashare.h"
141 #include "php_http_request.h"
142 #include "php_http_request_method.h"
143 #include "php_http_request_pool.h"
144 #include "php_http_url.h"
145 #include "php_http_version.h"
147 ZEND_BEGIN_MODULE_GLOBALS(php_http
)
148 struct php_http_env_globals env
;
149 struct php_http_persistent_handle_globals persistent_handle
;
150 struct php_http_request_datashare_globals request_datashare
;
151 struct php_http_request_pool_globals request_pool
;
152 ZEND_END_MODULE_GLOBALS(php_http
)
154 ZEND_EXTERN_MODULE_GLOBALS(php_http
);
157 # include "TSRM/TSRM.h"
158 # define PHP_HTTP_G ((zend_http_globals *) (*((void ***) tsrm_ls))[TSRM_UNSHUFFLE_RSRC_ID(php_http_globals_id)])
160 # define PHP_HTTP_G (&php_http_globals)
164 #endif /* PHP_EXT_HTTP_H */
171 * vim600: noet sw=4 ts=4 fdm=marker
172 * vim<600: noet sw=4 ts=4