Lines Matching refs:ftp
47 PHP_MINIT(ftp),
51 PHP_MINFO(ftp),
61 ftpbuf_t *ftp; member
76 obj->ftp = NULL; in ftp_object_create()
92 if (obj->ftp) { in ftp_object_destroy()
93 ftp_close(obj->ftp); in ftp_object_destroy()
99 PHP_MINIT_FUNCTION(ftp) in PHP_MINIT_FUNCTION() argument
135 PHP_MINFO_FUNCTION(ftp) in PHP_MINFO_FUNCTION() argument
159 ftpbuf_t *ftp; in PHP_FUNCTION() local
175 if (!(ftp = ftp_open(host, (short)port, timeout_sec))) { in PHP_FUNCTION()
180 ftp->autoseek = FTP_DEFAULT_AUTOSEEK; in PHP_FUNCTION()
181 ftp->usepasvaddress = FTP_DEFAULT_USEPASVADDRESS; in PHP_FUNCTION()
184 ftp->use_ssl = 0; in PHP_FUNCTION()
188 ftp_object_from_zend_object(Z_OBJ_P(return_value))->ftp = ftp; in PHP_FUNCTION()
196 ftpbuf_t *ftp; in PHP_FUNCTION() local
212 if (!(ftp = ftp_open(host, (short)port, timeout_sec))) { in PHP_FUNCTION()
217 ftp->autoseek = FTP_DEFAULT_AUTOSEEK; in PHP_FUNCTION()
218 ftp->usepasvaddress = FTP_DEFAULT_USEPASVADDRESS; in PHP_FUNCTION()
220 ftp->use_ssl = 1; in PHP_FUNCTION()
223 ftp_object_from_zend_object(Z_OBJ_P(return_value))->ftp = ftp; in PHP_FUNCTION()
229 ftpbuf = ftp_object_from_zend_object(Z_OBJ_P(zftp))->ftp; \
239 ftpbuf_t *ftp; in PHP_FUNCTION() local
246 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
249 if (!ftp_login(ftp, user, user_len, pass, pass_len)) { in PHP_FUNCTION()
250 if (*ftp->inbuf) { in PHP_FUNCTION()
251 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
264 ftpbuf_t *ftp; in PHP_FUNCTION() local
270 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
272 if (!(pwd = ftp_pwd(ftp))) { in PHP_FUNCTION()
273 if (*ftp->inbuf) { in PHP_FUNCTION()
274 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
287 ftpbuf_t *ftp; in PHP_FUNCTION() local
292 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
294 if (!ftp_cdup(ftp)) { in PHP_FUNCTION()
295 if (*ftp->inbuf) { in PHP_FUNCTION()
296 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
309 ftpbuf_t *ftp; in PHP_FUNCTION() local
316 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
319 if (!ftp_chdir(ftp, dir, dir_len)) { in PHP_FUNCTION()
320 if (*ftp->inbuf) { in PHP_FUNCTION()
321 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
334 ftpbuf_t *ftp; in PHP_FUNCTION() local
341 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
344 if (!ftp_exec(ftp, cmd, cmd_len)) { in PHP_FUNCTION()
345 if (*ftp->inbuf) { in PHP_FUNCTION()
346 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
359 ftpbuf_t *ftp; in PHP_FUNCTION() local
366 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
369 ftp_raw(ftp, cmd, cmd_len, return_value); in PHP_FUNCTION()
377 ftpbuf_t *ftp; in PHP_FUNCTION() local
385 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
388 if (NULL == (tmp = ftp_mkdir(ftp, dir, dir_len))) { in PHP_FUNCTION()
389 if (*ftp->inbuf) { in PHP_FUNCTION()
390 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
403 ftpbuf_t *ftp; in PHP_FUNCTION() local
410 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
413 if (!ftp_rmdir(ftp, dir, dir_len)) { in PHP_FUNCTION()
414 if (*ftp->inbuf) { in PHP_FUNCTION()
415 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
428 ftpbuf_t *ftp; in PHP_FUNCTION() local
436 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
438 if (!ftp_chmod(ftp, mode, filename, filename_len)) { in PHP_FUNCTION()
439 if (*ftp->inbuf) { in PHP_FUNCTION()
440 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
453 ftpbuf_t *ftp; in PHP_FUNCTION() local
460 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
462 ret = ftp_alloc(ftp, size, zresponse ? &response : NULL); in PHP_FUNCTION()
480 ftpbuf_t *ftp; in PHP_FUNCTION() local
487 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
490 if (NULL == (nlist = ftp_nlist(ftp, dir, dir_len))) { in PHP_FUNCTION()
506 ftpbuf_t *ftp; in PHP_FUNCTION() local
514 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
517 if (NULL == (llist = ftp_list(ftp, dir, dir_len, recursive))) { in PHP_FUNCTION()
533 ftpbuf_t *ftp; in PHP_FUNCTION() local
541 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
544 if (NULL == (llist = ftp_mlsd(ftp, dir, dir_len))) { in PHP_FUNCTION()
566 ftpbuf_t *ftp; in PHP_FUNCTION() local
572 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
574 if (NULL == (syst = ftp_syst(ftp))) { in PHP_FUNCTION()
575 if (*ftp->inbuf) { in PHP_FUNCTION()
576 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
589 ftpbuf_t *ftp; in PHP_FUNCTION() local
599 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
604 if (!ftp->autoseek && resumepos == PHP_FTP_AUTORESUME) { in PHP_FUNCTION()
608 if (ftp->autoseek && resumepos) { in PHP_FUNCTION()
618 if (!ftp_get(ftp, stream, file, file_len, xtype, resumepos)) { in PHP_FUNCTION()
619 if (*ftp->inbuf) { in PHP_FUNCTION()
620 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
633 ftpbuf_t *ftp; in PHP_FUNCTION() local
643 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
648 if (!ftp->autoseek && resumepos == PHP_FTP_AUTORESUME) { in PHP_FUNCTION()
652 if (ftp->autoseek && resumepos) { in PHP_FUNCTION()
663 ftp->direction = 0; /* recv */ in PHP_FUNCTION()
664 ftp->closestream = 0; /* do not close */ in PHP_FUNCTION()
666 if ((ret = ftp_nb_get(ftp, stream, file, file_len, xtype, resumepos)) == PHP_FTP_FAILED) { in PHP_FUNCTION()
667 if (*ftp->inbuf) { in PHP_FUNCTION()
668 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
681 ftpbuf_t *ftp; in PHP_FUNCTION() local
687 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
689 if (!ftp_pasv(ftp, pasv ? 1 : 0)) { in PHP_FUNCTION()
701 ftpbuf_t *ftp; in PHP_FUNCTION() local
711 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
715 if (!ftp->autoseek && resumepos == PHP_FTP_AUTORESUME) { in PHP_FUNCTION()
723 if (ftp->autoseek && resumepos) { in PHP_FUNCTION()
746 if (!ftp_get(ftp, outstream, remote, remote_len, xtype, resumepos)) { in PHP_FUNCTION()
749 if (*ftp->inbuf) { in PHP_FUNCTION()
750 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
764 ftpbuf_t *ftp; in PHP_FUNCTION() local
775 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
779 if (!ftp->autoseek && resumepos == PHP_FTP_AUTORESUME) { in PHP_FUNCTION()
785 if (ftp->autoseek && resumepos) { in PHP_FUNCTION()
809 ftp->direction = 0; /* recv */ in PHP_FUNCTION()
810 ftp->closestream = 1; /* do close */ in PHP_FUNCTION()
812 if ((ret = ftp_nb_get(ftp, outstream, remote, remote_len, xtype, resumepos)) == PHP_FTP_FAILED) { in PHP_FUNCTION()
814 ftp->stream = NULL; in PHP_FUNCTION()
816 if (*ftp->inbuf) { in PHP_FUNCTION()
817 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
824 ftp->stream = NULL; in PHP_FUNCTION()
835 ftpbuf_t *ftp; in PHP_FUNCTION() local
841 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
843 if (!ftp->nb) { in PHP_FUNCTION()
848 if (ftp->direction) { in PHP_FUNCTION()
849 ret=ftp_nb_continue_write(ftp); in PHP_FUNCTION()
851 ret=ftp_nb_continue_read(ftp); in PHP_FUNCTION()
854 if (ret != PHP_FTP_MOREDATA && ftp->closestream) { in PHP_FUNCTION()
855 php_stream_close(ftp->stream); in PHP_FUNCTION()
856 ftp->stream = NULL; in PHP_FUNCTION()
860 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
871 ftpbuf_t *ftp; in PHP_FUNCTION() local
881 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
886 if (!ftp->autoseek && startpos == PHP_FTP_AUTORESUME) { in PHP_FUNCTION()
890 if (ftp->autoseek && startpos) { in PHP_FUNCTION()
893 startpos = ftp_size(ftp, remote, remote_len); in PHP_FUNCTION()
903 if (!ftp_put(ftp, remote, remote_len, stream, xtype, startpos)) { in PHP_FUNCTION()
904 if (*ftp->inbuf) { in PHP_FUNCTION()
905 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
918 ftpbuf_t *ftp; in PHP_FUNCTION() local
929 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
934 if (!ftp->autoseek && startpos == PHP_FTP_AUTORESUME) { in PHP_FUNCTION()
938 if (ftp->autoseek && startpos) { in PHP_FUNCTION()
941 startpos = ftp_size(ftp, remote, remote_len); in PHP_FUNCTION()
952 ftp->direction = 1; /* send */ in PHP_FUNCTION()
953 ftp->closestream = 0; /* do not close */ in PHP_FUNCTION()
955 if (((ret = ftp_nb_put(ftp, remote, remote_len, stream, xtype, startpos)) == PHP_FTP_FAILED)) { in PHP_FUNCTION()
956 if (*ftp->inbuf) { in PHP_FUNCTION()
957 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
971 ftpbuf_t *ftp; in PHP_FUNCTION() local
981 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
989 if (!ftp->autoseek && startpos == PHP_FTP_AUTORESUME) { in PHP_FUNCTION()
993 if (ftp->autoseek && startpos) { in PHP_FUNCTION()
996 startpos = ftp_size(ftp, remote, remote_len); in PHP_FUNCTION()
1006 if (!ftp_put(ftp, remote, remote_len, instream, xtype, startpos)) { in PHP_FUNCTION()
1008 if (*ftp->inbuf) { in PHP_FUNCTION()
1009 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
1023 ftpbuf_t *ftp; in PHP_FUNCTION() local
1033 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
1040 if (!ftp_append(ftp, remote, remote_len, instream, xtype)) { in PHP_FUNCTION()
1042 if (*ftp->inbuf) { in PHP_FUNCTION()
1043 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
1057 ftpbuf_t *ftp; in PHP_FUNCTION() local
1067 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
1075 if (!ftp->autoseek && startpos == PHP_FTP_AUTORESUME) { in PHP_FUNCTION()
1079 if (ftp->autoseek && startpos) { in PHP_FUNCTION()
1082 startpos = ftp_size(ftp, remote, remote_len); in PHP_FUNCTION()
1093 ftp->direction = 1; /* send */ in PHP_FUNCTION()
1094 ftp->closestream = 1; /* do close */ in PHP_FUNCTION()
1096 ret = ftp_nb_put(ftp, remote, remote_len, instream, xtype, startpos); in PHP_FUNCTION()
1100 ftp->stream = NULL; in PHP_FUNCTION()
1104 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
1115 ftpbuf_t *ftp; in PHP_FUNCTION() local
1122 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
1125 RETURN_LONG(ftp_size(ftp, file, file_len)); in PHP_FUNCTION()
1133 ftpbuf_t *ftp; in PHP_FUNCTION() local
1140 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
1143 RETURN_LONG(ftp_mdtm(ftp, file, file_len)); in PHP_FUNCTION()
1151 ftpbuf_t *ftp; in PHP_FUNCTION() local
1158 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
1161 if (!ftp_rename(ftp, src, src_len, dest, dest_len)) { in PHP_FUNCTION()
1162 if (*ftp->inbuf) { in PHP_FUNCTION()
1163 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
1176 ftpbuf_t *ftp; in PHP_FUNCTION() local
1183 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
1186 if (!ftp_delete(ftp, file, file_len)) { in PHP_FUNCTION()
1187 if (*ftp->inbuf) { in PHP_FUNCTION()
1188 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
1201 ftpbuf_t *ftp; in PHP_FUNCTION() local
1208 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
1211 if (!ftp_site(ftp, cmd, cmd_len)) { in PHP_FUNCTION()
1212 if (*ftp->inbuf) { in PHP_FUNCTION()
1213 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
1234 if (obj->ftp) { in PHP_FUNCTION()
1235 success = ftp_quit(obj->ftp); in PHP_FUNCTION()
1236 ftp_close(obj->ftp); in PHP_FUNCTION()
1237 obj->ftp = NULL; in PHP_FUNCTION()
1249 ftpbuf_t *ftp; in PHP_FUNCTION() local
1254 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
1266 ftp->timeout_sec = Z_LVAL_P(z_value); in PHP_FUNCTION()
1274 ftp->autoseek = Z_TYPE_P(z_value) == IS_TRUE ? 1 : 0; in PHP_FUNCTION()
1282 ftp->usepasvaddress = Z_TYPE_P(z_value) == IS_TRUE ? 1 : 0; in PHP_FUNCTION()
1298 ftpbuf_t *ftp; in PHP_FUNCTION() local
1303 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
1307 RETURN_LONG(ftp->timeout_sec); in PHP_FUNCTION()
1310 RETURN_BOOL(ftp->autoseek); in PHP_FUNCTION()
1313 RETURN_BOOL(ftp->usepasvaddress); in PHP_FUNCTION()