Class ProgressShellHelper
Create a progress bar using a supplied callback.
- BaseShellHelper
- ProgressShellHelper
Copyright:
Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
License: MIT License
Location: Cake/Console/Helper/ProgressShellHelper.php
License: MIT License
Location: Cake/Console/Helper/ProgressShellHelper.php
Properties summary
-
$_progress
protectedinteger
The current progress. -
$_total
protectedinteger
The total number of 'items' to progress through. -
$_width
protectedinteger
The width of the bar.
Inherited Properties
Method Summary
-
draw() public
Render the progress bar based on the current state. -
increment() public
Increment the progress bar. -
init() public
Initialize the progress bar for use. -
output() public
Output a progress bar.
Method Detail
increment() public ¶
increment( integer $num = 1 )
Increment the progress bar.
Parameters
- integer $num optional 1
- The amount of progress to advance by.
init() public ¶
init( array $args = array() )
Initialize the progress bar for use.
total
The total number of items in the progress bar. Defaults to 100.width
The width of the progress bar. Defaults to 80.
Parameters
- array $args optional array()
- The initialization data.
output() public ¶
output( array $args )
Output a progress bar.
Takes a number of options to customize the behavior:
total
The total number of items in the progress bar. Defaults to 100.width
The width of the progress bar. Defaults to 80.callback
The callback that will be called in a loop to advance the progress bar.
Parameters
- array $args
- The arguments/options to use when outputing the progress bar.
Throws
RuntimeException
Methods inherited from BaseShellHelper
__construct() public ¶
__construct( ConsoleOutput
$consoleOutput , array $config = array() )
Constructor.
Parameters
-
ConsoleOutput
$consoleOutput - The ConsoleOutput instance to use.
- array $config optional array()
- The settings for this helper.