From 5003c48ab4760eab2f11f6f68a77e1890def1dfc Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Mon, 19 Nov 2007 02:52:30 +0000 Subject: add more($text) function. With this function it will ask the person to press return after 24 rows of output. Good for stuff like this: $temp = print_r($config, true); more($temp); --- usr/local/sbin/pfSsh.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'usr') diff --git a/usr/local/sbin/pfSsh.php b/usr/local/sbin/pfSsh.php index 0d77220..54d587a 100755 --- a/usr/local/sbin/pfSsh.php +++ b/usr/local/sbin/pfSsh.php @@ -13,11 +13,30 @@ require("config.inc"); echo "."; $g['booting'] = false; +function more($text) { + $counter=0; + $lines = split("\n", $text); + foreach($lines as $line) { + if($counter > 24) { + echo "Press RETURN to continue ..."; + $fp = fopen('php://stdin', 'r'); + $pressreturn = chop(fgets($fp)); + fclose($fp); + $counter = 0; + } + echo "{$line}\n"; + $counter++; + } +} + function show_help() { echo "\nExample commands:\n"; echo "\nparse_config(true); # reloads the \$config array\n"; - + + echo "\n\$temp = print_r(\$config, true);\n"; + echo "more(\$temp);\n"; + echo "\n/* to output a configuration array */\n"; echo "print_r(\$config);\n"; -- cgit v1.1