定制 icanhazstring/symfony-console-spinner 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

icanhazstring/symfony-console-spinner

最新稳定版本:1.1.1

Composer 安装命令:

composer require icanhazstring/symfony-console-spinner

包简介

Custom symfony progressbar spinner

README 文档

README

Custom symfony progressbar with a spinner.

I wanted a progressbar displaying a long running task like waiting for an external resource to be available. This is where I stumbled upon alecrabbit/php-cli-snake.

I tried to mimic the the animation using symfony/console and this is the result:

example of multiple progress bars with this spinner component

Installation

Use composer to require the small package

composer require icanhazstring/symfony-console-spinner

Usage

To use the spinner, just instantiate the SpinnerProgress like the default ProgressBar from symfony giving it the OutputInterface and the maximum count of items to process:

public function execute(OutputInterface $output, InputInterface $input) { $spinner = new SpinnerProgress($output, 100); for($i = 0; $i < 100; $i++) { usleep(1000); $spinner->advance(); } $spinner->finish(); }

You can also get the underlying ProgressBar instance if you want to change anything, for example adding the elapsed time to the output format:

$spinner = new SpinnerProgress($output, 100); $spinner->getProgressBar()->setFormat('%bar% (%elapsed:6s%) %message%');

License

This package is released under the MIT license.

统计信息

  • 总下载量: 54.19k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 30
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 30
  • Watchers: 1
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固