| @@ 305-313 (lines=9) @@ | ||
| 302 | return $value; |
|
| 303 | } |
|
| 304 | ||
| 305 | if (false !== $shell = $this->getShell()) { |
|
| 306 | $output->write($question); |
|
| 307 | $readCmd = $shell === 'csh' ? 'set mypassword = $<' : 'read -r mypassword'; |
|
| 308 | $command = sprintf("/usr/bin/env %s -c 'stty -echo; %s; stty echo; echo \$mypassword'", $shell, $readCmd); |
|
| 309 | $value = rtrim(shell_exec($command)); |
|
| 310 | $output->writeln(''); |
|
| 311 | ||
| 312 | return $value; |
|
| 313 | } |
|
| 314 | ||
| 315 | if ($fallback) { |
|
| 316 | return $this->ask($output, $question); |
|
| @@ 329-336 (lines=8) @@ | ||
| 326 | return $value; |
|
| 327 | } |
|
| 328 | ||
| 329 | if (false !== $shell = $this->getShell()) { |
|
| 330 | $readCmd = $shell === 'csh' ? 'set mypassword = $<' : 'read -r mypassword'; |
|
| 331 | $command = sprintf("/usr/bin/env %s -c 'stty -echo; %s; stty echo; echo \$mypassword'", $shell, $readCmd); |
|
| 332 | $value = rtrim(shell_exec($command)); |
|
| 333 | $output->writeln(''); |
|
| 334 | ||
| 335 | return $value; |
|
| 336 | } |
|
| 337 | ||
| 338 | throw new \RuntimeException('Unable to hide the response.'); |
|
| 339 | } |
|