mirror of
https://github.com/deployphp/deployer.git
synced 2025-02-24 09:12:51 +01:00
Merge pull request #727 from rlacerda83/ssh2_pty_option
Add pty option for ssh2 connection
This commit is contained in:
commit
4a90311244
@ -255,4 +255,17 @@ class Builder
|
|||||||
is_object($password) ? get_class($password) : gettype($password)
|
is_object($password) ? get_class($password) : gettype($password)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use pty in ssh2 connection
|
||||||
|
*
|
||||||
|
* @param $ssh2Pty
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function ssh2Pty($ssh2Pty)
|
||||||
|
{
|
||||||
|
$this->config->setSsh2Pty($ssh2Pty);
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -101,6 +101,14 @@ class Configuration
|
|||||||
*/
|
*/
|
||||||
private $pemFile;
|
private $pemFile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pty configuration for ssh2 connection
|
||||||
|
*
|
||||||
|
* @var mixed
|
||||||
|
*/
|
||||||
|
private $ssh2Pty = null;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct
|
* Construct
|
||||||
*
|
*
|
||||||
@ -412,4 +420,24 @@ class Configuration
|
|||||||
|
|
||||||
return $password;
|
return $password;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set pty for ssh2 connection
|
||||||
|
*
|
||||||
|
* @param $ssh2Pty
|
||||||
|
*/
|
||||||
|
public function setSsh2Pty($ssh2Pty)
|
||||||
|
{
|
||||||
|
$this->ssh2Pty = $ssh2Pty;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get pty option for ssh2 connection
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function getSsh2Pty()
|
||||||
|
{
|
||||||
|
return $this->ssh2Pty;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -113,7 +113,8 @@ class SshExtension implements ServerInterface
|
|||||||
{
|
{
|
||||||
$this->checkConnection();
|
$this->checkConnection();
|
||||||
|
|
||||||
return $this->session->getExec()->run($command);
|
$pty = $this->getConfiguration()->getSsh2Pty();
|
||||||
|
return $this->session->getExec()->run($command, $pty);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user