pollita         Mon Jun 16 15:13:39 2003 EDT

  Modified files:              
    /php4/main/streams  userspace.c 
    /php4       NEWS 
  Log:
  Add context property to userspace streams object.
  
  
Index: php4/main/streams/userspace.c
diff -u php4/main/streams/userspace.c:1.8 php4/main/streams/userspace.c:1.9
--- php4/main/streams/userspace.c:1.8   Tue Jun 10 16:03:42 2003
+++ php4/main/streams/userspace.c       Mon Jun 16 15:13:39 2003
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: userspace.c,v 1.8 2003/06/10 20:03:42 imajes Exp $ */
+/* $Id: userspace.c,v 1.9 2003/06/16 19:13:39 pollita Exp $ */
 
 #include "php.h"
 #include "php_globals.h"
@@ -185,6 +185,7 @@
        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) {
@@ -201,6 +202,17 @@
        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);
Index: php4/NEWS
diff -u php4/NEWS:1.1424 php4/NEWS:1.1425
--- php4/NEWS:1.1424    Sat Jun 14 20:31:08 2003
+++ php4/NEWS   Mon Jun 16 15:13:39 2003
@@ -15,6 +15,7 @@
   . "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.



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

Reply via email to