php cli progress bar
v2.1.0
แถบความคืบหน้าสำหรับสคริปต์บรรทัดบรรทัดคำสั่ง

ในการติดตั้งเพียงเรียกใช้คำสั่ง Composer ต่อไปนี้
composer require divineomega/php-cli-progress-bar
ตัวอย่างโค้ดต่อไปนี้แสดงตัวอย่างการใช้งานพื้นฐาน
$ max = 250 ;
$ progressBar = new DivineOmega CliProgressBar ProgressBar ;
$ progressBar -> setMaxProgress ( $ max );
for ( $ i = 0 ; $ i < $ max ; $ i ++) {
usleep ( 200000 ); // Instead of usleep, process a part of your long running task here.
$ progressBar -> advance ()-> display ();
}
$ progressBar -> complete ();