Add update_com.woltlab.wcf_5.5_checkSystemRequirements.php
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 11 May 2022 12:02:15 +0000 (14:02 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 11 May 2022 12:02:15 +0000 (14:02 +0200)
see 48b47a4a8ba0260d52226c80063ebac081fa719b

wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_checkSystemRequirements.php [new file with mode: 0644]

diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_checkSystemRequirements.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.5_checkSystemRequirements.php
new file mode 100644 (file)
index 0000000..022014e
--- /dev/null
@@ -0,0 +1,24 @@
+<?php
+
+/**
+ * Checks the increased system requirements.
+ *
+ * @author  Tim Duesterhus
+ * @copyright   2001-2022 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 = '8.1.2';
+if (!\version_compare($phpVersion, $neededPhpVersion, '>=')) {
+    if (WCF::getLanguage()->getFixedLanguageCode() === 'de') {
+        $message = "Ihre PHP-Version '{$phpVersion}' ist unzureichend f&uuml;r die Installation dieser Software. PHP-Version {$neededPhpVersion} oder h&ouml;her wird ben&ouml;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);
+}