Skip to content

Commit

Permalink
Throw an exception if contructor gets called on a disabled plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
annda committed Jan 25, 2024
1 parent 9ac2cb9 commit 48c6692
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions SQLiteDB.php
Expand Up @@ -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');
}
Expand Down

0 comments on commit 48c6692

Please sign in to comment.