Altax\Module\Task\Process\Process::getSFTP PHP Method

getSFTP() protected method

protected getSFTP ( )
    protected function getSFTP()
    {
        $sftp = new \Net_SFTP($this->node->getHostOrDefault(), $this->node->getPortOrDefault());
        $key = new \Crypt_RSA();
        $key->loadKey($this->node->getKeyContents());
        if (!$sftp->login($this->node->getUsernameOrDefault(), $key)) {
            throw new \RuntimeException('Unable to login ' . $this->node->getName());
        }
        return $sftp;
    }