process output
进度展示
自定义的动态文本输出
使用 Show::dynamicTxt()/$output->dynamicTxt()

简单的文本进度输出
使用 Show::progressTxt()/$output->progressTxt()

简单的进度条输出
使用 Show::progressBar()/$output->progressBar()
public static function progressBar(int $total, array $opts = [])
示例代码:
$total = 120; $bar = Show::progressBar($total, [ 'msg' => 'Msg Text', 'doneChar' => '#'// ♥ ■ ☺ ☻ = # Windows 环境下不要使用特殊字符,否则会乱码 ]); echo "Progress:\n"; $i = 0; while ($i <= $total) { $bar->send(1);// 发送步进长度,通常是 1 usleep(50000); $i++; }
