/** * ファイルアップロード * * @param string localpath * @param string Remotepath * @return boolean */ function upload($localpath, $rempath) { if (!$this->_is_conn()) { return FALSE; } $this->changeidir(); return parent::upload($localpath, $rempath); }
unset($filelist[$i]); } else { //将备份的文件记入日志,上线时统一删除 $example->add_log($filelist[$i] . '.bak' . "\n<br/>", 'remotebackup.log'); } } else { $logmessage = "MESSAGE: 文件 " . $filelist[$i] . " 不存在或者是新添加的。\n<br/>"; $example->add_log($logmessage); } } //同步本地目录到远程 for ($i = 0; $i < count($filelist); $i++) { echo str_pad('', 4096); ob_flush(); flush(); if (!$example->upload('../example/' . $filelist[$i], $filelist[$i])) { $logmessage = "FAILD : 文件 " . $filelist[$i] . " 上传失败!\n<br/>"; //失败文件记录 $faildlist[] = $filelist[$i]; echo $logmessage; $example->add_log($logmessage); unset($filelist[$i]); } else { $temp = $i + 1; $logmessage = "<font color='red'>SUCCESS: 文件 " . $filelist[$i] . " 上传成功![ " . $temp . " ]</font>\n<br/>"; echo $logmessage; $example->add_log($logmessage); } } $example->add_log("<br/>\n"); //删除远程备份的文件