Conditions | 5 |
Paths | 6 |
Total Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
49 | public function execute() |
||
50 | { |
||
51 | $process = new Process(Config::getBinFile()." {$this->option} -- {$this->link}"); |
||
52 | $process->setTimeout(600); |
||
53 | if ($this->verbose) { |
||
54 | $process->run(function($type, $buffer) { |
||
55 | if (Process::ERR === $type) { |
||
56 | echo 'ERR > '.$buffer; |
||
57 | } else { |
||
58 | echo 'OUT > '.$buffer; |
||
59 | } |
||
60 | }); |
||
61 | } else { |
||
62 | ($this->async) ? $process->start() : $process->run(); |
||
63 | } |
||
64 | if (!$process->isSuccessful()) { |
||
65 | throw new YoutubedlException($process->getErrorOutput()); |
||
66 | } |
||
67 | |||
68 | return explode("\n", trim($process->getOutput())); |
||
69 | } |
||
70 | } |
||
71 |