@@ 286-303 (lines=18) @@ | ||
283 | return $value; |
|
284 | } |
|
285 | ||
286 | if ($this->hasSttyAvailable()) { |
|
287 | $output->write($question); |
|
288 | ||
289 | $sttyMode = shell_exec('stty -g'); |
|
290 | ||
291 | shell_exec('stty -echo'); |
|
292 | $value = fgets($this->inputStream ?: STDIN, 4096); |
|
293 | shell_exec(sprintf('stty %s', $sttyMode)); |
|
294 | ||
295 | if (false === $value) { |
|
296 | throw new \RuntimeException('Aborted'); |
|
297 | } |
|
298 | ||
299 | $value = trim($value); |
|
300 | $output->writeln(''); |
|
301 | ||
302 | return $value; |
|
303 | } |
|
304 | ||
305 | if (false !== $shell = $this->getShell()) { |
|
306 | $output->write($question); |
@@ 312-327 (lines=16) @@ | ||
309 | return $value; |
|
310 | } |
|
311 | ||
312 | if ($this->hasSttyAvailable()) { |
|
313 | $sttyMode = shell_exec('stty -g'); |
|
314 | ||
315 | shell_exec('stty -echo'); |
|
316 | $value = fgets($inputStream, 4096); |
|
317 | shell_exec(sprintf('stty %s', $sttyMode)); |
|
318 | ||
319 | if (false === $value) { |
|
320 | throw new \RuntimeException('Aborted'); |
|
321 | } |
|
322 | ||
323 | $value = trim($value); |
|
324 | $output->writeln(''); |
|
325 | ||
326 | return $value; |
|
327 | } |
|
328 | ||
329 | if (false !== $shell = $this->getShell()) { |
|
330 | $readCmd = $shell === 'csh' ? 'set mypassword = $<' : 'read -r mypassword'; |