mirror of
https://github.com/grocy/grocy.git
synced 2026-04-07 05:16:15 +02:00
Added SQLite check
This commit is contained in:
parent
86b7cfed29
commit
05dcd5aec0
|
|
@ -2,12 +2,15 @@
|
|||
|
||||
class ERequirementNotMet extends Exception { }
|
||||
|
||||
const REQUIRED_PHP_EXTENSIONS = array('fileinfo', 'pdo_sqlite', 'gd');
|
||||
const REQUIRED_PHP_EXTENSIONS = array('fileinfo', 'pdo_sqlite', 'gd');
|
||||
const REQUIRED_SQLITE_VERSION_INT = "3008003"; //3.8.3 - this value will be checked
|
||||
const REQUIRED_SQLITE_VERSION_STRING = "3.8.3"; //This value is just for error output, no check is done
|
||||
|
||||
class PrerequisiteChecker
|
||||
{
|
||||
public function checkRequirements()
|
||||
{
|
||||
self::checkForSqliteVersion();
|
||||
self::checkForConfigFile();
|
||||
self::checkForConfigDistFile();
|
||||
self::checkForComposer();
|
||||
|
|
@ -50,4 +53,14 @@ class PrerequisiteChecker
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private function checkForSqliteVersion()
|
||||
{
|
||||
$sqliteVersion = SQLite3::version()["versionNumber"];
|
||||
if ($sqliteVersion < REQUIRED_SQLITE_VERSION_INT)
|
||||
{
|
||||
throw new ERequirementNotMet('SQLite ' . REQUIRED_SQLITE_VERSION_STRING . ' is required, however you are running ' . SQLite3::version()["versionString"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user