| @@ 32-40 (lines=9) @@ | ||
| 29 | * |
|
| 30 | * @return string |
|
| 31 | */ |
|
| 32 | public function run() |
|
| 33 | { |
|
| 34 | $this->process->run(); |
|
| 35 | if (!$this->process->isSuccessful()) { |
|
| 36 | throw new \RuntimeException($this->process->getErrorOutput()); |
|
| 37 | } |
|
| 38 | ||
| 39 | return $this->process->getOutput(); |
|
| 40 | } |
|
| 41 | ||
| 42 | /** |
|
| 43 | * Asynchronously start mediainfo operation. |
|
| @@ 61-71 (lines=11) @@ | ||
| 58 | * |
|
| 59 | * @return string |
|
| 60 | */ |
|
| 61 | public function wait() |
|
| 62 | { |
|
| 63 | // blocks here until process completes |
|
| 64 | $this->process->wait(); |
|
| 65 | ||
| 66 | if (!$this->process->isSuccessful()) { |
|
| 67 | throw new \RuntimeException($this->process->getErrorOutput()); |
|
| 68 | } |
|
| 69 | ||
| 70 | return $this->process->getOutput(); |
|
| 71 | } |
|
| 72 | } |
|
| 73 | ||