/** * Etablish a ftp-connection, cache connection-object * @param string $server Address of the ftp-server * @param string $port Port of the ftp-server * @param string $user for the connection * @param string $pass Password for the connection * @param string StartDirectory, where to change dir to. */ function getFTPConnection($server, $port, $user, $pass, $startdir) { $ftpConn = new ftp(); $ftpConn->ftp_connect($server, $port); $ftpConn->ftp_login($user, $pass); $ftpConn->ftp_chdir($startdir); return $ftpConn; }