Conditions | 2 |
Paths | 2 |
Total Lines | 8 |
Code Lines | 6 |
Lines | 8 |
Ratio | 100 % |
Changes | 0 |
1 | <?php |
||
43 | View Code Duplication | protected function runSSH($command, $server = null) |
|
44 | { |
||
45 | $server = $server ? $server : $this->hostNameForConfigFile(); |
||
46 | $ssh_config_file = $_SERVER['HOME'] . '/.ssh/config'; |
||
47 | $full_command = "ssh -F $ssh_config_file -t $server '$command'"; |
||
48 | $this->info($full_command); |
||
49 | passthru($full_command); |
||
50 | } |
||
51 | |||
69 |
Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable: