. "mail.force_extra_paramaters". (Derick)
- Improved streams support: (Wez)
+ . Added context property to userspace streams object. (sara)
. stream_socket_client() - similar to fsockopen(), but more powerful.
. stream_socket_server() - Creates a server socket.
. stream_socket_accept() - Accept a client connection.
zval **args[4];
int call_result;
php_stream *stream = NULL;
+ zval *zcontext = NULL;
/* Try to catch bad usage without preventing flexibility */
if (FG(user_stream_current_filename) != NULL && strcmp(filename, FG(user_stream_current_filename)) == 0) {
object_init_ex(us->object, uwrap->ce);
ZVAL_REFCOUNT(us->object) = 1;
PZVAL_IS_REF(us->object) = 1;
+
+ if (context) {
+ MAKE_STD_ZVAL(zcontext);
+ php_stream_context_to_zval(context, zcontext);
+ add_property_zval(us->object, "context", zcontext);
+ /* The object property should be the only reference,
+ 'get rid' of our local reference. */
+ zval_ptr_dtor(&zcontext);
+ } else {
+ add_property_null(us->object, "context");
+ }
/* call it's stream_open method - set up params first */
MAKE_STD_ZVAL(zfilename);