From 48c6692f46b1b980c8f8f6230a4e58d0973ee205 Mon Sep 17 00:00:00 2001 From: Anna Dabrowska Date: Thu, 25 Jan 2024 15:40:55 +0100 Subject: [PATCH] Throw an exception if contructor gets called on a disabled plugin --- SQLiteDB.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SQLiteDB.php b/SQLiteDB.php index d015f8c..7dc205f 100644 --- a/SQLiteDB.php +++ b/SQLiteDB.php @@ -41,6 +41,10 @@ class SQLiteDB */ public function __construct($dbname, $schemadir, $sqlitehelper = null) { + global $plugin_controller; + if (!$plugin_controller->isEnabled('sqlite')) { + throw new \Exception('SQLite plugin seems to be disabled.'); + } if (!class_exists('pdo') || !in_array('sqlite', \PDO::getAvailableDrivers())) { throw new \Exception('SQLite PDO driver not available'); }