wilzokch/laravel-progress-bar-lite

Laravel 命令的快速进度条。

v1.0.3 2019-04-02 08:59 UTC

This package is auto-updated.

Last update: 2024-09-21 20:54:03 UTC


README

这是一个为 Laravel 5.1 及以上版本提供更快进度条的包。

问题

Laravel 默认的进度条在数据量过大时会显著降低处理速度。

解决方案

此进度条允许您配置进度条更新的频率(默认更新频率为 100)

通过 "composer require" 安装

    composer require wilzokch/laravel-progress-bar-lite

示例

// put in your command class or refer to sample/TestCommand.php
use LiteProgressBarTrait;
// create progress bar using following function instead of $this->output->createProgressBar(count($data));
$bar = $this->createProgressBar(count($data));

在 my PC 上的测试结果

使用 Laravel 进度条

 100000/100000 [============================] 100%
time taken: 79.0038s

使用进度条轻量版

 100000/100000 [============================] 100%
time taken: 0.5265s