Fix: detection of the Suhosin extension during the installation and tell the user if the get_max_value is too small.

SVN:trunk[1528]
This commit is contained in:
Denis Flaven
2011-08-29 11:49:22 +00:00
parent d547394ba2
commit 5d9d44dc5e

View File

@@ -37,6 +37,7 @@ define('FINAL_CONFIG_FILE', APPROOT.'/config-itop.php');
define('PHP_MIN_VERSION', '5.2.0'); define('PHP_MIN_VERSION', '5.2.0');
define('MYSQL_MIN_VERSION', '5.0.0'); define('MYSQL_MIN_VERSION', '5.0.0');
define('MIN_MEMORY_LIMIT', 32*1024*1024); define('MIN_MEMORY_LIMIT', 32*1024*1024);
define('SUHOSIN_GET_MAX_VALUE_LENGTH', 1024);
$sOperation = Utils::ReadParam('operation', 'step0'); $sOperation = Utils::ReadParam('operation', 'step0');
$oP = new SetupWebPage('iTop configuration wizard'); $oP = new SetupWebPage('iTop configuration wizard');
@@ -310,6 +311,23 @@ function CheckPHPVersion(SetupWebPage $oP)
$aOk[] = "APC detected (version $sAPCVersion). The APC cache will be used to speed-up iTop."; $aOk[] = "APC detected (version $sAPCVersion). The APC cache will be used to speed-up iTop.";
} }
// Special case Suhosin extension
if (extension_loaded('suhosin'))
{
$sSuhosinVersion = phpversion('suhosin');
$aOk[] = "Suhosin extension detected (version $sSuhosinVersion).";
$iGetMaxValueLength = ini_get('suhosin.get.max_value_length');
if ($iGetMaxValueLength < SUHOSIN_GET_MAX_VALUE_LENGTH)
{
$aErrors[] = "suhosin.get.max_value_length ($iGetMaxValueLength) is too small, the minimum value to run iTop is ".SUHOSIN_GET_MAX_VALUE_LENGTH.". This value is set by the PHP configuration file(s): '$sPhpIniFile'. Be aware that this setting can also be overridden in the apache configuration.";
$bResult = false;
}
else
{
$oP->log_info("suhosin.get.max_value_length = $iGetMaxValueLength, ok.");
}
}
if (!$bResult) if (!$bResult)
{ {
$sTitle = 'Checking prerequisites: Failed !'; $sTitle = 'Checking prerequisites: Failed !';