{"id":22974156,"url":"https://github.com/diversen/php-cli-spinners","last_synced_at":"2025-08-02T16:05:27.354Z","repository":{"id":92436991,"uuid":"607822279","full_name":"diversen/php-cli-spinners","owner":"diversen","description":"Simple PHP library for displaying spinners in the terminal while running a callback function.","archived":false,"fork":false,"pushed_at":"2024-03-09T18:26:43.000Z","size":36,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-19T02:54:12.645Z","etag":null,"topics":["cli-spinners","php-cli-spinners"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/diversen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-02-28T18:44:09.000Z","updated_at":"2024-03-09T16:34:38.000Z","dependencies_parsed_at":"2024-03-09T14:37:50.465Z","dependency_job_id":"4d9c4f22-ba5c-43cf-91fd-4e401f6c1b0a","html_url":"https://github.com/diversen/php-cli-spinners","commit_stats":{"total_commits":33,"total_committers":2,"mean_commits":16.5,"dds":"0.030303030303030276","last_synced_commit":"bb1a5042b4305e20f1ff83e69f0eb873a4876bdf"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/diversen/php-cli-spinners","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diversen%2Fphp-cli-spinners","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diversen%2Fphp-cli-spinners/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diversen%2Fphp-cli-spinners/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diversen%2Fphp-cli-spinners/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/diversen","download_url":"https://codeload.github.com/diversen/php-cli-spinners/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diversen%2Fphp-cli-spinners/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266112248,"owners_count":23878028,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli-spinners","php-cli-spinners"],"created_at":"2024-12-15T00:00:24.604Z","updated_at":"2025-08-02T16:05:27.331Z","avatar_url":"https://github.com/diversen.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# php-cli-spinners\n\nSimple PHP library for displaying spinners in the terminal while running a callback function.\n\nYou will need to have the [pcntl](https://www.php.net/manual/en/book.pcntl.php) extension installed.\n\nThe library uses this [collection of spinners](https://github.com/sindresorhus/cli-spinners):\n\nThe spinners can be seen [in action here](https://jsfiddle.net/sindresorhus/2eLtsbey/embedded/result/)\n\nIf you don't have the `pcntl` extension installed, you can still use the library, but you will not see the spinner.\n\nOn windows use WSL. There may be some trouble using UTF-8 characters in the terminal on WSL.\n\nIn this case you can use the `simpleDots` or `simpleDotsScrolling` spinner.\n\n## How it works\n\nThe library will run a callback function in a separate process which displays the spinner. \nThe main process will run the callback function and return the result.\n\n## Installation\n\n```bash\ncomposer require diversen/php-cli-spinners\n```\n\n## Usage\n\n```php\n\u003c?php\n\nrequire_once \"vendor/autoload.php\";\n\nuse Diversen\\Spinner;\n\n$spinner = new Spinner(spinner: 'simpleDots', message: \"Loading\");\n$res = $spinner-\u003ecallback(function () {\n    sleep(2);\n    return 42;\n});\n\necho \"$res\\n\"; // 42\n\n\n\n```\n\n## Examples\n\nClone:\n\n    git clone https://github.com/diversen/php-cli-spinners.git\n\nSee [examples](examples) folder. E.g. run `php examples/simple.php`\n\n## License\n\nMIT © [Dennis Iversen](https://github.com/diversen)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiversen%2Fphp-cli-spinners","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiversen%2Fphp-cli-spinners","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiversen%2Fphp-cli-spinners/lists"}