Browse Source

Fixes #12879: Console progress bar was not working properly in Windows terminals

tags/2.0.11
Alexander Makarov 8 years ago
parent
commit
2788f83576
  1. 1
      framework/CHANGELOG.md
  2. 5
      framework/helpers/BaseConsole.php

1
framework/CHANGELOG.md

@ -22,6 +22,7 @@ Yii Framework 2 Change Log
- Enh #12790: Added `scrollToErrorOffset` option for `ActiveForm` which adds ability to specify offset in pixels when scrolling to error (mg-code)
- Enh #12748: Migration generator now tries to fetch reference column name for foreignKey from schema if it's not set explicitly (MKiselev)
- Bug #4113: Error page stacktrace was generating links to private methods which are not part of the API docs (samdark)
- Bug #12879: Console progress bar was not working properly in Windows terminals (samdark, kids-return)
2.0.10 October 20, 2016
-----------------------

5
framework/helpers/BaseConsole.php

@ -968,7 +968,10 @@ class BaseConsole
$info .= sprintf(' ETA: %d sec.', self::$_progressEta);
}
$width -= 3 + static::ansiStrlen($info);
// Number extra characters outputted. These are opening [, closing ], and space before info
// Since Windows uses \r\n\ for line endings, there's one more in the case
$extraChars = static::isRunningOnWindows() ? 4 : 3;
$width -= $extraChars + static::ansiStrlen($info);
// skipping progress bar on very small display or if forced to skip
if ($width < 5) {
static::stdout("\r$prefix$info ");

Loading…
Cancel
Save