From 37929ef31833a79767cea233698b2d650bd6a80a Mon Sep 17 00:00:00 2001 From: chrico Date: Fri, 13 May 2022 09:24:52 +0200 Subject: [PATCH] Unzipper // only write information about falling back from unzip to ZipArchive and vise versa when running in verbose mode. --- src/Util/Unzipper.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Util/Unzipper.php b/src/Util/Unzipper.php index e499036..0e078df 100644 --- a/src/Util/Unzipper.php +++ b/src/Util/Unzipper.php @@ -146,11 +146,10 @@ protected function extractWithSystemUnzip(string $file, string $path, bool $isLa throw $processError; } - $this->io->writeError(' '.$processError->getMessage()); - $this->io->writeError( - ' The archive may contain identical file names with different capitalization (which fails on case insensitive filesystems)' - ); - $this->io->writeError(' Unzip with unzip command failed, falling back to ZipArchive class'); + $message = " " . $processError->getMessage() . ""; + $message .= "\n The archive may contain identical file names with different capitalization (which fails on case insensitive filesystems)."; + $message .="\n Unzip with unzip command failed, falling back to ZipArchive class."; + $this->io->write($message, true, IOInterface::VERBOSE); return $this->extractWithZipArchive($file, $path, true); } @@ -218,8 +217,11 @@ protected function extractWithZipArchive(string $file, string $path, bool $isLas throw $processError; } - $this->io->writeError(' ' . $processError->getMessage()); - $this->io->writeError(' Unzip with ZipArchive class failed, falling back to unzip command'); + $message = " " . $processError->getMessage() . ""; + $message .= "\n Unzip with ZipArchive class failed, falling back to unzip command."; + + + $this->io->write($message, true, IOInterface::VERBOSE); return $this->extractWithSystemUnzip($file, $path, true); }