mirror of
https://github.com/grocy/grocy.git
synced 2026-04-07 05:16: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 {
|
class ERequirementNotMet extends Exception {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const REQUIRED_PHP_EXTENSIONS = array("fileinfo", "pdo_sqlite", "gd");
|
||||||
|
|
||||||
class PrerequisiteChecker {
|
class PrerequisiteChecker {
|
||||||
|
|
||||||
public function checkRequirements() {
|
public function checkRequirements() {
|
||||||
self::checkForConfigFile();
|
/* self::checkForConfigFile();
|
||||||
self::checkForConfigDistFile();
|
self::checkForConfigDistFile();
|
||||||
self::checkForComposer();
|
self::checkForComposer();
|
||||||
self::checkForYarn();
|
self::checkForYarn(); */
|
||||||
|
self::checkForPhpExtensions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -32,6 +36,14 @@ class PrerequisiteChecker {
|
||||||
if (!file_exists(__DIR__ . "/../public/node_modules"))
|
if (!file_exists(__DIR__ . "/../public/node_modules"))
|
||||||
throw new ERequirementNotMet("/public/node_modules not found. Have you run Yarn?");
|
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