承接 grasmash/symfony-console-spinner 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

grasmash/symfony-console-spinner

Composer 安装命令:

composer require grasmash/symfony-console-spinner

包简介

A utility for creating an animated spinner via Symfony Console.

README 文档

README

This utility provides two tools for use with Symfony Console:

  1. An animated spinner class. This is a wrapper around Symfony's built-in Progress Bar which will show a colored, animated spinner. It requires advance() to be called in order for the spinner to spin.
  2. A checklist class. This is a wrapper around the Spinner. It allows you to emit a checklist item, display a spinner next to it to indicate that it is in progress, and write a "message detail" under the item.

image

Usage

Simple Spinner

$output = new \Symfony\Component\Console\Output\ConsoleOutput(); $spinner = new Spinner($output); $spinner->setMessage('Fetching a really big file from far away'); $spinner->start(); while (getting_the_file()) { $spinner->advance(); } $spinner->finish();

Simple Checklist

$output = new \Symfony\Component\Console\Output\ConsoleOutput(); $checklist = new Checklist($output); $checklist->addItem('Fetching a really big file from far away'); while (getting_the_file()) { $checklist->updateProgressBar('Still getting the file'); } $checklist->completePreviousItem(); $checklist->addItem('Doing the next thing');

Advanced Checklist Example

 use Symfony\Component\Process\Process; use Symfony\Component\Console\Output\ConsoleOutput; public function runMyCommand() { $output = new ConsoleOutput(); $checklist = new Checklist($output); $checklist->addItem('Running a command with lots of output'); $process = new Process([ 'composer', 'run-script', 'my-script', '--no-interaction', ]); $process->start(); $process->wait(function ($type, $buffer) use ($checklist, $output) { if (!$output->isVerbose() && $checklist->getItems()) { $checklist->updateProgressBar($buffer); } $output->writeln($buffer, OutputInterface::VERBOSITY_VERY_VERBOSE); }); if (!$process->isSuccessful()) { throw new \Exception('Something went wrong! {message}' . $process->getErrorOutput()); } $checklist->completePreviousItem(); }

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固