Hack to disable memory limit for values in Gigabytes

This commit is contained in:
Timothy Warren 2019-02-12 14:39:58 -05:00
parent 58970e1c33
commit dea7b9074d

View File

@ -326,10 +326,12 @@ function check_config($config_file) {
$config->setServers($servers);
# Check the memory limit parameter.
if ((ini_get('memory_limit') > -1) && ini_get('memory_limit') < $config->getValue('session','memorylimit'))
$ini_limit = ini_get('memory_limit');
$ini_limit = str_replace('G', 1024 * 1024 * 1024 * (int)$ini_limit, $ini_limit);
if ((ini_get('memory_limit') > -1) && $ini_limit < $config->getValue('session','memorylimit'))
system_message(array(
'title'=>_('Memory Limit low.'),
'body'=>sprintf('Your php memory limit is low - currently %s, you should increase it to atleast %s. This is normally controlled in /etc/php.ini.',
'body'=>sprintf('Your php memory limit is low - currently %s, you should increase it to at least %s. This is normally controlled in /etc/php.ini.',
ini_get('memory_limit'),$config->getValue('session','memorylimit')),
'type'=>'error'));