diff --git a/htdocs/admin/system/phpinfo.php b/htdocs/admin/system/phpinfo.php index ac51ce33dc3..c9324565e5b 100644 --- a/htdocs/admin/system/phpinfo.php +++ b/htdocs/admin/system/phpinfo.php @@ -183,6 +183,22 @@ print "".$name.""; print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions); print ""; +$functions = ["easter_date"]; +$name = "Calendar"; + +print ""; +print "".$name.""; +print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions); +print ""; + +$functions = ["simplexml_load_string"]; +$name = "Xml"; + +print ""; +print "".$name.""; +print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions); +print ""; + if (empty($_SERVER["SERVER_ADMIN"]) || $_SERVER["SERVER_ADMIN"] != 'doliwamp@localhost') { $functions = ["locale_get_primary_language", "locale_get_region"]; $name = "Intl"; diff --git a/htdocs/admin/tools/update.php b/htdocs/admin/tools/update.php index ea9ca86e994..902e68b381e 100644 --- a/htdocs/admin/tools/update.php +++ b/htdocs/admin/tools/update.php @@ -61,7 +61,11 @@ $version = '0.0'; if ($action == 'getlastversion') { $result = getURLContent('https://sourceforge.net/projects/dolibarr/rss'); //var_dump($result['content']); - $sfurl = simplexml_load_string($result['content'], 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET); + if (function_exists('simplexml_load_string')) { + $sfurl = simplexml_load_string($result['content'], 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET); + } else { + $sfurl = 'xml_not_available'; + } } @@ -82,7 +86,10 @@ if (function_exists('curl_init')) { $conf->global->MAIN_USE_RESPONSE_TIMEOUT = 10; if ($action == 'getlastversion') { - if ($sfurl) { + if ($sfurl == 'xml_not_available') { + $langs->load("errors"); + print $langs->trans("LastStableVersion").' : '.$langs->trans("ErrorFunctionNotAvailableInPHP", 'simplexml_load_string').'
'; + } elseif ($sfurl) { $i = 0; while (!empty($sfurl->channel[0]->item[$i]->title) && $i < 10000) { $title = $sfurl->channel[0]->item[$i]->title; diff --git a/htdocs/install/check.php b/htdocs/install/check.php index f260be4f9fb..e9023b6389c 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -118,10 +118,28 @@ if (!function_exists("session_id")) { } +// Check for mbstring extension +if (!extension_loaded("mbstring")) { + $langs->load("errors"); + print 'Error '.$langs->trans("ErrorPHPDoesNotSupport", "MBString")."
\n"; + // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) +} else { + print 'Ok '.$langs->trans("PHPSupport", "MBString")."
\n"; +} + +// Check for json extension +if (!extension_loaded("json")) { + $langs->load("errors"); + print 'Error '.$langs->trans("ErrorPHPDoesNotSupport", "JSON")."
\n"; + // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) +} else { + print 'Ok '.$langs->trans("PHPSupport", "JSON")."
\n"; +} + // Check if GD is supported (we need GD for image conversion) if (!function_exists("imagecreate")) { $langs->load("errors"); - print 'Error '.$langs->trans("ErrorPHPDoesNotSupportGD")."
\n"; + print 'Error '.$langs->trans("ErrorPHPDoesNotSupport", "GD")."
\n"; // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) } else { print 'Ok '.$langs->trans("PHPSupport", "GD")."
\n"; @@ -131,7 +149,7 @@ if (!function_exists("imagecreate")) { // Check if Curl is supported if (!function_exists("curl_init")) { $langs->load("errors"); - print 'Error '.$langs->trans("ErrorPHPDoesNotSupportCurl")."
\n"; + print 'Error '.$langs->trans("ErrorPHPDoesNotSupport", "Curl")."
\n"; // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) } else { print 'Ok '.$langs->trans("PHPSupport", "Curl")."
\n"; @@ -139,41 +157,49 @@ if (!function_exists("curl_init")) { // Check if PHP calendar extension is available if (!function_exists("easter_date")) { - print 'Error '.$langs->trans("ErrorPHPDoesNotSupportCalendar")."
\n"; + print 'Error '.$langs->trans("ErrorPHPDoesNotSupport", "Calendar")."
\n"; } else { print 'Ok '.$langs->trans("PHPSupport", "Calendar")."
\n"; } +// Check if Curl is supported +if (!function_exists("simplexml_load_string")) { + $langs->load("errors"); + print 'Error '.$langs->trans("ErrorPHPDoesNotSupport", "Xml")."
\n"; + // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) +} else { + print 'Ok '.$langs->trans("PHPSupport", "Xml")."
\n"; +} // Check if UTF8 is supported if (!function_exists("utf8_encode")) { $langs->load("errors"); - print 'Error '.$langs->trans("ErrorPHPDoesNotSupportUTF8")."
\n"; + print 'Error '.$langs->trans("ErrorPHPDoesNotSupport", "UTF8")."
\n"; // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) } else { print 'Ok '.$langs->trans("PHPSupport", "UTF8")."
\n"; } -// Check for mbstring extension -if (!extension_loaded("mbstring")) { - $langs->load("errors"); - print 'Error '.$langs->trans("ErrorPHPDoesNotSupportMbstring")."
\n"; - // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) -} else { - print 'Ok '.$langs->trans("PHPSupport", "mbstring")."
\n"; -} - // Check if intl methods are supported if (empty($_SERVER["SERVER_ADMIN"]) || $_SERVER["SERVER_ADMIN"] != 'doliwamp@localhost') { if (!function_exists("locale_get_primary_language") || !function_exists("locale_get_region")) { $langs->load("errors"); - print 'Error '.$langs->trans("ErrorPHPDoesNotSupportIntl")."
\n"; + print 'Error '.$langs->trans("ErrorPHPDoesNotSupport", "Intl")."
\n"; // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) } else { print 'Ok '.$langs->trans("PHPSupport", "Intl")."
\n"; } } +// Check if Curl is supported +if (!function_exists("imap_open")) { + $langs->load("errors"); + print 'Error '.$langs->trans("ErrorPHPDoesNotSupport", "IMAP")."
\n"; + // $checksok = 0; // If ko, just warning. So check must still be 1 (otherwise no way to install) +} else { + print 'Ok '.$langs->trans("PHPSupport", "IMAP")."
\n"; +} + if (!class_exists('ZipArchive')) { $langs->load("errors"); print 'Error '.$langs->trans("ErrorPHPDoesNotSupport", "ZIP")."
\n"; diff --git a/htdocs/langs/en_US/install.lang b/htdocs/langs/en_US/install.lang index 18a2eee941c..9d76ad15d43 100644 --- a/htdocs/langs/en_US/install.lang +++ b/htdocs/langs/en_US/install.lang @@ -17,13 +17,6 @@ PHPMemoryOK=Your PHP max session memory is set to %s. This should be enou PHPMemoryTooLow=Your PHP max session memory is set to %s bytes. This is too low. Change your php.ini to set memory_limit parameter to at least %s bytes. Recheck=Click here for a more detailed test ErrorPHPDoesNotSupportSessions=Your PHP installation does not support sessions. This feature is required to allow Dolibarr to work. Check your PHP setup and permissions of the sessions directory. -ErrorPHPDoesNotSupportGD=Your PHP installation does not support GD graphical functions. No graphs will be available. -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. -ErrorPHPDoesNotSupportMbstring=Your PHP installation does not support mbstring functions. -ErrorPHPDoesNotSupportxDebug=Your PHP installation does not support extend debug functions. ErrorPHPDoesNotSupport=Your PHP installation does not support %s functions. ErrorDirDoesNotExists=Directory %s does not exist. ErrorGoBackAndCorrectParameters=Go back and check/correct the parameters.