https://github.com/firehed/counter
CLI progressmeter/counter
https://github.com/firehed/counter
Last synced: about 1 year ago
JSON representation
CLI progressmeter/counter
- Host: GitHub
- URL: https://github.com/firehed/counter
- Owner: Firehed
- Created: 2011-07-30T21:10:53.000Z (almost 15 years ago)
- Default Branch: master
- Last Pushed: 2011-07-30T21:16:52.000Z (almost 15 years ago)
- Last Synced: 2025-02-13T22:27:13.358Z (over 1 year ago)
- Language: PHP
- Homepage:
- Size: 93.8 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Command Line Progress Counter
=============================
A simple tool to track the progress of your upgrades and other long-running
tasks. It has the added benefit over a simple homegrown system by displaying the
counter on the current output line.
This is not intended for web usage - it is designed around CLI scripts. It was
designed for upgrade scripts that run on tens of thousands of objects where
upgrades by SQL queries are not a practical solution (cache interference, logic
better handled in PHP, etc.) but should work for anything that needs a counter,
such as unit test output or deployment scripts.
Usage
-----
upgrader.php:
upgrade(); // return true on success, false on fail
counter::next($pass ? '.' : 'E');
}
Output
------
During upgrades:
$ php upgrader.php
Some thing that needs upgrading:
........................E........................ 049/500
After completion:
$ php upgrader.php
Some thing that needs upgrading:
........................E........................E.......... 060/500
..............E........................E.................... 120/500
....E........................E........................E..... 180/500
...................E........................E............... 240/500
.........E........................E........................E 300/500
........................E........................E.......... 360/500
..............E........................E.................... 420/500
....E........................E........................E..... 480/500
...................E 500/500
$