Skip to content

Commit 53e5c9b

Browse files
authored
Add new sshConnectionInfo and make sftpConnectionInfo call it. (#2719)
* Add new purpose param to sftpConnectionInfo function. * Add new function. * Missed renames. * Coding standards.
1 parent 7639496 commit 53e5c9b

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

src/Commands/Remote/SSHBaseCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ private function getCommandSummary($command_args)
376376
*/
377377
private function getConnectionString()
378378
{
379-
$sftp = $this->environment->sftpConnectionInfo();
379+
$ssh = $this->environment->sshConnectionInfo();
380380
$command = $this->getConfig()->get('ssh_command');
381381
if ($this->output()->isDebug()) {
382382
$command .= ' -vvv';
@@ -387,7 +387,7 @@ private function getConnectionString()
387387
}
388388
return vsprintf(
389389
'%s -T %s@%s -p %s -o "StrictHostKeyChecking=no" -o "AddressFamily inet"',
390-
[$command, $sftp['username'], $this->lookupHostViaAlternateNameserver($sftp['host']), $sftp['port']]
390+
[$command, $ssh['username'], $this->lookupHostViaAlternateNameserver($ssh['host']), $ssh['port']]
391391
);
392392
}
393393

src/Models/Environment.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -985,16 +985,24 @@ public function setHttpsCertificate($certificate = [])
985985
}
986986

987987
/**
988-
* Gives SFTP connection info for this environment
989-
*
990-
* @return array
988+
* Gives sftp connection info for this environment.
991989
*/
992990
public function sftpConnectionInfo()
993991
{
994992
if ($this->isEvcsSite()) {
995993
// No SFTP for EVCS sites
996994
return [];
997995
}
996+
return $this->sshConnectionInfo();
997+
}
998+
999+
/**
1000+
* Gives ssh connection info for this environment
1001+
*
1002+
* @return array
1003+
*/
1004+
public function sshConnectionInfo()
1005+
{
9981006
$site = $this->getSite();
9991007
if (!empty($ssh_host = $this->getConfig()->get('ssh_host'))) {
10001008
$username = "appserver.{$this->id}.{$site->id}";

0 commit comments

Comments
 (0)