function get_ftp_content($source, $target) { $result = false; $config = array('hostname' => FTP_HOST, 'username' => FTP_USER, 'password' => FTP_PASSWORD, 'port' => FTP_PORT, 'timeout' => FTP_TIMEOUT); $ftp = new Ftp(); $ftp->connect($config); if ($ftp->existsFile($source)) { $result = $ftp->download($source, $target); } else { access_log('log', 'No documents.'); //clear_file(); } $ftp->close(); return $result; }