ZEND_ARG_INFO(0, options) /* ARRAY_INFO(0, options, 1) */
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) */
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)
}
/* }}} */
+/* {{{ proto resource stream_context_set_default(array options) U
+ 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]]) U
Create a file context and optionally set parameters */
PHP_FUNCTION(stream_context_create)
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);