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-2011, Michael Wallner <mike@php.net> |
10 +--------------------------------------------------------------------+
13 #ifndef PHP_EXT_HTTP_H
14 #define PHP_EXT_HTTP_H
16 #define PHP_HTTP_EXT_VERSION "2.0.0dev"
22 # include "php_config.h"
27 #if defined(PHP_WIN32)
28 # if defined(PHP_HTTP_EXPORTS)
29 # define PHP_HTTP_API __declspec(dllexport)
30 # elif defined(COMPILE_DL_HTTP)
31 # define PHP_HTTP_API __declspec(dllimport)
39 /* make functions that return SUCCESS|FAILURE more obvious */
42 #include "php_http_buffer.h"
43 #include "php_http_strlist.h"
45 #if (defined(HAVE_ICONV) || defined(PHP_HTTP_HAVE_EXT_ICONV)) && (PHP_HTTP_SHARED_DEPS || !defined(COMPILE_DL_ICONV))
46 # define PHP_HTTP_HAVE_ICONV
49 #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)
50 # define PHP_HTTP_HAVE_HASH
54 # define CURL_STATICLIB
55 # define PHP_HTTP_HAVE_NETDB
56 # include <winsock2.h>
57 #elif defined(HAVE_NETDB_H)
58 # define PHP_HTTP_HAVE_NETDB
66 #define PHP_HTTP_IS_CTYPE(type, c) is##type((int) (unsigned char) (c))
67 #define PHP_HTTP_TO_CTYPE(type, c) to##type((int) (unsigned char) (c))
69 extern zend_module_entry http_module_entry
;
70 #define phpext_http_ptr &http_module_entry
72 extern int http_module_number
;
78 extern void _dpf(int type
, const char *data
, size_t length
);
83 #include "php_http_misc.h"
85 #include "php_http_cookie.h"
86 #include "php_http_encoding.h"
87 #include "php_http_env.h"
88 #include "php_http_env_response.h"
89 #include "php_http_etag.h"
90 #include "php_http_exception.h"
91 #include "php_http_filter.h"
92 #include "php_http_headers.h"
93 #include "php_http_info.h"
94 #include "php_http_header_parser.h"
95 #include "php_http_message_body.h"
96 #include "php_http_message.h"
97 #include "php_http_message_parser.h"
98 #include "php_http_negotiate.h"
99 #include "php_http_object.h"
100 #include "php_http_params.h"
101 #include "php_http_resource_factory.h"
102 #include "php_http_persistent_handle.h"
103 #include "php_http_property_proxy.h"
104 #include "php_http_querystring.h"
105 #include "php_http_request_datashare.h"
106 #include "php_http_request_factory.h"
107 #include "php_http_request.h"
108 #include "php_http_curl.h"
109 #include "php_http_neon.h"
110 #include "php_http_request_method.h"
111 #include "php_http_request_pool.h"
112 #include "php_http_url.h"
113 #include "php_http_version.h"
115 ZEND_BEGIN_MODULE_GLOBALS(php_http
)
116 struct php_http_env_globals env
;
117 struct php_http_persistent_handle_globals persistent_handle
;
118 struct php_http_request_datashare_globals request_datashare
;
119 #if PHP_HTTP_HAVE_CURL && PHP_HTTP_HAVE_EVENT
120 struct php_http_curl_globals curl
;
122 ZEND_END_MODULE_GLOBALS(php_http
)
124 ZEND_EXTERN_MODULE_GLOBALS(php_http
);
127 # include "TSRM/TSRM.h"
128 # define PHP_HTTP_G ((zend_php_http_globals *) (*((void ***) tsrm_ls))[TSRM_UNSHUFFLE_RSRC_ID(php_http_globals_id)])
129 # undef TSRMLS_FETCH_FROM_CTX
130 # define TSRMLS_FETCH_FROM_CTX(ctx) void ***tsrm_ls = ((ctx)?(ctx):ts_resource_ex(0, NULL))
132 # define PHP_HTTP_G (&php_http_globals)
136 #endif /* PHP_EXT_HTTP_H */
143 * vim600: noet sw=4 ts=4 fdm=marker
144 * vim<600: noet sw=4 ts=4