</instructions>
<instructions type="update" fromversion="5.3.*">
+ <!--
+tar cvf com.woltlab.wcf/files_pre_check.tar -C wcfsetup/install/files/ \
+ acp/update_com.woltlab.wcf_5.4_checkSystemRequirements.php \
+ acp/update_com.woltlab.wcf_5.4_checkOwnerGroup.php
+ -->
+ <instruction type="file" run="standalone">files_pre_check.tar</instruction>
+
+ <!-- Checks that need to happen before the upgrade starts. -->
+ <instruction type="script" run="standalone">acp/update_com.woltlab.wcf_5.4_checkSystemRequirements.php</instruction>
+ <instruction type="script" run="standalone">acp/update_com.woltlab.wcf_5.4_checkOwnerGroup.php</instruction>
+
<!--
tar cvf com.woltlab.wcf/files_pre.tar -C wcfsetup/install/files/ \
- acp/update_com.woltlab.wcf_5.4_checkOwnerGroup.php \
acp/update_com.woltlab.wcf_5.4_session_1_cookies.php \
acp/update_com.woltlab.wcf_5.4_session_2_user_session.php \
acp/update_com.woltlab.wcf_5.4_session_3_migrate_session.php \
lib/system/package/plugin/FilePackageInstallationPlugin.class.php
-->
<instruction type="file" run="standalone">files_pre.tar</instruction>
-
- <!-- Checks that need to happen before the upgrade starts. -->
- <instruction type="script" run="standalone">acp/update_com.woltlab.wcf_5.4_checkOwnerGroup.php</instruction>
-
+
<!-- Preparations for the new session system. -->
<instruction type="script" run="standalone">acp/update_com.woltlab.wcf_5.4_session_1_cookies.php</instruction>
<instruction type="script" run="standalone">acp/update_com.woltlab.wcf_5.4_session_2_user_session.php</instruction>
--- /dev/null
+<?php
+
+/**
+ * Checks the increased system requirements.
+ *
+ * @author Tim Duesterhus
+ * @copyright 2001-2021 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package WoltLabSuite\Core
+ */
+
+use wcf\system\WCF;
+
+$phpVersion = \PHP_VERSION;
+$neededPhpVersion = '7.2.24';
+if (!\version_compare($phpVersion, $neededPhpVersion, '>=')) {
+ if (WCF::getLanguage()->getFixedLanguageCode() === 'de') {
+ $message = "Ihre PHP-Version '{$phpVersion}' ist unzureichend für die Installation dieser Software. PHP-Version {$neededPhpVersion} oder höher wird benötigt.";
+ } else {
+ $message = "Your PHP version '{$phpVersion}' is insufficient for installation of this software. PHP version {$neededPhpVersion} or greater is required.";
+ }
+
+ throw new \RuntimeException($message);
+}
+
+$sqlVersion = WCF::getDB()->getVersion();
+$compareSQLVersion = \preg_replace('/^(\d+\.\d+\.\d+).*$/', '\\1', $sqlVersion);
+if (\stripos($sqlVersion, 'MariaDB') !== false) {
+ $neededSqlVersion = '10.1.44';
+ $sqlFork = 'MariaDB';
+} else {
+ $sqlFork = 'MySQL';
+ if ($compareSQLVersion[0] === '5') {
+ $neededSqlVersion = '5.7.31';
+ } else {
+ $neededSqlVersion = '8.0.19';
+ }
+}
+
+if (!\version_compare($compareSQLVersion, $neededSqlVersion, '>=')) {
+ if (WCF::getLanguage()->getFixedLanguageCode() === 'de') {
+ $message = "Ihre {$sqlFork}-Version '{$sqlVersion}' ist unzureichend für die Installation dieser Software. {$sqlFork}-Version {$neededSqlVersion} oder höher wird benötigt.";
+ } else {
+ $message = "Your {$sqlFork} version '{$sqlVersion}' is insufficient for installation of this software. {$sqlFork} version {$neededSqlVersion} or greater is required.";
+ }
+
+ throw new \RuntimeException($message);
+}