8000 [Console] Update some method names by javiereguiluz · Pull Request #12604 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

[Console] Update some method names #12604

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 9, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions components/console/helpers/progressbar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,16 @@ you can also set the current progress by calling the

If your platform doesn't support ANSI codes, updates to the progress
bar are added as new lines. To prevent the output from being flooded,
use the method :method:`Symfony\\Component\\Console\\Helper\\ProgressBar::preventRedrawFasterThan`
(it writes to the output after every N seconds) and the method
use the method :method:`Symfony\\Component\\Console\\Helper\\ProgressBar::minSecondsBetweenRedraws`
to limit the number of redraws and the method
:method:`Symfony\\Component\\Console\\Helper\\ProgressBar::setRedrawFrequency`
(it writes to the output every N iterations). By default, redraw frequency is
to redraw every N iterations. By default, redraw frequency is
**100ms** or **10%** of your ``max``.

.. versionadded:: 4.4

The ``preventRedrawFasterThan()`` method was introduced in Symfony 4.4.
The ``minSecondsBetweenRedraws()`` and ``maxSecondsBetweenRedraws()``
methods were introduced in Symfony 4.4.

If you don't know the exact number of steps in advance, set it to a reasonable
value and then call the ``setMaxSteps()`` method to update it as needed::
Expand Down Expand Up @@ -295,19 +296,18 @@ to display it can be customized::
.. caution::

For performance reasons, Symfony redraws screen every 100ms. If this is too
fast or to slow for your application, use these methods:
:method:`Symfony\\Component\\Console\\Helper\\ProgressBar::preventRedrawFasterThan`
:method:`Symfony\\Component\\Console\\Helper\\ProgressBar::setRedrawFrequency`
:method:`Symfony\\Component\\Console\\Helper\\ProgressBar::forceRedrawSlowerThan`::
fast or to slow for your application, use the methods
:method:`Symfony\\Component\\Console\\Helper\\ProgressBar::minSecondsBetweenRedraws` and
:method:`Symfony\\Component\\Console\\Helper\\ProgressBar::maxSecondsBetweenRedraws`::

$progressBar = new ProgressBar($output, 50000);
$progressBar->start();

// this redraws the screen every 100 iterations, but sets additional limits:
// don't redraw slower than 100ms (0.1) or faster than 200ms (0.2)
// don't redraw slower than 200ms (0.2) or faster than 100ms (0.1)
$progressBar->setRedrawFrequency(100);
$progressBar->forceRedrawSlowerThan(0.2);
$progressBar->preventRedrawFasterThan(0.1);
$progressBar->maxSecondsBetweenRedraws(0.2);
$progressBar->minSecondsBetweenRedraws(0.1);

$i = 0;
while ($i++ < 50000) {
Expand All @@ -318,7 +318,7 @@ to display it can be customized::

.. versionadded:: 4.4

The ``forceRedrawSlowerThan`` and ``preventRedrawFasterThan()`` methods
The ``minSecondsBetweenRedraws`` and ``maxSecondsBetweenRedraws()`` methods
were introduced in Symfony 4.4.

Custom Placeholders
Expand Down
0