cvs: pecl /http http.c http_api.c http_functions.c http_querystring_object.c http_request_object.c php_http_send_api.h php_http_std_defs.h

From: Date: Mon, 20 Feb 2006 15:59:38 +0000
Subject: cvs: pecl /http http.c http_api.c http_functions.c http_querystring_object.c http_request_object.c php_http_send_api.h php_http_std_defs.h
Groups: php.pecl.cvs 
Request: Send a blank email to pecl-cvs+get-5213@lists.php.net to get a copy of this message
mike Mon Feb 20 15:59:38 2006 UTC Modified files: /pecl/http http.c http_api.c http_functions.c http_querystring_object.c http_request_object.c php_http_send_api.h php_http_std_defs.h Log: - add default stream context support http://cvs.php.net/viewcvs.cgi/pecl/http/http.c?r1=1.159&r2=1.160&diff_format=u Index: pecl/http/http.c diff -u pecl/http/http.c:1.159 pecl/http/http.c:1.160 --- pecl/http/http.c:1.159 Sat Feb 11 21:19:28 2006 +++ pecl/http/http.c Mon Feb 20 15:59:37 2006 @@ -10,7 +10,7 @@ +--------------------------------------------------------------------+ */ -/* $Id: http.c,v 1.159 2006/02/11 21:19:28 mike Exp $ */ +/* $Id: http.c,v 1.160 2006/02/20 15:59:37 mike Exp $ */ #define HTTP_WANT_SAPI #define HTTP_WANT_CURL @@ -124,7 +124,7 @@ /* {{{ http_module_dep */ #if ZEND_EXTENSION_API_NO >= 220050617 -static zend_module_dep http_module_dep[] = { +static zend_module_dep http_module_deps[] = { # ifdef HAVE_SPL ZEND_MOD_REQUIRED("spl") # endif @@ -134,6 +134,9 @@ # ifdef HAVE_PHP_SESSION ZEND_MOD_REQUIRED("session") # endif +#ifdef HAVE_ICONV + ZEND_MOD_REQUIRED("iconv") +#endif {NULL, NULL, NULL, 0} }; #endif @@ -143,7 +146,7 @@ zend_module_entry http_module_entry = { #if ZEND_EXTENSION_API_NO >= 220050617 STANDARD_MODULE_HEADER_EX, NULL, - http_module_dep, + http_module_deps, #else STANDARD_MODULE_HEADER, #endif http://cvs.php.net/viewcvs.cgi/pecl/http/http_api.c?r1=1.141&r2=1.142&diff_format=u Index: pecl/http/http_api.c diff -u pecl/http/http_api.c:1.141 pecl/http/http_api.c:1.142 --- pecl/http/http_api.c:1.141 Sat Feb 11 21:19:28 2006 +++ pecl/http/http_api.c Mon Feb 20 15:59:37 2006 @@ -10,7 +10,7 @@ +--------------------------------------------------------------------+ */ -/* $Id: http_api.c,v 1.141 2006/02/11 21:19:28 mike Exp $ */ +/* $Id: http_api.c,v 1.142 2006/02/20 15:59:37 mike Exp $ */ #define HTTP_WANT_SAPI #include "php_http.h" @@ -116,7 +116,7 @@ #define HTTP_LOG_WRITE(file, type, msg) \ if (file && *file) { \ - php_stream *log = php_stream_open_wrapper(file, "ab", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL); \ + php_stream *log = php_stream_open_wrapper(file, "ab", REPORT_ERRORS|ENFORCE_SAFE_MODE, HTTP_DEFAULT_STREAM_CONTEXT); \ \ if (log) { \ php_stream_printf(log TSRMLS_CC, "%s\t[%s]\t%s\t<%s>%s", datetime, type, msg, SG(request_info).request_uri, PHP_EOL); \ http://cvs.php.net/viewcvs.cgi/pecl/http/http_functions.c?r1=1.121&r2=1.122&diff_format=u Index: pecl/http/http_functions.c diff -u pecl/http/http_functions.c:1.121 pecl/http/http_functions.c:1.122 --- pecl/http/http_functions.c:1.121 Fri Feb 17 16:35:05 2006 +++ pecl/http/http_functions.c Mon Feb 20 15:59:37 2006 @@ -10,7 +10,7 @@ +--------------------------------------------------------------------+ */ -/* $Id: http_functions.c,v 1.121 2006/02/17 16:35:05 mike Exp $ */ +/* $Id: http_functions.c,v 1.122 2006/02/20 15:59:37 mike Exp $ */ #define HTTP_WANT_SAPI #define HTTP_WANT_CURL @@ -1502,7 +1502,7 @@ RETURN_FALSE; } - if (!(stream = php_stream_open_wrapper(file, "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL))) { + if (!(stream = php_stream_open_wrapper(file, "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, HTTP_DEFAULT_STREAM_CONTEXT))) { RETURN_FALSE; } if (php_stream_stat(stream, &ssb)) { http://cvs.php.net/viewcvs.cgi/pecl/http/http_querystring_object.c?r1=1.11&r2=1.12&diff_format=u Index: pecl/http/http_querystring_object.c diff -u pecl/http/http_querystring_object.c:1.11 pecl/http/http_querystring_object.c:1.12 --- pecl/http/http_querystring_object.c:1.11 Sat Feb 18 19:44:40 2006 +++ pecl/http/http_querystring_object.c Mon Feb 20 15:59:37 2006 @@ -10,7 +10,7 @@ +--------------------------------------------------------------------+ */ -/* $Id: http_querystring_object.c,v 1.11 2006/02/18 19:44:40 mike Exp $ */ +/* $Id: http_querystring_object.c,v 1.12 2006/02/20 15:59:37 mike Exp $ */ #define HTTP_WANT_SAPI #include "php_http.h" @@ -549,6 +549,7 @@ /* {{{ proto bool HttpQueryString::iconv(string ie, string oe) * * Converts the query string from the source encoding ie to the target encoding oe. + * WARNING: Don't use any character set that can contain NUL bytes like UTF-16. * * Returns TRUE on success or FALSE on failure. */ http://cvs.php.net/viewcvs.cgi/pecl/http/http_request_object.c?r1=1.113&r2=1.114&diff_format=u Index: pecl/http/http_request_object.c diff -u pecl/http/http_request_object.c:1.113 pecl/http/http_request_object.c:1.114 --- pecl/http/http_request_object.c:1.113 Thu Feb 16 09:09:23 2006 +++ pecl/http/http_request_object.c Mon Feb 20 15:59:37 2006 @@ -10,7 +10,7 @@ +--------------------------------------------------------------------+ */ -/* $Id: http_request_object.c,v 1.113 2006/02/16 09:09:23 mike Exp $ */ +/* $Id: http_request_object.c,v 1.114 2006/02/20 15:59:37 mike Exp $ */ #define HTTP_WANT_CURL #include "php_http.h" @@ -450,7 +450,7 @@ case HTTP_PUT: { php_stream_statbuf ssb; - php_stream *stream = php_stream_open_wrapper(Z_STRVAL_P(GET_PROP(putFile)), "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL); + php_stream *stream = php_stream_open_wrapper(Z_STRVAL_P(GET_PROP(putFile)), "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, HTTP_DEFAULT_STREAM_CONTEXT); if (stream && !php_stream_stat(stream, &ssb)) { obj->request->body = http_request_body_init_ex(obj->request->body, HTTP_REQUEST_BODY_UPLOADFILE, stream, ssb.sb.st_size, 1); http://cvs.php.net/viewcvs.cgi/pecl/http/php_http_send_api.h?r1=1.12&r2=1.13&diff_format=u Index: pecl/http/php_http_send_api.h diff -u pecl/http/php_http_send_api.h:1.12 pecl/http/php_http_send_api.h:1.13 --- pecl/http/php_http_send_api.h:1.12 Sat Jan 7 19:17:05 2006 +++ pecl/http/php_http_send_api.h Mon Feb 20 15:59:37 2006 @@ -10,7 +10,7 @@ +--------------------------------------------------------------------+ */ -/* $Id: php_http_send_api.h,v 1.12 2006/01/07 19:17:05 mike Exp $ */ +/* $Id: php_http_send_api.h,v 1.13 2006/02/20 15:59:37 mike Exp $ */ #ifndef PHP_HTTP_SEND_API_H #define PHP_HTTP_SEND_API_H @@ -61,8 +61,8 @@ #define http_send_ex(d, s, m, nc) _http_send_ex((d), (s), (m), (nc) TSRMLS_CC) PHP_HTTP_API STATUS _http_send_ex(const void *data, size_t data_size, http_send_mode mode, zend_bool no_cache TSRMLS_DC); -#define http_send_file(f) http_send_stream_ex(php_stream_open_wrapper(f, "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL), 1, 0) -#define http_send_file_ex(f, nc) http_send_stream_ex(php_stream_open_wrapper(f, "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL), 1, (nc)) +#define http_send_file(f) http_send_stream_ex(php_stream_open_wrapper(f, "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, HTTP_DEFAULT_STREAM_CONTEXT), 1, 0) +#define http_send_file_ex(f, nc) http_send_stream_ex(php_stream_open_wrapper(f, "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, HTTP_DEFAULT_STREAM_CONTEXT), 1, (nc)) #define http_send_stream(s) http_send_stream_ex((s), 0, 0) #define http_send_stream_ex(s, c, nc) _http_send_stream_ex((s), (c), (nc) TSRMLS_CC) PHP_HTTP_API STATUS _http_send_stream_ex(php_stream *s, zend_bool close_stream, zend_bool no_cache TSRMLS_DC); http://cvs.php.net/viewcvs.cgi/pecl/http/php_http_std_defs.h?r1=1.83&r2=1.84&diff_format=u Index: pecl/http/php_http_std_defs.h diff -u pecl/http/php_http_std_defs.h:1.83 pecl/http/php_http_std_defs.h:1.84 --- pecl/http/php_http_std_defs.h:1.83 Tue Feb 7 21:31:34 2006 +++ pecl/http/php_http_std_defs.h Mon Feb 20 15:59:38 2006 @@ -10,7 +10,7 @@ +--------------------------------------------------------------------+ */ -/* $Id: php_http_std_defs.h,v 1.83 2006/02/07 21:31:34 mike Exp $ */ +/* $Id: php_http_std_defs.h,v 1.84 2006/02/20 15:59:38 mike Exp $ */ #ifndef PHP_HTTP_STD_DEFS_H #define PHP_HTTP_STD_DEFS_H @@ -133,6 +133,12 @@ "ACL, " \ /* END */ +#ifdef ZEND_ENGINE_2 +# include "ext/standard/file.h" +# define HTTP_DEFAULT_STREAM_CONTEXT FG(default_context) +#else +# define HTTP_DEFAULT_STREAM_CONTEXT NULL +#endif #define HTTP_PHP_INI_ENTRY(entry, default, scope, updater, global) \ STD_PHP_INI_ENTRY(entry, default, scope, updater, global, zend_http_globals, http_globals)

« previous php.pecl.cvs (#5213) next »