We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2392fd8 commit 5836d87Copy full SHA for 5836d87
src/voku/SimplePhpParser/Parsers/Helper/Utils.php
@@ -495,6 +495,23 @@ public static function getCpuCores(): int
495
}
496
497
498
+ /**
499
+ * macOS (FreeBSD)
500
+ */
501
+ $ret = @\shell_exec('sysctl -n hw.ncpu');
502
+ if (\is_string($ret)) {
503
+ $ret = \trim($ret);
504
+ /** @noinspection PhpAssignmentInConditionInspection */
505
+ if ($ret && ($tmp = \filter_var($ret, \FILTER_VALIDATE_INT)) !== false) {
506
+ $return = (int)round($tmp / 2);
507
+ if ($return > 1) {
508
+ return $return;
509
+ }
510
+
511
+ return 1;
512
513
514
515
return 1;
516
517
0 commit comments