Skip to content

Commit bc31b7f

Browse files
committed
Prevent installation on SQLite3 dbs
1 parent aa9bd7d commit bc31b7f

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

ext.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,21 @@ class ext extends \phpbb\extension\base
2222
{
2323
/**
2424
* Check whether or not the extension can be enabled.
25-
* The current phpBB version should meet or exceed
26-
* the minimum version required by this extension:
2725
*
28-
* Requires phpBB 3.2.1 due to use of $event->update_subarray()
26+
* Requires phpBB >= 3.2.1 due to use of $event->update_subarray()
27+
* Also incompatible with SQLite which does not support SQRT in SQL queries
2928
*
3029
* @return bool
3130
* @access public
3231
*/
3332
public function is_enableable()
3433
{
35-
return phpbb_version_compare(PHPBB_VERSION, '3.2.1', '>=');
34+
if (phpbb_version_compare(PHPBB_VERSION, '3.2.1', '<'))
35+
{
36+
return false;
37+
}
38+
39+
$db = $this->container->get('dbal.conn');
40+
return ($db->get_sql_layer() !== 'sqlite3');
3641
}
3742
}

0 commit comments

Comments
 (0)