X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=src%2Fphp_http_api.h;h=91b2eb6c895b03e333ee8d17624f2e0b333a202d;hp=8c0b9bee17cf835a03df379e9b6b0ab2a2b7bb17;hb=6c1356cbe7363bf41f770b1dce59abef93dcc021;hpb=e761c34103c0c5316cce092ea42a789b95e887d2 diff --git a/src/php_http_api.h b/src/php_http_api.h index 8c0b9be..91b2eb6 100644 --- a/src/php_http_api.h +++ b/src/php_http_api.h @@ -23,8 +23,8 @@ #include "php.h" #include "SAPI.h" -#include "ext/raphf/php_raphf.h" -#include "ext/propro/php_propro.h" +#include "ext/raphf/php_raphf_api.h" +#include "ext/propro/php_propro_api.h" #include "ext/standard/php_string.h" #include "ext/spl/spl_iterators.h" #include "ext/date/php_date.h" @@ -33,37 +33,37 @@ #include "zend_exceptions.h" -#ifdef PHP_WIN32 +#if PHP_WIN32 # define PHP_HTTP_API __declspec(dllexport) -#elif defined(__GNUC__) && __GNUC__ >= 4 +#elif __GNUC__ >= 4 # define PHP_HTTP_API extern __attribute__ ((visibility("default"))) #else # define PHP_HTTP_API extern #endif -#if (defined(HAVE_ICONV) || defined(PHP_HTTP_HAVE_EXT_ICONV)) && (PHP_HTTP_SHARED_DEPS || !defined(COMPILE_DL_ICONV)) -# define PHP_HTTP_HAVE_ICONV +#if (HAVE_ICONV || PHP_HTTP_HAVE_EXT_ICONV) && (PHP_HTTP_SHARED_DEPS || !COMPILE_DL_ICONV) +# define PHP_HTTP_HAVE_ICONV 1 #endif -#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) -# define PHP_HTTP_HAVE_HASH +#if (HAVE_HASH_EXT || PHP_HTTP_HAVE_EXT_HASH) && (PHP_HTTP_SHARED_DEPS || !COMPILE_DL_HASH) +# define PHP_HTTP_HAVE_HASH 1 #endif #include -#ifdef PHP_WIN32 +#if PHP_WIN32 # define CURL_STATICLIB # include #else -# ifdef HAVE_NETDB_H +# if HAVE_NETDB_H # include # endif -# ifdef HAVE_UNISTD_H +# if HAVE_UNISTD_H # include # endif #endif -#if defined(HAVE_WCHAR_H) && defined(HAVE_WCTYPE_H) && defined(HAVE_ISWALNUM) && (defined(HAVE_MBRTOWC) || defined(HAVE_MBTOWC)) +#if HAVE_WCHAR_H && HAVE_WCTYPE_H && HAVE_ISWALNUM && (HAVE_MBRTOWC || HAVE_MBTOWC) # define PHP_HTTP_HAVE_WCHAR 1 #endif @@ -80,6 +80,8 @@ #include "php_http.h" #include "php_http_cookie.h" #include "php_http_encoding.h" +#include "php_http_encoding_zlib.h" +#include "php_http_encoding_brotli.h" #include "php_http_info.h" #include "php_http_message.h" #include "php_http_env.h" @@ -108,15 +110,22 @@ ZEND_BEGIN_MODULE_GLOBALS(php_http) struct php_http_env_globals env; +#if PHP_HTTP_HAVE_CLIENT + struct { +# if PHP_HTTP_HAVE_LIBCURL + struct php_http_client_curl_globals curl; +# endif + } client; +#endif ZEND_END_MODULE_GLOBALS(php_http) ZEND_EXTERN_MODULE_GLOBALS(php_http); -#ifdef ZTS +#if ZTS # include "TSRM/TSRM.h" -# define PHP_HTTP_G ((zend_php_http_globals *) (*((void ***) tsrm_ls))[TSRM_UNSHUFFLE_RSRC_ID(php_http_globals_id)]) +# define PHP_HTTP_G ((zend_php_http_globals *) (*((void ***) tsrm_get_ls_cache()))[TSRM_UNSHUFFLE_RSRC_ID(php_http_globals_id)]) # undef TSRMLS_FETCH_FROM_CTX -# define TSRMLS_FETCH_FROM_CTX(ctx) void ***tsrm_ls = ((ctx)?(ctx):ts_resource_ex(0, NULL)) +# define TSRMLS_FETCH_FROM_CTX(ctx) ERROR #else # define PHP_HTTP_G (&php_http_globals) #endif