Don't show setup page if node or npm are missing

This commit is contained in:
Benjamin Beganović 2020-07-27 16:55:26 +02:00
parent c2cae00016
commit deb6a18e79

View File

@ -60,6 +60,14 @@ class SystemHealth
$system_health = false;
}
if (!self::checkNode()) {
$system_health = false;
}
if (!self::checkNpm()) {
$system_health = false;
}
return [
'system_health' => $system_health,
'extensions' => self::extensions(),
@ -82,14 +90,13 @@ class SystemHealth
exec('node -v', $foo, $exitCode);
if ($exitCode === 0) {
return $foo[0];
return true;
}
} catch (\Exception $e) {
return false;
} catch (\Exception $e) {
return false;
}
}
public static function checkNpm()
@ -98,14 +105,14 @@ class SystemHealth
exec('npm -v', $foo, $exitCode);
if ($exitCode === 0) {
return $foo[0];
return true;
}
}catch (\Exception $e) {
return false;
}
} catch (\Exception $e) {
return false;
}
}
private static function simpleDbCheck() :bool