This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Azi modified Shane Harter's code to draw a progress bar | |
| * feel free to use | |
| **/ | |
| function progress ($step_x, $of_y, $label = '') { | |
| $screen_width = `tput cols` - 2 ; | |
| $fraction_done = $step_x / $of_y; | |
| $percent_done = $fraction_done * 100; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Blinky is a little ASCII animation inspired by | |
| * Shane Harter's Progress Display for PHP CLI scripts | |
| * see: https://gist.github.com/4211173 | |
| * this one is written by Azi Crawford forked by Tim Correia forked again by Azi Crawford | |
| * 12/08/2012 -> added ears to blinky | |
| **/ | |
| $blinks_array = array( '<O.O>', '<O.o>', '<O.->', '<O.o>', '<O.O>', '<o.O>', '<-.O>', '<o.O>', '<O.O>', '<o.o>', '<-.->', '<o.o>' ); | |
| define('SCREEN_WIDTH', `tput cols` - 2); |