API Documentation

ProgressBar/Adapter/Console.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_ProgressBar
version
$Id: Console.php 20096 2010-01-06 02:05:09Z bkarwin $
Classes
Zend_ProgressBar_Adapter_Console

Description

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.

Zend_ProgressBar_Adapter_Console

Extends from
Zend_ProgressBar_Adapter
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_ProgressBar
uses
Zend_ProgressBar_Adapter_Interface
Constants
ELEMENT_PERCENT
ELEMENT_BAR
ELEMENT_ETA
ELEMENT_TEXT
FINISH_ACTION_EOL
FINISH_ACTION_CLEAR_LINE
FINISH_ACTION_NONE
Properties
$_width
$_elements
$_finishAction
$_barWidth
$_barLeftChar
$_barIndicatorChar
$_barRightChar
$_outputStream
$_textWidth
$_outputStarted
$_charset
Methods
__construct
__destruct
setOutputStream
getOutputStream
setWidth
setElements
setBarLeftChar
setBarRightChar
setBarIndicatorChar
setTextWidth
setCharset
setFinishAction
notify
finish
_calculateBarWidth
_outputData

Description

Zend_ProgressBar_Adapter_Console offers a text-based progressbar for console applications

Constants

ELEMENT_PERCENT

 ELEMENT_PERCENT = 'ELEMENT_PERCENT'

Percentage value of the progress

Details

value
ELEMENT_PERCENT

ELEMENT_BAR

 ELEMENT_BAR = 'ELEMENT_BAR'

Visual value of the progress

Details

value
ELEMENT_BAR

ELEMENT_ETA

 ELEMENT_ETA = 'ELEMENT_ETA'

ETA of the progress

Details

value
ELEMENT_ETA

ELEMENT_TEXT

 ELEMENT_TEXT = 'ELEMENT_TEXT'

Text part of the progress

Details

value
ELEMENT_TEXT

FINISH_ACTION_EOL

 FINISH_ACTION_EOL = 'FINISH_ACTION_EOL'

Finish action: End of Line

Details

value
FINISH_ACTION_EOL

FINISH_ACTION_CLEAR_LINE

 FINISH_ACTION_CLEAR_LINE = 'FINISH_ACTION_CLEAR_LINE'

Finish action: Clear Line

Details

value
FINISH_ACTION_CLEAR_LINE

FINISH_ACTION_NONE

 FINISH_ACTION_NONE = 'FINISH_ACTION_NONE'

Finish action: None

Details

value
FINISH_ACTION_NONE

Properties

$_barIndicatorChar

string $_barIndicatorChar = ''

Indicator character(s) within the bar

Details

$_barIndicatorChar
string
visibility
protected
default
final
false
static
false

$_barLeftChar

string $_barLeftChar = '#'

Left character(s) within the bar

Details

$_barLeftChar
string
visibility
protected
default
#
final
false
static
false

$_barRightChar

string $_barRightChar = '-'

Right character(s) within the bar

Details

$_barRightChar
string
visibility
protected
default
-
final
false
static
false

$_barWidth

integer $_barWidth = ''

Width of the bar element

Details

$_barWidth
integer
visibility
protected
default
final
false
static
false

$_charset

string $_charset = 'utf-8'

Charset of text element

Details

$_charset
string
visibility
protected
default
utf-8
final
false
static
false

$_elements

array $_elements = 'array'

Elements to display

Details

$_elements
array
visibility
protected
default
array
final
false
static
false

$_finishAction

string $_finishAction = 'self'

Which action to do at finish call

Details

$_finishAction
string
visibility
protected
default
self
final
false
static
false

$_outputStarted

boolean $_outputStarted = 'false'

Wether the output started yet or not

Details

$_outputStarted
boolean
visibility
protected
default
false
final
false
static
false

$_outputStream

resource $_outputStream = 'null'

Output-stream, when STDOUT is not defined (e.g. in CGI) or set manually

Details

$_outputStream
resource
visibility
protected
default
null
final
false
static
false

$_textWidth

string $_textWidth = '20'

Width of the text element

Details

$_textWidth
string
visibility
protected
default
20
final
false
static
false

$_width

integer $_width = 'null'

Width of the progressbar

Details

$_width
integer
visibility
protected
default
null
final
false
static
false

Methods

__construct

__construct( null|array|Zend_Config $options = null ) :

Defined by Zend_ProgressBar_Adapter

Arguments
$options
nullarrayZend_Config
Details
visibility
public
final
false
static
false

__destruct

__destruct( ) :

Close local stdout, when open

Details
visibility
public
final
false
static
false

_calculateBarWidth

_calculateBarWidth( ) : void

Calculate the bar width when other elements changed

Details
visibility
protected
final
false
static
false

_outputData

_outputData( string $data ) : void

Outputs given data to STDOUT.

This split-off is required for unit-testing.

Arguments
$data
string
Details
visibility
protected
final
false
static
false

finish

finish( ) : void

Defined by Zend_ProgressBar_Adapter_Interface

Details
visibility
public
final
false
static
false

getOutputStream

getOutputStream( ) : resource

Get the current output stream

Output
resource
Details
visibility
public
final
false
static
false

notify

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

Defined by Zend_ProgressBar_Adapter_Interface

Arguments
$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
Details
visibility
public
final
false
static
false

setBarIndicatorChar

setBarIndicatorChar( string $char ) : Zend_ProgressBar_Adapter_Console

Set the indicator character for the bar

Arguments
$char
string
Details
visibility
public
final
false
static
false

setBarLeftChar

setBarLeftChar( string $char ) : Zend_ProgressBar_Adapter_Console

Set the left-hand character for the bar

Arguments
$char
string
Details
visibility
public
final
false
static
false
throws
When character is empty

setBarRightChar

setBarRightChar( string $char ) : Zend_ProgressBar_Adapter_Console

Set the right-hand character for the bar

Arguments
$char
string
Details
visibility
public
final
false
static
false
throws
When character is empty

setCharset

setCharset( string $charset ) :

Set the charset of the text element

Arguments
$charset
string
Details
visibility
public
final
false
static
false

setElements

setElements( array $elements ) : Zend_ProgressBar_Adapter_Console

Set the elements to display with the progressbar

Arguments
$elements
array
Details
visibility
public
final
false
static
false
throws
When an invalid element is foudn in the array

setFinishAction

setFinishAction( string $action ) : Zend_ProgressBar_Adapter_Console

Set the finish action

Arguments
$action
string
Details
visibility
public
final
false
static
false
throws
When an invalid action is specified

setOutputStream

setOutputStream( string $resource ) : Zend_ProgressBar_Adapter_Console

Set a different output-stream

Arguments
$resource
string
Details
visibility
public
final
false
static
false

setTextWidth

setTextWidth( integer $width ) : Zend_ProgressBar_Adapter_Console

Set the width of the text element

Arguments
$width
integer
Details
visibility
public
final
false
static
false

setWidth

setWidth( integer $width = null ) : Zend_ProgressBar_Adapter_Console

Set the width of the progressbar

Arguments
$width
integer
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.