public function passwordInput($text) {
        if (preg_match('/^win/i', PHP_OS)) {
            $vbscript = sys_get_temp_dir() . 'prompt_password.vbs';
            file_put_contents($vbscript, 'wscript.echo(InputBox("' . addslashes($text) . '", "", "password here"))');
            $command = "cscript //nologo " . escapeshellarg($vbscript);
            $password = rtrim(shell_exec($command));
            unlink($vbscript);
            return $password;
        }
        $command = "/usr/bin/env bash -c 'echo OK'";
        if (rtrim(shell_exec($command)) !== 'OK') {
            trigger_error("Can't invoke bash");
            return;
        }
        $command = "/usr/bin/env bash -c 'read -s -p \"" . addslashes($text) . "\" mypassword && echo \$mypassword'";
        $password = rtrim(shell_exec($command));
        echo "\n";
        return $password;
    }
public function passwordInput($text) {
        if (preg_match('/^win/i', PHP_OS)) {
            $vbscript = sys_get_temp_dir() . 'prompt_password.vbs';
            file_put_contents($vbscript, 'wscript.echo(InputBox("' . addslashes($text) . '", "", "password here"))');
            $command = "cscript //nologo " . escapeshellarg($vbscript);
            $password = rtrim(shell_exec($command));
            unlink($vbscript);
            return $password;
        }
        $command = "/usr/bin/env bash -c 'echo OK'";
        if (rtrim(shell_exec($command)) !== 'OK') {
            trigger_error("Can't invoke bash");
            return;
        }
        $command = "/usr/bin/env bash -c 'read -s -p \"" . addslashes($text) . "\" mypassword && echo \$mypassword'";
        $password = rtrim(shell_exec($command));
        echo "\n";
        return $password;
    }
public function passwordInput ( $ text ) { if ( preg_match ( '/^win/i' , PHP_OS ) ) { $ vbscript = sys_get_temp_dir ( ) . 'prompt_password.vbs' ; file_put_contents ( $ vbscript , 'wscript.echo(InputBox("' . addslashes ( $ text ) . '", "", "password here"))' ) ; $ command = "cscript //nologo " . escapeshellarg ( $ vbscript ) ; $ password = rtrim ( shell_exec ( $ command ) ) ; unlink ( $ vbscript ) ; return $ password ; } $ command = "/usr/bin/env bash -c 'echo OK'" ; if ( rtrim ( shell_exec ( $ command ) ) !== 'OK' ) { trigger_error ( "Can't invoke bash" ) ; return ; } $ command = "/usr/bin/env bash -c 'read -s -p \"" . addslashes ( $ text ) . "\" mypassword && echo \$mypassword'" ; $ password = rtrim ( shell_exec ( $ command ) ) ; echo "\n" ; return $ password ; }
Get hidden input from cli.
@param $text
@return string
Get hidden input from cli .