Skip to content

Commit

Permalink
Merge pull request #1125 from mr-bryn/platform-check-fix
Browse files Browse the repository at this point in the history
Update AdminController.php platform check
  • Loading branch information
marcelklehr authored Apr 17, 2024
2 parents 92dc6c9 + 7219bb4 commit 5ae62c3
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions lib/Controller/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,21 +157,7 @@ public function avx(): JSONResponse {
}

public function platform(): JSONResponse {
try {
exec('lscpu --json' . ' 2>&1', $output, $returnCode);
} catch (\Throwable $e) {
return new JSONResponse(['platform' => null]);
}

if ($returnCode !== 0) {
return new JSONResponse(['platform' => null]);
}

$lscpu = \json_decode(trim(implode("\n", $output)), true);
if (!isset($lscpu['lscpu'][0]['data'])) {
return new JSONResponse(['platform' => null]);
}
return new JSONResponse(['platform' => $lscpu['lscpu'][0]['data']]);
return new JSONResponse(['platform' => php_uname('m')]);
}

public function musl(): JSONResponse {
Expand Down

0 comments on commit 5ae62c3

Please sign in to comment.