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
protectedThe current progress.integer
-
$_total
protectedThe total number of 'items' to progress through.integer
-
$_width
protectedThe width of the bar.integer
Inherited Properties
Method Summary
- draw() publicRender the progress bar based on the current state.
- increment() publicIncrement the progress bar.
- init() publicInitialize the progress bar for use.
- output() publicOutput a progress bar.
Method Detail
increment()source public
increment( integer $num 1 )
Increment the progress bar.
Parameters
- integer
$num
optional 1 - The amount of progress to advance by.
init()source 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()source 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
RuntimeExceptionMethods inherited from BaseShellHelper
__construct()source 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.
config()source public
config( null $config null )
Initialize config & store config values
Parameters
- null
$config
optional null - Config values to set
Returns
array|Properties detail
© 2005–2017 The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/2.10/class-ProgressShellHelper.html