1
0
Fork 0

Merge remote-tracking branch 'discordier/fix-zip-downloader'

pull/3034/head
Jordi Boggiano 2014-06-03 10:35:06 +02:00
commit 5336b039c1
1 changed files with 10 additions and 4 deletions

View File

@ -39,12 +39,18 @@ 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) . ' && chmod -R u+w ' . escapeshellarg($path); $command = 'unzip '.escapeshellarg($file).' -d '.escapeshellarg($path) . ' && chmod -R u+w ' . escapeshellarg($path);
try {
if (0 === $this->process->execute($command, $ignoredOutput)) { if (0 === $this->process->execute($command, $ignoredOutput)) {
return; return;
} }
$processError = 'Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput(); $processError = 'Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput();
} }
catch(\Exception $e)
{
$processError = $e->getMessage();
}
}
if (!class_exists('ZipArchive')) { if (!class_exists('ZipArchive')) {
// php.ini path is added to the error message to help users find the correct file // php.ini path is added to the error message to help users find the correct file