ftpStart and ftpEnd functions added

This commit is contained in:
Matt Pass
2015-08-19 06:34:51 +01:00
parent 78ddfe61ba
commit 41592007b9

View File

@@ -1,4 +1,23 @@
<?php
// Start a FTP connection
function ftpStart() {
global $ftpConn, $ftpLogin, $ftpHost, $ftpUser, $ftpPass, $ftpPasv;
// Establish connection, login and maybe use pasv
$ftpConn = ftp_connect($ftpHost);
$ftpLogin = ftp_login($ftpConn, $ftpUser, $ftpPass);
if ($ftpPasv) {
ftp_pasv($ftpConn, true);
}
}
// End a FTP connection
function ftpEnd() {
global $ftpConn;
ftp_close($ftpConn);
}
// Get dir/file lists (simple and detailed) from FTP detailed rawlist response
function ftpGetList($ftpConn, $directory = '.') {
$simpleList = $detailedList = array();