Skip to content

Commit

Permalink
Fix M1 processor count
Browse files Browse the repository at this point in the history
  • Loading branch information
bochoven committed Nov 20, 2020
1 parent 606645e commit cb63c35
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions machine_processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ public function run($plist)
$mylist['computer_name'] = 'No name';
}

// Fix Apple Silicon processor count - processor count is the first number
if (isset($mylist['number_processors'])) {
$mylist['number_processors'] = preg_replace('/^[^0-9]*(\d+)/', '$1', $mylist['number_processors']);
}

// Convert memory string (4 GB) to int
if (isset($mylist['physical_memory'])) {
$mylist['physical_memory'] = intval($mylist['physical_memory']);
Expand Down

0 comments on commit cb63c35

Please sign in to comment.