Skip to content

process output

Inhere edited this page Jan 10, 2019 · 1 revision

进度展示

自定义的动态文本输出

使用 Show::dynamicTxt()/$output->dynamicTxt()

show-progress-txt

简单的文本进度输出

使用 Show::progressTxt()/$output->progressTxt()

show-progress-txt

简单的进度条输出

使用 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++;
}

show-progress-bar

Clone this wiki locally
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy