Class ProgressShellHelper

Create a progress bar using a supplied callback.

BaseShellHelper
Extended by ProgressShellHelper
Copyright: Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
License: MIT License
Location: Cake/Console/Helper/ProgressShellHelper.php

Properties summary

  • $_progress protected
    integer
    The current progress.
  • $_total protected
    integer
    The total number of 'items' to progress through.
  • $_width protected
    integer
    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

draw()source public

draw( )

Render the progress bar based on the current state.

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

RuntimeException

Methods 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

$_progresssource

protected integer

The current progress.

$_totalsource

protected integer

The total number of 'items' to progress through.

$_widthsource

protected integer

The width of the bar.

© 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