Browse Source

fixed div/0 issue in console progress bar

tags/2.0.0-beta
Carsten Brandt 11 years ago
parent
commit
4d99677f07
  1. 2
      framework/yii/helpers/BaseConsole.php

2
framework/yii/helpers/BaseConsole.php

@ -861,7 +861,7 @@ class BaseConsole
} }
$width -= mb_strlen($prefix); $width -= mb_strlen($prefix);
$percent = $done / $total; $percent = ($total == 0) ? 1 : $done / $total;
$info = sprintf("%d%% (%d/%d)", $percent * 100, $done, $total); $info = sprintf("%d%% (%d/%d)", $percent * 100, $done, $total);
if ($done > $total || $done == 0) { if ($done > $total || $done == 0) {

Loading…
Cancel
Save