pollita Mon Jan 6 20:02:30 2003 EDT Modified files: /php4/ext/standard user_filters.c Log: Add option to stream_get_filters() user-defined fiters vs. all filters, default to user only Index: php4/ext/standard/user_filters.c diff -u php4/ext/standard/user_filters.c:1.6 php4/ext/standard/user_filters.c:1.7 --- php4/ext/standard/user_filters.c:1.6 Sun Jan 5 23:06:40 2003 +++ php4/ext/standard/user_filters.c Mon Jan 6 20:02:29 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: user_filters.c,v 1.6 2003/01/06 04:06:40 pollita Exp $ */ +/* $Id: user_filters.c,v 1.7 2003/01/07 01:02:29 pollita Exp $ */ #include "php.h" #include "php_globals.h" @@ -411,21 +411,27 @@ { } -/* {{{ proto array stream_get_filters() +/* {{{ proto array stream_get_filters([bool system]) Returns a list of registered filters */ PHP_FUNCTION(stream_get_filters) { char *filter_name; int key_flags, filter_name_len = 0; + zend_bool return_system = 0; HashTable *filters_hash; - if (ZEND_NUM_ARGS() != 0) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &return_system) == +FAILURE) { + RETURN_FALSE; } array_init(return_value); - filters_hash = php_get_stream_filters_hash(); + /* TODO: Bug #21487 */ + + if (return_system) + filters_hash = php_get_stream_filters_hash(); + else + filters_hash = BG(user_filter_map); if (filters_hash) { for(zend_hash_internal_pointer_reset(filters_hash);
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php