CLIFramework
CLIFramework copied to clipboard
Implement PasswordPrompter
From issue #3
On Linux (CentOS 6.7 and Linux Mint 17.2) even with the use of shell_exec('stty -echo'); the readline function the password prompt was displaying the password.
I was able to fix by altering IO/UnixStty.php and Prompter.php to incorporate code from http://www.dasprids.de/blog/2008/08/22/getting-a-password-hidden-from-stdin-with-php-cli which provides a masking character (*).
If masking isn't required then the following can be used within IO/ReadlineConsole.php in the readPassword function instead of the call to doReadLine
echo $prompt;
$password = fgets(STDIN);
echo "\n";