friendsofhyperf/console-spinner
Composer 安装命令:
composer require friendsofhyperf/console-spinner
包简介
The progress bar component For Hyperf.
README 文档
README
The progress bar component For Hyperf.
Installation
composer require friendsofhyperf/console-spinner
Publish
- Optional
php bin/hyperf.php vendor:publish friendsofhyperf/console-spinner
Usage
class FooCommand extends Command { use Spinnerable; /** * Execute the console command. * * @return void */ public function handle() { $spinner = $this->spinner($users->count()); $spinner->setMessage('Loading...'); $spinner->start(); foreach ($users as $user) { // Do your stuff... $spinner->advance(); } $spinner->finish(); } }
The $spinner is compatible with Symfony ProgressBar, so you can run any method of this class.
Or you can also use with withSpinner method by giving an iterable.
$this->withSpinner(User::all(), function($user) { // Do your stuff with $user }, 'Loading...');
Contact
License
统计信息
- 总下载量: 4.45k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-09-07