Utils: eliminate usages of backtick operator

This commit is contained in:
Dylan K. Taylor 2021-11-01 15:25:56 +00:00
parent d5f13d8be2
commit 0f0b6f0efa
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -71,6 +71,7 @@ use function rmdir;
use function rtrim; use function rtrim;
use function scandir; use function scandir;
use function sha1; use function sha1;
use function shell_exec;
use function spl_object_hash; use function spl_object_hash;
use function str_pad; use function str_pad;
use function str_replace; use function str_replace;
@ -235,7 +236,7 @@ class Utils{
}elseif($os === Utils::OS_ANDROID){ }elseif($os === Utils::OS_ANDROID){
$machine .= @file_get_contents("/system/build.prop"); $machine .= @file_get_contents("/system/build.prop");
}elseif($os === Utils::OS_MACOS){ }elseif($os === Utils::OS_MACOS){
$machine .= `system_profiler SPHardwareDataType | grep UUID`; $machine .= shell_exec("system_profiler SPHardwareDataType | grep UUID");
} }
$data = $machine . PHP_MAXPATHLEN; $data = $machine . PHP_MAXPATHLEN;
$data .= PHP_INT_MAX; $data .= PHP_INT_MAX;
@ -358,7 +359,7 @@ class Utils{
break; break;
case Utils::OS_BSD: case Utils::OS_BSD:
case Utils::OS_MACOS: case Utils::OS_MACOS:
$processors = (int) `sysctl -n hw.ncpu`; $processors = (int) shell_exec("sysctl -n hw.ncpu");
break; break;
case Utils::OS_WINDOWS: case Utils::OS_WINDOWS:
$processors = (int) getenv("NUMBER_OF_PROCESSORS"); $processors = (int) getenv("NUMBER_OF_PROCESSORS");