{"id":16409569,"url":"https://github.com/pointybeard/helpers-cli-progressbar","last_synced_at":"2025-11-17T12:04:18.919Z","repository":{"id":57043299,"uuid":"184991673","full_name":"pointybeard/helpers-cli-progressbar","owner":"pointybeard","description":"Utility for rendering a progress bar to the command-line in PHP","archived":false,"fork":false,"pushed_at":"2020-04-23T00:16:27.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-24T02:31:52.538Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pointybeard.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-05T06:52:26.000Z","updated_at":"2023-08-21T12:00:21.000Z","dependencies_parsed_at":"2022-08-23T23:30:17.003Z","dependency_job_id":null,"html_url":"https://github.com/pointybeard/helpers-cli-progressbar","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/pointybeard/helpers-cli-progressbar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pointybeard%2Fhelpers-cli-progressbar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pointybeard%2Fhelpers-cli-progressbar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pointybeard%2Fhelpers-cli-progressbar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pointybeard%2Fhelpers-cli-progressbar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pointybeard","download_url":"https://codeload.github.com/pointybeard/helpers-cli-progressbar/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pointybeard%2Fhelpers-cli-progressbar/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284877005,"owners_count":27077734,"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","status":"online","status_checked_at":"2025-11-17T02:00:06.431Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-10-11T06:20:26.751Z","updated_at":"2025-11-17T12:04:18.893Z","avatar_url":"https://github.com/pointybeard.png","language":"PHP","readme":"# PHP Helpers: Command-line Progress Bar\n\n-   Version: v1.1.0\n-   Date: May 23 2019\n-   [Release notes](https://github.com/pointybeard/helpers-cli-progressbar/blob/master/CHANGELOG.md)\n-   [GitHub repository](https://github.com/pointybeard/helpers-cli-progressbar)\n\nA simple, yet powerful, class for rendering progress bars to the command-line.\n\n## Installation\n\nThis library is installed via [Composer](http://getcomposer.org/). To install, use `composer require pointybeard/helpers-cli-progressbar` or add `\"pointybeard/helpers-cli-progressbar\": \"~1.0\"` to your `composer.json` file.\n\nAnd run composer to update your dependencies:\n\n    $ curl -s http://getcomposer.org/installer | php\n    $ php composer.phar update\n\n### Requirements\n\nThis library makes use of the [PHP Helpers: Sliding Average](https://github.com/pointybeard/helpers-statistics-slidingaverage) (`pointybeard/helpers-statistics-slidingaverage`), [PHP Helpers: Command-line Colours](https://github.com/pointybeard/helpers-cli-colour) (`pointybeard/helpers-cli-colour`), and [PHP Helpers: Time Functions](https://github.com/pointybeard/helpers-functions-time) (`pointybeard/helpers-functions-time`) packages. They are installed automatically via composer.\n\nTo include all the [PHP Helpers](https://github.com/pointybeard/helpers) packages on your project, use `composer require pointybeard/helpers` or add `\"pointybeard/helpers\": \"~1.0\"` to your composer file.\n\n## Usage\n\nInclude this library in your PHP files with `use pointybeard\\Helpers\\Cli\\ProgressBar` and instanciate the `ProgressBar\\ProgressBar` class like so:\n\n```php\n\u003c?php\n\ndeclare(strict_types=1);\n\ninclude __DIR__.'/vendor/autoload.php';\n\nuse pointybeard\\Helpers\\Cli\\ProgressBar;\nuse pointybeard\\Helpers\\Cli\\Colour;\n\n$progress = (new ProgressBar\\ProgressBar(rand(10000, 20000)))\n    -\u003elength(30)\n    -\u003eforeground(Colour\\Colour::FG_GREEN)\n    -\u003ebackground(Colour\\Colour::BG_DEFAULT)\n    -\u003eformat('{{PROGRESS_BAR}} {{PERCENTAGE}}% {{COMPLETED}}/{{TOTAL}} ({{REMAINING_TIME}} remaining)')\n;\n\n// Optional. Seeds the start time of the progress bar. time() is used\n// if omitted.\n$progress-\u003estart();\n\ndo {\n    // This moves the progress forward (default is 1 unit) and redraws it\n    $progress-\u003eadvance();\n\n    // Slow the script down so we can see what's happening\n    usleep(rand(5000, 20000));\n} while ($progress-\u003eremaining() \u003e 0);\n\necho PHP_EOL.'Work complete!'.PHP_EOL;\n\n```\n\n### Placeholders\n\nThe format of the progress bar can be modified using the `format` method. The default format is `{{PROGRESS_BAR}} {{PERCENTAGE}}% {{COMPLETED}}/{{TOTAL}} ({{ELAPSED_TIME}} elapsed, approx. {{REMAINING_TIME}} remaining)`.\n\nPlaceholders available are:\n\n-   PROGRESS_BAR\n-   PERCENTAGE\n-   COMPLETED\n-   TOTAL\n-   ELAPSED_TIME\n-   REMAINING_TIME\n\n## Support\n\nIf you believe you have found a bug, please report it using the [GitHub issue tracker](https://github.com/pointybeard/helpers-cli-progressbar/issues),\nor better yet, fork the library and submit a pull request.\n\n## Contributing\n\nWe encourage you to contribute to this project. Please check out the [Contributing documentation](https://github.com/pointybeard/helpers-cli-progressbar/blob/master/CONTRIBUTING.md) for guidelines about how to get involved.\n\n## License\n\n\"PHP Helpers: Command-line Progress Bar\" is released under the [MIT License](http://www.opensource.org/licenses/MIT).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpointybeard%2Fhelpers-cli-progressbar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpointybeard%2Fhelpers-cli-progressbar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpointybeard%2Fhelpers-cli-progressbar/lists"}