Skip to content

Commit 4159200

Browse files
committed
ftpStart and ftpEnd functions added
1 parent 78ddfe6 commit 4159200

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

lib/ftp-control.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
11
<?php
2+
// Start a FTP connection
3+
function ftpStart() {
4+
global $ftpConn, $ftpLogin, $ftpHost, $ftpUser, $ftpPass, $ftpPasv;
5+
6+
// Establish connection, login and maybe use pasv
7+
$ftpConn = ftp_connect($ftpHost);
8+
$ftpLogin = ftp_login($ftpConn, $ftpUser, $ftpPass);
9+
if ($ftpPasv) {
10+
ftp_pasv($ftpConn, true);
11+
}
12+
}
13+
14+
// End a FTP connection
15+
function ftpEnd() {
16+
global $ftpConn;
17+
18+
ftp_close($ftpConn);
19+
}
20+
221
// Get dir/file lists (simple and detailed) from FTP detailed rawlist response
322
function ftpGetList($ftpConn, $directory = '.') {
423
$simpleList = $detailedList = array();

0 commit comments

Comments
 (0)