private function generateUploadCmd(Torrent $torrent) { $command = sprintf("sftp -oIdentityFile=%s %s@%s <<EOF\nlcd '%s/" . $torrent->getName() . "'\ncd '%s'\nmkdir '" . $torrent->getName() . "'\nput -r . '" . $torrent->getName() . "'\nEOF", $this->params->getSftpIdentityfile(), $this->params->getSftpUser(), $this->params->getSftpHost(), $this->params->getDirLocal(), $this->params->getDirRemote()); return $command; }