1
0
Fork 0
pull/830/head
Smasty 2012-06-24 13:00:35 +03:00
parent bd83eb93bf
commit 58f0d4aeac
1 changed files with 3 additions and 3 deletions

View File

@ -164,13 +164,13 @@ class ConsoleIO implements IOInterface
// handle other OSs with bash/zsh/ksh/csh if available to hide the answer
$test = "/usr/bin/env %s -c 'echo OK' 2> /dev/null";
foreach(array('bash', 'zsh', 'ksh', 'csh') as $sh){
if('OK' === rtrim(shell_exec(sprintf($test, $sh)))){
foreach (array('bash', 'zsh', 'ksh', 'csh') as $sh) {
if ('OK' === rtrim(shell_exec(sprintf($test, $sh)))) {
$shell = $sh;
break;
}
}
if(isset($shell)){
if (isset($shell)) {
$this->write($question, false);
$readCmd = ($shell === 'csh') ? 'set mypassword = $<' : 'read mypassword';
$command = sprintf("/usr/bin/env %s -c 'stty -echo; %s; stty echo; echo \$mypassword'", $shell, $readCmd);