Lines Matching refs:ftp
48 PHP_MINIT(ftp),
52 PHP_MINFO(ftp),
62 ftpbuf_t *ftp; member
77 obj->ftp = NULL; in ftp_object_create()
93 if (obj->ftp) { in ftp_object_destroy()
94 ftp_close(obj->ftp); in ftp_object_destroy()
100 PHP_MINIT_FUNCTION(ftp) in PHP_MINIT_FUNCTION() argument
127 PHP_MINFO_FUNCTION(ftp) in PHP_MINFO_FUNCTION() argument
151 ftpbuf_t *ftp; in PHP_FUNCTION() local
167 if (!(ftp = ftp_open(host, (short)port, timeout_sec))) { in PHP_FUNCTION()
172 ftp->autoseek = FTP_DEFAULT_AUTOSEEK; in PHP_FUNCTION()
173 ftp->usepasvaddress = FTP_DEFAULT_USEPASVADDRESS; in PHP_FUNCTION()
176 ftp->use_ssl = 0; in PHP_FUNCTION()
180 ftp_object_from_zend_object(Z_OBJ_P(return_value))->ftp = ftp; in PHP_FUNCTION()
188 ftpbuf_t *ftp; in PHP_FUNCTION() local
204 if (!(ftp = ftp_open(host, (short)port, timeout_sec))) { in PHP_FUNCTION()
209 ftp->autoseek = FTP_DEFAULT_AUTOSEEK; in PHP_FUNCTION()
210 ftp->usepasvaddress = FTP_DEFAULT_USEPASVADDRESS; in PHP_FUNCTION()
212 ftp->use_ssl = 1; in PHP_FUNCTION()
215 ftp_object_from_zend_object(Z_OBJ_P(return_value))->ftp = ftp; in PHP_FUNCTION()
221 ftpbuf = ftp_object_from_zend_object(Z_OBJ_P(zftp))->ftp; \
231 ftpbuf_t *ftp; in PHP_FUNCTION() local
238 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
241 if (!ftp_login(ftp, user, user_len, pass, pass_len)) { in PHP_FUNCTION()
242 if (*ftp->inbuf) { in PHP_FUNCTION()
243 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
256 ftpbuf_t *ftp; in PHP_FUNCTION() local
262 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
264 if (!(pwd = ftp_pwd(ftp))) { in PHP_FUNCTION()
265 if (*ftp->inbuf) { in PHP_FUNCTION()
266 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
279 ftpbuf_t *ftp; in PHP_FUNCTION() local
284 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
286 if (!ftp_cdup(ftp)) { in PHP_FUNCTION()
287 if (*ftp->inbuf) { in PHP_FUNCTION()
288 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
301 ftpbuf_t *ftp; in PHP_FUNCTION() local
308 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
311 if (!ftp_chdir(ftp, dir, dir_len)) { in PHP_FUNCTION()
312 if (*ftp->inbuf) { in PHP_FUNCTION()
313 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
326 ftpbuf_t *ftp; in PHP_FUNCTION() local
333 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
336 if (!ftp_exec(ftp, cmd, cmd_len)) { in PHP_FUNCTION()
337 if (*ftp->inbuf) { in PHP_FUNCTION()
338 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
351 ftpbuf_t *ftp; in PHP_FUNCTION() local
358 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
361 ftp_raw(ftp, cmd, cmd_len, return_value); in PHP_FUNCTION()
369 ftpbuf_t *ftp; in PHP_FUNCTION() local
377 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
380 if (NULL == (tmp = ftp_mkdir(ftp, dir, dir_len))) { in PHP_FUNCTION()
381 if (*ftp->inbuf) { in PHP_FUNCTION()
382 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
395 ftpbuf_t *ftp; in PHP_FUNCTION() local
402 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
405 if (!ftp_rmdir(ftp, dir, dir_len)) { in PHP_FUNCTION()
406 if (*ftp->inbuf) { in PHP_FUNCTION()
407 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
420 ftpbuf_t *ftp; in PHP_FUNCTION() local
428 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
430 if (!ftp_chmod(ftp, mode, filename, filename_len)) { in PHP_FUNCTION()
431 if (*ftp->inbuf) { in PHP_FUNCTION()
432 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
445 ftpbuf_t *ftp; in PHP_FUNCTION() local
452 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
454 ret = ftp_alloc(ftp, size, zresponse ? &response : NULL); in PHP_FUNCTION()
472 ftpbuf_t *ftp; in PHP_FUNCTION() local
479 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
482 if (NULL == (nlist = ftp_nlist(ftp, dir, dir_len))) { in PHP_FUNCTION()
498 ftpbuf_t *ftp; in PHP_FUNCTION() local
506 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
509 if (NULL == (llist = ftp_list(ftp, dir, dir_len, recursive))) { in PHP_FUNCTION()
525 ftpbuf_t *ftp; in PHP_FUNCTION() local
533 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
536 if (NULL == (llist = ftp_mlsd(ftp, dir, dir_len))) { in PHP_FUNCTION()
558 ftpbuf_t *ftp; in PHP_FUNCTION() local
564 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
566 if (NULL == (syst = ftp_syst(ftp))) { in PHP_FUNCTION()
567 if (*ftp->inbuf) { in PHP_FUNCTION()
568 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
581 ftpbuf_t *ftp; in PHP_FUNCTION() local
591 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
596 if (!ftp->autoseek && resumepos == PHP_FTP_AUTORESUME) { in PHP_FUNCTION()
600 if (ftp->autoseek && resumepos) { in PHP_FUNCTION()
610 if (!ftp_get(ftp, stream, file, file_len, xtype, resumepos)) { in PHP_FUNCTION()
611 if (*ftp->inbuf) { in PHP_FUNCTION()
612 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
625 ftpbuf_t *ftp; in PHP_FUNCTION() local
635 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
640 if (!ftp->autoseek && resumepos == PHP_FTP_AUTORESUME) { in PHP_FUNCTION()
644 if (ftp->autoseek && resumepos) { in PHP_FUNCTION()
655 ftp->direction = 0; /* recv */ in PHP_FUNCTION()
656 ftp->closestream = 0; /* do not close */ in PHP_FUNCTION()
658 if ((ret = ftp_nb_get(ftp, stream, file, file_len, xtype, resumepos)) == PHP_FTP_FAILED) { in PHP_FUNCTION()
659 if (*ftp->inbuf) { in PHP_FUNCTION()
660 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
673 ftpbuf_t *ftp; in PHP_FUNCTION() local
679 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
681 if (!ftp_pasv(ftp, pasv ? 1 : 0)) { in PHP_FUNCTION()
693 ftpbuf_t *ftp; in PHP_FUNCTION() local
703 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
707 if (!ftp->autoseek && resumepos == PHP_FTP_AUTORESUME) { in PHP_FUNCTION()
715 if (ftp->autoseek && resumepos) { in PHP_FUNCTION()
738 if (!ftp_get(ftp, outstream, remote, remote_len, xtype, resumepos)) { in PHP_FUNCTION()
741 if (*ftp->inbuf) { in PHP_FUNCTION()
742 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
756 ftpbuf_t *ftp; in PHP_FUNCTION() local
767 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
771 if (!ftp->autoseek && resumepos == PHP_FTP_AUTORESUME) { in PHP_FUNCTION()
777 if (ftp->autoseek && resumepos) { in PHP_FUNCTION()
801 ftp->direction = 0; /* recv */ in PHP_FUNCTION()
802 ftp->closestream = 1; /* do close */ in PHP_FUNCTION()
804 if ((ret = ftp_nb_get(ftp, outstream, remote, remote_len, xtype, resumepos)) == PHP_FTP_FAILED) { in PHP_FUNCTION()
806 ftp->stream = NULL; in PHP_FUNCTION()
808 if (*ftp->inbuf) { in PHP_FUNCTION()
809 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
816 ftp->stream = NULL; in PHP_FUNCTION()
827 ftpbuf_t *ftp; in PHP_FUNCTION() local
833 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
835 if (!ftp->nb) { in PHP_FUNCTION()
840 if (ftp->direction) { in PHP_FUNCTION()
841 ret=ftp_nb_continue_write(ftp); in PHP_FUNCTION()
843 ret=ftp_nb_continue_read(ftp); in PHP_FUNCTION()
846 if (ret != PHP_FTP_MOREDATA && ftp->closestream) { in PHP_FUNCTION()
847 php_stream_close(ftp->stream); in PHP_FUNCTION()
848 ftp->stream = NULL; in PHP_FUNCTION()
852 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
863 ftpbuf_t *ftp; in PHP_FUNCTION() local
873 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
878 if (!ftp->autoseek && startpos == PHP_FTP_AUTORESUME) { in PHP_FUNCTION()
882 if (ftp->autoseek && startpos) { in PHP_FUNCTION()
885 startpos = ftp_size(ftp, remote, remote_len); in PHP_FUNCTION()
895 if (!ftp_put(ftp, remote, remote_len, stream, xtype, startpos)) { in PHP_FUNCTION()
896 if (*ftp->inbuf) { in PHP_FUNCTION()
897 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
910 ftpbuf_t *ftp; in PHP_FUNCTION() local
921 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
926 if (!ftp->autoseek && startpos == PHP_FTP_AUTORESUME) { in PHP_FUNCTION()
930 if (ftp->autoseek && startpos) { in PHP_FUNCTION()
933 startpos = ftp_size(ftp, remote, remote_len); in PHP_FUNCTION()
944 ftp->direction = 1; /* send */ in PHP_FUNCTION()
945 ftp->closestream = 0; /* do not close */ in PHP_FUNCTION()
947 if (((ret = ftp_nb_put(ftp, remote, remote_len, stream, xtype, startpos)) == PHP_FTP_FAILED)) { in PHP_FUNCTION()
948 if (*ftp->inbuf) { in PHP_FUNCTION()
949 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
963 ftpbuf_t *ftp; in PHP_FUNCTION() local
973 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
981 if (!ftp->autoseek && startpos == PHP_FTP_AUTORESUME) { in PHP_FUNCTION()
985 if (ftp->autoseek && startpos) { in PHP_FUNCTION()
988 startpos = ftp_size(ftp, remote, remote_len); in PHP_FUNCTION()
998 if (!ftp_put(ftp, remote, remote_len, instream, xtype, startpos)) { in PHP_FUNCTION()
1000 if (*ftp->inbuf) { in PHP_FUNCTION()
1001 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
1015 ftpbuf_t *ftp; in PHP_FUNCTION() local
1025 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
1032 if (!ftp_append(ftp, remote, remote_len, instream, xtype)) { in PHP_FUNCTION()
1034 if (*ftp->inbuf) { in PHP_FUNCTION()
1035 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
1049 ftpbuf_t *ftp; in PHP_FUNCTION() local
1059 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
1067 if (!ftp->autoseek && startpos == PHP_FTP_AUTORESUME) { in PHP_FUNCTION()
1071 if (ftp->autoseek && startpos) { in PHP_FUNCTION()
1074 startpos = ftp_size(ftp, remote, remote_len); in PHP_FUNCTION()
1085 ftp->direction = 1; /* send */ in PHP_FUNCTION()
1086 ftp->closestream = 1; /* do close */ in PHP_FUNCTION()
1088 ret = ftp_nb_put(ftp, remote, remote_len, instream, xtype, startpos); in PHP_FUNCTION()
1092 ftp->stream = NULL; in PHP_FUNCTION()
1096 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
1107 ftpbuf_t *ftp; in PHP_FUNCTION() local
1114 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
1117 RETURN_LONG(ftp_size(ftp, file, file_len)); in PHP_FUNCTION()
1125 ftpbuf_t *ftp; in PHP_FUNCTION() local
1132 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
1135 RETURN_LONG(ftp_mdtm(ftp, file, file_len)); in PHP_FUNCTION()
1143 ftpbuf_t *ftp; in PHP_FUNCTION() local
1150 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
1153 if (!ftp_rename(ftp, src, src_len, dest, dest_len)) { in PHP_FUNCTION()
1154 if (*ftp->inbuf) { in PHP_FUNCTION()
1155 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
1168 ftpbuf_t *ftp; in PHP_FUNCTION() local
1175 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
1178 if (!ftp_delete(ftp, file, file_len)) { in PHP_FUNCTION()
1179 if (*ftp->inbuf) { in PHP_FUNCTION()
1180 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
1193 ftpbuf_t *ftp; in PHP_FUNCTION() local
1200 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
1203 if (!ftp_site(ftp, cmd, cmd_len)) { in PHP_FUNCTION()
1204 if (*ftp->inbuf) { in PHP_FUNCTION()
1205 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
1226 if (obj->ftp) { in PHP_FUNCTION()
1227 success = ftp_quit(obj->ftp); in PHP_FUNCTION()
1228 ftp_close(obj->ftp); in PHP_FUNCTION()
1229 obj->ftp = NULL; in PHP_FUNCTION()
1241 ftpbuf_t *ftp; in PHP_FUNCTION() local
1246 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
1258 ftp->timeout_sec = Z_LVAL_P(z_value); in PHP_FUNCTION()
1266 ftp->autoseek = Z_TYPE_P(z_value) == IS_TRUE ? 1 : 0; in PHP_FUNCTION()
1274 ftp->usepasvaddress = Z_TYPE_P(z_value) == IS_TRUE ? 1 : 0; in PHP_FUNCTION()
1290 ftpbuf_t *ftp; in PHP_FUNCTION() local
1295 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
1299 RETURN_LONG(ftp->timeout_sec); in PHP_FUNCTION()
1302 RETURN_BOOL(ftp->autoseek); in PHP_FUNCTION()
1305 RETURN_BOOL(ftp->usepasvaddress); in PHP_FUNCTION()