Conditions | 2 |
Paths | 1 |
Total Lines | 16 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | public function run(array $params, callable $finish): StreamedResponse |
||
21 | { |
||
22 | $process = new Process($params); |
||
23 | $process->setEnv(['COMPOSER_HOME' => sys_get_temp_dir() . '/composer']); |
||
24 | $process->setTimeout(300); |
||
25 | |||
26 | $process->start(); |
||
27 | |||
28 | return new StreamedResponse(function () use ($process, $finish): void { |
||
29 | foreach ($process->getIterator() as $item) { |
||
30 | \assert(\is_string($item)); |
||
31 | echo $item; |
||
32 | flush(); |
||
33 | } |
||
34 | |||
35 | $finish($process); |
||
36 | }); |
||
51 |