pollita         Fri Jan  3 03:02:38 2003 EDT

  Modified files:              
    /php4/ext/standard  file.c file.h basic_functions.c 
  Log:
  Added stream_get_wrappers()
  
  
Index: php4/ext/standard/file.c
diff -u php4/ext/standard/file.c:1.284 php4/ext/standard/file.c:1.285
--- php4/ext/standard/file.c:1.284      Tue Dec 31 11:07:38 2002
+++ php4/ext/standard/file.c    Fri Jan  3 03:02:35 2003
@@ -21,7 +21,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: file.c,v 1.284 2002/12/31 16:07:38 sebastian Exp $ */
+/* $Id: file.c,v 1.285 2003/01/03 08:02:35 pollita Exp $ */
 
 /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
 
@@ -621,6 +621,31 @@
                add_assoc_bool(return_value, "timed_out", 0);
                add_assoc_bool(return_value, "blocked", 1);
                add_assoc_bool(return_value, "eof", php_stream_eof(stream));
+       }
+
+}
+/* }}} */
+
+/* {{{ proto array stream_get_wrappers()
+    Retrieves list of registered stream wrappers */
+PHP_FUNCTION(stream_get_wrappers)
+{
+       HashTable *url_stream_wrappers_hash;
+       char *stream_protocol;
+       int stream_protocol_len = 0;
+
+       if (ZEND_NUM_ARGS() != 0) {
+               WRONG_PARAM_COUNT;
+       }
+
+       if (url_stream_wrappers_hash = php_stream_get_url_stream_wrappers_hash()) {
+               array_init(return_value);
+               for(zend_hash_internal_pointer_reset(url_stream_wrappers_hash);
+                       zend_hash_get_current_key_ex(url_stream_wrappers_hash, 
+&stream_protocol, &stream_protocol_len, NULL, 0, NULL) == HASH_KEY_IS_STRING;
+                       zend_hash_move_forward(url_stream_wrappers_hash)) 
+                               add_next_index_string(return_value,stream_protocol,1);
+       } else {
+               RETURN_FALSE;
        }
 
 }
Index: php4/ext/standard/file.h
diff -u php4/ext/standard/file.h:1.72 php4/ext/standard/file.h:1.73
--- php4/ext/standard/file.h:1.72       Tue Dec 31 11:07:39 2002
+++ php4/ext/standard/file.h    Fri Jan  3 03:02:36 2003
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: file.h,v 1.72 2002/12/31 16:07:39 sebastian Exp $ */
+/* $Id: file.h,v 1.73 2003/01/03 08:02:36 pollita Exp $ */
 
 /* Synced with php 3.0 revision 1.30 1999-06-16 [ssb] */
 
@@ -59,6 +59,7 @@
 PHP_FUNCTION(stream_select);
 PHP_FUNCTION(stream_set_timeout);
 PHP_FUNCTION(stream_set_write_buffer);
+PHP_FUNCTION(stream_get_wrappers);
 PHP_FUNCTION(get_meta_tags);
 PHP_FUNCTION(flock);
 PHP_FUNCTION(fd_set);
Index: php4/ext/standard/basic_functions.c
diff -u php4/ext/standard/basic_functions.c:1.552 
php4/ext/standard/basic_functions.c:1.553
--- php4/ext/standard/basic_functions.c:1.552   Wed Jan  1 06:04:43 2003
+++ php4/ext/standard/basic_functions.c Fri Jan  3 03:02:36 2003
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: basic_functions.c,v 1.552 2003/01/01 11:04:43 wez Exp $ */
+/* $Id: basic_functions.c,v 1.553 2003/01/03 08:02:36 pollita Exp $ */
 
 #include "php.h"
 #include "php_streams.h"
@@ -670,6 +670,7 @@
 
        PHP_FE(stream_get_meta_data,                                                   
                                 NULL)
        PHP_FE(stream_register_wrapper,                                                
                                 NULL)
+       PHP_FE(stream_get_wrappers,                                                    
+                                         NULL)
 
 #if HAVE_SYS_TIME_H || defined(PHP_WIN32)
        PHP_FE(stream_set_timeout,                                                     
                                         NULL)



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

Reply via email to