Zend Framework  1.12
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Zend_ProgressBar_Adapter_Console Class Reference

Public Member Functions

 __construct ($options=null)
 Defined by Zend_ProgressBar_Adapter.
 
 __destruct ()
 Close local stdout, when open.
 
 setOutputStream ($resource)
 Set a different output-stream.
 
 getOutputStream ()
 Get the current output stream.
 
 setWidth ($width=null)
 Set the width of the progressbar.
 
 setElements (array $elements)
 Set the elements to display with the progressbar.
 
 setBarLeftChar ($char)
 Set the left-hand character for the bar.
 
 setBarRightChar ($char)
 Set the right-hand character for the bar.
 
 setBarIndicatorChar ($char)
 Set the indicator character for the bar.
 
 setTextWidth ($width)
 Set the width of the text element.
 
 setCharset ($charset)
 Set the charset of the text element.
 
 setFinishAction ($action)
 Set the finish action.
 
 notify ($current, $max, $percent, $timeTaken, $timeRemaining, $text)
 Defined by Zend_ProgressBar_Adapter_Interface.
 
 finish ()
 Defined by Zend_ProgressBar_Adapter_Interface.
 
- Public Member Functions inherited from Zend_ProgressBar_Adapter
 __construct ($options=null)
 Create a new adapter.
 
 setConfig (Zend_Config $config)
 Set options via a Zend_Config instance.
 
 setOptions (array $options)
 Set options via an array.
 
 notify ($current, $max, $percent, $timeTaken, $timeRemaining, $text)
 Notify the adapter about an update.
 
 finish ()
 Called when the progress is explicitly finished.
 

Public Attributes

const ELEMENT_PERCENT = 'ELEMENT_PERCENT'
 Percentage value of the progress.
 
const ELEMENT_BAR = 'ELEMENT_BAR'
 Visual value of the progress.
 
const ELEMENT_ETA = 'ELEMENT_ETA'
 ETA of the progress.
 
const ELEMENT_TEXT = 'ELEMENT_TEXT'
 Text part of the progress.
 
const FINISH_ACTION_EOL = 'FINISH_ACTION_EOL'
 Finish action: End of Line.
 
const FINISH_ACTION_CLEAR_LINE = 'FINISH_ACTION_CLEAR_LINE'
 Finish action: Clear Line.
 
const FINISH_ACTION_NONE = 'FINISH_ACTION_NONE'
 Finish action: None.
 

Protected Member Functions

 _calculateBarWidth ()
 Calculate the bar width when other elements changed.
 
 _outputData ($data)
 Outputs given data to STDOUT.
 

Protected Attributes

 $_width = null
 
 $_elements
 
 $_finishAction = self::FINISH_ACTION_EOL
 
 $_barWidth
 
 $_barLeftChar = '#'
 
 $_barIndicatorChar = ''
 
 $_barRightChar = '-'
 
 $_outputStream = null
 
 $_textWidth = 20
 
 $_outputStarted = false
 
 $_charset = 'utf-8'
 
- Protected Attributes inherited from Zend_ProgressBar_Adapter
 $_skipOptions
 

Constructor & Destructor Documentation

__construct (   $options = null)

Defined by Zend_ProgressBar_Adapter.

Parameters
null | array | Zend_Config$options
__destruct ( )

Close local stdout, when open.

Member Function Documentation

_calculateBarWidth ( )
protected

Calculate the bar width when other elements changed.

Returns
void
_outputData (   $data)
protected

Outputs given data to STDOUT.

This split-off is required for unit-testing.

Parameters
string$data
Returns
void
finish ( )

Defined by Zend_ProgressBar_Adapter_Interface.

Returns
void
getOutputStream ( )

Get the current output stream.

Returns
resource
notify (   $current,
  $max,
  $percent,
  $timeTaken,
  $timeRemaining,
  $text 
)

Defined by Zend_ProgressBar_Adapter_Interface.

Parameters
float$currentCurrent progress value
float$maxMax progress value
float$percentCurrent percent value
integer$timeTakenTaken time in seconds
integer$timeRemainingRemaining time in seconds
string$textStatus text
Returns
void
setBarIndicatorChar (   $char)

Set the indicator character for the bar.

Parameters
string$char
Returns
Zend_ProgressBar_Adapter_Console
setBarLeftChar (   $char)

Set the left-hand character for the bar.

Parameters
string$char
Exceptions
Zend_ProgressBar_Adapter_ExceptionWhen character is empty
Returns
Zend_ProgressBar_Adapter_Console
setBarRightChar (   $char)

Set the right-hand character for the bar.

Parameters
string$char
Exceptions
Zend_ProgressBar_Adapter_ExceptionWhen character is empty
Returns
Zend_ProgressBar_Adapter_Console
setCharset (   $charset)

Set the charset of the text element.

Parameters
string$charset
setElements ( array  $elements)

Set the elements to display with the progressbar.

Parameters
array$elements
Exceptions
Zend_ProgressBar_Adapter_ExceptionWhen an invalid element is foudn in the array
Returns
Zend_ProgressBar_Adapter_Console
setFinishAction (   $action)

Set the finish action.

Parameters
string$action
Exceptions
Zend_ProgressBar_Adapter_ExceptionWhen an invalid action is specified
Returns
Zend_ProgressBar_Adapter_Console
setOutputStream (   $resource)

Set a different output-stream.

Parameters
string$resource
Returns
Zend_ProgressBar_Adapter_Console
setTextWidth (   $width)

Set the width of the text element.

Parameters
integer$width
Returns
Zend_ProgressBar_Adapter_Console
setWidth (   $width = null)

Set the width of the progressbar.

Parameters
integer$width
Returns
Zend_ProgressBar_Adapter_Console

Member Data Documentation

$_barIndicatorChar = ''
protected
$_barLeftChar = '#'
protected
$_barRightChar = '-'
protected
$_barWidth
protected
$_charset = 'utf-8'
protected
$_elements
protected
Initial value:
= array(self::ELEMENT_PERCENT,
self::ELEMENT_BAR,
self::ELEMENT_ETA)
$_finishAction = self::FINISH_ACTION_EOL
protected
$_outputStarted = false
protected
$_outputStream = null
protected
$_textWidth = 20
protected
$_width = null
protected
const ELEMENT_BAR = 'ELEMENT_BAR'

Visual value of the progress.

const ELEMENT_ETA = 'ELEMENT_ETA'

ETA of the progress.

const ELEMENT_PERCENT = 'ELEMENT_PERCENT'

Percentage value of the progress.

const ELEMENT_TEXT = 'ELEMENT_TEXT'

Text part of the progress.

const FINISH_ACTION_CLEAR_LINE = 'FINISH_ACTION_CLEAR_LINE'

Finish action: Clear Line.

const FINISH_ACTION_EOL = 'FINISH_ACTION_EOL'

Finish action: End of Line.

const FINISH_ACTION_NONE = 'FINISH_ACTION_NONE'

Finish action: None.