PHPackages                             diversen/php-cli-spinners - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. diversen/php-cli-spinners

ActiveLibrary[CLI &amp; Console](/categories/cli)

diversen/php-cli-spinners
=========================

Show a cli spinner while executing a callback

v1.1.0(2y ago)36.4k↓41%1MITPHP

Since Feb 28Pushed 2y ago1 watchersCompare

[ Source](https://github.com/diversen/php-cli-spinners)[ Packagist](https://packagist.org/packages/diversen/php-cli-spinners)[ Docs](http://github.com/diversen/php-cli-spinners)[ RSS](/packages/diversen-php-cli-spinners/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (20)Used By (0)

php-cli-spinners
================

[](#php-cli-spinners)

Simple PHP library for displaying spinners in the terminal while running a callback function.

You will need to have the [pcntl](https://www.php.net/manual/en/book.pcntl.php) extension installed.

The library uses this [collection of spinners](https://github.com/sindresorhus/cli-spinners):

The spinners can be seen [in action here](https://jsfiddle.net/sindresorhus/2eLtsbey/embedded/result/)

If you don't have the `pcntl` extension installed, you can still use the library, but you will not see the spinner.

On windows use WSL. There may be some trouble using UTF-8 characters in the terminal on WSL.

In this case you can use the `simpleDots` or `simpleDotsScrolling` spinner.

How it works
------------

[](#how-it-works)

The library will run a callback function in a separate process which displays the spinner. The main process will run the callback function and return the result.

Installation
------------

[](#installation)

```
composer require diversen/php-cli-spinners
```

Usage
-----

[](#usage)

```
