|
|
@ -65,7 +65,7 @@ class ConsoleIO implements IOInterface
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* {@inheritDoc}
|
|
|
|
* {@inheritDoc}
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public function overwrite($messages, $size = 80, $newline = false)
|
|
|
|
public function overwrite($messages, $newline = true, $size = 80)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
for ($place = $size; $place > 0; $place--) {
|
|
|
|
for ($place = $size; $place > 0; $place--) {
|
|
|
|
$this->write("\x08", false);
|
|
|
|
$this->write("\x08", false);
|
|
|
@ -124,16 +124,16 @@ class ConsoleIO implements IOInterface
|
|
|
|
. addslashes($question) . '", ""))');
|
|
|
|
. addslashes($question) . '", ""))');
|
|
|
|
$command = "cscript //nologo " . escapeshellarg($vbscript);
|
|
|
|
$command = "cscript //nologo " . escapeshellarg($vbscript);
|
|
|
|
|
|
|
|
|
|
|
|
$this->write($question);
|
|
|
|
$this->write($question, false);
|
|
|
|
|
|
|
|
|
|
|
|
$value = rtrim(shell_exec($command));
|
|
|
|
$value = rtrim(shell_exec($command));
|
|
|
|
unlink($vbscript);
|
|
|
|
unlink($vbscript);
|
|
|
|
|
|
|
|
|
|
|
|
for ($i = 0; $i < strlen($value); ++$i) {
|
|
|
|
for ($i = 0; $i < strlen($value); ++$i) {
|
|
|
|
$this->write('*');
|
|
|
|
$this->write('*', false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$this->writeln('');
|
|
|
|
$this->write('');
|
|
|
|
|
|
|
|
|
|
|
|
return $value;
|
|
|
|
return $value;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -142,22 +142,22 @@ class ConsoleIO implements IOInterface
|
|
|
|
if (rtrim(shell_exec($command)) === 'OK') {
|
|
|
|
if (rtrim(shell_exec($command)) === 'OK') {
|
|
|
|
$command = "/usr/bin/env bash -c 'echo OK'";
|
|
|
|
$command = "/usr/bin/env bash -c 'echo OK'";
|
|
|
|
|
|
|
|
|
|
|
|
$this->write($question);
|
|
|
|
$this->write($question, false);
|
|
|
|
|
|
|
|
|
|
|
|
$command = "/usr/bin/env bash -c 'read -s mypassword && echo \$mypassword'";
|
|
|
|
$command = "/usr/bin/env bash -c 'read -s mypassword && echo \$mypassword'";
|
|
|
|
$value = rtrim(shell_exec($command));
|
|
|
|
$value = rtrim(shell_exec($command));
|
|
|
|
|
|
|
|
|
|
|
|
for ($i = 0; $i < strlen($value); ++$i) {
|
|
|
|
for ($i = 0; $i < strlen($value); ++$i) {
|
|
|
|
$this->write('*');
|
|
|
|
$this->write('*', false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$this->writeln('');
|
|
|
|
$this->write('');
|
|
|
|
|
|
|
|
|
|
|
|
return $value;
|
|
|
|
return $value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// for other OS without shell_exec (does not hide the answer)
|
|
|
|
// for other OS without shell_exec (does not hide the answer)
|
|
|
|
$this->writeln('');
|
|
|
|
$this->write('');
|
|
|
|
|
|
|
|
|
|
|
|
return $this->ask($question);
|
|
|
|
return $this->ask($question);
|
|
|
|
}
|
|
|
|
}
|
|
|
|