1
0
Fork 0

Merge remote-tracking branch 'mkopras/ticket_1052'

pull/1366/merge
Jordi Boggiano 2012-11-29 11:12:03 +01:00
commit 9c029c234e
1 changed files with 12 additions and 1 deletions

View File

@ -34,7 +34,17 @@ class ZipDownloader extends ArchiveDownloader
protected function extract($file, $path) protected function extract($file, $path)
{ {
if (!class_exists('ZipArchive')) { if (!class_exists('ZipArchive')) {
$error = 'You need the zip extension enabled to use the ZipDownloader'; // php.ini path is added to the error message to help users find the correct file
$iniPath = php_ini_loaded_file();
if ($iniPath) {
$iniMessage = 'The php.ini used by your command-line PHP is: ' . $iniPath;
} else {
$iniMessage = 'A php.ini file does not exist. You will have to create one.';
}
$error = "You need the zip extension enabled to use the ZipDownloader.\n".
$iniMessage;
// try to use unzip on *nix // try to use unzip on *nix
if (!defined('PHP_WINDOWS_VERSION_BUILD')) { if (!defined('PHP_WINDOWS_VERSION_BUILD')) {
@ -44,6 +54,7 @@ class ZipDownloader extends ArchiveDownloader
} }
$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" .
'Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput(); 'Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput();
} }