We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4be110a commit 2c6fbdaCopy full SHA for 2c6fbda
src/SSHConnection.php
@@ -18,6 +18,7 @@ class SSHConnection
18
private $username;
19
private $password;
20
private $privateKeyPath;
21
+ private $timeout;
22
private $connected = false;
23
private $ssh;
24
@@ -51,6 +52,12 @@ public function withPrivateKey(string $privateKeyPath): self
51
52
return $this;
53
}
54
55
+ public function timeout(int $timeout): self
56
+ {
57
+ $this->timeout = $timeout;
58
+ return $this;
59
+ }
60
+
61
private function sanityCheck()
62
{
63
if (!$this->hostname) {
@@ -92,6 +99,10 @@ public function connect(): self
92
99
93
100
94
101
102
+ if ($this->timeout) {
103
+ $this->ssh->setTimeout($this->timeout);
104
105
95
106
$this->connected = true;
96
107
97
108
0 commit comments