mirror of
https://github.com/silverstripe/silverstripe-sqlite3
synced 2024-10-22 17:05:37 +02:00
ENHANCEMENT Added SQLiteDatabaseConfigurationHelper::getDatabaseVersion()
This commit is contained in:
parent
016d848a87
commit
5be44e56b4
@ -107,9 +107,7 @@ class SQLiteDatabaseConfigurationHelper implements DatabaseConfigurationHelper {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function requireDatabaseVersion($databaseConfig) {
|
public function getDatabaseVersion($databaseConfig) {
|
||||||
$success = false;
|
|
||||||
$error = '';
|
|
||||||
$version = 0;
|
$version = 0;
|
||||||
|
|
||||||
if(class_exists('SQLite3')) {
|
if(class_exists('SQLite3')) {
|
||||||
@ -128,6 +126,14 @@ class SQLiteDatabaseConfigurationHelper implements DatabaseConfigurationHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $version;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function requireDatabaseVersion($databaseConfig) {
|
||||||
|
$success = false;
|
||||||
|
$error = '';
|
||||||
|
$version = $this->getDatabaseVersion($databaseConfig);
|
||||||
|
|
||||||
if($version) {
|
if($version) {
|
||||||
$success = version_compare($version, '3.3', '>=');
|
$success = version_compare($version, '3.3', '>=');
|
||||||
if(!$success) {
|
if(!$success) {
|
||||||
|
Loading…
Reference in New Issue
Block a user