summaryrefslogtreecommitdiff
path: root/ext/standard/ftp_fopen_wrapper.c
diff options
context:
space:
mode:
authorSara Golemon <pollita@php.net>2004-07-24 04:01:48 +0000
committerSara Golemon <pollita@php.net>2004-07-24 04:01:48 +0000
commit93f795bb9e74a2e7cae0ead7deacdf311a7aa6c7 (patch)
treec1ebd84547aad19fecf84f24aa6c1a41b8a5d9d1 /ext/standard/ftp_fopen_wrapper.c
parent49e31e4b0fd3dcfd54078fe99cf02190d5bc645c (diff)
downloadphp-git-93f795bb9e74a2e7cae0ead7deacdf311a7aa6c7.tar.gz
Add proxy support to ftp using http wrapper
Diffstat (limited to 'ext/standard/ftp_fopen_wrapper.c')
-rw-r--r--ext/standard/ftp_fopen_wrapper.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c
index 3ef9c117fd..4d6b28b53d 100644
--- a/ext/standard/ftp_fopen_wrapper.c
+++ b/ext/standard/ftp_fopen_wrapper.c
@@ -384,6 +384,12 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, char *path, ch
int allow_overwrite = 0;
int read_write = 0;
+ if (context &&
+ php_stream_context_get_option(context, "ftp", "proxy", &tmpzval) == SUCCESS) {
+ /* Use http wrapper to proxy ftp request */
+ return php_stream_url_wrap_http(wrapper, path, mode, options, opened_path, context STREAMS_CC TSRMLS_CC);
+ }
+
tmp_line[0] = '\0';
if (strpbrk(mode, "r+")) {
@@ -1130,7 +1136,7 @@ static php_stream_wrapper_ops ftp_stream_wops = {
php_stream_ftp_stream_stat,
php_stream_ftp_url_stat, /* stat_url */
php_stream_ftp_opendir, /* opendir */
- "FTP",
+ "ftp",
php_stream_ftp_unlink, /* unlink */
php_stream_ftp_rename, /* rename */
php_stream_ftp_mkdir, /* mkdir */