aboutsummaryrefslogtreecommitdiff
path: root/cli/import-sqlite-for-user.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2025-03-22 23:17:52 +0100
committerGravatar GitHub <noreply@github.com> 2025-03-22 23:17:52 +0100
commit64bbb42553c925ebf7177945d048c18675188584 (patch)
treee9f11e54b44512628304bcd83a1f6f418529099f /cli/import-sqlite-for-user.php
parent72ad6e528cc7d65d4d4f401a705cd9e2e6183c1a (diff)
Fix CLI flag parsing (#7430)
* Fix CLI flag parsing fix https://github.com/FreshRSS/FreshRSS/issues/7428 * Fix other places * Forgotten debugging
Diffstat (limited to 'cli/import-sqlite-for-user.php')
-rwxr-xr-xcli/import-sqlite-for-user.php5
1 files changed, 2 insertions, 3 deletions
diff --git a/cli/import-sqlite-for-user.php b/cli/import-sqlite-for-user.php
index 45ecb3597..2eb3e2965 100755
--- a/cli/import-sqlite-for-user.php
+++ b/cli/import-sqlite-for-user.php
@@ -8,7 +8,7 @@ performRequirementCheck(FreshRSS_Context::systemConf()->db['type'] ?? '');
$cliOptions = new class extends CliOptionsParser {
public string $user;
public string $filename;
- public string $forceOverwrite;
+ public bool $forceOverwrite;
public function __construct() {
$this->addRequiredOption('user', (new CliOption('user')));
@@ -32,8 +32,7 @@ if (pathinfo($filename, PATHINFO_EXTENSION) !== 'sqlite') {
echo 'FreshRSS importing database from SQLite for user “', $username, "”…\n";
$databaseDAO = FreshRSS_Factory::createDatabaseDAO($username);
-$clearFirst = isset($cliOptions->forceOverwrite);
-$ok = $databaseDAO->dbCopy($filename, FreshRSS_DatabaseDAO::SQLITE_IMPORT, $clearFirst);
+$ok = $databaseDAO->dbCopy($filename, FreshRSS_DatabaseDAO::SQLITE_IMPORT, clearFirst: $cliOptions->forceOverwrite);
if (!$ok) {
echo 'If you would like to clear the user database first, use the option --force-overwrite', "\n";
}