mirror of
https://github.com/php/php-src.git
synced 2025-01-27 14:13:41 +08:00
Added stream_get_filters(); to list registered filters
This commit is contained in:
parent
baabdbd1ee
commit
43630e2ac0
@ -863,6 +863,7 @@ function_entry basic_functions[] = {
|
||||
#endif
|
||||
|
||||
PHP_FE(str_rot13, NULL)
|
||||
PHP_FE(stream_get_filters, NULL)
|
||||
PHP_FE(stream_register_filter, NULL)
|
||||
|
||||
/* functions from aggregate.c */
|
||||
|
@ -105,6 +105,7 @@ PHP_FUNCTION(move_uploaded_file);
|
||||
PHP_FUNCTION(parse_ini_file);
|
||||
|
||||
PHP_FUNCTION(str_rot13);
|
||||
PHP_FUNCTION(stream_get_filters);
|
||||
PHP_FUNCTION(stream_register_filter);
|
||||
PHP_MINIT_FUNCTION(user_filters);
|
||||
|
||||
|
@ -411,6 +411,24 @@ static void filter_item_dtor(struct php_user_filter_data *fdat)
|
||||
{
|
||||
}
|
||||
|
||||
/* {{{ proto array stream_get_filters()
|
||||
Returns a list of registered filters */
|
||||
PHP_FUNCTION(stream_get_filters)
|
||||
{
|
||||
char *filter_name;
|
||||
int filter_name_len = 0;
|
||||
|
||||
array_init(return_value);
|
||||
|
||||
if (BG(user_filter_map)) {
|
||||
for(zend_hash_internal_pointer_reset(BG(user_filter_map));
|
||||
zend_hash_get_current_key_ex(BG(user_filter_map), &filter_name, &filter_name_len, NULL, 0, NULL) == HASH_KEY_IS_STRING;
|
||||
zend_hash_move_forward(BG(user_filter_map)))
|
||||
add_next_index_string(return_value, filter_name, 1);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto bool stream_register_filter(string filtername, string classname)
|
||||
Registers a custom filter handler class */
|
||||
PHP_FUNCTION(stream_register_filter)
|
||||
|
Loading…
Reference in New Issue
Block a user