1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-13 17:57:37 +01:00

fixed Uncaught Error: Call to undefined function shell_exec()

This commit is contained in:
Thomas Bley 2021-09-20 12:18:49 +02:00
parent b4f4c94f77
commit 449ef0d994

View File

@ -1449,6 +1449,7 @@ class ProjectAnalyzer
return 1; return 1;
} }
if (\function_exists('shell_exec')) {
$has_nproc = trim((string) @shell_exec('command -v nproc')); $has_nproc = trim((string) @shell_exec('command -v nproc'));
if ($has_nproc) { if ($has_nproc) {
$ret = @shell_exec('nproc'); $ret = @shell_exec('nproc');
@ -1469,6 +1470,7 @@ class ProjectAnalyzer
return $tmp; return $tmp;
} }
} }
}
if (is_readable('/proc/cpuinfo')) { if (is_readable('/proc/cpuinfo')) {
$cpuinfo = file_get_contents('/proc/cpuinfo'); $cpuinfo = file_get_contents('/proc/cpuinfo');