diff --git a/ext.php b/ext.php new file mode 100644 index 0000000..37fce91 --- /dev/null +++ b/ext.php @@ -0,0 +1,62 @@ +check_phpbb_version() && $this->check_php_version(); + + if (!$enableable) + { + $language = $this->container->get('language'); + $language->add_lang('install_groupswitches', 'phpbbmodders/groupswitches'); + + return $language->lang('GROUPSWITCHES_NOT_ENABLEABLE'); + } + + return $enableable; + } + + /** + * Require phpBB 3.3.19 + * + * @return bool + */ + public function check_phpbb_version() + { + return phpbb_version_compare(PHPBB_VERSION, '3.3.19', '>='); + } + + /** + * Require PHP 7.4 + * + * @return bool + */ + public function check_php_version() + { + return PHP_VERSION_ID >= 70400; + } +} diff --git a/language/en/install_groupswitches.php b/language/en/install_groupswitches.php new file mode 100644 index 0000000..1d86f76 --- /dev/null +++ b/language/en/install_groupswitches.php @@ -0,0 +1,44 @@ + 'Group Switches could not be enabled. The minimum requirements of phpBB 3.3.19 and/or PHP 7.4.0 were not satisfied.', +]);