PHP CLI Spinner: Make the cursor spin in the command line shells

Recommend this page to a friend!
  Info   View files Example   View files View files (17)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog (1)    
Last Updated Ratings Unique User Downloads Download Rankings
2021-06-23 (2 months ago) RSS 2.0 feedNot enough user ratingsTotal: 56 All time: 10,006 This week: 181Up
Version License PHP version Categories
spinner 1.0.0Custom (specified...5PHP 5, Console
Description Author

This package can make the cursor spin in the command line shells.

It can start a parallel process that will change the character that appears in the current cursor position in the command-line shell to make it appear as an animated cursor.

The package provides theme classes that implement different styles of animations to be used as characters that appear spinning near the cursor.

Innovation Award
PHP Programming Innovation award nominee
June 2021
Number 3
Sometimes applications need to execute tasks that take a long time to finish. It is always good to provide feedback to the users to let them know what is happening, avoiding that the users become too anxious.

For console-based applications, usually, a cursor may appear blinking, but that does not give feedback on whether the current application is running well.

This package implements a better solution by showing the cursor changing its character, so it appears to be animated. This can give the users a better feeling by letting them know that the application is running.

The package implements a solution that uses a parallel process to animate the cursor character, so the application does not have to stop its main job to update the cursor animation.

Manuel Lemos
Picture of Isa Eken
  Performance   Level  
Innovation award
Innovation award
Nominee: 7x

 

Details

PHP Spinner

> Elegant spinner for interactive CLI apps. > > Alternative for https://github.com/sindresorhus/elegant-spinner

Spinner

$result = \IsaEken\Spinner\Spinner::run(function () {
    \IsaEken\Spinner\Spinner::setTitle('Calculating...');
    $a = 1;
    $b = 2;
    $c = $a + $b;
    \IsaEken\Spinner\Spinner::setTitle('Waiting...');
    sleep($c);
    return $c;
});

echo "The result is: $result!";

Installation

You can install using composer.

composer require isaeken/spinner

License

The MIT License (MIT). Please see License File for more information.

  Files folder image Files  
File Role Description
Files folder imagebin (2 files)
Files folder imageexample (3 files)
Files folder imagesrc (4 files, 3 directories)
Plain text file composer.json Data Auxiliary data
Plain text file LICENSE.md Lic. License text
Plain text file README.md Doc. Documentation

 Version Control Unique User Downloads Download Rankings  
 100%
Total:56
This week:0
All time:10,006
This week:181Up

For more information send a message to info at phpclasses dot org.