- use PHP macros, so that it is obvious when to call what
authorMichael Wallner <mike@php.net>
Tue, 11 Oct 2005 17:11:37 +0000 (17:11 +0000)
committerMichael Wallner <mike@php.net>
Tue, 11 Oct 2005 17:11:37 +0000 (17:11 +0000)
27 files changed:
http.c
http_api.c
http_cache_api.c
http_exception_object.c
http_functions.c
http_headers_api.c
http_message_object.c
http_request_api.c
http_request_method_api.c
http_request_object.c
http_requestpool_object.c
http_response_object.c
http_util_object.c
php_http.h
php_http_api.h
php_http_cache_api.h
php_http_encoding_api.h
php_http_exception_object.h
php_http_headers_api.h
php_http_message_object.h
php_http_request_api.h
php_http_request_method_api.h
php_http_request_object.h
php_http_requestpool_object.h
php_http_response_object.h
php_http_std_defs.h
php_http_util_object.h

diff --git a/http.c b/http.c
index 8930b67939e65efbdc47ae7331d92131a24c8425..0f5f936aeb08781aae74de19d2965d2a9cd939ae 100644 (file)
--- a/http.c
+++ b/http.c
@@ -277,29 +277,29 @@ PHP_MINIT_FUNCTION(http)
 
        REGISTER_INI_ENTRIES();
        
 
        REGISTER_INI_ENTRIES();
        
-       if (    (SUCCESS != http_support_global_init())                 ||
-                       (SUCCESS != http_headers_global_init())                 ||
-                       (SUCCESS != http_cache_global_init())                   ||
-                       (SUCCESS != http_request_method_global_init())) {
-               return FAILURE;
-       }
+       if (    (SUCCESS != PHP_MINIT_CALL(http_support))       ||
+                       (SUCCESS != PHP_MINIT_CALL(http_headers))       ||
+                       (SUCCESS != PHP_MINIT_CALL(http_cache))         ||
 #ifdef HTTP_HAVE_CURL
 #ifdef HTTP_HAVE_CURL
-       if (SUCCESS != http_request_global_init()) {
+                       (SUCCESS != PHP_MINIT_CALL(http_request))       ||
+#endif /* HTTP_HAVE_CURL */
+                       (SUCCESS != PHP_MINIT_CALL(http_request_method))) {
                return FAILURE;
        }
                return FAILURE;
        }
-#endif /* HTTP_HAVE_CURL */
 
 #ifdef ZEND_ENGINE_2
 
 #ifdef ZEND_ENGINE_2
-       http_util_object_init();
-       http_message_object_init();
+       if (    (SUCCESS != PHP_MINIT_CALL(http_util_object))           ||
+                       (SUCCESS != PHP_MINIT_CALL(http_message_object))        ||
 #      ifndef WONKY
 #      ifndef WONKY
-       http_response_object_init();
-#      endif
+                       (SUCCESS != PHP_MINIT_CALL(http_response_object))       ||
+#      endif /* WONKY */
 #      ifdef HTTP_HAVE_CURL
 #      ifdef HTTP_HAVE_CURL
-       http_request_object_init();
-       http_requestpool_object_init();
+                       (SUCCESS != PHP_MINIT_CALL(http_request_object))        ||
+                       (SUCCESS != PHP_MINIT_CALL(http_requestpool_object))    ||
 #      endif /* HTTP_HAVE_CURL */
 #      endif /* HTTP_HAVE_CURL */
-       http_exception_object_init();
+                       (SUCCESS != PHP_MINIT_CALL(http_exception_object))) {
+               return FAILURE;
+       }
 #endif /* ZEND_ENGINE_2 */
 
        return SUCCESS;
 #endif /* ZEND_ENGINE_2 */
 
        return SUCCESS;
@@ -311,7 +311,7 @@ PHP_MSHUTDOWN_FUNCTION(http)
 {
        UNREGISTER_INI_ENTRIES();
 #ifdef HTTP_HAVE_CURL
 {
        UNREGISTER_INI_ENTRIES();
 #ifdef HTTP_HAVE_CURL
-       http_request_global_cleanup();
+       return PHP_MSHUTDOWN_CALL(http_request);
 #endif
        return SUCCESS;
 }
 #endif
        return SUCCESS;
 }
@@ -334,15 +334,14 @@ PHP_RINIT_FUNCTION(http)
 /* {{{ PHP_RSHUTDOWN_FUNCTION */
 PHP_RSHUTDOWN_FUNCTION(http)
 {
 /* {{{ PHP_RSHUTDOWN_FUNCTION */
 PHP_RSHUTDOWN_FUNCTION(http)
 {
-#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL)
-       int i, c = zend_hash_num_elements(&HTTP_G(request).methods.custom);
+       STATUS status = SUCCESS;
        
        
-       for (i = 0; i < c; ++i) {
-               http_request_method_unregister(HTTP_MAX_REQUEST_METHOD + i);
-       }
+#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL)
+       status = PHP_RSHUTDOWN_CALL(http_request_method);
 #endif
 #endif
+       
        http_globals_free(HTTP_GLOBALS);
        http_globals_free(HTTP_GLOBALS);
-       return SUCCESS;
+       return status;
 }
 /* }}} */
 
 }
 /* }}} */
 
index 683da9db6959f518b2e5fb9aea440e7ccded71dd..d689c8622baa1818e4cee1cb1cc63d84dab359ed 100644 (file)
@@ -49,7 +49,7 @@ ZEND_EXTERN_MODULE_GLOBALS(http);
 
 static zend_bool http_support_ssl;
 
 
 static zend_bool http_support_ssl;
 
-STATUS _http_support_global_init(INIT_FUNC_ARGS)
+PHP_MINIT_FUNCTION(http_support)
 {
        http_support_ssl = http_request_supports_ssl();
        
 {
        http_support_ssl = http_request_supports_ssl();
        
index 6fa1c523cac05804b5b2d5e544f5cf66dbccbfd0..dcc833ed9f4ed93e00a66cb50e6fde6c5f6822a1 100644 (file)
@@ -39,7 +39,7 @@
 
 ZEND_EXTERN_MODULE_GLOBALS(http);
 
 
 ZEND_EXTERN_MODULE_GLOBALS(http);
 
-STATUS _http_cache_global_init(INIT_FUNC_ARGS)
+PHP_MINIT_FUNCTION(http_cache)
 {
        HTTP_LONG_CONSTANT("HTTP_ETAG_MD5", HTTP_ETAG_MD5);
        HTTP_LONG_CONSTANT("HTTP_ETAG_SHA1", HTTP_ETAG_SHA1);
 {
        HTTP_LONG_CONSTANT("HTTP_ETAG_MD5", HTTP_ETAG_MD5);
        HTTP_LONG_CONSTANT("HTTP_ETAG_SHA1", HTTP_ETAG_SHA1);
index a35eb0e8906b4a1600cfbf476831ff02e0d69a9e..610413a660f0a858fcd9c6d577cb2bf8d6de0b81 100644 (file)
@@ -45,7 +45,7 @@ zend_class_entry *HTTP_EX_CE(socket);
 zend_class_entry *HTTP_EX_CE(response);
 zend_class_entry *HTTP_EX_CE(url);
 
 zend_class_entry *HTTP_EX_CE(response);
 zend_class_entry *HTTP_EX_CE(url);
 
-void _http_exception_object_init(INIT_FUNC_ARGS)
+PHP_MINIT_FUNCTION(http_exception_object)
 {
        HTTP_REGISTER_EXCEPTION(HttpException, http_exception_object_ce, zend_exception_get_default());
        HTTP_REGISTER_EXCEPTION(HttpRuntimeException, HTTP_EX_CE(runtime), HTTP_EX_DEF_CE);
 {
        HTTP_REGISTER_EXCEPTION(HttpException, http_exception_object_ce, zend_exception_get_default());
        HTTP_REGISTER_EXCEPTION(HttpRuntimeException, HTTP_EX_CE(runtime), HTTP_EX_DEF_CE);
@@ -73,6 +73,8 @@ void _http_exception_object_init(INIT_FUNC_ARGS)
        HTTP_LONG_CONSTANT("HTTP_E_SOCKET", HTTP_E_SOCKET);
        HTTP_LONG_CONSTANT("HTTP_E_RESPONSE", HTTP_E_RESPONSE);
        HTTP_LONG_CONSTANT("HTTP_E_URL", HTTP_E_URL);
        HTTP_LONG_CONSTANT("HTTP_E_SOCKET", HTTP_E_SOCKET);
        HTTP_LONG_CONSTANT("HTTP_E_RESPONSE", HTTP_E_RESPONSE);
        HTTP_LONG_CONSTANT("HTTP_E_URL", HTTP_E_URL);
+       
+       return SUCCESS;
 }
 
 zend_class_entry *_http_exception_get_default()
 }
 
 zend_class_entry *_http_exception_get_default()
index 1f635c59d6f85f100d1994008868cff0ecd12e6f..dd24050b00ae818878e2f1c7c36ca98424a1950f 100644 (file)
@@ -956,7 +956,7 @@ PHP_FUNCTION(http_match_request_header)
  *  - compress:         bool, whether to allow gzip/deflate content encoding
  *                      (defaults to true)
  *  - port:             int, use another port as specified in the url
  *  - compress:         bool, whether to allow gzip/deflate content encoding
  *                      (defaults to true)
  *  - port:             int, use another port as specified in the url
- *  - referer:          string, the referer to sends
+ *  - referer:          string, the referer to send
  *  - useragent:        string, the user agent to send
  *                      (defaults to PECL::HTTP/version (PHP/version)))
  *  - headers:          array, list of custom headers as associative array
  *  - useragent:        string, the user agent to send
  *                      (defaults to PECL::HTTP/version (PHP/version)))
  *  - headers:          array, list of custom headers as associative array
index 2af2da0d71258cd0387ca7d78601fe642a419a96..e93418008e3fc41108f36c0f9a86de781fb25d3c 100644 (file)
@@ -37,8 +37,8 @@ ZEND_EXTERN_MODULE_GLOBALS(http);
 #      define HTTP_DBG_NEG 0
 #endif
 
 #      define HTTP_DBG_NEG 0
 #endif
 
-/* {{{ STATUS http_headers_global_init() */
-STATUS _http_headers_global_init(INIT_FUNC_ARGS)
+/* {{{ */
+PHP_MINIT_FUNCTION(http_headers)
 {
        HTTP_LONG_CONSTANT("HTTP_REDIRECT", HTTP_REDIRECT);
        HTTP_LONG_CONSTANT("HTTP_REDIRECT_PERM", HTTP_REDIRECT_PERM);
 {
        HTTP_LONG_CONSTANT("HTTP_REDIRECT", HTTP_REDIRECT);
        HTTP_LONG_CONSTANT("HTTP_REDIRECT_PERM", HTTP_REDIRECT_PERM);
index d588192e2fc0e8e523eba35c1297f32f6a2090ff..561b3508aa54003e5ad8441e8d87c2a082cb6212 100644 (file)
@@ -133,7 +133,7 @@ zend_function_entry http_message_object_fe[] = {
 };
 static zend_object_handlers http_message_object_handlers;
 
 };
 static zend_object_handlers http_message_object_handlers;
 
-void _http_message_object_init(INIT_FUNC_ARGS)
+PHP_MINIT_FUNCTION(http_message_object)
 {
        HTTP_REGISTER_CLASS_EX(HttpMessage, http_message_object, NULL, 0);
 
 {
        HTTP_REGISTER_CLASS_EX(HttpMessage, http_message_object, NULL, 0);
 
@@ -146,6 +146,8 @@ void _http_message_object_init(INIT_FUNC_ARGS)
        http_message_object_handlers.write_property = http_message_object_write_prop;
        http_message_object_handlers.get_properties = http_message_object_get_props;
        http_message_object_handlers.get_property_ptr_ptr = NULL;
        http_message_object_handlers.write_property = http_message_object_write_prop;
        http_message_object_handlers.get_properties = http_message_object_get_props;
        http_message_object_handlers.get_property_ptr_ptr = NULL;
+       
+       return SUCCESS;
 }
 
 zend_object_value _http_message_object_new(zend_class_entry *ce TSRMLS_DC)
 }
 
 zend_object_value _http_message_object_new(zend_class_entry *ce TSRMLS_DC)
index c7bdcb316705b1c24e7273ae09682f6c28a5358f..615958c01f88d327e73e72a9e98e536c5eb3d65b 100644 (file)
@@ -56,7 +56,7 @@ static inline zend_bool http_ssl_init(void);
 static inline void http_ssl_cleanup(void);
 #endif
 
 static inline void http_ssl_cleanup(void);
 #endif
 
-STATUS _http_request_global_init(INIT_FUNC_ARGS)
+PHP_MINIT_FUNCTION(http_request)
 {
        if (CURLE_OK != curl_global_init(CURL_GLOBAL_ALL)) {
                return FAILURE;
 {
        if (CURLE_OK != curl_global_init(CURL_GLOBAL_ALL)) {
                return FAILURE;
@@ -76,12 +76,13 @@ STATUS _http_request_global_init(INIT_FUNC_ARGS)
        return SUCCESS;
 }
 
        return SUCCESS;
 }
 
-void _http_request_global_cleanup(TSRMLS_D)
+PHP_MSHUTDOWN_FUNCTION(http_request)
 {
        curl_global_cleanup();
 #ifdef HTTP_NEED_SSL
        http_ssl_cleanup();
 #endif
 {
        curl_global_cleanup();
 #ifdef HTTP_NEED_SSL
        http_ssl_cleanup();
 #endif
+       return SUCCESS;
 }
 
 #ifndef HAVE_CURL_EASY_STRERROR
 }
 
 #ifndef HAVE_CURL_EASY_STRERROR
index 595a1de5bfb7e39b01e93eb8d8e1447ee1826fb0..37895d7d916b3da0f4917b32c93c80180d2b625b 100644 (file)
@@ -71,7 +71,7 @@ static const char *const http_request_methods[] = {
 };
 /* }}} */
 
 };
 /* }}} */
 
-STATUS _http_request_method_global_init(INIT_FUNC_ARGS)
+PHP_MINIT_FUNCTION(http_request_method)
 {
        /* HTTP/1.1 */
        HTTP_LONG_CONSTANT("HTTP_METH_GET", HTTP_GET);
 {
        /* HTTP/1.1 */
        HTTP_LONG_CONSTANT("HTTP_METH_GET", HTTP_GET);
@@ -108,6 +108,17 @@ STATUS _http_request_method_global_init(INIT_FUNC_ARGS)
        return SUCCESS;
 }
 
        return SUCCESS;
 }
 
+PHP_RSHUTDOWN_FUNCTION(http_request_method)
+{
+       int i, c = zend_hash_num_elements(&HTTP_G(request).methods.custom);
+       
+       for (i = 0; i < c; ++i) {
+               http_request_method_unregister(HTTP_MAX_REQUEST_METHOD + i);
+       }
+       
+       return SUCCESS;
+}
+
 /* {{{ char *http_request_method_name(http_request_method) */
 PHP_HTTP_API const char *_http_request_method_name(http_request_method m TSRMLS_DC)
 {
 /* {{{ char *http_request_method_name(http_request_method) */
 PHP_HTTP_API const char *_http_request_method_name(http_request_method m TSRMLS_DC)
 {
index 479e0b699978fcffd017a281be207d28ad1995af..3244161e2bd6e6556c24a287f409a1f4f8d8aaae 100644 (file)
@@ -298,9 +298,10 @@ zend_function_entry http_request_object_fe[] = {
 };
 static zend_object_handlers http_request_object_handlers;
 
 };
 static zend_object_handlers http_request_object_handlers;
 
-void _http_request_object_init(INIT_FUNC_ARGS)
+PHP_MINIT_FUNCTION(http_request_object)
 {
        HTTP_REGISTER_CLASS_EX(HttpRequest, http_request_object, NULL, 0);
 {
        HTTP_REGISTER_CLASS_EX(HttpRequest, http_request_object, NULL, 0);
+       return SUCCESS;
 }
 
 zend_object_value _http_request_object_new(zend_class_entry *ce TSRMLS_DC)
 }
 
 zend_object_value _http_request_object_new(zend_class_entry *ce TSRMLS_DC)
index dfb9c604f72f6d387f2209e491535f8a3abe1f74..58aec24d561a0cc4e52dcbbfc773d6a05799e313 100644 (file)
@@ -94,10 +94,11 @@ zend_function_entry http_requestpool_object_fe[] = {
 };
 static zend_object_handlers http_requestpool_object_handlers;
 
 };
 static zend_object_handlers http_requestpool_object_handlers;
 
-void _http_requestpool_object_init(INIT_FUNC_ARGS)
+PHP_MINIT_FUNCTION(http_requestpool_object)
 {
        HTTP_REGISTER_CLASS_EX(HttpRequestPool, http_requestpool_object, NULL, 0);
        zend_class_implements(http_requestpool_object_ce TSRMLS_CC, 1, zend_ce_iterator);
 {
        HTTP_REGISTER_CLASS_EX(HttpRequestPool, http_requestpool_object, NULL, 0);
        zend_class_implements(http_requestpool_object_ce TSRMLS_CC, 1, zend_ce_iterator);
+       return SUCCESS;
 }
 
 zend_object_value _http_requestpool_object_new(zend_class_entry *ce TSRMLS_DC)
 }
 
 zend_object_value _http_requestpool_object_new(zend_class_entry *ce TSRMLS_DC)
index 72289b65f291fc71025eb04262abb32fdd03695c..9193590266ebbf31cd116c6d8189bffd1e1f05e6 100644 (file)
@@ -214,10 +214,11 @@ zend_function_entry http_response_object_fe[] = {
        EMPTY_FUNCTION_ENTRY
 };
 
        EMPTY_FUNCTION_ENTRY
 };
 
-void _http_response_object_init(INIT_FUNC_ARGS)
+PHP_MINIT_FUNCTION(http_response_object)
 {
        HTTP_REGISTER_CLASS(HttpResponse, http_response_object, NULL, 0);
        http_response_object_declare_default_properties();
 {
        HTTP_REGISTER_CLASS(HttpResponse, http_response_object, NULL, 0);
        http_response_object_declare_default_properties();
+       return SUCCESS;
 }
 
 static inline void _http_response_object_declare_default_properties(TSRMLS_D)
 }
 
 static inline void _http_response_object_declare_default_properties(TSRMLS_D)
index 5829c194d539e0c56061bc8ddae35163f2daa67a..a97984d7bea76f5f3a6d8a2319852a92a89535fd 100644 (file)
@@ -135,9 +135,10 @@ zend_function_entry http_util_object_fe[] = {
        EMPTY_FUNCTION_ENTRY
 };
 
        EMPTY_FUNCTION_ENTRY
 };
 
-void _http_util_object_init(INIT_FUNC_ARGS)
+PHP_MINIT_FUNCTION(http_util_object)
 {
        HTTP_REGISTER_CLASS(HttpUtil, http_util_object, NULL, 0);
 {
        HTTP_REGISTER_CLASS(HttpUtil, http_util_object, NULL, 0);
+       return SUCCESS;
 }
 
 #endif /* ZEND_ENGINE_2 */
 }
 
 #endif /* ZEND_ENGINE_2 */
index e59d0c241e72d42b3a3d63dbe4463ca49f527688..a11d4848323ac5a646341b526f458b1871133955 100644 (file)
@@ -18,7 +18,7 @@
 #ifndef PHP_EXT_HTTP_H
 #define PHP_EXT_HTTP_H
 
 #ifndef PHP_EXT_HTTP_H
 #define PHP_EXT_HTTP_H
 
-#define HTTP_PEXT_VERSION "0.15.0"
+#define HTTP_PEXT_VERSION "0.15.1dev"
 
 /* make compile on Win32 */
 #ifdef HTTP_HAVE_CURL
 
 /* make compile on Win32 */
 #ifdef HTTP_HAVE_CURL
index 7196048c4b58f77e8bc2b95946e8af30710dd2b1..dd3a4daf43a99420bbc80383a65dc940362912a6 100644 (file)
@@ -28,8 +28,7 @@
 #define HTTP_SUPPORT_MHASHETAGS                0x10L
 #define HTTP_SUPPORT_SSLREQUESTS       0x20L
 
 #define HTTP_SUPPORT_MHASHETAGS                0x10L
 #define HTTP_SUPPORT_SSLREQUESTS       0x20L
 
-#define http_support_global_init() _http_support_global_init(INIT_FUNC_ARGS_PASSTHRU)
-extern STATUS _http_support_global_init(INIT_FUNC_ARGS);
+extern PHP_MINIT_FUNCTION(http_support);
 
 #define http_support(f) _http_support(f)
 PHP_HTTP_API long _http_support(long feature);
 
 #define http_support(f) _http_support(f)
 PHP_HTTP_API long _http_support(long feature);
index f81f853aecbff935c2378905f0151850c1904871..5d7731e80542eb53cfbdb14a5683d1a4170c0e4b 100644 (file)
 
 ZEND_EXTERN_MODULE_GLOBALS(http);
 
 
 ZEND_EXTERN_MODULE_GLOBALS(http);
 
-#define http_cache_global_init() _http_cache_global_init(INIT_FUNC_ARGS_PASSTHRU)
-extern STATUS _http_cache_global_init(INIT_FUNC_ARGS);
-
 typedef enum {
        HTTP_ETAG_CRC32 = -3,
        HTTP_ETAG_MD5 = -2,
        HTTP_ETAG_SHA1 = -1,
 } http_etag_mode;
 
 typedef enum {
        HTTP_ETAG_CRC32 = -3,
        HTTP_ETAG_MD5 = -2,
        HTTP_ETAG_SHA1 = -1,
 } http_etag_mode;
 
+extern PHP_MINIT_FUNCTION(http_cache);
+
 #ifdef HTTP_HAVE_MHASH
 static void *http_etag_alloc_mhash_digest(size_t size)
 {
 #ifdef HTTP_HAVE_MHASH
 static void *http_etag_alloc_mhash_digest(size_t size)
 {
index 92a2f9a7d58977eaf3c1ad203b22a099b5a2b8e1..7e235c7bc739cfabee25ebab86745d0261f69136 100644 (file)
@@ -38,7 +38,8 @@ PHP_HTTP_API STATUS _http_encoding_compress(int level, const char *data, size_t
 #define http_encoding_uncompress(d, dl, r, rl) _http_encoding_uncompress((d), (dl), (r), (rl) TSRMLS_CC)
 PHP_HTTP_API STATUS _http_encoding_uncompress(const char *data, size_t data_len, char **decoded, size_t *decoded_len TSRMLS_DC);
 
 #define http_encoding_uncompress(d, dl, r, rl) _http_encoding_uncompress((d), (dl), (r), (rl) TSRMLS_CC)
 PHP_HTTP_API STATUS _http_encoding_uncompress(const char *data, size_t data_len, char **decoded, size_t *decoded_len TSRMLS_DC);
 
-#endif
+#endif /* HTTP_HAVE_ZLIB */
+
 #endif
 
 /*
 #endif
 
 /*
index f309035429a44fd78bc1717ae9cbc01098cbc553..c3804c2e1928f5f6855884edaef217a3d3462619 100644 (file)
 #define PHP_HTTP_EXCEPTION_OBJECT_H
 #ifdef ZEND_ENGINE_2
 
 #define PHP_HTTP_EXCEPTION_OBJECT_H
 #ifdef ZEND_ENGINE_2
 
+PHP_MINIT_FUNCTION(http_exception_object);
+
 extern zend_class_entry *http_exception_object_ce;
 extern zend_function_entry http_exception_object_fe[];
 
 extern zend_class_entry *http_exception_object_ce;
 extern zend_function_entry http_exception_object_fe[];
 
-#define http_exception_object_init() _http_exception_object_init(INIT_FUNC_ARGS_PASSTHRU)
-extern void _http_exception_object_init(INIT_FUNC_ARGS);
-
 #define http_exception_get_default _http_exception_get_default
 extern zend_class_entry *_http_exception_get_default();
 
 #define http_exception_get_default _http_exception_get_default
 extern zend_class_entry *_http_exception_get_default();
 
index dbf1a439e3bb0cc5cda26b5ad8939228e31dfa26..8b3b95f1771e7309118fb6f25369fd2107c8a4b8 100644 (file)
@@ -32,8 +32,7 @@ typedef enum {
        RANGE_ERR
 } http_range_status;
 
        RANGE_ERR
 } http_range_status;
 
-#define http_headers_global_init() _http_headers_global_init(INIT_FUNC_ARGS_PASSTHRU)
-extern STATUS _http_headers_global_init(INIT_FUNC_ARGS);
+extern PHP_MINIT_FUNCTION(http_headers);
 
 #define http_parse_headers(h, a) _http_parse_headers_ex((h), Z_ARRVAL_P(a), 1, http_info_default_callback, NULL TSRMLS_CC)
 #define http_parse_headers_ex(h, ht, p) _http_parse_headers_ex((h), (ht), (p), http_info_default_callback, NULL TSRMLS_CC)
 
 #define http_parse_headers(h, a) _http_parse_headers_ex((h), Z_ARRVAL_P(a), 1, http_info_default_callback, NULL TSRMLS_CC)
 #define http_parse_headers_ex(h, ht, p) _http_parse_headers_ex((h), (ht), (p), http_info_default_callback, NULL TSRMLS_CC)
index 1e95c7490f1f633ebacf46947b13f8981bb2170c..1ff1362848b7b92ee274002f0a8dcb08c7900200 100644 (file)
@@ -30,8 +30,8 @@ typedef struct {
 extern zend_class_entry *http_message_object_ce;
 extern zend_function_entry http_message_object_fe[];
 
 extern zend_class_entry *http_message_object_ce;
 extern zend_function_entry http_message_object_fe[];
 
-#define http_message_object_init() _http_message_object_init(INIT_FUNC_ARGS_PASSTHRU)
-extern void _http_message_object_init(INIT_FUNC_ARGS);
+extern PHP_MINIT_FUNCTION(http_message_object);
+
 #define http_message_object_new _http_message_object_new
 extern zend_object_value _http_message_object_new(zend_class_entry *ce TSRMLS_DC);
 #define http_message_object_new_ex(ce, msg) _http_message_object_new_ex(ce, msg TSRMLS_CC)
 #define http_message_object_new _http_message_object_new
 extern zend_object_value _http_message_object_new(zend_class_entry *ce TSRMLS_DC);
 #define http_message_object_new_ex(ce, msg) _http_message_object_new_ex(ce, msg TSRMLS_CC)
index 5b4dc16edb69046be5c456368bc94e38c7f64363..9a24b3c7ebf0e795fa1d82939be2fdf279ecd5cc 100644 (file)
@@ -34,10 +34,8 @@ extern zend_bool _http_request_supports_ssl(void);
 #endif
 #include <curl/curl.h>
 
 #endif
 #include <curl/curl.h>
 
-#define http_request_global_init() _http_request_global_init(INIT_FUNC_ARGS_PASSTHRU)
-extern STATUS _http_request_global_init(INIT_FUNC_ARGS);
-#define http_request_global_cleanup() _http_request_global_cleanup(TSRMLS_C)
-extern void _http_request_global_cleanup(TSRMLS_D);
+extern PHP_MINIT_FUNCTION(http_request);
+extern PHP_MSHUTDOWN_FUNCTION(http_request);
 
 #define HTTP_REQUEST_BODY_CSTRING              1
 #define HTTP_REQUEST_BODY_CURLPOST             2
 
 #define HTTP_REQUEST_BODY_CSTRING              1
 #define HTTP_REQUEST_BODY_CURLPOST             2
index ed0d8a7291b5dec1e246233e7f98b08ecda437f1..7275f2dd599ab5f5f0baed7805d8370a1e803024 100644 (file)
@@ -57,12 +57,12 @@ typedef enum {
        HTTP_MAX_REQUEST_METHOD = 28
 } http_request_method;
 
        HTTP_MAX_REQUEST_METHOD = 28
 } http_request_method;
 
-#define http_request_method_global_init() _http_request_method_global_init(INIT_FUNC_ARGS_PASSTHRU)
-STATUS _http_request_method_global_init(INIT_FUNC_ARGS);
-
 #define HTTP_STD_REQUEST_METHOD(m) ((m > HTTP_NO_REQUEST_METHOD) && (m < HTTP_MAX_REQUEST_METHOD))
 #define HTTP_CUSTOM_REQUEST_METHOD(m) (m - HTTP_MAX_REQUEST_METHOD)
 
 #define HTTP_STD_REQUEST_METHOD(m) ((m > HTTP_NO_REQUEST_METHOD) && (m < HTTP_MAX_REQUEST_METHOD))
 #define HTTP_CUSTOM_REQUEST_METHOD(m) (m - HTTP_MAX_REQUEST_METHOD)
 
+extern PHP_MINIT_FUNCTION(http_request_method);
+extern PHP_RSHUTDOWN_FUNCTION(http_request_method);
+
 #define http_request_method_name(m) _http_request_method_name((m) TSRMLS_CC)
 PHP_HTTP_API const char *_http_request_method_name(http_request_method m TSRMLS_DC);
 
 #define http_request_method_name(m) _http_request_method_name((m) TSRMLS_CC)
 PHP_HTTP_API const char *_http_request_method_name(http_request_method m TSRMLS_DC);
 
index 17a9fb46b1e1ed29bb3300a0cac8539e57b21971..5959dbd4cb4e3219ba59e422759bbb5ec83b3b46 100644 (file)
@@ -42,8 +42,8 @@ typedef struct {
 extern zend_class_entry *http_request_object_ce;
 extern zend_function_entry http_request_object_fe[];
 
 extern zend_class_entry *http_request_object_ce;
 extern zend_function_entry http_request_object_fe[];
 
-#define http_request_object_init() _http_request_object_init(INIT_FUNC_ARGS_PASSTHRU)
-extern void _http_request_object_init(INIT_FUNC_ARGS);
+extern PHP_MINIT_FUNCTION(http_request_object);
+
 #define http_request_object_new _http_request_object_new
 extern zend_object_value _http_request_object_new(zend_class_entry *ce TSRMLS_DC);
 #define http_request_object_free _http_request_object_free
 #define http_request_object_new _http_request_object_new
 extern zend_object_value _http_request_object_new(zend_class_entry *ce TSRMLS_DC);
 #define http_request_object_free _http_request_object_free
index 24c40e0268133b046a2e12a09acf1240f1b0ab08..49bb78c5bb7af668a823bac299dbd5e9840633c3 100644 (file)
@@ -39,8 +39,8 @@ typedef struct {
 extern zend_class_entry *http_requestpool_object_ce;
 extern zend_function_entry http_requestpool_object_fe[];
 
 extern zend_class_entry *http_requestpool_object_ce;
 extern zend_function_entry http_requestpool_object_fe[];
 
-#define http_requestpool_object_init() _http_requestpool_object_init(INIT_FUNC_ARGS_PASSTHRU)
-extern void _http_requestpool_object_init(INIT_FUNC_ARGS);
+extern PHP_MINIT_FUNCTION(http_requestpool_object);
+
 #define http_requestpool_object_new _http_requestpool_object_new
 extern zend_object_value _http_requestpool_object_new(zend_class_entry *ce TSRMLS_DC);
 #define http_requestpool_object_free _http_requestpool_object_free
 #define http_requestpool_object_new _http_requestpool_object_new
 extern zend_object_value _http_requestpool_object_new(zend_class_entry *ce TSRMLS_DC);
 #define http_requestpool_object_free _http_requestpool_object_free
index 60a5be011e96508ac1e2ee7e40cb9708db1ce7b9..757bc894a79d6c6663865236a43138980895240c 100644 (file)
@@ -26,8 +26,7 @@
 extern zend_class_entry *http_response_object_ce;
 extern zend_function_entry http_response_object_fe[];
 
 extern zend_class_entry *http_response_object_ce;
 extern zend_function_entry http_response_object_fe[];
 
-#define http_response_object_init() _http_response_object_init(INIT_FUNC_ARGS_PASSTHRU)
-extern void _http_response_object_init(INIT_FUNC_ARGS);
+extern PHP_MINIT_FUNCTION(http_response_object);
 
 PHP_METHOD(HttpResponse, setHeader);
 PHP_METHOD(HttpResponse, getHeader);
 
 PHP_METHOD(HttpResponse, setHeader);
 PHP_METHOD(HttpResponse, getHeader);
index 79b69ae9d294691a72d68ccc4612494c380bce1d..c13f3bd4fe1990bd76dd993f79ee877520e9e2cb 100644 (file)
@@ -406,6 +406,10 @@ typedef int STATUS;
 #define RETURN_ZVAL(zv, copy, dtor)            { RETVAL_ZVAL(zv, copy, dtor); return; }
 #endif
 
 #define RETURN_ZVAL(zv, copy, dtor)            { RETVAL_ZVAL(zv, copy, dtor); return; }
 #endif
 
+#define PHP_MINIT_CALL(func) PHP_MINIT(func)(INIT_FUNC_ARGS_PASSTHRU)
+#define PHP_RINIT_CALL(func) PHP_RINIT(func)(INIT_FUNC_ARGS_PASSTHRU)
+#define PHP_MSHUTDOWN_CALL(func) PHP_MSHUTDOWN(func)(SHUTDOWN_FUNC_ARGS_PASSTHRU)
+#define PHP_RSHUTDOWN_CALL(func) PHP_RSHUTDOWN(func)(SHUTDOWN_FUNC_ARGS_PASSTHRU)
 
 #endif /* PHP_HTTP_STD_DEFS_H */
 
 
 #endif /* PHP_HTTP_STD_DEFS_H */
 
index 414cc8ee67b681396674a36755d9c63c814fafee..53dcb5a5c13bffe68ed4555c67dde9ee13f6783b 100644 (file)
@@ -22,8 +22,7 @@
 extern zend_class_entry *http_util_object_ce;
 extern zend_function_entry http_util_object_fe[];
 
 extern zend_class_entry *http_util_object_ce;
 extern zend_function_entry http_util_object_fe[];
 
-#define http_util_object_init() _http_util_object_init(INIT_FUNC_ARGS_PASSTHRU)
-extern void _http_util_object_init(INIT_FUNC_ARGS);
+extern PHP_MINIT_FUNCTION(http_util_object);
 
 PHP_METHOD(HttpUtil, date);
 PHP_METHOD(HttpUtil, absoluteUri);
 
 PHP_METHOD(HttpUtil, date);
 PHP_METHOD(HttpUtil, absoluteUri);