PHP Class ConsoleKit\Widgets\ProgressBar

$total = 100; $progress = new ProgressBar($textWriter, $total); for ($i = 0; $i < $total; $i++) { $progress->incr(); usleep(10000); } $progress->stop();
Inheritance: extends AbstractWidget
Afficher le fichier Open project: maximebf/consolekit Class Usage Examples

Protected Properties

Свойство Type Description
$showRemainingTime boolean
$size integer
$startTime integer
$total integer
$value integer

Méthodes publiques

Méthode Description
__construct ( ConsoleKit\TextWriter $writer = null, integer $total = 100, integer $size = 50, $showRemainingTime = true )
__toString ( )
getShowRemainingTime ( ) : boolean
getSize ( ) : integer
getValue ( ) : number
incr ( integer $increment = 1 ) : ProgressBar Increments the value and calls {@see write()}
render ( ) : string Generates the text to write for the current values
setShowRemainingTime ( boolean $show = true )
setSize ( integer $size ) : ProgressBar
setValue ( number $value )
start ( integer $total = 100 ) : ProgressBar
stop ( ) : ProgressBar Writes a new line
write ( ) : ProgressBar Writes the rendered progress bar to the text writer

Method Details

__construct() public méthode

public __construct ( ConsoleKit\TextWriter $writer = null, integer $total = 100, integer $size = 50, $showRemainingTime = true )
$writer ConsoleKit\TextWriter
$total integer
$size integer

__toString() public méthode

public __toString ( )

getShowRemainingTime() public méthode

public getShowRemainingTime ( ) : boolean
Résultat boolean

getSize() public méthode

public getSize ( ) : integer
Résultat integer

getValue() public méthode

public getValue ( ) : number
Résultat number

incr() public méthode

Increments the value and calls {@see write()}
public incr ( integer $increment = 1 ) : ProgressBar
$increment integer
Résultat ProgressBar

render() public méthode

Generates the text to write for the current values
public render ( ) : string
Résultat string

setShowRemainingTime() public méthode

public setShowRemainingTime ( boolean $show = true )
$show boolean

setSize() public méthode

public setSize ( integer $size ) : ProgressBar
$size integer
Résultat ProgressBar

setValue() public méthode

public setValue ( number $value )
$value number

start() public méthode

public start ( integer $total = 100 ) : ProgressBar
$total integer
Résultat ProgressBar

stop() public méthode

Writes a new line
public stop ( ) : ProgressBar
Résultat ProgressBar

write() public méthode

Writes the rendered progress bar to the text writer
public write ( ) : ProgressBar
Résultat ProgressBar

Property Details

$showRemainingTime protected_oe property

protected bool $showRemainingTime
Résultat boolean

$size protected_oe property

protected int $size
Résultat integer

$startTime protected_oe property

protected int $startTime
Résultat integer

$total protected_oe property

protected int $total
Résultat integer

$value protected_oe property

protected int $value
Résultat integer