Skip to content

Commit c05a7ea

Browse files
committed
Improve PHP and phpBB compatibility checks
1 parent 0d4d106 commit c05a7ea

3 files changed

Lines changed: 27 additions & 3 deletions

File tree

includes/settings.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,26 @@ public function validate()
166166
$validation_errors[] = ['BOARDS_DIR_MISSING', $this->get_boards_dir()];
167167
}
168168

169+
// Validate alt environment boards
170+
if ($this->settings['alt_env'])
171+
{
172+
$phpbb_version = get_phpbb_version($this->qi_path . 'sources/phpBB3_alt/' . $this->settings['alt_env']);
173+
// phpBB 3.1.x is not compat with PHP >= 7 (700000)
174+
// phpBB 3.2.0-3.2.1 is not compat with PHP >= 7.2 (702000)
175+
// phpBB 3.2.x is not compat with PHP >= 7.3 (703000)
176+
// phpBB 3.3.x is not compat with PHP < 7.1.3 (70103)
177+
// phpBB 4.0.x is not compat with PHP < 7.3 (703000)
178+
if ((PHP_VERSION_ID >= 70000 && qi::phpbb_version_compare($phpbb_version, '3.2', '<')) ||
179+
(PHP_VERSION_ID >= 70200 && qi::phpbb_version_compare($phpbb_version, '3.2.2', '<')) ||
180+
(PHP_VERSION_ID >= 70300 && qi::phpbb_version_compare($phpbb_version, '3.3', '<')) ||
181+
(PHP_VERSION_ID < 70103 && qi::phpbb_version_compare($phpbb_version, '3.3', '>=')) ||
182+
(PHP_VERSION_ID < 70300 && qi::phpbb_version_compare($phpbb_version, '4.0', '>='))
183+
)
184+
{
185+
$validation_errors[] = ['PHP_INCOMPATIBLE', $phpbb_version, PHP_VERSION];
186+
}
187+
}
188+
169189
// Adjust boards URL path
170190
qi_file::append_slash($this->settings['boards_url']);
171191

language/en/qi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@
230230
'PHPBB_QI_FULLLINK' => '<a href="https://www.phpbb.com/customise/db/official_tool/phpbb3_quickinstall/">phpBB<small><sup>&reg;</sup></small> QuickInstall</a> %s for phpBB 3.0 - 4.0',
231231
'PHPBB_QI_TITLE' => 'phpBB&reg; QuickInstall',
232232

233-
'PHP7_INCOMPATIBLE' => 'The board you are trying to install, phpBB %1$s, is not compatible with PHP %2$s.',
233+
'PHP_INCOMPATIBLE' => 'The board you are trying to use, phpBB %1$s, is not compatible with PHP %2$s. Refer to the Documentation for our compatibility grid.',
234234
'PHPINFO' => 'PHP info',
235235
'PHPINFO_TITLE' => 'PHP information',
236236
'PHPINFO_EXPLAIN' => 'This page lists information on the version of PHP installed on this server. It includes details of loaded modules, available variables and default settings. This information may be useful when diagnosing problems.<br /><br />Please be aware that some hosting companies will limit what information is displayed here for security reasons.<br /><br />You are advised to only give out details on this page on a need to know basis.',

modules/qi_create.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,16 @@ public function run()
2525
// phpBB 3.1.x is not compat with PHP 7 (700000)
2626
// phpBB 3.2.0-3.2.1 is not compat with PHP 7.2 (702000)
2727
// phpBB 3.2.x is not compat with PHP 7.3 (703000)
28+
// phpBB 3.3.x is not compat with PHP < 7.1.3 (70103)
29+
// phpBB 4.0.x is not compat with PHP < 7.3 (703000)
2830
if ((PHP_VERSION_ID >= 70000 && !defined('PHPBB_32')) ||
2931
(PHP_VERSION_ID >= 70200 && qi::phpbb_version_compare(PHPBB_VERSION, '3.2.2', '<')) ||
30-
(PHP_VERSION_ID >= 70300 && !defined('PHPBB_33'))
32+
(PHP_VERSION_ID >= 70300 && !defined('PHPBB_33')) ||
33+
(PHP_VERSION_ID < 70103 && defined('PHPBB_33')) ||
34+
(PHP_VERSION_ID < 70300 && defined('PHPBB_40'))
3135
)
3236
{
33-
trigger_error(qi::lang('PHP7_INCOMPATIBLE', PHPBB_VERSION, PHP_VERSION));
37+
trigger_error(qi::lang('PHP_INCOMPATIBLE', PHPBB_VERSION, PHP_VERSION));
3438
}
3539

3640
if (defined('PHPBB_31'))

0 commit comments

Comments
 (0)