1 | <?php |
||
10 | class SshClient |
||
11 | { |
||
12 | const DEFAULT_USERNAME = 'docker'; |
||
13 | const DEFAULT_PASSWORD = 'tcuser'; |
||
14 | |||
15 | /** |
||
16 | * @var \Ssh\Session |
||
17 | */ |
||
18 | private $session; |
||
19 | |||
20 | /** |
||
21 | * @var Exec |
||
22 | */ |
||
23 | private $exec; |
||
24 | |||
25 | /** |
||
26 | * @var Machine |
||
27 | */ |
||
28 | private $machine; |
||
29 | |||
30 | /** |
||
31 | * @param Machine $machine |
||
32 | */ |
||
33 | public function __construct(Machine $machine) |
||
37 | |||
38 | /** |
||
39 | * @param string $command |
||
40 | * |
||
41 | * @return string |
||
42 | */ |
||
43 | public function run($command) |
||
51 | |||
52 | /** |
||
53 | * @param string $command |
||
54 | * |
||
55 | * @return bool |
||
56 | */ |
||
57 | public function runAndCheckOutputWasGenerated($command) |
||
67 | |||
68 | /** |
||
69 | * @return \Ssh\Sftp |
||
70 | */ |
||
71 | public function getSftp() |
||
72 | { |
||
73 | return $this->getSession()->getSftp(); |
||
74 | } |
||
75 | |||
76 | /** |
||
77 | * @return Session |
||
78 | */ |
||
79 | private function getSession() |
||
92 | } |
||
93 |