Skip to content

Commit

Permalink
Merge pull request #89 from cosmocode/disabled
Browse files Browse the repository at this point in the history
Throw an exception if constructor gets called on a disabled plugin
  • Loading branch information
splitbrain authored Jan 25, 2024
2 parents 9ac2cb9 + 48c6692 commit 735cfd0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions SQLiteDB.php
Original file line number Diff line number Diff line change
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 735cfd0

Please sign in to comment.