Overview

Namespaces

  • Evenement
  • None
  • Peridot
    • Console
    • Core
    • Reporter
    • Runner
    • Scope
    • Test
  • Symfony
    • Component
      • Console
        • Command
        • Descriptor
        • Event
        • Exception
        • Formatter
        • Helper
        • Input
        • Logger
        • Output
        • Question
        • Style
        • Tester
        • Tests
          • Command
          • Descriptor
          • Fixtures
          • Formatter
          • Helper
          • Input
          • Logger
          • Output
          • Style
          • Tester

Classes

  • DebugFormatterHelper
  • DescriptorHelper
  • DialogHelper
  • FormatterHelper
  • Helper
  • HelperSet
  • InputAwareHelper
  • ProcessHelper
  • ProgressBar
  • ProgressHelper
  • ProgressIndicator
  • QuestionHelper
  • SymfonyQuestionHelper
  • Table
  • TableCell
  • TableHelper
  • TableSeparator
  • TableStyle

Interfaces

  • HelperInterface
  • Overview
  • Namespace
  • Class

Class ProgressBar

The ProgressBar provides helpers to display progress output.

Namespace: Symfony\Component\Console\Helper
Author: Fabien Potencier fabien@symfony.com
Author: Chris Jones leeked@gmail.com
Located at Helper/ProgressBar.php
Methods summary
public
# __construct( Symfony\Component\Console\Output\OutputInterface $output, integer $max = 0 )

Constructor.

Constructor.

Parameters

$output
An OutputInterface instance
$max
Maximum steps (0 if unknown)
public static
# setPlaceholderFormatterDefinition( string $name, callable $callable )

Sets a placeholder formatter for a given name.

Sets a placeholder formatter for a given name.

This method also allow you to override an existing placeholder.

Parameters

$name
The placeholder name (including the delimiter char like %)
$callable
A PHP callable
public static callable|null
# getPlaceholderFormatterDefinition( string $name )

Gets the placeholder formatter for a given name.

Gets the placeholder formatter for a given name.

Parameters

$name
The placeholder name (including the delimiter char like %)

Returns

callable|null
A PHP callable
public static
# setFormatDefinition( string $name, string $format )

Sets a format for a given name.

Sets a format for a given name.

This method also allow you to override an existing format.

Parameters

$name
The format name
$format
A format string
public static string|null
# getFormatDefinition( string $name )

Gets the format for a given name.

Gets the format for a given name.

Parameters

$name
The format name

Returns

string|null
A format string
public
# setMessage( string $message, string $name = 'message' )

Associates a text with a named placeholder.

Associates a text with a named placeholder.

The text is displayed when the progress bar is rendered but only when the corresponding placeholder is part of the custom format line (by wrapping the name with %).

Parameters

$message
The text to associate with the placeholder
$name
The name of the placeholder
public
# getMessage( $name = 'message' )
public integer
# getStartTime( )

Gets the progress bar start time.

Gets the progress bar start time.

Returns

integer
The progress bar start time
public integer
# getMaxSteps( )

Gets the progress bar maximal steps.

Gets the progress bar maximal steps.

Returns

integer
The progress bar max steps
public integer
# getStep( )

Gets the progress bar step.

Gets the progress bar step.

Deprecated

since version 2.6, to be removed in 3.0. Use Symfony\Component\Console\Helper\ProgressBar::getProgress() instead.

Returns

integer
The progress bar step
public integer
# getProgress( )

Gets the current step position.

Gets the current step position.

Returns

integer
The progress bar step
public integer
# getStepWidth( )

Gets the progress bar step width.

Gets the progress bar step width.

Returns

integer
The progress bar step width
public float
# getProgressPercent( )

Gets the current progress bar percent.

Gets the current progress bar percent.

Returns

float
The current progress bar percent
public
# setBarWidth( integer $size )

Sets the progress bar width.

Sets the progress bar width.

Parameters

$size
The progress bar size
public integer
# getBarWidth( )

Gets the progress bar width.

Gets the progress bar width.

Returns

integer
The progress bar size
public
# setBarCharacter( string $char )

Sets the bar character.

Sets the bar character.

Parameters

$char
A character
public string
# getBarCharacter( )

Gets the bar character.

Gets the bar character.

Returns

string
A character
public
# setEmptyBarCharacter( string $char )

Sets the empty bar character.

Sets the empty bar character.

Parameters

$char
A character
public string
# getEmptyBarCharacter( )

Gets the empty bar character.

Gets the empty bar character.

Returns

string
A character
public
# setProgressCharacter( string $char )

Sets the progress bar character.

Sets the progress bar character.

Parameters

$char
A character
public string
# getProgressCharacter( )

Gets the progress bar character.

Gets the progress bar character.

Returns

string
A character
public
# setFormat( string $format )

Sets the progress bar format.

Sets the progress bar format.

Parameters

$format
The format
public
# setRedrawFrequency( integer|float $freq )

Sets the redraw frequency.

Sets the redraw frequency.

Parameters

$freq
The frequency in steps
public
# start( integer|null $max = null )

Starts the progress output.

Starts the progress output.

Parameters

$max
Number of steps to complete the bar (0 if indeterminate), null to leave unchanged
public
# advance( integer $step = 1 )

Advances the progress output X steps.

Advances the progress output X steps.

Parameters

$step
Number of steps to advance

Throws

Symfony\Component\Console\Exception\LogicException
public
# setCurrent( integer $step )

Sets the current progress.

Sets the current progress.

Deprecated

since version 2.6, to be removed in 3.0. Use Symfony\Component\Console\Helper\ProgressBar::setProgress() instead.

Parameters

$step
The current progress

Throws

Symfony\Component\Console\Exception\LogicException
public
# setOverwrite( boolean $overwrite )

Sets whether to overwrite the progressbar, false for new line.

Sets whether to overwrite the progressbar, false for new line.

Parameters

$overwrite
public
# setProgress( integer $step )

Sets the current progress.

Sets the current progress.

Parameters

$step
The current progress

Throws

Symfony\Component\Console\Exception\LogicException
public
# finish( )

Finishes the progress output.

Finishes the progress output.

public
# display( )

Outputs the current progress string.

Outputs the current progress string.

public
# clear( )

Removes the progress bar from the current line.

Removes the progress bar from the current line.

This is useful if you wish to write some output while a progress bar is running. Call display() to show the progress bar again.

Peridot API documentation generated by ApiGen