private function login()
{
extract($this->config);
$this->link = ftp_connect($host, $port, $timeout);
if ($this->link) {
if (ftp_login($this->link, $username, $password)) {
return true;
} else {
$this->error = "无法登录到FTP服务器:username - {$username}";
}
} else {
$this->error = "无法连接到FTP服务器:{$host}";
}
return false;
}