@@ -17,28 +17,25 @@ class ext extends \phpbb\extension\base
1717{
1818 /**
1919 * Check whether or not the extension can be enabled.
20- * The current phpBB version should meet or exceed
21- * the minimum version required by this extension:
22- *
23- * Requires phpBB 3.1.4
2420 *
2521 * @return bool
2622 */
2723 public function is_enableable ()
2824 {
29- return class_exists ( ' ZipArchive ' ) && ($ this ->phpbb_legacy_compatibility () || $ this ->phpbb_current_compatibility ());
25+ return $ this -> php_requirements ( ) && ($ this ->phpbb_31x_compatible () || $ this ->phpbb_current_compatible ());
3026 }
3127
3228 /**
33- * Check phpBB 3.1 compatibility
29+ * Check PHP requirements
3430 *
35- * Requires phpBB 3.1.4 or greater
31+ * Requires PHP 5.3.9 or greater
32+ * Requires PHP ZipArchive binary
3633 *
3734 * @return bool
3835 */
39- protected function phpbb_legacy_compatibility ()
36+ protected function php_requirements ()
4037 {
41- return phpbb_version_compare (PHPBB_VERSION , '3.1.4 ' , '>= ' ) && phpbb_version_compare ( PHPBB_VERSION , ' 3.2.0-dev ' , ' < ' );
38+ return phpbb_version_compare (PHP_VERSION , '5.3.9 ' , '>= ' ) && class_exists ( ' ZipArchive ' );
4239 }
4340
4441 /**
@@ -48,9 +45,21 @@ protected function phpbb_legacy_compatibility()
4845 *
4946 * @return bool
5047 */
51- protected function phpbb_current_compatibility ()
48+ protected function phpbb_current_compatible ()
5249 {
5350 return phpbb_version_compare (PHPBB_VERSION , '3.2.0-b3 ' , '>= ' );
5451 }
52+
53+ /**
54+ * Check phpBB 3.1 compatibility
55+ *
56+ * Requires phpBB 3.1.4 or greater
57+ *
58+ * @return bool
59+ */
60+ protected function phpbb_31x_compatible ()
61+ {
62+ return phpbb_version_compare (PHPBB_VERSION , '3.1.4 ' , '>= ' ) && phpbb_version_compare (PHPBB_VERSION , '3.2.0-dev ' , '< ' );
63+ }
5564}
5665
0 commit comments