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 license@zend.com so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_ProgressBar
- Version
- $Id$
\Zend_ProgressBar_Adapter_Console
Package: Zend_ProgressBar
Zend_ProgressBar_Adapter_Console offers a text-based progressbar for console
applications
- Parent(s)
- \Zend_ProgressBar_Adapter
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Uses
Constants
Properties
array $_elements = array(self::ELEMENT_PERCENT, self::ELEMENT_BAR, self::ELEMENT_ETA)
Elements to display
Default value
array(self::ELEMENT_PERCENT, self::ELEMENT_BAR, self::ELEMENT_ETA)
Details- Type
- array
string $_finishAction = self::FINISH_ACTION_EOL
Which action to do at finish call
Default value
self::FINISH_ACTION_EOL
Details- Type
- string
boolean $_outputStarted = false
Wether the output started yet or not
Default value
false
Details- Type
- boolean
resource $_outputStream = null
Output-stream, when STDOUT is not defined (e.g. in CGI) or set manually
Default value
null
Details- Type
- resource
Methods
__construct(null | array | \Zend_Config $options = null) : void
Defined by Zend_ProgressBar_Adapter
Parameters
Name | Type | Description |
---|---|---|
$options | null | array | \Zend_Config |
_outputData(string $data) : void
Outputs given data to STDOUT.
This split-off is required for unit-testing.
ParametersName | Type | Description |
---|---|---|
$data | string |
notify(float $current, float $max, float $percent, integer $timeTaken, integer $timeRemaining, string $text) : void
Defined by Zend_ProgressBar_Adapter_Interface
Parameters
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_Console
Set the indicator character for the bar
Parameters
Returns
Name | Type | Description |
---|---|---|
$char | string |
Type | Description |
---|---|
\Zend_ProgressBar_Adapter_Console |
setBarLeftChar(string $char) : \Zend_ProgressBar_Adapter_Console
Set the left-hand character for the bar
Parameters
Returns
Throws
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_Console
Set the right-hand character for the bar
Parameters
Returns
Throws
Name | Type | Description |
---|---|---|
$char | string |
Type | Description |
---|---|
\Zend_ProgressBar_Adapter_Console |
Exception | Description |
---|---|
\Zend_ProgressBar_Adapter_Exception | When character is empty |
setCharset(string $charset) : void
Set the charset of the text element
Parameters
Name | Type | Description |
---|---|---|
$charset | string |
setElements(array $elements) : \Zend_ProgressBar_Adapter_Console
Set the elements to display with the progressbar
Parameters
Returns
Throws
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_Console
Set the finish action
Parameters
Returns
Throws
Name | Type | Description |
---|---|---|
$action | string |
Type | Description |
---|---|
\Zend_ProgressBar_Adapter_Console |
Exception | Description |
---|---|
\Zend_ProgressBar_Adapter_Exception | When an invalid action is specified |
setOutputStream(string $resource) : \Zend_ProgressBar_Adapter_Console
Set a different output-stream
Parameters
Returns
Name | Type | Description |
---|---|---|
$resource | string |
Type | Description |
---|---|
\Zend_ProgressBar_Adapter_Console |
setTextWidth(integer $width) : \Zend_ProgressBar_Adapter_Console
Set the width of the text element
Parameters
Returns
Name | Type | Description |
---|---|---|
$width | integer |
Type | Description |
---|---|
\Zend_ProgressBar_Adapter_Console |
setWidth(integer $width = null) : \Zend_ProgressBar_Adapter_Console
Set the width of the progressbar
Parameters
Returns
Name | Type | Description |
---|---|---|
$width | integer |
Type | Description |
---|---|
\Zend_ProgressBar_Adapter_Console |