1
0
Fork 0

Added php.ini path to error message #1052

pull/1371/head
Mikołaj Kopras 2012-11-28 21:26:58 +01:00
parent e868c9706b
commit 534fe36149
1 changed files with 12 additions and 1 deletions

View File

@ -34,7 +34,17 @@ class ZipDownloader extends ArchiveDownloader
protected function extract($file, $path)
{
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
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".
$iniMessage . "\n" .
'Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput();
}