X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Fpharext%2FExecCmd.php;h=5a6ee81f6fdad1be6b6eb4756d3c5cf966de58ae;hb=337e76964be2ed6724633ac477affc3a28426c97;hp=7e657f3d6f4bab3351988eb754d49c6639d7a032;hpb=23b4f263e68ae8d0a34292ed6215350483fe8451;p=pharext%2Fpharext diff --git a/src/pharext/ExecCmd.php b/src/pharext/ExecCmd.php index 7e657f3..5a6ee81 100644 --- a/src/pharext/ExecCmd.php +++ b/src/pharext/ExecCmd.php @@ -94,7 +94,7 @@ class ExecCmd print $this->progress($data, 0); } else { if ($verbose) { - printf("%s\n", $data); + printf("%s", $data); } $this->output .= $data; } @@ -112,14 +112,18 @@ class ExecCmd * @return string */ private function progress($string, $flags) { - static $c = 0; - static $s = ["\\","|","/","-"]; + static $counter = 0; + static $symbols = ["\\","|","/","-"]; $this->output .= $string; + + if (false !== strpos($string, "\n")) { + ++$counter; + } return $flags & PHP_OUTPUT_HANDLER_FINAL ? " \r" - : sprintf(" %s\r", $s[$c++ % count($s)]); + : sprintf(" %s\r", $symbols[$counter % 4]); } /**