1 | <?php |
||
14 | class ProcessOutputPrinter |
||
15 | { |
||
16 | /** |
||
17 | * @var OutputInterface |
||
18 | */ |
||
19 | private $output; |
||
20 | |||
21 | /** |
||
22 | * @var Logger |
||
23 | */ |
||
24 | private $logger; |
||
25 | |||
26 | public function __construct(OutputInterface $output, Logger $logger) |
||
31 | |||
32 | /** |
||
33 | * Returns a callable for use with the symfony Process->run($callable) method. |
||
34 | * |
||
35 | * @return callable A function expecting a int $type (e.g. Process::OUT or Process::ERR) and string $buffer parameters. |
||
36 | */ |
||
37 | public function callback(string $hostname) |
||
45 | |||
46 | public function command(string $hostname, string $command) |
||
54 | |||
55 | /** |
||
56 | * @param int $type Process::OUT or Process::ERR |
||
57 | * @param string $hostname for debugging |
||
58 | * @param string $line to print |
||
59 | */ |
||
60 | public function writeln($type, $hostname, $line) |
||
89 | |||
90 | /** |
||
91 | * This filtering used only in Ssh\Client, but for simplify putted here. |
||
92 | * |
||
93 | * @param string $output |
||
94 | * @return string |
||
95 | */ |
||
96 | public function filterOutput($output) |
||
100 | } |
||
101 |