18. Class

18.1. Zend\ProgressBar\Adapter\Console

Zend_ProgressBar_Adapter_Console offers a text-based progressbar for console applications

18.1.1. Methods

18.1.1.1. __construct

__construct()

Defined by Zend_ProgressBar_Adapter

Parameters:array|Traversable

18.1.1.2. __destruct

__destruct()

Close local stdout, when open

18.1.1.3. setOutputStream

setOutputStream()

Set a different output-stream

Parameters:string
Throws ExceptionRuntimeException:
 
Return type:ZendProgressBarAdapterConsole

18.1.1.4. getOutputStream

getOutputStream()

Get the current output stream

Return type:resource

18.1.1.5. setWidth

setWidth()

Set the width of the progressbar

Parameters:integer
Return type:ZendProgressBarAdapterConsole

18.1.1.6. setElements

setElements()

Set the elements to display with the progressbar

Parameters:array
Throws ZendProgressBarAdapterExceptionInvalidArgumentException:
 When an invalid element is found in the array
Return type:ZendProgressBarAdapterConsole

18.1.1.7. setBarLeftChar

setBarLeftChar()

Set the left-hand character for the bar

Parameters:string
Throws ZendProgressBarAdapterExceptionInvalidArgumentException:
 When character is empty
Return type:ZendProgressBarAdapterConsole

18.1.1.8. setBarRightChar

setBarRightChar()

Set the right-hand character for the bar

Parameters:string
Throws ZendProgressBarAdapterExceptionInvalidArgumentException:
 When character is empty
Return type:ZendProgressBarAdapterConsole

18.1.1.9. setBarIndicatorChar

setBarIndicatorChar()

Set the indicator character for the bar

Parameters:string
Return type:ZendProgressBarAdapterConsole

18.1.1.10. setTextWidth

setTextWidth()

Set the width of the text element

Parameters:integer
Return type:ZendProgressBarAdapterConsole

18.1.1.11. setCharset

setCharset()

Set the charset of the text element

Parameters:string

18.1.1.12. setFinishAction

setFinishAction()

Set the finish action

Parameters:string
Throws ZendProgressBarAdapterExceptionInvalidArgumentException:
 When an invalid action is specified
Return type:ZendProgressBarAdapterConsole

18.1.1.13. notify

notify()

Defined by ZendProgressBarAdapterAbstractAdapter

Parameters:
  • float – Current progress value
  • float – Max progress value
  • float – Current percent value
  • integer – Taken time in seconds
  • integer – Remaining time in seconds
  • string – Status text
Return type:

void

18.1.1.14. finish

finish()

Defined by ZendProgressBarAdapterAbstractAdapter

Return type:void

18.1.1.15. _calculateBarWidth

_calculateBarWidth()

Calculate the bar width when other elements changed

Return type:void

18.1.1.16. _outputData

_outputData()

Outputs given data to STDOUT.

This split-off is required for unit-testing.

Parameters:string
Return type:void

18.1.2. Constants

18.1.2.1. ELEMENT_PERCENT

Percentage value of the progress

18.1.2.2. ELEMENT_BAR

Visual value of the progress

18.1.2.3. ELEMENT_ETA

ETA of the progress

18.1.2.4. ELEMENT_TEXT

Text part of the progress

18.1.2.5. FINISH_ACTION_EOL

Finish action: End of Line

18.1.2.6. FINISH_ACTION_CLEAR_LINE

Finish action: Clear Line

18.1.2.7. FINISH_ACTION_NONE

Finish action: None