X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=scripts%2Fconsole.php;h=4d207c261b5a7da9f52799107dd04805e0240520;hb=a9bb1c75282a642d34b88fee2a7ca31ab7c2a0fb;hp=329caf472407a4764d5b017a2dfedc5f9cba0cb3;hpb=b93068083e4366aa6847471c5fae34d770bbad18;p=quix0rs-gnu-social.git diff --git a/scripts/console.php b/scripts/console.php index 329caf4724..4d207c261b 100755 --- a/scripts/console.php +++ b/scripts/console.php @@ -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 { @@ -128,6 +130,8 @@ function console_help() if (CONSOLE_INTERACTIVE) { print "StatusNet interactive PHP console... type ctrl+D or enter 'exit' to exit.\n"; $prompt = common_config('site', 'name') . '> '; +} else { + $prompt = ''; } while (!feof(STDIN)) { $line = read_input_line($prompt);