Zend\ProgressBar\Adapter\Console offers a text-based progressbar for console applications

 Methods

Defined by Zend\ProgressBar adapter

__construct(array | \Traversable $options) 

$options may be either be an array or a Zend\Config object which specifies adapter related options.

Parameters

$options

array\Traversable

Close local stdout, when open

__destruct() 

Defined by Zend\ProgressBar\Adapter\AbstractAdapter

finish() : void

Get the current output stream

getOutputStream() : resource

Returns

resource

Defined by Zend\ProgressBar\Adapter\AbstractAdapter

notify(float $current, float $max, float $percent, int $timeTaken, int $timeRemaining, string $text) : void

Parameters

$current

float

Current progress value

$max

float

Max progress value

$percent

float

Current percent value

$timeTaken

int

Taken time in seconds

$timeRemaining

int

Remaining time in seconds

$text

string

Status text

Set the indicator character for the bar

setBarIndicatorChar(string $char) : \Zend\ProgressBar\Adapter\Console

Parameters

$char

string

Returns

Set the left-hand character for the bar

setBarLeftChar(string $char) : \Zend\ProgressBar\Adapter\Console

Parameters

$char

string

Exceptions

\Zend\ProgressBar\Adapter\Exception\InvalidArgumentException When character is empty

Returns

Set the right-hand character for the bar

setBarRightChar(string $char) : \Zend\ProgressBar\Adapter\Console

Parameters

$char

string

Exceptions

\Zend\ProgressBar\Adapter\Exception\InvalidArgumentException When character is empty

Returns

Set the charset of the text element

setCharset(string $charset) 

Parameters

$charset

string

Set the elements to display with the progressbar

setElements(array $elements) : \Zend\ProgressBar\Adapter\Console

Parameters

$elements

array

Exceptions

\Zend\ProgressBar\Adapter\Exception\InvalidArgumentException When an invalid element is found in the array

Returns

Set the finish action

setFinishAction(string $action) : \Zend\ProgressBar\Adapter\Console

Parameters

$action

string

Exceptions

\Zend\ProgressBar\Adapter\Exception\InvalidArgumentException When an invalid action is specified

Returns

Set options via an array

setOptions(array $options) : \Zend\ProgressBar\Adapter\AbstractAdapter
Inherited

inherited_from \Zend\ProgressBar\Adapter\AbstractAdapter::setOptions()

Parameters

$options

array

Returns

Set a different output-stream

setOutputStream(string $resource) : \Zend\ProgressBar\Adapter\Console

Set the width of the text element

setTextWidth(int $width) : \Zend\ProgressBar\Adapter\Console

Parameters

$width

int

Returns

Set the width of the progressbar

setWidth(int $width) : \Zend\ProgressBar\Adapter\Console

Parameters

$width

int

Returns

Calculate the bar width when other elements changed

_calculateBarWidth() : void

Outputs given data to STDOUT.

_outputData(string $data) : void

This split-off is required for unit-testing.

Parameters

$data

string

 Properties

 

Indicator character(s) within the bar

$barIndicatorChar : string

 

Left character(s) within the bar

$barLeftChar : string

 

Right character(s) within the bar

$barRightChar : string

 

Width of the bar element

$barWidth : int

 

Charset of text element

$charset : string

 

Elements to display

$elements : array

 

Which action to do at finish call

$finishAction : string

 

Whether the output started yet or not

$outputStarted : bool

 

Output-stream, when STDOUT is not defined (e.g.

$outputStream : resource

in CGI) or set manually

 

Option keys to skip when calling setOptions()

$skipOptions : array
Inherited

inherited_from \Zend\ProgressBar\Adapter\AbstractAdapter::$$skipOptions
 

Width of the text element

$textWidth : string

 

Width of the progressbar

$width : int

 Constants

 

Visual value of the progress

ELEMENT_BAR 

 

ETA of the progress

ELEMENT_ETA 

 

Percentage value of the progress

ELEMENT_PERCENT 

 

Text part of the progress

ELEMENT_TEXT 

 

Finish action: Clear Line

FINISH_ACTION_CLEAR_LINE 

 

Finish action: End of Line

FINISH_ACTION_EOL 

 

Finish action: None

FINISH_ACTION_NONE