Add second argument of more allowing control of when press Return is displayed

This commit is contained in:
Scott Ullrich 2007-11-19 02:57:27 +00:00
parent 5003c48ab4
commit cd8ca22fad

View File

@ -13,14 +13,16 @@ require("config.inc");
echo ".";
$g['booting'] = false;
function more($text) {
function more($text, $count=24) {
$counter=0;
$lines = split("\n", $text);
foreach($lines as $line) {
if($counter > 24) {
if($counter > $count) {
echo "Press RETURN to continue ...";
$fp = fopen('php://stdin', 'r');
$pressreturn = chop(fgets($fp));
if($pressreturn == "q" || $pressreturn == "quit")
return;
fclose($fp);
$counter = 0;
}