bjori Mon Apr 14 08:15:12 2008 UTC
Modified files: (Branch: PHP_5_3)
/php-src/ext/standard streamsfuncs.c
/php-src NEWS
Log:
MFH: Add "params" argument to stream_context_create()
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/streamsfuncs.c?r1=1.58.2.6.2.15.2.12&r2=1.58.2.6.2.15.2.13&diff_format=u
Index: php-src/ext/standard/streamsfuncs.c
diff -u php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.12
php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.13
--- php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.12 Mon Apr 14
07:49:00 2008
+++ php-src/ext/standard/streamsfuncs.c Mon Apr 14 08:15:11 2008
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.12 2008/04/14 07:49:00 tony2001 Exp $
*/
+/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.13 2008/04/14 08:15:11 bjori Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -1041,21 +1041,25 @@
}
/* }}} */
-/* {{{ proto resource stream_context_create([array options])
+/* {{{ proto resource stream_context_create([array options[, array params]])
Create a file context and optionally set parameters */
PHP_FUNCTION(stream_context_create)
{
- zval *params = NULL;
+ zval *options = NULL, *params = NULL;
php_stream_context *context;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|a", ¶ms) ==
FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|a!a!", &options,
¶ms) == FAILURE) {
RETURN_FALSE;
}
context = php_stream_context_alloc();
+ if (options) {
+ parse_context_options(context, options TSRMLS_CC);
+ }
+
if (params) {
- parse_context_options(context, params TSRMLS_CC);
+ parse_context_params(context, params TSRMLS_CC);
}
php_stream_context_to_zval(context, return_value);
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.157&r2=1.2027.2.547.2.965.2.158&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.157
php-src/NEWS:1.2027.2.547.2.965.2.158
--- php-src/NEWS:1.2027.2.547.2.965.2.157 Fri Apr 11 09:43:27 2008
+++ php-src/NEWS Mon Apr 14 08:15:11 2008
@@ -130,6 +130,7 @@
. Added "ignore_errors" option to http fopen wrapper. (David Zulke, Sara)
. Added context parameter for copy() function. (Sara)
. Added "glob" stream wrapper. (Marcus)
+ . Added "params" as optional parameter for stream_context_create(). (Sara)
- Improved ext/soap to support element names in context of XMLShema's <any>.
(Dmitry)
- Improved ext/openssl: (Dmitry)
@@ -158,7 +159,7 @@
- Fixed bug #44214 (Crash using preg_replace_callback() and global variable).
(Nuno, Scott)
- Fixed bug #43960 (strtotime() returns timestamp in the future when given a
- bogus string).
+ bogus string). (Derick)
- Fixed bug #43832 (mysqli_get_charset() doesn't expose charset comment).
(Andrey)
- Fixed bug #43808 (date_create never fails (even when it should)). (Derick)
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php