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-2011 Zend Technologies USA Inc. (http://www.zend.com)
- license
-
New BSD License
- package
- Zend_ProgressBar
- version
- $Id: Console.php 23775 2011-03-01 17:25:24Z ralph $
\Zend_ProgressBar_Adapter_Console
Zend_ProgressBar_Adapter_Console offers a text-based progressbar for console
applications
- Extends from
- \Zend_ProgressBar_Adapter
- category
- Zend
- copyright
- Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
- license
-
New BSD License
- package
- Zend_ProgressBar
- uses
- \Zend_ProgressBar_Adapter_Interface
Constants
Properties



string
$_barLeftChar= '#'
Left character(s) within the bar
Default value#
Details
- Type
- string



string
$_barRightChar= '-'
Right character(s) within the bar
Default value-
Details
- Type
- string



string
$_finishAction= 'self'
Which action to do at finish call
Default valueself
Details
- Type
- string



boolean
$_outputStarted= 'false'
Wether the output started yet or not
Default valuefalse
Details
- Type
- boolean



resource
$_outputStream= 'null'
Output-stream, when STDOUT is not defined (e.g. in CGI) or set manually
Default valuenull
Details
- Type
- resource



string
$_textWidth= '20'
Width of the text element
Default value20
Details
- Type
- string
Methods



__construct(
null|array|\Zend_Config $options
=
null
)
:
void
Defined by Zend_ProgressBar_Adapter
$options may be either be an array or a Zend_Config object which
specifies adapter related options.
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.
Parameters
Name |
Type |
Description |
$data |
string |
|



getOutputStream(
)
:
resource
Get the current output stream
Returns
Type |
Description |
resource |
|



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 |



setBarLeftChar(
string $char
)
:
\Zend_ProgressBar_Adapter_Console
Set the left-hand character for the bar
Parameters
Name |
Type |
Description |
$char |
string |
|
Returns
Throws



setBarRightChar(
string $char
)
:
\Zend_ProgressBar_Adapter_Console
Set the right-hand character for the bar
Parameters
Name |
Type |
Description |
$char |
string |
|
Returns
Throws



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
Name |
Type |
Description |
$elements |
array |
|
Returns
Throws