diff options
Diffstat (limited to 'ext/ftp/php_ftp.c')
-rw-r--r-- | ext/ftp/php_ftp.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c index f96cc21a3c..a4f843ffb8 100644 --- a/ext/ftp/php_ftp.c +++ b/ext/ftp/php_ftp.c @@ -62,6 +62,7 @@ function_entry php_ftp_functions[] = { PHP_FE(ftp_mdtm, NULL) PHP_FE(ftp_rename, NULL) PHP_FE(ftp_delete, NULL) + PHP_FE(ftp_site, NULL) PHP_FE(ftp_quit, NULL) {NULL, NULL, NULL} }; @@ -758,6 +759,35 @@ PHP_FUNCTION(ftp_delete) } /* }}} */ +/* {{{ proto int ftp_site(int stream, string cmd) + Sends a SITE command to the server */ +PHP_FUNCTION(ftp_site) +{ + pval *arg1, *arg2; + ftpbuf_t *ftp; + + /* arg1 - ftp + * arg2 - cmd + */ + if ( ARG_COUNT(ht) != 2 || + getParameters(ht, 2, &arg1, &arg2) == FAILURE) + { + WRONG_PARAM_COUNT; + } + + FTPBUF(ftp, arg1); + convert_to_string(arg2); + + /* send the site command */ + if (!ftp_site(ftp, arg2->value.str.val)) { + php_error(E_WARNING, "ftp_site: %s", ftp->inbuf); + RETURN_FALSE; + } + + RETURN_TRUE; +} +/* }}} */ + /* {{{ proto int ftp_quit(int stream) Closes the FTP stream */ PHP_FUNCTION(ftp_quit) |