bjori           Sat Aug 16 10:57:56 2008 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src    NEWS 
    /php-src/ext/standard       basic_functions.c streamsfuncs.c 
                                streamsfuncs.h 
  Log:
  MFH: [DOC] Added stream_context_set_default() function. (Davey Shafik)
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.271&r2=1.2027.2.547.2.965.2.272&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.271 
php-src/NEWS:1.2027.2.547.2.965.2.272
--- php-src/NEWS:1.2027.2.547.2.965.2.271       Fri Aug 15 19:31:04 2008
+++ php-src/NEWS        Sat Aug 16 10:57:54 2008
@@ -12,6 +12,7 @@
 - Added litespeed SAPI module. (George Wang)
 - Added ext/hash support to ext/session's ID generator. (Sara)
 - Added quoted_printable_encode() function. (Tony)
+- Added stream_context_set_default() function. (Davey Shafik)
 - Added optional "is_xhtml" parameter to nl2br() which makes the function
   output <br> when false and <br /> when true (FR #34381). (Kalle)
 
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/basic_functions.c?r1=1.725.2.31.2.64.2.50&r2=1.725.2.31.2.64.2.51&diff_format=u
Index: php-src/ext/standard/basic_functions.c
diff -u php-src/ext/standard/basic_functions.c:1.725.2.31.2.64.2.50 
php-src/ext/standard/basic_functions.c:1.725.2.31.2.64.2.51
--- php-src/ext/standard/basic_functions.c:1.725.2.31.2.64.2.50 Thu Aug 14 
10:12:19 2008
+++ php-src/ext/standard/basic_functions.c      Sat Aug 16 10:57:56 2008
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: basic_functions.c,v 1.725.2.31.2.64.2.50 2008/08/14 10:12:19 tony2001 
Exp $ */
+/* $Id: basic_functions.c,v 1.725.2.31.2.64.2.51 2008/08/16 10:57:56 bjori Exp 
$ */
 
 #include "php.h"
 #include "php_streams.h"
@@ -2396,6 +2396,11 @@
 ZEND_END_ARG_INFO()
 
 static
+ZEND_BEGIN_ARG_INFO(arginfo_stream_context_set_default, 0)
+       ZEND_ARG_INFO(0, options)
+ZEND_END_ARG_INFO()
+
+static
 ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_context_create, 0, 0, 0)
        ZEND_ARG_INFO(0, options) /* ARRAY_INFO(0, options, 1) */
 ZEND_END_ARG_INFO()
@@ -3520,6 +3525,7 @@
        PHP_FE(stream_context_set_option,                                       
                                        arginfo_stream_context_set_option)
        PHP_FE(stream_context_get_options,                                      
                                        arginfo_stream_context_get_options)
        PHP_FE(stream_context_get_default,                                      
                                        arginfo_stream_context_get_default)
+       PHP_FE(stream_context_set_default,                                      
                                        arginfo_stream_context_set_default)
        PHP_FE(stream_filter_prepend,                                           
                                        arginfo_stream_filter_prepend)
        PHP_FE(stream_filter_append,                                            
                                        arginfo_stream_filter_append)
        PHP_FE(stream_filter_remove,                                            
                                        arginfo_stream_filter_remove)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/streamsfuncs.c?r1=1.58.2.6.2.15.2.19&r2=1.58.2.6.2.15.2.20&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.19 
php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.20
--- php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.15.2.19      Wed Jul 23 
11:25:14 2008
+++ php-src/ext/standard/streamsfuncs.c Sat Aug 16 10:57:56 2008
@@ -17,7 +17,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.19 2008/07/23 11:25:14 tony2001 Exp $ 
*/
+/* $Id: streamsfuncs.c,v 1.58.2.6.2.15.2.20 2008/08/16 10:57:56 bjori Exp $ */
 
 #include "php.h"
 #include "php_globals.h"
@@ -1047,6 +1047,28 @@
 }
 /* }}} */
 
+/* {{{ proto resource stream_context_set_default(array options)
+   Set default file/stream context, returns the context as a resource */
+PHP_FUNCTION(stream_context_set_default)
+{
+       zval *options = NULL;
+       php_stream_context *context;
+
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &options) == 
FAILURE) {
+               return;
+       }
+
+       if (FG(default_context) == NULL) {
+               FG(default_context) = php_stream_context_alloc();
+       }
+       context = FG(default_context);
+
+       parse_context_options(context, options TSRMLS_CC);
+
+       php_stream_context_to_zval(context, return_value);
+}
+/* }}} */
+
 /* {{{ proto resource stream_context_create([array options[, array params]])
    Create a file context and optionally set parameters */
 PHP_FUNCTION(stream_context_create)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/streamsfuncs.h?r1=1.13.2.1.2.4.2.2&r2=1.13.2.1.2.4.2.3&diff_format=u
Index: php-src/ext/standard/streamsfuncs.h
diff -u php-src/ext/standard/streamsfuncs.h:1.13.2.1.2.4.2.2 
php-src/ext/standard/streamsfuncs.h:1.13.2.1.2.4.2.3
--- php-src/ext/standard/streamsfuncs.h:1.13.2.1.2.4.2.2        Mon Dec 31 
07:17:15 2007
+++ php-src/ext/standard/streamsfuncs.h Sat Aug 16 10:57:56 2008
@@ -16,7 +16,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: streamsfuncs.h,v 1.13.2.1.2.4.2.2 2007/12/31 07:17:15 sebastian Exp $ 
*/
+/* $Id: streamsfuncs.h,v 1.13.2.1.2.4.2.3 2008/08/16 10:57:56 bjori Exp $ */
 
 /* Flags for stream_socket_client */
 #define PHP_STREAM_CLIENT_PERSISTENT   1
@@ -49,6 +49,7 @@
 PHP_FUNCTION(stream_context_set_option);
 PHP_FUNCTION(stream_context_get_options);
 PHP_FUNCTION(stream_context_get_default);
+PHP_FUNCTION(stream_context_set_default);
 PHP_FUNCTION(stream_filter_prepend);
 PHP_FUNCTION(stream_filter_append);
 PHP_FUNCTION(stream_filter_remove);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to