X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=scripts%2Fconsole.php;h=44f3934a1fcff1a8f20b8808230a6642595d4205;hb=eaa1b62053a52ab247f1bc7f50d6e0739befc2cb;hp=8b62a3a96783d7a7442326f33007d4f859e8d4f3;hpb=fdb64eed2f1d24ad38fe4a6bc680e3592647c0a6;p=quix0rs-gnu-social.git diff --git a/scripts/console.php b/scripts/console.php index 8b62a3a967..44f3934a1f 100755 --- a/scripts/console.php +++ b/scripts/console.php @@ -18,7 +18,7 @@ * along with this program. If not, see . */ -# Abort if called from a web server +// Abort if called from a web server define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); @@ -27,7 +27,7 @@ console.php - provide an interactive PHP interpreter for testing ENDOFHELP; -require_once INSTALLDIR.'/scripts/commandline.inc'; +require_once INSTALLDIR.'/scripts/commandline.inc.php'; // Assume we're on a terminal if on Windows, otherwise posix_isatty tells us. define('CONSOLE_INTERACTIVE', !function_exists('posix_isatty') || posix_isatty(0)); @@ -45,10 +45,12 @@ function read_input_line($prompt) if (CONSOLE_INTERACTIVE) { if (CONSOLE_READLINE) { $line = readline($prompt); - readline_add_history($line); - if (defined('CONSOLE_HISTORY')) { - // Save often; it's easy to hit fatal errors. - readline_write_history(CONSOLE_HISTORY); + if (trim($line) != '') { + readline_add_history($line); + if (defined('CONSOLE_HISTORY')) { + // Save often; it's easy to hit fatal errors. + readline_write_history(CONSOLE_HISTORY); + } } return $line; } else {