ProgressBar/Adapter/Console.php
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to [email protected] so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_ProgressBar
- Version
- $Id: Console.php 24593 2012-01-05 20:35:02Z matthew $
\Zend_ProgressBar_Adapter_Console
Zend_ProgressBar_Adapter_Console offers a text-based progressbar for console applications
- Parent(s)
- \Zend_ProgressBar_Adapter
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Uses
- \global\Zend_ProgressBar_Adapter_Interface
Constants
Properties

string $_barIndicatorChar = ''Indicator character(s) within the bar
''Details- Type
- string

array $_elements = array(self::ELEMENT_PERCENT, self::ELEMENT_BAR, self::ELEMENT_ETA)Elements to display
array(self::ELEMENT_PERCENT, self::ELEMENT_BAR, self::ELEMENT_ETA)Details- Type
- array

string $_finishAction = self::FINISH_ACTION_EOLWhich action to do at finish call
self::FINISH_ACTION_EOLDetails- Type
- string

boolean $_outputStarted = falseWether the output started yet or not
falseDetails- Type
- boolean

resource $_outputStream = nullOutput-stream, when STDOUT is not defined (e.g.
in CGI) or set manually
nullDetails- Type
- resource

array $_skipOptions = array('options', 'config')Option keys to skip when calling setOptions()
Inherited from: \Zend_ProgressBar_Adapter::$$_skipOptionsarray('options', 'config')Details- Type
- array
- Inherited_from
- \Zend_ProgressBar_Adapter::$$_skipOptions
Methods

__construct(null | array | \Zend_Config $options = null) : voidDefined by Zend_ProgressBar_Adapter
$options may be either be an array or a Zend_Config object which specifies adapter related options.
| Name | Type | Description |
|---|---|---|
| $options | null | array | \Zend_Config |

_outputData(string $data) : voidOutputs given data to STDOUT.
This split-off is required for unit-testing.
| Name | Type | Description |
|---|---|---|
| $data | string |

notify(float $current, float $max, float $percent, integer $timeTaken, integer $timeRemaining, string $text) : voidDefined by Zend_ProgressBar_Adapter_Interface
| Name | Type | Description |
|---|---|---|
| $current | float | Current progress value |
| $max | float | Max progress value |
| $percent | float | Current percent value |
| $timeTaken | integer | Taken time in seconds |
| $timeRemaining | integer | Remaining time in seconds |
| $text | string | Status text |

setBarIndicatorChar(string $char) : \Zend_ProgressBar_Adapter_ConsoleSet the indicator character for the bar
| Name | Type | Description |
|---|---|---|
| $char | string |
| Type | Description |
|---|---|
| \Zend_ProgressBar_Adapter_Console |

setBarLeftChar(string $char) : \Zend_ProgressBar_Adapter_ConsoleSet the left-hand character for the bar
| Name | Type | Description |
|---|---|---|
| $char | string |
| Type | Description |
|---|---|
| \Zend_ProgressBar_Adapter_Console |
| Exception | Description |
|---|---|
| \Zend_ProgressBar_Adapter_Exception | When character is empty |

setBarRightChar(string $char) : \Zend_ProgressBar_Adapter_ConsoleSet the right-hand character for the bar
| Name | Type | Description |
|---|---|---|
| $char | string |
| Type | Description |
|---|---|
| \Zend_ProgressBar_Adapter_Console |
| Exception | Description |
|---|---|
| \Zend_ProgressBar_Adapter_Exception | When character is empty |

setCharset(string $charset) : voidSet the charset of the text element
| Name | Type | Description |
|---|---|---|
| $charset | string |

setConfig(\Zend_Config $config) : \Zend_ProgressBar_AdapterSet options via a Zend_Config instance
Inherited from: \Zend_ProgressBar_Adapter::setConfig()| Name | Type | Description |
|---|---|---|
| $config | \Zend_Config |
| Type | Description |
|---|---|
| \Zend_ProgressBar_Adapter |

setElements(array $elements) : \Zend_ProgressBar_Adapter_ConsoleSet the elements to display with the progressbar
| Name | Type | Description |
|---|---|---|
| $elements | array |
| Type | Description |
|---|---|
| \Zend_ProgressBar_Adapter_Console |
| Exception | Description |
|---|---|
| \Zend_ProgressBar_Adapter_Exception | When an invalid element is foudn in the array |

setFinishAction(string $action) : \Zend_ProgressBar_Adapter_ConsoleSet the finish action
| Name | Type | Description |
|---|---|---|
| $action | string |
| Type | Description |
|---|---|
| \Zend_ProgressBar_Adapter_Console |
| Exception | Description |
|---|---|
| \Zend_ProgressBar_Adapter_Exception | When an invalid action is specified |

setOptions(array $options) : \Zend_ProgressBar_Adapter
| Name | Type | Description |
|---|---|---|
| $options | array |
| Type | Description |
|---|---|
| \Zend_ProgressBar_Adapter |

setOutputStream(string $resource) : \Zend_ProgressBar_Adapter_ConsoleSet a different output-stream
| Name | Type | Description |
|---|---|---|
| $resource | string |
| Type | Description |
|---|---|
| \Zend_ProgressBar_Adapter_Console |

setTextWidth(integer $width) : \Zend_ProgressBar_Adapter_ConsoleSet the width of the text element
| Name | Type | Description |
|---|---|---|
| $width | integer |
| Type | Description |
|---|---|
| \Zend_ProgressBar_Adapter_Console |

setWidth(integer $width = null) : \Zend_ProgressBar_Adapter_ConsoleSet the width of the progressbar
| Name | Type | Description |
|---|---|---|
| $width | integer |
| Type | Description |
|---|---|
| \Zend_ProgressBar_Adapter_Console |