From 3fd785654372d493c031d9b541ab33a881023a32 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 26 Feb 2021 19:16:17 +0300 Subject: * switch to composer for qrcode and otp dependencies * move most OTP-related stuff into userhelper * remove old phpqrcode and otphp libraries --- .../thecodingmachine/safe/generated/readline.php | 157 +++++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 vendor/thecodingmachine/safe/generated/readline.php (limited to 'vendor/thecodingmachine/safe/generated/readline.php') diff --git a/vendor/thecodingmachine/safe/generated/readline.php b/vendor/thecodingmachine/safe/generated/readline.php new file mode 100644 index 000000000..a1c52c755 --- /dev/null +++ b/vendor/thecodingmachine/safe/generated/readline.php @@ -0,0 +1,157 @@ + + * ]]> + * + * + * + * @param string $prompt The prompt message. + * @param callable $callback The callback function takes one parameter; the + * user input returned. + * @throws ReadlineException + * + */ +function readline_callback_handler_install(string $prompt, callable $callback): void +{ + error_clear_last(); + $result = \readline_callback_handler_install($prompt, $callback); + if ($result === false) { + throw ReadlineException::createFromPhpError(); + } +} + + +/** + * This function clears the entire command line history. + * + * @throws ReadlineException + * + */ +function readline_clear_history(): void +{ + error_clear_last(); + $result = \readline_clear_history(); + if ($result === false) { + throw ReadlineException::createFromPhpError(); + } +} + + +/** + * This function registers a completion function. This is the same kind of + * functionality you'd get if you hit your tab key while using Bash. + * + * @param callable $function You must supply the name of an existing function which accepts a + * partial command line and returns an array of possible matches. + * @throws ReadlineException + * + */ +function readline_completion_function(callable $function): void +{ + error_clear_last(); + $result = \readline_completion_function($function); + if ($result === false) { + throw ReadlineException::createFromPhpError(); + } +} + + +/** + * This function reads a command history from a file. + * + * @param string $filename Path to the filename containing the command history. + * @throws ReadlineException + * + */ +function readline_read_history(string $filename = null): void +{ + error_clear_last(); + if ($filename !== null) { + $result = \readline_read_history($filename); + } else { + $result = \readline_read_history(); + } + if ($result === false) { + throw ReadlineException::createFromPhpError(); + } +} + + +/** + * This function writes the command history to a file. + * + * @param string $filename Path to the saved file. + * @throws ReadlineException + * + */ +function readline_write_history(string $filename = null): void +{ + error_clear_last(); + if ($filename !== null) { + $result = \readline_write_history($filename); + } else { + $result = \readline_write_history(); + } + if ($result === false) { + throw ReadlineException::createFromPhpError(); + } +} -- cgit v1.2.3-54-g00ecf