Add MAIN_MEMORY_LIMIT_ARCHIVE_DATAROOT and MAIN_MEMORY_LIMIT_DUMP

This commit is contained in:
Laurent Destailleur 2021-11-13 01:45:38 +01:00
parent e113fe468f
commit a368200036
2 changed files with 12 additions and 1 deletions

View File

@ -98,7 +98,9 @@ if (!empty($ExecTimeLimit)) {
@set_time_limit($ExecTimeLimit); // Need more than 240 on Windows 7/64
error_reporting($err);
}
$MemoryLimit = 0;
/* If value has been forced with a php_admin_value, this has no effect. Example of value: '512M' */
$MemoryLimit = getDolGlobalString('MAIN_MEMORY_LIMIT_ARCHIVE_DATAROOT');
if (!empty($MemoryLimit)) {
@ini_set('memory_limit', $MemoryLimit);
}

View File

@ -358,10 +358,19 @@ class Utils
dol_syslog("Utils::dumpDatabase execmethod=".$execmethod." command:".$fullcommandcrypted, LOG_INFO);
/* If value has been forced with a php_admin_value, this has no effect. Example of value: '512M' */
$MemoryLimit = getDolGlobalString('MAIN_MEMORY_LIMIT_DUMP');
if (!empty($MemoryLimit)) {
@ini_set('memory_limit', $MemoryLimit);
}
// TODO Replace with executeCLI function
if ($execmethod == 1) {
$output_arr = array();
$retval = null;
exec($fullcommandclear, $output_arr, $retval);
if ($retval != 0) {