Lines Matching refs:ftp
46 PHP_MINIT(ftp),
50 PHP_MINFO(ftp),
61 ftpbuf_t *ftp = (ftpbuf_t *)rsrc->ptr; in ZEND_GET_MODULE() local
63 ftp_close(ftp); in ZEND_GET_MODULE()
66 PHP_MINIT_FUNCTION(ftp) in PHP_MINIT_FUNCTION() argument
94 PHP_MINFO_FUNCTION(ftp) in PHP_MINFO_FUNCTION() argument
118 ftpbuf_t *ftp; in PHP_FUNCTION() local
134 if (!(ftp = ftp_open(host, (short)port, timeout_sec))) { in PHP_FUNCTION()
139 ftp->autoseek = FTP_DEFAULT_AUTOSEEK; in PHP_FUNCTION()
140 ftp->usepasvaddress = FTP_DEFAULT_USEPASVADDRESS; in PHP_FUNCTION()
143 ftp->use_ssl = 0; in PHP_FUNCTION()
146 RETURN_RES(zend_register_resource(ftp, le_ftpbuf)); in PHP_FUNCTION()
154 ftpbuf_t *ftp; in PHP_FUNCTION() local
170 if (!(ftp = ftp_open(host, (short)port, timeout_sec))) { in PHP_FUNCTION()
175 ftp->autoseek = FTP_DEFAULT_AUTOSEEK; in PHP_FUNCTION()
176 ftp->usepasvaddress = FTP_DEFAULT_USEPASVADDRESS; in PHP_FUNCTION()
178 ftp->use_ssl = 1; in PHP_FUNCTION()
180 RETURN_RES(zend_register_resource(ftp, le_ftpbuf)); in PHP_FUNCTION()
189 ftpbuf_t *ftp; in PHP_FUNCTION() local
197 if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) { in PHP_FUNCTION()
202 if (!ftp_login(ftp, user, user_len, pass, pass_len)) { in PHP_FUNCTION()
203 if (*ftp->inbuf) { in PHP_FUNCTION()
204 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
217 ftpbuf_t *ftp; in PHP_FUNCTION() local
224 if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) { in PHP_FUNCTION()
228 if (!(pwd = ftp_pwd(ftp))) { in PHP_FUNCTION()
229 if (*ftp->inbuf) { in PHP_FUNCTION()
230 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
243 ftpbuf_t *ftp; in PHP_FUNCTION() local
249 if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) { in PHP_FUNCTION()
253 if (!ftp_cdup(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
276 if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) { in PHP_FUNCTION()
281 if (!ftp_chdir(ftp, dir, dir_len)) { in PHP_FUNCTION()
282 if (*ftp->inbuf) { in PHP_FUNCTION()
283 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
296 ftpbuf_t *ftp; in PHP_FUNCTION() local
304 if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) { in PHP_FUNCTION()
309 if (!ftp_exec(ftp, cmd, cmd_len)) { in PHP_FUNCTION()
310 if (*ftp->inbuf) { in PHP_FUNCTION()
311 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
324 ftpbuf_t *ftp; in PHP_FUNCTION() local
332 if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) { in PHP_FUNCTION()
337 ftp_raw(ftp, cmd, cmd_len, return_value); in PHP_FUNCTION()
345 ftpbuf_t *ftp; in PHP_FUNCTION() local
354 if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) { in PHP_FUNCTION()
359 if (NULL == (tmp = ftp_mkdir(ftp, dir, dir_len))) { in PHP_FUNCTION()
360 if (*ftp->inbuf) { in PHP_FUNCTION()
361 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
374 ftpbuf_t *ftp; in PHP_FUNCTION() local
382 if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) { in PHP_FUNCTION()
387 if (!ftp_rmdir(ftp, dir, dir_len)) { in PHP_FUNCTION()
388 if (*ftp->inbuf) { in PHP_FUNCTION()
389 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
402 ftpbuf_t *ftp; in PHP_FUNCTION() local
411 if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) { in PHP_FUNCTION()
415 if (!ftp_chmod(ftp, mode, filename, filename_len)) { in PHP_FUNCTION()
416 if (*ftp->inbuf) { in PHP_FUNCTION()
417 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
430 ftpbuf_t *ftp; in PHP_FUNCTION() local
438 if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) { in PHP_FUNCTION()
442 ret = ftp_alloc(ftp, size, zresponse ? &response : NULL); in PHP_FUNCTION()
460 ftpbuf_t *ftp; in PHP_FUNCTION() local
468 if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) { in PHP_FUNCTION()
473 if (NULL == (nlist = ftp_nlist(ftp, dir, dir_len))) { in PHP_FUNCTION()
489 ftpbuf_t *ftp; in PHP_FUNCTION() local
498 if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) { in PHP_FUNCTION()
503 if (NULL == (llist = ftp_list(ftp, dir, dir_len, recursive))) { in PHP_FUNCTION()
519 ftpbuf_t *ftp; in PHP_FUNCTION() local
528 if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) { in PHP_FUNCTION()
533 if (NULL == (llist = ftp_mlsd(ftp, dir, dir_len))) { in PHP_FUNCTION()
555 ftpbuf_t *ftp; in PHP_FUNCTION() local
562 if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) { 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
592 if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) { in PHP_FUNCTION()
599 if (!ftp->autoseek && resumepos == PHP_FTP_AUTORESUME) { in PHP_FUNCTION()
603 if (ftp->autoseek && resumepos) { in PHP_FUNCTION()
613 if (!ftp_get(ftp, stream, file, file_len, xtype, resumepos)) { in PHP_FUNCTION()
614 if (*ftp->inbuf) { in PHP_FUNCTION()
615 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
628 ftpbuf_t *ftp; in PHP_FUNCTION() local
639 if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) { in PHP_FUNCTION()
646 if (!ftp->autoseek && resumepos == PHP_FTP_AUTORESUME) { in PHP_FUNCTION()
650 if (ftp->autoseek && resumepos) { in PHP_FUNCTION()
661 ftp->direction = 0; /* recv */ in PHP_FUNCTION()
662 ftp->closestream = 0; /* do not close */ in PHP_FUNCTION()
664 if ((ret = ftp_nb_get(ftp, stream, file, file_len, xtype, resumepos)) == PHP_FTP_FAILED) { in PHP_FUNCTION()
665 if (*ftp->inbuf) { in PHP_FUNCTION()
666 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
679 ftpbuf_t *ftp; in PHP_FUNCTION() local
686 if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) { in PHP_FUNCTION()
690 if (!ftp_pasv(ftp, pasv ? 1 : 0)) { in PHP_FUNCTION()
702 ftpbuf_t *ftp; in PHP_FUNCTION() local
713 if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) { in PHP_FUNCTION()
719 if (!ftp->autoseek && resumepos == PHP_FTP_AUTORESUME) { in PHP_FUNCTION()
727 if (ftp->autoseek && resumepos) { in PHP_FUNCTION()
750 if (!ftp_get(ftp, outstream, remote, remote_len, xtype, resumepos)) { in PHP_FUNCTION()
753 if (*ftp->inbuf) { in PHP_FUNCTION()
754 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
768 ftpbuf_t *ftp; in PHP_FUNCTION() local
780 if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) { in PHP_FUNCTION()
786 if (!ftp->autoseek && resumepos == PHP_FTP_AUTORESUME) { in PHP_FUNCTION()
792 if (ftp->autoseek && resumepos) { in PHP_FUNCTION()
816 ftp->direction = 0; /* recv */ in PHP_FUNCTION()
817 ftp->closestream = 1; /* do close */ in PHP_FUNCTION()
819 if ((ret = ftp_nb_get(ftp, outstream, remote, remote_len, xtype, resumepos)) == PHP_FTP_FAILED) { in PHP_FUNCTION()
821 ftp->stream = NULL; in PHP_FUNCTION()
823 if (*ftp->inbuf) { in PHP_FUNCTION()
824 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
831 ftp->stream = NULL; in PHP_FUNCTION()
842 ftpbuf_t *ftp; in PHP_FUNCTION() local
849 if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) { in PHP_FUNCTION()
853 if (!ftp->nb) { in PHP_FUNCTION()
858 if (ftp->direction) { in PHP_FUNCTION()
859 ret=ftp_nb_continue_write(ftp); in PHP_FUNCTION()
861 ret=ftp_nb_continue_read(ftp); in PHP_FUNCTION()
864 if (ret != PHP_FTP_MOREDATA && ftp->closestream) { in PHP_FUNCTION()
865 php_stream_close(ftp->stream); in PHP_FUNCTION()
866 ftp->stream = NULL; in PHP_FUNCTION()
870 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
881 ftpbuf_t *ftp; in PHP_FUNCTION() local
892 if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) { in PHP_FUNCTION()
899 if (!ftp->autoseek && startpos == PHP_FTP_AUTORESUME) { in PHP_FUNCTION()
903 if (ftp->autoseek && startpos) { in PHP_FUNCTION()
906 startpos = ftp_size(ftp, remote, remote_len); in PHP_FUNCTION()
916 if (!ftp_put(ftp, remote, remote_len, stream, xtype, startpos)) { in PHP_FUNCTION()
917 if (*ftp->inbuf) { in PHP_FUNCTION()
918 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
931 ftpbuf_t *ftp; in PHP_FUNCTION() local
943 if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) { in PHP_FUNCTION()
950 if (!ftp->autoseek && startpos == PHP_FTP_AUTORESUME) { in PHP_FUNCTION()
954 if (ftp->autoseek && startpos) { in PHP_FUNCTION()
957 startpos = ftp_size(ftp, remote, remote_len); in PHP_FUNCTION()
968 ftp->direction = 1; /* send */ in PHP_FUNCTION()
969 ftp->closestream = 0; /* do not close */ in PHP_FUNCTION()
971 if (((ret = ftp_nb_put(ftp, remote, remote_len, stream, xtype, startpos)) == PHP_FTP_FAILED)) { in PHP_FUNCTION()
972 if (*ftp->inbuf) { in PHP_FUNCTION()
973 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
987 ftpbuf_t *ftp; in PHP_FUNCTION() local
998 if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) { in PHP_FUNCTION()
1008 if (!ftp->autoseek && startpos == PHP_FTP_AUTORESUME) { in PHP_FUNCTION()
1012 if (ftp->autoseek && startpos) { in PHP_FUNCTION()
1015 startpos = ftp_size(ftp, remote, remote_len); in PHP_FUNCTION()
1025 if (!ftp_put(ftp, remote, remote_len, instream, xtype, startpos)) { in PHP_FUNCTION()
1027 if (*ftp->inbuf) { in PHP_FUNCTION()
1028 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
1042 ftpbuf_t *ftp; in PHP_FUNCTION() local
1053 if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) { in PHP_FUNCTION()
1062 if (!ftp_append(ftp, remote, remote_len, instream, xtype)) { in PHP_FUNCTION()
1064 if (*ftp->inbuf) { in PHP_FUNCTION()
1065 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
1079 ftpbuf_t *ftp; in PHP_FUNCTION() local
1090 if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) { in PHP_FUNCTION()
1100 if (!ftp->autoseek && startpos == PHP_FTP_AUTORESUME) { in PHP_FUNCTION()
1104 if (ftp->autoseek && startpos) { in PHP_FUNCTION()
1107 startpos = ftp_size(ftp, remote, remote_len); in PHP_FUNCTION()
1118 ftp->direction = 1; /* send */ in PHP_FUNCTION()
1119 ftp->closestream = 1; /* do close */ in PHP_FUNCTION()
1121 ret = ftp_nb_put(ftp, remote, remote_len, instream, xtype, startpos); in PHP_FUNCTION()
1125 ftp->stream = NULL; in PHP_FUNCTION()
1129 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
1140 ftpbuf_t *ftp; in PHP_FUNCTION() local
1148 if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) { in PHP_FUNCTION()
1153 RETURN_LONG(ftp_size(ftp, file, file_len)); in PHP_FUNCTION()
1161 ftpbuf_t *ftp; in PHP_FUNCTION() local
1169 if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) { in PHP_FUNCTION()
1174 RETURN_LONG(ftp_mdtm(ftp, file, file_len)); in PHP_FUNCTION()
1182 ftpbuf_t *ftp; in PHP_FUNCTION() local
1190 if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) { in PHP_FUNCTION()
1195 if (!ftp_rename(ftp, src, src_len, dest, dest_len)) { in PHP_FUNCTION()
1196 if (*ftp->inbuf) { in PHP_FUNCTION()
1197 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
1210 ftpbuf_t *ftp; in PHP_FUNCTION() local
1218 if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) { in PHP_FUNCTION()
1223 if (!ftp_delete(ftp, file, file_len)) { in PHP_FUNCTION()
1224 if (*ftp->inbuf) { in PHP_FUNCTION()
1225 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
1238 ftpbuf_t *ftp; in PHP_FUNCTION() local
1246 if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) { in PHP_FUNCTION()
1251 if (!ftp_site(ftp, cmd, cmd_len)) { in PHP_FUNCTION()
1252 if (*ftp->inbuf) { in PHP_FUNCTION()
1253 php_error_docref(NULL, E_WARNING, "%s", ftp->inbuf); in PHP_FUNCTION()
1266 ftpbuf_t *ftp; in PHP_FUNCTION() local
1272 if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) { in PHP_FUNCTION()
1276 ftp_quit(ftp); in PHP_FUNCTION()
1287 ftpbuf_t *ftp; in PHP_FUNCTION() local
1293 if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) { in PHP_FUNCTION()
1307 ftp->timeout_sec = Z_LVAL_P(z_value); in PHP_FUNCTION()
1315 ftp->autoseek = Z_TYPE_P(z_value) == IS_TRUE ? 1 : 0; in PHP_FUNCTION()
1323 ftp->usepasvaddress = Z_TYPE_P(z_value) == IS_TRUE ? 1 : 0; in PHP_FUNCTION()
1339 ftpbuf_t *ftp; in PHP_FUNCTION() local
1345 if ((ftp = (ftpbuf_t *)zend_fetch_resource(Z_RES_P(z_ftp), le_ftpbuf_name, le_ftpbuf)) == NULL) { in PHP_FUNCTION()
1351 RETURN_LONG(ftp->timeout_sec); in PHP_FUNCTION()
1354 RETURN_BOOL(ftp->autoseek); in PHP_FUNCTION()
1357 RETURN_BOOL(ftp->usepasvaddress); in PHP_FUNCTION()