Skip to content

Latest commit

History

65 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

console-spinner

中文说明

Latest Stable VersionTotal DownloadsLicense

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 */publicfunctionhandle()
{
$spinner = $this->spinner($users->count());
$spinner->setMessage('Loading...');
$spinner->start();
foreach ($usersas$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

MIT

About

[READ-ONLY]Then progress bar component For Hyperf.

Resources

Security policy

Stars

1 star

Watchers

1 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages