From f620f16e2b62cc12e8b2a155d8f764dd8bafefe8 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Fri, 6 Jun 2025 09:56:27 +0200 Subject: Install: add test PDO typing (#7651) fix https://github.com/FreshRSS/FreshRSS/issues/7647 --- lib/Minz/ModelPdo.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/Minz/ModelPdo.php b/lib/Minz/ModelPdo.php index 86f6df306..cb541a1e4 100644 --- a/lib/Minz/ModelPdo.php +++ b/lib/Minz/ModelPdo.php @@ -62,7 +62,11 @@ class Minz_ModelPdo { $this->pdo->setPrefix($db['prefix'] . $this->current_user . '_'); break; case 'sqlite': - $dsn = 'sqlite:' . DATA_PATH . '/users/' . $this->current_user . '/db.sqlite'; + if (in_array($this->current_user, [null, '', Minz_User::INTERNAL_USER], true)) { + $dsn = 'sqlite::memory:'; + } else { + $dsn = 'sqlite:' . DATA_PATH . '/users/' . $this->current_user . '/db.sqlite'; + } $this->pdo = new Minz_PdoSqlite($dsn . $dsnParams, null, null, $driver_options); $this->pdo->setPrefix(''); break; -- cgit v1.2.3