Pantheon\Terminus\Models\Environment::sftpConnectionInfo PHP Method

sftpConnectionInfo() public method

Gives SFTP connection info for this environment
public sftpConnectionInfo ( ) : array
return array
    public function sftpConnectionInfo()
    {
        if (!empty($ssh_host = $this->getConfig()->get('ssh_host'))) {
            $username = "appserver.{$this->id}.{$this->site->id}";
            $hostname = $ssh_host;
        } elseif (strpos($this->getConfig()->get('host'), 'onebox') !== false) {
            $username = "appserver.{$this->id}.{$this->site->id}";
            $hostname = $this->getConfig()->get('host');
        } else {
            $username = "{$this->id}.{$this->site->id}";
            $hostname = "appserver.{$this->id}.{$this->site->id}.drush.in";
        }
        $password = 'Use your account password';
        $port = '2222';
        $url = "sftp://{$username}@{$hostname}:{$port}";
        $command = "sftp -o Port={$port} {$username}@{$hostname}";
        $info = ['username' => $username, 'host' => $hostname, 'port' => $port, 'password' => $password, 'url' => $url, 'command' => $command];
        return $info;
    }