From 6c2ec966ffe839dc32569fe35f514317fee790a1 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 18 Jan 2012 10:35:02 +0100 Subject: [PATCH] Fix ConsoleIO::overwrite --- src/Composer/Downloader/FileDownloader.php | 8 ++++---- src/Composer/IO/ConsoleIO.php | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Composer/Downloader/FileDownloader.php b/src/Composer/Downloader/FileDownloader.php index 936531a4d..8f95d6079 100644 --- a/src/Composer/Downloader/FileDownloader.php +++ b/src/Composer/Downloader/FileDownloader.php @@ -24,7 +24,7 @@ use Composer\Package\PackageInterface; abstract class FileDownloader implements DownloaderInterface { protected $io; - protected $bytesMax; + private $bytesMax; /** * Constructor. @@ -103,9 +103,9 @@ abstract class FileDownloader implements DownloaderInterface $ctx = stream_context_create($params); stream_context_set_params($ctx, array("notification" => array($this, 'callbackGet'))); - $this->io->overwrite(" Downloading: connection...", 80); + $this->io->overwrite(" Downloading: connection..."); copy($url, $fileName, $ctx); - $this->io->overwrite(" Downloading", 80); + $this->io->overwrite(" Downloading"); if (!file_exists($fileName)) { throw new \UnexpectedValueException($url.' could not be saved to '.$fileName.', make sure the' @@ -193,7 +193,7 @@ abstract class FileDownloader implements DownloaderInterface } if (0 === $progression % 5) { - $this->io->overwrite(" Downloading: $progression%", 80); + $this->io->overwrite(" Downloading: $progression%"); } } break; diff --git a/src/Composer/IO/ConsoleIO.php b/src/Composer/IO/ConsoleIO.php index 7592e2d50..381cb9b84 100644 --- a/src/Composer/IO/ConsoleIO.php +++ b/src/Composer/IO/ConsoleIO.php @@ -65,25 +65,25 @@ class ConsoleIO implements IOInterface /** * {@inheritDoc} */ - public function overwrite($messages, $size = 80, $newline = false, $type = 0) + public function overwrite($messages, $size = 80, $newline = false) { for ($place = $size; $place > 0; $place--) { - $this->write("\x08"); + $this->write("\x08", false); } - $this->write($messages, false, $type); + $this->write($messages, false); for ($place = ($size - strlen($messages)); $place > 0; $place--) { - $this->write(' '); + $this->write(' ', false); } // clean up the end line for ($place = ($size - strlen($messages)); $place > 0; $place--) { - $this->write("\x08"); + $this->write("\x08", false); } if ($newline) { - $this->writeln(''); + $this->write(''); } }