mirror of
https://github.com/grocy/grocy.git
synced 2026-04-05 20:36:15 +02:00
Also check for php modules
This commit is contained in:
parent
71b7a24462
commit
5236b755cd
|
|
@ -3,13 +3,17 @@
|
|||
class ERequirementNotMet extends Exception {
|
||||
}
|
||||
|
||||
|
||||
const REQUIRED_PHP_EXTENSIONS = array("fileinfo", "pdo_sqlite", "gd");
|
||||
|
||||
class PrerequisiteChecker {
|
||||
|
||||
public function checkRequirements() {
|
||||
self::checkForConfigFile();
|
||||
/* self::checkForConfigFile();
|
||||
self::checkForConfigDistFile();
|
||||
self::checkForComposer();
|
||||
self::checkForYarn();
|
||||
self::checkForYarn(); */
|
||||
self::checkForPhpExtensions();
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -32,6 +36,14 @@ class PrerequisiteChecker {
|
|||
if (!file_exists(__DIR__ . "/../public/node_modules"))
|
||||
throw new ERequirementNotMet("/public/node_modules not found. Have you run Yarn?");
|
||||
}
|
||||
|
||||
private function checkForPhpExtensions() {
|
||||
$loadedExtensions = get_loaded_extensions();
|
||||
foreach (REQUIRED_PHP_EXTENSIONS as $extension) {
|
||||
if (!in_array($extension, $loadedExtensions))
|
||||
throw new ERequirementNotMet("PHP module '{$extension}' not installed, but required.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user