pollita Fri Apr 4 00:21:03 2003 EDT
Modified files:
/php4/ext/standard basic_functions.c streamsfuncs.c streamsfuncs.h
Log:
Added stream_get_transports()
Index: php4/ext/standard/basic_functions.c
diff -u php4/ext/standard/basic_functions.c:1.604
php4/ext/standard/basic_functions.c:1.605
--- php4/ext/standard/basic_functions.c:1.604 Thu Apr 3 13:09:41 2003
+++ php4/ext/standard/basic_functions.c Fri Apr 4 00:21:03 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: basic_functions.c,v 1.604 2003/04/03 18:09:41 sas Exp $ */
+/* $Id: basic_functions.c,v 1.605 2003/04/04 05:21:03 pollita Exp $ */
#include "php.h"
#include "php_streams.h"
@@ -701,6 +701,7 @@
PHP_FE(stream_get_line,
NULL)
PHP_FE(stream_register_wrapper,
NULL)
PHP_FE(stream_get_wrappers,
NULL)
+ PHP_FE(stream_get_transports,
NULL)
PHP_FE(get_headers,
NULL)
#if HAVE_SYS_TIME_H || defined(PHP_WIN32)
Index: php4/ext/standard/streamsfuncs.c
diff -u php4/ext/standard/streamsfuncs.c:1.5 php4/ext/standard/streamsfuncs.c:1.6
--- php4/ext/standard/streamsfuncs.c:1.5 Tue Mar 18 18:45:27 2003
+++ php4/ext/standard/streamsfuncs.c Fri Apr 4 00:21:03 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: streamsfuncs.c,v 1.5 2003/03/18 23:45:27 wez Exp $ */
+/* $Id: streamsfuncs.c,v 1.6 2003/04/04 05:21:03 pollita Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -334,6 +334,33 @@
add_assoc_bool(return_value, "eof", php_stream_eof(stream));
}
+}
+/* }}} */
+
+/* {{{ proto array stream_get_transports()
+ Retrieves list of registered socket transports */
+PHP_FUNCTION(stream_get_transports)
+{
+ HashTable *stream_xport_hash;
+ char *stream_xport;
+ int key_flags, stream_xport_len;
+
+ if (ZEND_NUM_ARGS() != 0) {
+ WRONG_PARAM_COUNT;
+ }
+
+ if (stream_xport_hash = php_stream_xport_get_hash()) {
+ array_init(return_value);
+ for(zend_hash_internal_pointer_reset(stream_xport_hash);
+ (key_flags = zend_hash_get_current_key_ex(stream_xport_hash,
&stream_xport, &stream_xport_len, NULL, 0, NULL)) != HASH_KEY_NON_EXISTANT;
+ zend_hash_move_forward(stream_xport_hash)) {
+ if (key_flags == HASH_KEY_IS_STRING) {
+ add_next_index_stringl(return_value,
stream_xport, stream_xport_len, 1);
+ }
+ }
+ } else {
+ RETURN_FALSE;
+ }
}
/* }}} */
Index: php4/ext/standard/streamsfuncs.h
diff -u php4/ext/standard/streamsfuncs.h:1.2 php4/ext/standard/streamsfuncs.h:1.3
--- php4/ext/standard/streamsfuncs.h:1.2 Fri Feb 28 20:27:50 2003
+++ php4/ext/standard/streamsfuncs.h Fri Apr 4 00:21:03 2003
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: streamsfuncs.h,v 1.2 2003/03/01 01:27:50 wez Exp $ */
+/* $Id: streamsfuncs.h,v 1.3 2003/04/04 05:21:03 pollita Exp $ */
/* Flags for stream_socket_client */
#define PHP_STREAM_CLIENT_PERSISTENT 1
@@ -34,6 +34,7 @@
PHP_FUNCTION(stream_select);
PHP_FUNCTION(stream_set_timeout);
PHP_FUNCTION(stream_set_write_buffer);
+PHP_FUNCTION(stream_get_transports);
PHP_FUNCTION(stream_get_wrappers);
PHP_FUNCTION(stream_get_line);
PHP_FUNCTION(stream_get_meta_data);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php