From: Michael Wallner Date: Tue, 19 Jul 2005 16:19:27 +0000 (+0000) Subject: - reorder includes, always include php.h first X-Git-Tag: RELEASE_0_10_0~39 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=902d195a198f4976c8ff081a95cdd3e315c14f5f;p=m6w6%2Fext-http - reorder includes, always include php.h first --- diff --git a/http.c b/http.c index 3e7baeb..3b05887 100644 --- a/http.c +++ b/http.c @@ -19,21 +19,11 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif - -#ifdef HTTP_HAVE_CURL -# ifdef PHP_WIN32 -# include -# endif -# include -#endif - -#include - #include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" #include "SAPI.h" +#include "php_ini.h" +#include "ext/standard/info.h" #include "php_http.h" #include "php_http_std_defs.h" @@ -54,6 +44,15 @@ #include "phpstr/phpstr.h" +#ifdef HTTP_HAVE_CURL +# ifdef PHP_WIN32 +# include +# endif +# include +#endif + +#include + ZEND_DECLARE_MODULE_GLOBALS(http); HTTP_DECLARE_ARG_PASS_INFO(); diff --git a/http_api.c b/http_api.c index d943b0d..1773ce7 100644 --- a/http_api.c +++ b/http_api.c @@ -18,13 +18,10 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif - -#include - #include "php.h" -#include "ext/standard/url.h" #include "SAPI.h" +#include "ext/standard/url.h" #include "php_http.h" #include "php_http_std_defs.h" @@ -37,6 +34,8 @@ # include "php_http_exception_object.h" #endif +#include + ZEND_EXTERN_MODULE_GLOBALS(http); /* char *pretty_key(char *, size_t, zend_bool, zebd_bool) */ diff --git a/http_auth_api.c b/http_auth_api.c index 645d335..5e5bafc 100644 --- a/http_auth_api.c +++ b/http_auth_api.c @@ -18,11 +18,10 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif - #include "php.h" -#include "ext/standard/base64.h" #include "SAPI.h" +#include "ext/standard/base64.h" #include "php_http.h" #include "php_http_api.h" diff --git a/http_cache_api.c b/http_cache_api.c index a70feb0..4e1473a 100644 --- a/http_cache_api.c +++ b/http_cache_api.c @@ -18,14 +18,13 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif - #include "php.h" + +#include "SAPI.h" #include "php_streams.h" #include "php_output.h" #include "ext/standard/md5.h" -#include "SAPI.h" - #include "php_http.h" #include "php_http_std_defs.h" #include "php_http_api.h" diff --git a/http_date_api.c b/http_date_api.c index fc67a89..c59b2cf 100644 --- a/http_date_api.c +++ b/http_date_api.c @@ -18,13 +18,13 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif - -#include - #include "php.h" + #include "php_http.h" #include "php_http_std_defs.h" +#include + static int check_day(char *day, size_t len); static int check_month(char *month); static int check_tzone(char *tzone); diff --git a/http_exception_object.c b/http_exception_object.c index 7ea4af5..af84046 100644 --- a/http_exception_object.c +++ b/http_exception_object.c @@ -19,24 +19,23 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif - #include "php.h" -#include "php_http.h" -#include "php_http_std_defs.h" - #ifdef ZEND_ENGINE_2 -#include "php_http_exception_object.h" #include "zend_exceptions.h" +#include "php_http.h" +#include "php_http_std_defs.h" +#include "php_http_exception_object.h" + zend_class_entry *http_exception_object_ce; zend_function_entry http_exception_object_fe[] = {{NULL, NULL, NULL}}; void _http_exception_object_init(INIT_FUNC_ARGS) { HTTP_REGISTER_CLASS(HttpException, http_exception_object, zend_exception_get_default(), 0); - + HTTP_LONG_CONSTANT("HTTP_E_UNKNOWN", HTTP_E_UNKOWN); HTTP_LONG_CONSTANT("HTTP_E_PARSE", HTTP_E_PARSE); HTTP_LONG_CONSTANT("HTTP_E_HEADER", HTTP_E_HEADER); diff --git a/http_functions.c b/http_functions.c index 4e67be7..7612013 100644 --- a/http_functions.c +++ b/http_functions.c @@ -18,17 +18,14 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif - #include "php.h" + +#include "SAPI.h" #include "php_ini.h" #include "ext/standard/info.h" #include "ext/session/php_session.h" #include "ext/standard/php_string.h" -#include "SAPI.h" - -#include "phpstr/phpstr.h" - #include "php_http.h" #include "php_http_std_defs.h" #include "php_http_api.h" @@ -42,6 +39,8 @@ #include "php_http_send_api.h" #include "php_http_url_api.h" +#include "phpstr/phpstr.h" + ZEND_EXTERN_MODULE_GLOBALS(http) /* {{{ proto string http_date([int timestamp]) diff --git a/http_headers_api.c b/http_headers_api.c index 8c124cb..f264b68 100644 --- a/http_headers_api.c +++ b/http_headers_api.c @@ -18,10 +18,8 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif - -#include - #include "php.h" + #include "ext/standard/php_string.h" #include "ext/standard/url.h" @@ -30,6 +28,8 @@ #include "php_http_api.h" #include "php_http_headers_api.h" +#include + /* {{{ static int http_sort_q(const void *, const void *) */ static int http_sort_q(const void *a, const void *b TSRMLS_DC) { diff --git a/http_message_api.c b/http_message_api.c index 47cd1dd..1cf8661 100644 --- a/http_message_api.c +++ b/http_message_api.c @@ -18,8 +18,8 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif - #include "php.h" + #include "php_http.h" #include "php_http_std_defs.h" #include "php_http_api.h" diff --git a/http_message_object.c b/http_message_object.c index c26a2f1..c619991 100644 --- a/http_message_object.c +++ b/http_message_object.c @@ -19,17 +19,16 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif - #include "php.h" +#ifdef ZEND_ENGINE_2 + #include "php_http.h" #include "php_http_std_defs.h" #include "php_http_message_object.h" #include "phpstr/phpstr.h" -#ifdef ZEND_ENGINE_2 - #define http_message_object_declare_default_properties() _http_message_object_declare_default_properties(TSRMLS_C) static inline void _http_message_object_declare_default_properties(TSRMLS_D); #define http_message_object_read_prop _http_message_object_read_prop diff --git a/http_methods.c b/http_methods.c index c18e5ae..08959ed 100644 --- a/http_methods.c +++ b/http_methods.c @@ -18,8 +18,10 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif - #include "php.h" + +#ifdef ZEND_ENGINE_2 + #include "php_streams.h" #include "php_http.h" @@ -40,11 +42,9 @@ #include "php_http_requestpool_object.h" #include "php_http_exception_object.h" -#ifdef ZEND_ENGINE_2 - #include "missing.h" -ZEND_EXTERN_MODULE_GLOBALS(http) +ZEND_EXTERN_MODULE_GLOBALS(http); /* {{{ HttpResponse */ diff --git a/http_request_api.c b/http_request_api.c index 24b1acc..3f77eff 100644 --- a/http_request_api.c +++ b/http_request_api.c @@ -18,6 +18,15 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif +#include "php.h" + +#include "php_http.h" +#include "php_http_std_defs.h" +#include "php_http_api.h" +#include "php_http_request_api.h" +#include "php_http_url_api.h" + +#include "phpstr/phpstr.h" #ifdef PHP_WIN32 # include @@ -25,21 +34,12 @@ #include -#include "phpstr/phpstr.h" - -#include "php.h" -#include "php_http.h" -#include "php_http_std_defs.h" -#include "php_http_api.h" -#include "php_http_request_api.h" -#include "php_http_url_api.h" +ZEND_EXTERN_MODULE_GLOBALS(http); #ifndef HTTP_CURL_USE_ZEND_MM # define HTTP_CURL_USE_ZEND_MM 0 #endif -ZEND_EXTERN_MODULE_GLOBALS(http) - #if LIBCURL_VERSION_NUM < 0x070c00 # define curl_easy_strerror(code) HTTP_G(request).error #endif @@ -507,7 +507,7 @@ PHP_HTTP_API STATUS _http_request_init(CURL *ch, http_request_method meth, char } else { HTTP_CURL_OPT(COOKIEFILE, NULL); } - + /* cookiestore, read initial cookies from that file and store cookies back into that file */ if ((zoption = http_curl_getopt(options, "cookiestore", IS_STRING)) && Z_STRLEN_P(zoption)) { HTTP_CURL_OPT(COOKIEFILE, http_request_data_copy(COPY_STRING, Z_STRVAL_P(zoption))); diff --git a/http_request_object.c b/http_request_object.c index 5987681..444516f 100644 --- a/http_request_object.c +++ b/http_request_object.c @@ -19,16 +19,10 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif - -#ifdef HTTP_HAVE_CURL -# ifdef PHP_WIN32 -# include -# endif -# include -#endif - #include "php.h" +#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL) + #include "php_http_std_defs.h" #include "php_http_request_object.h" #include "php_http_request_api.h" @@ -38,8 +32,10 @@ #include "php_http_message_api.h" #include "php_http_message_object.h" -#ifdef ZEND_ENGINE_2 -#ifdef HTTP_HAVE_CURL +#ifdef PHP_WIN32 +# include +#endif +#include #define http_request_object_declare_default_properties() _http_request_object_declare_default_properties(TSRMLS_C) static inline void _http_request_object_declare_default_properties(TSRMLS_D); @@ -330,8 +326,7 @@ STATUS _http_request_object_responsehandler(http_request_object *obj, zval *this return FAILURE; } -#endif /* HTTP_HAVE_CURL */ -#endif /* ZEND_ENGINE_2 */ +#endif /* ZEND_ENGINE_2 && HTTP_HAVE_CURL */ /* * Local variables: diff --git a/http_request_pool_api.c b/http_request_pool_api.c index a9cd4ed..7dc809b 100644 --- a/http_request_pool_api.c +++ b/http_request_pool_api.c @@ -18,8 +18,10 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif - #include "php.h" + +#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL) + #include "php_http.h" #include "php_http_std_defs.h" #include "php_http_api.h" @@ -28,8 +30,6 @@ #include "php_http_request_object.h" #include "php_http_requestpool_object.h" -#ifdef ZEND_ENGINE_2 - #ifndef HTTP_DEBUG_REQPOOLS # define HTTP_DEBUG_REQPOOLS 0 #endif @@ -240,7 +240,7 @@ static int http_request_pool_compare_handles(void *h1, void *h2) } /* }}} */ -#endif /* ZEND_ENGINE_2 */ +#endif /* ZEND_ENGINE_2 && HTTP_HAVE_CURL */ /* diff --git a/http_requestpool_object.c b/http_requestpool_object.c index f7161c7..2f1b417 100644 --- a/http_requestpool_object.c +++ b/http_requestpool_object.c @@ -19,22 +19,18 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif - -#ifdef HTTP_HAVE_CURL -# ifdef PHP_WIN32 -# include -# endif -# include -#endif - #include "php.h" +#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL) + #include "php_http_std_defs.h" #include "php_http_requestpool_object.h" #include "php_http_request_pool_api.h" -#ifdef ZEND_ENGINE_2 -#ifdef HTTP_HAVE_CURL +#ifdef PHP_WIN32 +# include +#endif +#include HTTP_DECLARE_ARG_PASS_INFO(); @@ -102,8 +98,7 @@ void _http_requestpool_object_free(zend_object *object TSRMLS_DC) efree(o); } -#endif /* HTTP_HAVE_CURL */ -#endif /* ZEND_ENGINE_2 */ +#endif /* ZEND_ENGINE_2 && HTTP_HAVE_CURL */ /* * Local variables: diff --git a/http_response_object.c b/http_response_object.c index 42416ec..4f42afe 100644 --- a/http_response_object.c +++ b/http_response_object.c @@ -19,14 +19,13 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif - #include "php.h" +#ifdef ZEND_ENGINE_2 + #include "php_http_std_defs.h" #include "php_http_response_object.h" -#ifdef ZEND_ENGINE_2 - #include "missing.h" #define http_response_object_declare_default_properties() _http_response_object_declare_default_properties(TSRMLS_C) diff --git a/http_send_api.c b/http_send_api.c index 4caf6ee..764d2ac 100644 --- a/http_send_api.c +++ b/http_send_api.c @@ -18,11 +18,11 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif - #include "php.h" + +#include "SAPI.h" #include "php_streams.h" #include "ext/standard/php_lcg.h" -#include "SAPI.h" #include "php_http.h" #include "php_http_std_defs.h" diff --git a/http_url_api.c b/http_url_api.c index 288abe4..b32fd9d 100644 --- a/http_url_api.c +++ b/http_url_api.c @@ -18,21 +18,20 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif - #include "php.h" + +#include "SAPI.h" #include "zend_ini.h" #include "php_output.h" #include "ext/standard/url.h" -#include "SAPI.h" - -#include "phpstr/phpstr.h" - #include "php_http.h" #include "php_http_api.h" #include "php_http_url_api.h" #include "php_http_std_defs.h" +#include "phpstr/phpstr.h" + #ifdef PHP_WIN32 # include #elif defined(HAVE_NETDB_H) diff --git a/http_util_object.c b/http_util_object.c index 123c83d..54baa0b 100644 --- a/http_util_object.c +++ b/http_util_object.c @@ -19,14 +19,14 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif - #include "php.h" + +#ifdef ZEND_ENGINE_2 + #include "php_http.h" #include "php_http_std_defs.h" #include "php_http_util_object.h" -#ifdef ZEND_ENGINE_2 - HTTP_DECLARE_ARG_PASS_INFO(); zend_class_entry *http_util_object_ce;