diff options
author | Andrew Skalski <askalski@php.net> | 2000-02-22 20:50:00 +0000 |
---|---|---|
committer | Andrew Skalski <askalski@php.net> | 2000-02-22 20:50:00 +0000 |
commit | ceebb2db615960d17f751011cfe955d668b591ea (patch) | |
tree | 4a5a9cd0e80c2840f0e8ae8020274e7393e872b0 /ext/ftp/php_ftp.c | |
parent | 5283b0b821ab14b738471246bb7377bbfcf95480 (diff) | |
download | php-git-ceebb2db615960d17f751011cfe955d668b591ea.tar.gz |
added the ftp_site() function
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) |