From 196265e696ed2f8eddf452c4d0ea1c635178b7f6 Mon Sep 17 00:00:00 2001 From: mr-bryn Date: Wed, 17 Apr 2024 08:25:56 +1000 Subject: [PATCH] Update AdminController.php Update platform() function to instead use PHP's in-built php_uname() function to return machine type Signed-off-by: mr-bryn --- lib/Controller/AdminController.php | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/lib/Controller/AdminController.php b/lib/Controller/AdminController.php index cdd10d14..e7fd7dc8 100644 --- a/lib/Controller/AdminController.php +++ b/lib/Controller/AdminController.php @@ -157,18 +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); - return new JSONResponse(['platform' => $lscpu['lscpu'][0]['data']]); + return new JSONResponse(['platform' => php_uname('m')]); } public function musl(): JSONResponse {