Methods summary
public
|
|
public static
|
#
setPlaceholderFormatterDefinition( string $name, callable $callable )
Sets a placeholder formatter for a given name.
Sets a placeholder formatter for a given name.
This method also allow you to override an existing placeholder.
Parameters
- $name
- The placeholder name (including the delimiter char like %)
- $callable
- A PHP callable
|
public static
callable|null
|
#
getPlaceholderFormatterDefinition( string $name )
Gets the placeholder formatter for a given name.
Gets the placeholder formatter for a given name.
Parameters
- $name
- The placeholder name (including the delimiter char like %)
Returns
callable|null A PHP callable
|
public static
|
#
setFormatDefinition( string $name, string $format )
Sets a format for a given name.
Sets a format for a given name.
This method also allow you to override an existing format.
Parameters
- $name
- The format name
- $format
- A format string
|
public static
string|null
|
#
getFormatDefinition( string $name )
Gets the format for a given name.
Gets the format for a given name.
Parameters
Returns
string|null A format string
|
public
|
#
setMessage( string $message, string $name = 'message' )
Associates a text with a named placeholder.
Associates a text with a named placeholder.
The text is displayed when the progress bar is rendered but only
when the corresponding placeholder is part of the custom format line
(by wrapping the name with %).
Parameters
- $message
- The text to associate with the placeholder
- $name
- The name of the placeholder
|
public
|
|
public
integer
|
#
getStartTime( )
Gets the progress bar start time.
Gets the progress bar start time.
Returns
integer The progress bar start time
|
public
integer
|
#
getMaxSteps( )
Gets the progress bar maximal steps.
Gets the progress bar maximal steps.
Returns
integer The progress bar max steps
|
public
integer
|
#
getStep( )
Gets the progress bar step.
Gets the progress bar step.
Deprecated
Returns
integer The progress bar step
|
public
integer
|
#
getProgress( )
Gets the current step position.
Gets the current step position.
Returns
integer The progress bar step
|
public
integer
|
#
getStepWidth( )
Gets the progress bar step width.
Gets the progress bar step width.
Returns
integer The progress bar step width
|
public
float
|
#
getProgressPercent( )
Gets the current progress bar percent.
Gets the current progress bar percent.
Returns
float The current progress bar percent
|
public
|
#
setBarWidth( integer $size )
Sets the progress bar width.
Sets the progress bar width.
Parameters
- $size
- The progress bar size
|
public
integer
|
#
getBarWidth( )
Gets the progress bar width.
Gets the progress bar width.
Returns
integer The progress bar size
|
public
|
|
public
string
|
|
public
|
#
setEmptyBarCharacter( string $char )
Sets the empty bar character.
Sets the empty bar character.
Parameters
|
public
string
|
#
getEmptyBarCharacter( )
Gets the empty bar character.
Gets the empty bar character.
Returns
string A character
|
public
|
#
setProgressCharacter( string $char )
Sets the progress bar character.
Sets the progress bar character.
Parameters
|
public
string
|
#
getProgressCharacter( )
Gets the progress bar character.
Gets the progress bar character.
Returns
string A character
|
public
|
#
setFormat( string $format )
Sets the progress bar format.
Sets the progress bar format.
Parameters
|
public
|
#
setRedrawFrequency( integer|float $freq )
Sets the redraw frequency.
Sets the redraw frequency.
Parameters
- $freq
- The frequency in steps
|
public
|
#
start( integer|null $max = null )
Starts the progress output.
Starts the progress output.
Parameters
- $max
- Number of steps to complete the bar (0 if indeterminate), null to leave unchanged
|
public
|
#
advance( integer $step = 1 )
Advances the progress output X steps.
Advances the progress output X steps.
Parameters
- $step
- Number of steps to advance
Throws
|
public
|
#
setCurrent( integer $step )
Sets the current progress.
Sets the current progress.
Deprecated
Parameters
- $step
- The current progress
Throws
|
public
|
#
setOverwrite( boolean $overwrite )
Sets whether to overwrite the progressbar, false for new line.
Sets whether to overwrite the progressbar, false for new line.
Parameters
|
public
|
#
setProgress( integer $step )
Sets the current progress.
Sets the current progress.
Parameters
- $step
- The current progress
Throws
|
public
|
#
finish( )
Finishes the progress output.
Finishes the progress output.
|
public
|
#
display( )
Outputs the current progress string.
Outputs the current progress string.
|
public
|
#
clear( )
Removes the progress bar from the current line.
Removes the progress bar from the current line.
This is useful if you wish to write some output
while a progress bar is running.
Call display() to show the progress bar again.
|