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
116 PHP_MINFO_FUNCTION(ftp) in PHP_MINFO_FUNCTION() argument
140 ftpbuf_t *ftp; in PHP_FUNCTION() local
156 if (!(ftp = ftp_open(host, (short)port, timeout_sec))) { in PHP_FUNCTION()
161 ftp->autoseek = FTP_DEFAULT_AUTOSEEK; in PHP_FUNCTION()
162 ftp->usepasvaddress = FTP_DEFAULT_USEPASVADDRESS; in PHP_FUNCTION()
165 ftp->use_ssl = 0; in PHP_FUNCTION()
169 ftp_object_from_zend_object(Z_OBJ_P(return_value))->ftp = ftp; in PHP_FUNCTION()
177 ftpbuf_t *ftp; in PHP_FUNCTION() local
193 if (!(ftp = ftp_open(host, (short)port, timeout_sec))) { in PHP_FUNCTION()
198 ftp->autoseek = FTP_DEFAULT_AUTOSEEK; in PHP_FUNCTION()
199 ftp->usepasvaddress = FTP_DEFAULT_USEPASVADDRESS; in PHP_FUNCTION()
201 ftp->use_ssl = 1; in PHP_FUNCTION()
204 ftp_object_from_zend_object(Z_OBJ_P(return_value))->ftp = ftp; in PHP_FUNCTION()
210 ftpbuf = ftp_object_from_zend_object(Z_OBJ_P(zftp))->ftp; \
220 ftpbuf_t *ftp; in PHP_FUNCTION() local
227 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
230 if (!ftp_login(ftp, user, user_len, pass, pass_len)) { in PHP_FUNCTION()
231 if (*ftp->inbuf) { in PHP_FUNCTION()
232 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
245 ftpbuf_t *ftp; in PHP_FUNCTION() local
251 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
253 if (!(pwd = ftp_pwd(ftp))) { in PHP_FUNCTION()
254 if (*ftp->inbuf) { in PHP_FUNCTION()
255 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
268 ftpbuf_t *ftp; in PHP_FUNCTION() local
273 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
275 if (!ftp_cdup(ftp)) { in PHP_FUNCTION()
276 if (*ftp->inbuf) { in PHP_FUNCTION()
277 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
290 ftpbuf_t *ftp; in PHP_FUNCTION() local
297 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
300 if (!ftp_chdir(ftp, dir, dir_len)) { in PHP_FUNCTION()
301 if (*ftp->inbuf) { in PHP_FUNCTION()
302 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
315 ftpbuf_t *ftp; in PHP_FUNCTION() local
322 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
325 if (!ftp_exec(ftp, cmd, cmd_len)) { in PHP_FUNCTION()
326 if (*ftp->inbuf) { in PHP_FUNCTION()
327 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
340 ftpbuf_t *ftp; in PHP_FUNCTION() local
347 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
350 ftp_raw(ftp, cmd, cmd_len, return_value); in PHP_FUNCTION()
358 ftpbuf_t *ftp; in PHP_FUNCTION() local
366 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
369 if (NULL == (tmp = ftp_mkdir(ftp, dir, dir_len))) { in PHP_FUNCTION()
370 if (*ftp->inbuf) { in PHP_FUNCTION()
371 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
384 ftpbuf_t *ftp; in PHP_FUNCTION() local
391 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
394 if (!ftp_rmdir(ftp, dir, dir_len)) { in PHP_FUNCTION()
395 if (*ftp->inbuf) { in PHP_FUNCTION()
396 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
409 ftpbuf_t *ftp; in PHP_FUNCTION() local
417 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
419 if (!ftp_chmod(ftp, mode, filename, filename_len)) { in PHP_FUNCTION()
420 if (*ftp->inbuf) { in PHP_FUNCTION()
421 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
434 ftpbuf_t *ftp; in PHP_FUNCTION() local
441 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
443 ret = ftp_alloc(ftp, size, zresponse ? &response : NULL); in PHP_FUNCTION()
461 ftpbuf_t *ftp; in PHP_FUNCTION() local
468 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
471 if (NULL == (nlist = ftp_nlist(ftp, dir, dir_len))) { in PHP_FUNCTION()
487 ftpbuf_t *ftp; in PHP_FUNCTION() local
495 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
498 if (NULL == (llist = ftp_list(ftp, dir, dir_len, recursive))) { in PHP_FUNCTION()
514 ftpbuf_t *ftp; in PHP_FUNCTION() local
522 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
525 if (NULL == (llist = ftp_mlsd(ftp, dir, dir_len))) { in PHP_FUNCTION()
547 ftpbuf_t *ftp; in PHP_FUNCTION() local
553 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
555 if (NULL == (syst = ftp_syst(ftp))) { in PHP_FUNCTION()
556 if (*ftp->inbuf) { in PHP_FUNCTION()
557 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
570 ftpbuf_t *ftp; in PHP_FUNCTION() local
580 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
585 if (!ftp->autoseek && resumepos == PHP_FTP_AUTORESUME) { in PHP_FUNCTION()
589 if (ftp->autoseek && resumepos) { in PHP_FUNCTION()
599 if (!ftp_get(ftp, stream, file, file_len, xtype, resumepos)) { in PHP_FUNCTION()
600 if (*ftp->inbuf) { in PHP_FUNCTION()
601 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
614 ftpbuf_t *ftp; in PHP_FUNCTION() local
624 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
629 if (!ftp->autoseek && resumepos == PHP_FTP_AUTORESUME) { in PHP_FUNCTION()
633 if (ftp->autoseek && resumepos) { in PHP_FUNCTION()
644 ftp->direction = 0; /* recv */ in PHP_FUNCTION()
645 ftp->closestream = 0; /* do not close */ in PHP_FUNCTION()
647 if ((ret = ftp_nb_get(ftp, stream, file, file_len, xtype, resumepos)) == PHP_FTP_FAILED) { in PHP_FUNCTION()
648 if (*ftp->inbuf) { in PHP_FUNCTION()
649 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
662 ftpbuf_t *ftp; in PHP_FUNCTION() local
668 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
670 if (!ftp_pasv(ftp, pasv ? 1 : 0)) { in PHP_FUNCTION()
682 ftpbuf_t *ftp; in PHP_FUNCTION() local
692 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
696 if (!ftp->autoseek && resumepos == PHP_FTP_AUTORESUME) { in PHP_FUNCTION()
704 if (ftp->autoseek && resumepos) { in PHP_FUNCTION()
727 if (!ftp_get(ftp, outstream, remote, remote_len, xtype, resumepos)) { in PHP_FUNCTION()
730 if (*ftp->inbuf) { in PHP_FUNCTION()
731 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
745 ftpbuf_t *ftp; in PHP_FUNCTION() local
756 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
760 if (!ftp->autoseek && resumepos == PHP_FTP_AUTORESUME) { in PHP_FUNCTION()
766 if (ftp->autoseek && resumepos) { in PHP_FUNCTION()
790 ftp->direction = 0; /* recv */ in PHP_FUNCTION()
791 ftp->closestream = 1; /* do close */ in PHP_FUNCTION()
793 if ((ret = ftp_nb_get(ftp, outstream, remote, remote_len, xtype, resumepos)) == PHP_FTP_FAILED) { in PHP_FUNCTION()
795 ftp->stream = NULL; in PHP_FUNCTION()
797 if (*ftp->inbuf) { in PHP_FUNCTION()
798 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
805 ftp->stream = NULL; in PHP_FUNCTION()
816 ftpbuf_t *ftp; in PHP_FUNCTION() local
822 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
824 if (!ftp->nb) { in PHP_FUNCTION()
829 if (ftp->direction) { in PHP_FUNCTION()
830 ret=ftp_nb_continue_write(ftp); in PHP_FUNCTION()
832 ret=ftp_nb_continue_read(ftp); in PHP_FUNCTION()
835 if (ret != PHP_FTP_MOREDATA && ftp->closestream) { in PHP_FUNCTION()
836 php_stream_close(ftp->stream); in PHP_FUNCTION()
837 ftp->stream = NULL; in PHP_FUNCTION()
841 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
852 ftpbuf_t *ftp; in PHP_FUNCTION() local
862 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
867 if (!ftp->autoseek && startpos == PHP_FTP_AUTORESUME) { in PHP_FUNCTION()
871 if (ftp->autoseek && startpos) { in PHP_FUNCTION()
874 startpos = ftp_size(ftp, remote, remote_len); in PHP_FUNCTION()
884 if (!ftp_put(ftp, remote, remote_len, stream, xtype, startpos)) { in PHP_FUNCTION()
885 if (*ftp->inbuf) { in PHP_FUNCTION()
886 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
899 ftpbuf_t *ftp; in PHP_FUNCTION() local
910 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
915 if (!ftp->autoseek && startpos == PHP_FTP_AUTORESUME) { in PHP_FUNCTION()
919 if (ftp->autoseek && startpos) { in PHP_FUNCTION()
922 startpos = ftp_size(ftp, remote, remote_len); in PHP_FUNCTION()
933 ftp->direction = 1; /* send */ in PHP_FUNCTION()
934 ftp->closestream = 0; /* do not close */ in PHP_FUNCTION()
936 if (((ret = ftp_nb_put(ftp, remote, remote_len, stream, xtype, startpos)) == PHP_FTP_FAILED)) { in PHP_FUNCTION()
937 if (*ftp->inbuf) { in PHP_FUNCTION()
938 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
952 ftpbuf_t *ftp; in PHP_FUNCTION() local
962 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
970 if (!ftp->autoseek && startpos == PHP_FTP_AUTORESUME) { in PHP_FUNCTION()
974 if (ftp->autoseek && startpos) { in PHP_FUNCTION()
977 startpos = ftp_size(ftp, remote, remote_len); in PHP_FUNCTION()
987 if (!ftp_put(ftp, remote, remote_len, instream, xtype, startpos)) { in PHP_FUNCTION()
989 if (*ftp->inbuf) { in PHP_FUNCTION()
990 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
1004 ftpbuf_t *ftp; in PHP_FUNCTION() local
1014 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
1021 if (!ftp_append(ftp, remote, remote_len, instream, xtype)) { in PHP_FUNCTION()
1023 if (*ftp->inbuf) { in PHP_FUNCTION()
1024 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
1038 ftpbuf_t *ftp; in PHP_FUNCTION() local
1048 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
1056 if (!ftp->autoseek && startpos == PHP_FTP_AUTORESUME) { in PHP_FUNCTION()
1060 if (ftp->autoseek && startpos) { in PHP_FUNCTION()
1063 startpos = ftp_size(ftp, remote, remote_len); in PHP_FUNCTION()
1074 ftp->direction = 1; /* send */ in PHP_FUNCTION()
1075 ftp->closestream = 1; /* do close */ in PHP_FUNCTION()
1077 ret = ftp_nb_put(ftp, remote, remote_len, instream, xtype, startpos); in PHP_FUNCTION()
1081 ftp->stream = NULL; in PHP_FUNCTION()
1085 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
1096 ftpbuf_t *ftp; in PHP_FUNCTION() local
1103 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
1106 RETURN_LONG(ftp_size(ftp, file, file_len)); in PHP_FUNCTION()
1114 ftpbuf_t *ftp; in PHP_FUNCTION() local
1121 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
1124 RETURN_LONG(ftp_mdtm(ftp, file, file_len)); in PHP_FUNCTION()
1132 ftpbuf_t *ftp; in PHP_FUNCTION() local
1139 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
1142 if (!ftp_rename(ftp, src, src_len, dest, dest_len)) { in PHP_FUNCTION()
1143 if (*ftp->inbuf) { in PHP_FUNCTION()
1144 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
1157 ftpbuf_t *ftp; in PHP_FUNCTION() local
1164 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
1167 if (!ftp_delete(ftp, file, file_len)) { in PHP_FUNCTION()
1168 if (*ftp->inbuf) { in PHP_FUNCTION()
1169 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
1182 ftpbuf_t *ftp; in PHP_FUNCTION() local
1189 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
1192 if (!ftp_site(ftp, cmd, cmd_len)) { in PHP_FUNCTION()
1193 if (*ftp->inbuf) { in PHP_FUNCTION()
1194 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
1215 if (obj->ftp) { in PHP_FUNCTION()
1216 success = ftp_quit(obj->ftp); in PHP_FUNCTION()
1217 ftp_close(obj->ftp); in PHP_FUNCTION()
1218 obj->ftp = NULL; in PHP_FUNCTION()
1230 ftpbuf_t *ftp; in PHP_FUNCTION() local
1235 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
1247 ftp->timeout_sec = Z_LVAL_P(z_value); in PHP_FUNCTION()
1255 ftp->autoseek = Z_TYPE_P(z_value) == IS_TRUE ? 1 : 0; in PHP_FUNCTION()
1263 ftp->usepasvaddress = Z_TYPE_P(z_value) == IS_TRUE ? 1 : 0; in PHP_FUNCTION()
1279 ftpbuf_t *ftp; in PHP_FUNCTION() local
1284 GET_FTPBUF(ftp, z_ftp); in PHP_FUNCTION()
1288 RETURN_LONG(ftp->timeout_sec); in PHP_FUNCTION()
1291 RETURN_BOOL(ftp->autoseek); in PHP_FUNCTION()
1294 RETURN_BOOL(ftp->usepasvaddress); in PHP_FUNCTION()