1 | <?php |
||
21 | class SSH extends AbstractProtocol |
||
22 | { |
||
23 | /** |
||
24 | * @var string |
||
25 | */ |
||
26 | protected $executable = "ssh"; |
||
27 | |||
28 | /** |
||
29 | * @var string |
||
30 | */ |
||
31 | protected $host; |
||
32 | |||
33 | /** |
||
34 | * @var int |
||
35 | */ |
||
36 | protected $port = 22; |
||
37 | |||
38 | /** |
||
39 | * @var string |
||
40 | */ |
||
41 | protected $username; |
||
42 | |||
43 | /** |
||
44 | * @var null |
||
45 | */ |
||
46 | protected $publicKey = null; |
||
47 | |||
48 | /** |
||
49 | * @var string |
||
50 | */ |
||
51 | protected $strictHostKeyCheking = null; |
||
52 | |||
53 | /** |
||
54 | * @var string |
||
55 | */ |
||
56 | protected $userKnownHostsFile = null; |
||
57 | |||
58 | /** |
||
59 | * Injects and validates config |
||
60 | * |
||
61 | * @param array $options |
||
62 | */ |
||
63 | public function __construct(array $options = array()) |
||
73 | |||
74 | /** |
||
75 | * @param $host |
||
76 | */ |
||
77 | public function setHost($host) |
||
81 | |||
82 | /** |
||
83 | * @return mixed |
||
84 | */ |
||
85 | public function getHost() |
||
89 | |||
90 | /** |
||
91 | * @param $port |
||
92 | * |
||
93 | * @throws \InvalidArgumentException If the port is not numeric |
||
94 | */ |
||
95 | public function setPort($port) |
||
103 | |||
104 | /** |
||
105 | * @return int |
||
106 | */ |
||
107 | public function getPort() |
||
111 | |||
112 | /** |
||
113 | * @param $publicKey |
||
114 | * @throws \InvalidArgumentException |
||
115 | */ |
||
116 | public function setPublicKey($publicKey) |
||
124 | |||
125 | /** |
||
126 | * @return null |
||
127 | */ |
||
128 | public function getPublicKey() |
||
132 | |||
133 | /** |
||
134 | * @param $username |
||
135 | */ |
||
136 | public function setUsername($username) |
||
140 | |||
141 | /** |
||
142 | * @return mixed |
||
143 | */ |
||
144 | public function getUsername() |
||
148 | |||
149 | /** |
||
150 | * @param $string |
||
151 | * @throws \InvalidArgumentException |
||
152 | */ |
||
153 | public function setStrictHostKeyChecking($strictHostKeyCheking) |
||
161 | |||
162 | /** |
||
163 | * @return $string |
||
|
|||
164 | */ |
||
165 | public function getStrictHostKeyChecking($strictHostKeyCheking) |
||
169 | |||
170 | /** |
||
171 | * @param $string |
||
172 | */ |
||
173 | public function setUserKnownHostFile($userKnownHostsFile) |
||
177 | |||
178 | /** |
||
179 | * @return $string |
||
180 | */ |
||
181 | public function getUserKnownHostFile($userKnownHostFile) |
||
185 | |||
186 | /** |
||
187 | * Gets commands for this SSH connection |
||
188 | * |
||
189 | * @param bool $hostConnection |
||
190 | * |
||
191 | * @return string |
||
192 | * |
||
193 | * @throws \InvalidArgumentException If you don't specify a SSH username or host |
||
194 | */ |
||
195 | public function getCommand($hostConnection = true) |
||
229 | |||
230 | /** |
||
231 | * Gets only connection options, without user@host string |
||
232 | * |
||
233 | * @return string |
||
234 | */ |
||
235 | public function getConnectionOptions() |
||
239 | |||
240 | /** |
||
241 | * Gets only host connection, without the rest |
||
242 | * of options |
||
243 | * |
||
244 | * @return string |
||
245 | */ |
||
246 | public function getHostConnection() |
||
250 | |||
251 | /** |
||
252 | * @param $executable |
||
253 | */ |
||
254 | public function setExecutable($executable) |
||
258 | |||
259 | /** |
||
260 | * @return string |
||
261 | */ |
||
262 | public function getExecutable() |
||
266 | } |
||
267 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.