1
0
Fork 0

Minor code reformatting and error message clarification

pull/1552/merge
Jordi Boggiano 2013-02-11 22:55:14 +01:00
parent 8bcb442d2b
commit f98f093f7b
1 changed files with 3 additions and 5 deletions

View File

@ -37,7 +37,6 @@ class ZipDownloader extends ArchiveDownloader
// try to use unzip on *nix // try to use unzip on *nix
if (!defined('PHP_WINDOWS_VERSION_BUILD')) { if (!defined('PHP_WINDOWS_VERSION_BUILD')) {
$command = 'unzip '.escapeshellarg($file).' -d '.escapeshellarg($path); $command = 'unzip '.escapeshellarg($file).' -d '.escapeshellarg($path);
if (0 === $this->process->execute($command, $ignoredOutput)) { if (0 === $this->process->execute($command, $ignoredOutput)) {
return; return;
@ -56,12 +55,11 @@ class ZipDownloader extends ArchiveDownloader
$iniMessage = 'A php.ini file does not exist. You will have to create one.'; $iniMessage = 'A php.ini file does not exist. You will have to create one.';
} }
$error = "Could not decompress the archive, enable the PHP zip extension or install unzip.\n". $error = "Could not decompress the archive, enable the PHP zip extension or install unzip.\n"
$iniMessage . "\n" . $processError; . $iniMessage . "\n" . $processError;
if (!defined('PHP_WINDOWS_VERSION_BUILD')) { if (!defined('PHP_WINDOWS_VERSION_BUILD')) {
$error = "You need the zip extension enabled to use the ZipDownloader.\n". $error = "Could not decompress the archive, enable the PHP zip extension.\n" . $iniMessage;
$iniMessage;
} }
throw new \RuntimeException($error); throw new \RuntimeException($error);