login($username, $password)) { return $sftp; } return 'Ошибка: Не удалось соединиться с сервером!'; } public function open($sftp, $command) { return $sftp->get($command); } public function write($sftp, $command, $file) { return $sftp->put($command, $file); } public function files($sftp, $path) { return @$sftp->nlist($path); } public function get($sftp, $path, $fun) { return @$sftp->$fun($path); } } ?>