Add warning if zip lib missing

This commit is contained in:
Laurent Destailleur 2020-01-16 01:11:39 +01:00
parent 4770bdcb79
commit 8f73bce878
5 changed files with 31 additions and 4 deletions

View File

@ -254,6 +254,7 @@ before_script:
fi
- sudo a2enmod rewrite actions fastcgi alias
- echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- echo "extension = zip.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- sudo sed -i -e "s,www-data,travis,g" /etc/apache2/envvars
- sudo chown -R travis:travis /var/lib/apache2/fastcgi
- ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm

View File

@ -169,6 +169,17 @@ if (empty($_SERVER["SERVER_ADMIN"]) || $_SERVER["SERVER_ADMIN"] != 'doliwamp@loc
}
}
print '<tr><td>Zip support</td><td>';
if (!class_exists('ZipArchive'))
{
print '<img src="'.$WarningPicturePath.'" alt="Warning"> '.$langs->trans("ErrorPHPDoesNotSupportZip");
}
else
{
print '<img src="'.$OkayPicturePath.'" alt="Ok"> '.$langs->trans("PHPSupportZip");
}
print '</td></tr>';
print '</table>';

View File

@ -127,7 +127,7 @@ if (!function_exists("imagecreate"))
{
$langs->load("errors");
print '<img src="../theme/eldy/img/warning.png" alt="Error"> '.$langs->trans("ErrorPHPDoesNotSupportGD")."<br>\n";
// $checksok=0; // If ko, just warning. So check must still be 1 (otherwise no way to install)
// $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install)
}
else
{
@ -140,7 +140,7 @@ if (!function_exists("curl_init"))
{
$langs->load("errors");
print '<img src="../theme/eldy/img/warning.png" alt="Error"> '.$langs->trans("ErrorPHPDoesNotSupportCurl")."<br>\n";
// $checksok=0; // If ko, just warning. So check must still be 1 (otherwise no way to install)
// $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install)
}
else
{
@ -163,7 +163,7 @@ if (!function_exists("utf8_encode"))
{
$langs->load("errors");
print '<img src="../theme/eldy/img/warning.png" alt="Error"> '.$langs->trans("ErrorPHPDoesNotSupportUTF8")."<br>\n";
// $checksok=0; // If ko, just warning. So check must still be 1 (otherwise no way to install)
// $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install)
}
else
{
@ -178,7 +178,7 @@ if (empty($_SERVER["SERVER_ADMIN"]) || $_SERVER["SERVER_ADMIN"] != 'doliwamp@loc
{
$langs->load("errors");
print '<img src="../theme/eldy/img/warning.png" alt="Error"> '.$langs->trans("ErrorPHPDoesNotSupportIntl")."<br>\n";
// $checksok=0; // If ko, just warning. So check must still be 1 (otherwise no way to install)
// $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install)
}
else
{
@ -186,6 +186,16 @@ if (empty($_SERVER["SERVER_ADMIN"]) || $_SERVER["SERVER_ADMIN"] != 'doliwamp@loc
}
}
if (!class_exists('ZipArchive'))
{
$langs->load("errors");
print '<img src="../theme/eldy/img/warning.png" alt="Error"> '.$langs->trans("ErrorPHPDoesNotSupport", "ZIP")."<br>\n";
// $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install)
}
else
{
print '<img src="../theme/eldy/img/tick.png" alt="Ok"> '.$langs->trans("PHPSupport", "ZIP")."<br>\n";
}
// Check memory
$memrequiredorig = '64M';

View File

@ -16,6 +16,7 @@ PHPSupportCurl=This PHP supports Curl.
PHPSupportCalendar=This PHP supports calendars extensions.
PHPSupportUTF8=This PHP supports UTF8 functions.
PHPSupportIntl=This PHP supports Intl functions.
PHPSupport=This PHP supports %s functions.
PHPMemoryOK=Your PHP max session memory is set to <b>%s</b>. This should be enough.
PHPMemoryTooLow=Your PHP max session memory is set to <b>%s</b> bytes. This is too low. Change your <b>php.ini</b> to set <b>memory_limit</b> parameter to at least <b>%s</b> bytes.
Recheck=Click here for a more detailed test
@ -25,6 +26,7 @@ ErrorPHPDoesNotSupportCurl=Your PHP installation does not support Curl.
ErrorPHPDoesNotSupportCalendar=Your PHP installation does not support php calendar extensions.
ErrorPHPDoesNotSupportUTF8=Your PHP installation does not support UTF8 functions. Dolibarr cannot work correctly. Resolve this before installing Dolibarr.
ErrorPHPDoesNotSupportIntl=Your PHP installation does not support Intl functions.
ErrorPHPDoesNotSupport=Your PHP installation does not support %s functions.
ErrorDirDoesNotExists=Directory %s does not exist.
ErrorGoBackAndCorrectParameters=Go back and check/correct the parameters.
ErrorWrongValueForParameter=You may have typed a wrong value for parameter '%s'.

View File

@ -235,6 +235,7 @@ class ExportTest extends PHPUnit\Framework\TestCase
$model='csv';
// Build export file
print "Process build_file for model = ".$model."\n";
$result=$objexport->build_file($user, $model, $datatoexport, $array_selected, array(), $sql);
$expectedresult=1;
$this->assertEquals($expectedresult, $result,'Error in CSV export');
@ -242,6 +243,7 @@ class ExportTest extends PHPUnit\Framework\TestCase
$model='tsv';
// Build export file
print "Process build_file for model = ".$model."\n";
$result=$objexport->build_file($user, $model, $datatoexport, $array_selected, array(), $sql);
$expectedresult=1;
$this->assertEquals($expectedresult, $result, 'Error in TSV export');
@ -249,6 +251,7 @@ class ExportTest extends PHPUnit\Framework\TestCase
$model='excel2007new';
// Build export file
print "Process build_file for model = ".$model."\n";
$result=$objexport->build_file($user, $model, $datatoexport, $array_selected, array(), $sql);
$expectedresult=1;
$this->assertEquals($expectedresult, $result, 'Error in Excel2007new export');