We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5e60267 commit 5e2e63aCopy full SHA for 5e2e63a
panellib/analyze.php
@@ -2000,10 +2000,10 @@ function analyse_tree_host_graph_detail() {
2000
2001
$cpu_cores = 0;
2002
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
2003
- $output = shell_exec('wmic cpu get NumberOfCores');
+ $output = shell_exec("powershell -Command \"Get-WmiObject Win32_Processor | Select-Object NumberOfLogicalProcessors\"");
2004
if (!is_null($output) && $output !== false) {
2005
- $lines = preg_split('/\r\n|\r|\n/', $output);
2006
- $cpu_cores = $lines[1];
+ preg_match_all('/\d+/', $output, $matches);
+ $cpu_cores = array_sum($matches[0]);
2007
}
2008
} elseif (substr_count(strtolower(PHP_OS), 'darwin')) {
2009
$cpu_cores = shell_exec('sysctl -n hw.ncpu');
0 commit comments