ProgressBar
class ProgressBar
Progress bar helper.
Properties
protected int | $width | Progressbar width. | |
protected string | $emptyTemplate | String that represents the empty part of the progess bar. | |
protected string | $filledTemplate | String that represents the filled part of the progess bar. | |
protected int | $items | Number of items. | |
protected float | $minTimeBetweenRedraw | Minimum time between redraw in seconds. | |
protected float | $lastRedraw | Time of last redraw. | |
protected int | $progress | Progress status. | |
protected Output | $output | Output instance. | |
protected string | $prefix | Progress bar prefix. |
Methods
Sets the progress bar width.
Sets the string that represents the empty part of the progess bar.
Sets the string that represents the filled part of the progess bar.
Sets the progress bar prefix.
Builds the progressbar.
Draws the progressbar.
Return current unix timestamp with microseconds.
Should the progress bar be redrawn?
Move progress forward and redraws the progressbar.
Removes the progressbar.
Details
at line 97
__construct(Output $output, int $items, float $minTimeBetweenRedraw = 0.1)
Constructor.
at line 111
setWidth(int $width)
Sets the progress bar width.
at line 121
setEmptyTemplate(string $template)
Sets the string that represents the empty part of the progess bar.
at line 131
setFilledTemplate(string $template)
Sets the string that represents the filled part of the progess bar.
at line 141
setPrefix(string $prefix)
Sets the progress bar prefix.
at line 152
protected string
buildProgressBar(float $percent)
Builds the progressbar.
at line 166
draw()
Draws the progressbar.
at line 200
protected float
getMicrotime()
Return current unix timestamp with microseconds.
at line 210
protected bool
shouldRedraw()
Should the progress bar be redrawn?
at line 227
advance()
Move progress forward and redraws the progressbar.
at line 240
remove()
Removes the progressbar.