diff options
author | foobar <sniper@php.net> | 2002-07-04 13:48:48 +0000 |
---|---|---|
committer | foobar <sniper@php.net> | 2002-07-04 13:48:48 +0000 |
commit | b0ed560c95a560690786bd4e9a1b5b6f8725cda3 (patch) | |
tree | 496f6e39e01d2e207d84cb34c0d3a3e314bdbb90 /ext/ftp/php_ftp.c | |
parent | a6eeec28b63b6661f5b25810f17d7f665daefc22 (diff) | |
download | php-git-b0ed560c95a560690786bd4e9a1b5b6f8725cda3.tar.gz |
@- Added optional 3rd parameter 'recursive' to ftp_rawlist() which will
@ do 'LIST -R' instead of 'LIST'. (Jani)
# tested too..and it even works. :)
# (removed that Z_TYPE_P() pollution also..)
Diffstat (limited to 'ext/ftp/php_ftp.c')
-rw-r--r-- | ext/ftp/php_ftp.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c index 2b91ed94cd..7a8b665b18 100644 --- a/ext/ftp/php_ftp.c +++ b/ext/ftp/php_ftp.c @@ -342,7 +342,7 @@ PHP_FUNCTION(ftp_nlist) } /* }}} */ -/* {{{ proto array ftp_rawlist(resource stream, string directory) +/* {{{ proto array ftp_rawlist(resource stream, string directory [, bool recursive]) Returns a detailed listing of a directory as an array of output lines */ PHP_FUNCTION(ftp_rawlist) { @@ -350,15 +350,16 @@ PHP_FUNCTION(ftp_rawlist) ftpbuf_t *ftp; char **llist, **ptr, *dir; int dir_len; + zend_bool recursive; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &dir, &dir_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|b", &z_ftp, &dir, &dir_len, &recursive) == FAILURE) { return; } ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); /* get raw directory listing */ - if (NULL == (llist = ftp_list(ftp, dir))) { + if (NULL == (llist = ftp_list(ftp, dir, recursive))) { RETURN_FALSE; } |