Modify special case for SQLite

This commit is contained in:
Alexandre Alapetite
2019-09-12 01:13:52 +02:00
parent db1af9607e
commit fbc849fc36

View File

@@ -191,8 +191,14 @@ class FreshRSS_DatabaseDAO extends Minz_ModelPdo {
$nbEntries = $entryDAO->countUnreadRead();
if (!empty($nbEntries['all'])) {
$error = 'Error: Destination database already contains some entries!';
break;
}
}
if ($this->bd->dbType() === 'sqlite') {
//For importing to SQLite, we can just copy the SQLite source (issues when using another PDO)
copy($filename, join_path(DATA_PATH, 'users', $this->current_user, 'db.sqlite'));
goto done;
}
break;
default:
$error = 'Invalid copy mode!';
@@ -202,12 +208,6 @@ class FreshRSS_DatabaseDAO extends Minz_ModelPdo {
goto done;
}
if ($this->bd->dbType() === 'sqlite') {
//For importing to SQLite, we cannot have two PDO instances at the same time but we can just copy the SQLite source
copy($filename, join_path(DATA_PATH, 'users', $this->current_user, 'db.sqlite'));
goto done;
}
$sqlite = null;
try {