| @@ 75-86 (lines=12) @@ | ||
| 72 | * @throws \RuntimeException |
|
| 73 | * @return mixed|string |
|
| 74 | */ |
|
| 75 | public function getOptionLog(InputInterface $input) |
|
| 76 | { |
|
| 77 | $log = $input->getOption('log'); |
|
| 78 | if (!$log && 0 === ftell(STDIN)) { |
|
| 79 | $log = ''; |
|
| 80 | while (!feof(STDIN)) { |
|
| 81 | $log .= fread(STDIN, 1024); |
|
| 82 | } |
|
| 83 | } |
|
| 84 | ||
| 85 | return $log; |
|
| 86 | } |
|
| 87 | ||
| 88 | /** |
|
| 89 | * @param GuzzleHttp\ClientInterface $client |
|
| @@ 81-96 (lines=16) @@ | ||
| 78 | * @throws \RuntimeException |
|
| 79 | * @return string |
|
| 80 | */ |
|
| 81 | private function getMonitorArgument(InputInterface $input) |
|
| 82 | { |
|
| 83 | $monitor = $input->getArgument('monitor'); |
|
| 84 | if (!$monitor && 0 === ftell(STDIN)) { |
|
| 85 | $monitor = ''; |
|
| 86 | while (!feof(STDIN)) { |
|
| 87 | $monitor .= fread(STDIN, 1024); |
|
| 88 | } |
|
| 89 | } |
|
| 90 | ||
| 91 | if (!$monitor) { |
|
| 92 | throw new \RuntimeException('Please provide a command or pipe content to STDIN.'); |
|
| 93 | } |
|
| 94 | ||
| 95 | return $monitor; |
|
| 96 | } |
|
| 97 | ||
| 98 | /** |
|
| 99 | * @param GuzzleHttp\ClientInterface $client |
|