Skip to content

Commit e7d1a58

Browse files
committed
Merge branch '2.2'
Conflicts: components/console/helpers/progresshelper.rst reference/configuration/framework.rst
2 parents 98c0ff6 + 880dd44 commit e7d1a58

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

components/console/helpers/progresshelper.rst

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,20 @@ To see other available options, check the API documentation for
6565

6666
.. caution::
6767

68-
For performance reasons, be careful to not set the total number of steps
69-
to a high number. For example, if you're iterating over a large number
70-
of items, consider a smaller "step" number that updates on only some
71-
iterations::
68+
For performance reasons, be careful if you set the total number of steps
69+
to a high number. For example, if you're iterating over a large number of
70+
items, consider setting the redraw frequency to a higher value by calling
71+
:method:`Symfony\\Component\\Console\\Helper\\ProgressHelper::setRedrawFrequency`,
72+
so it updates on only some iterations::
73+
74+
$progress->start($output, 50000);
75+
76+
// update every 100 iterations
77+
$progress->setRedrawFrequency(100);
7278

73-
$progress->start($output, 500);
7479
$i = 0;
7580
while ($i++ < 50000) {
7681
// ... do some work
7782

78-
// advance every 100 iterations
79-
if ($i % 100 == 0) {
80-
$progress->advance();
81-
}
83+
$progress->advance();
8284
}

reference/configuration/framework.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Configuration
4444
* `assets_version_format`_
4545
* `profiler`_
4646
* `collect`_
47-
* `enabled`_
47+
* :ref:`enabled<profiler.enabled>`
4848

4949
secret
5050
~~~~~~
@@ -404,6 +404,8 @@ profiler
404404
could only be disabled by omitting the ``framework.profiler`` configuration
405405
entirely.
406406

407+
.. _profiler.enabled:
408+
407409
enabled
408410
.......
409411

0 commit comments

Comments
 (0)