Merge branch 'ent-7854-warning-por-memoria-php-umc-cuando-vale-1' into 'develop'

Minor fix in memory detection UMC

See merge request artica/pandorafms!4327
This commit is contained in:
Daniel Rodriguez 2021-08-05 11:51:39 +00:00
commit e623fa1822
2 changed files with 19 additions and 19 deletions

View File

@ -231,6 +231,21 @@ if (is_ajax() !== true) {
}
}
}
$PHPmemory_limit_min = config_return_in_bytes('800M');
$PHPmemory_limit = config_return_in_bytes(ini_get('memory_limit'));
if ($PHPmemory_limit < $PHPmemory_limit_min && $PHPmemory_limit !== -1) {
$msg = __(
'\'%s\' recommended value is %s or greater. Please, change it on your PHP configuration file (php.ini) or contact with administrator',
'memory_limit',
'800M'
);
if (function_exists('ui_print_warning_message') === true) {
ui_print_warning_message($msg);
} else {
echo $msg;
}
}
}
// Load styles.
@ -366,21 +381,6 @@ if (is_array($config) === true) {
}
}
$PHPmemory_limit_min = config_return_in_bytes('800M');
$PHPmemory_limit = config_return_in_bytes(ini_get('memory_limit'));
if ($PHPmemory_limit < $PHPmemory_limit_min && $PHPmemory_limit !== '-1') {
$msg = __(
'\'%s\' recommended value is %s or greater. Please, change it on your PHP configuration file (php.ini) or contact with administrator',
'memory_limit',
'800M'
);
if (function_exists('ui_print_warning_message') === true) {
ui_print_warning_message($msg);
} else {
echo $msg;
}
}
$ui = new Manager(
((is_array($config) === true) ? $pandora_url : 'http://'.$_SERVER['SERVER_ADDR'].'/'),
((is_array($config) === true) ? ui_get_full_url('ajax.php') : ''),

View File

@ -941,7 +941,7 @@ class Client
$queries = preg_split("/(;\n)|(;\n\r)/", $sql);
foreach ($queries as $query) {
if (empty($query) !== true) {
if (preg_match('/^\s*LOAD\s+(.*)$/i', $query, $matches) > 0) {
if (preg_match('/^\s*SOURCE\s+(.*)$/i', $query, $matches) > 0) {
$filepath = dirname($mr_file).'/'.$matches[1];
if (file_exists($filepath) === true) {
$query = file_get_contents($filepath);
@ -1342,14 +1342,14 @@ class Client
function ($errno, $errstr) {
throw new \Exception($errstr, $errno);
},
E_ERROR
(E_ALL ^ E_NOTICE)
);
register_shutdown_function(
function () {
$error = error_get_last();
if (null !== $error
&& $error['type'] === E_ERROR
&& $error['type'] === (E_ALL ^ E_NOTICE)
) {
echo __('Failed to analyze package: %s', $error['message']);
}
@ -1434,7 +1434,7 @@ class Client
function ($errno, $errstr) {
throw new \Exception($errstr, $errno);
},
E_ERROR
(E_ALL ^ E_NOTICE)
);
if ($package === null) {