From 3445cbe2a005ead9843d9e17709a915631dd11b5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 23 Sep 2021 10:33:23 +0200 Subject: [PATCH] Recommend 64-bit PHP during WCFSetup Resolves #4512 --- .../files/lib/system/WCFSetup.class.php | 6 +++++ wcfsetup/setup/lang/setup_de.xml | 2 ++ wcfsetup/setup/lang/setup_en.xml | 2 ++ .../template/stepShowSystemRequirements.tpl | 22 +++++++++++++++++++ 4 files changed, 32 insertions(+) diff --git a/wcfsetup/install/files/lib/system/WCFSetup.class.php b/wcfsetup/install/files/lib/system/WCFSetup.class.php index 3135a1e903..e6940b546a 100644 --- a/wcfsetup/install/files/lib/system/WCFSetup.class.php +++ b/wcfsetup/install/files/lib/system/WCFSetup.class.php @@ -387,6 +387,12 @@ class WCFSetup extends WCF $comparePhpVersion = \preg_replace('/^(\d+\.\d+\.\d+).*$/', '\\1', $system['phpVersion']['value']); $system['phpVersion']['result'] = (\version_compare($comparePhpVersion, '7.2.24') >= 0); + // The magic number below is 2**53, the largest integer that can be represented exactly + // as an 64 Bit double precision IEEE-754 floating point number. + // 64 Bit PHP will be able to detect the difference between 2**53 and 2**53 + 1, while + // 32 Bit PHP will not. + $system['x64']['result'] = \PHP_INT_SIZE >= 8 && (9007199254740992 !== 9007199254740992 + 1); + // sql $system['sql']['result'] = MySQLDatabase::isSupported(); diff --git a/wcfsetup/setup/lang/setup_de.xml b/wcfsetup/setup/lang/setup_de.xml index 1e36745109..61a7ede8a7 100644 --- a/wcfsetup/setup/lang/setup_de.xml +++ b/wcfsetup/setup/lang/setup_de.xml @@ -50,6 +50,8 @@ + + diff --git a/wcfsetup/setup/lang/setup_en.xml b/wcfsetup/setup/lang/setup_en.xml index 03a2775eaa..d4d7fbfb5a 100644 --- a/wcfsetup/setup/lang/setup_en.xml +++ b/wcfsetup/setup/lang/setup_en.xml @@ -50,6 +50,8 @@ + + diff --git a/wcfsetup/setup/template/stepShowSystemRequirements.tpl b/wcfsetup/setup/template/stepShowSystemRequirements.tpl index 059e381f6d..8cee1cbe34 100644 --- a/wcfsetup/setup/template/stepShowSystemRequirements.tpl +++ b/wcfsetup/setup/template/stepShowSystemRequirements.tpl @@ -154,6 +154,28 @@

{lang}wcf.global.systemRequirements.recommended{/lang}

+
+

{lang}wcf.global.systemRequirements.x64{/lang}

+ +
+
+
{lang}wcf.global.systemRequirements.element.required{/lang}
+
{lang}wcf.global.systemRequirements.active{/lang}
+
+ +
+
{lang}wcf.global.systemRequirements.element.yours{/lang}
+
+ + {if !$system.x64.result}{lang}wcf.global.systemRequirements.notActive{/lang}{else} + {lang}wcf.global.systemRequirements.active{/lang} + {/if} + {if !$system.x64.result}{lang}wcf.global.systemRequirements.x64.description{/lang}{/if} +
+
+
+
+

{lang}wcf.global.systemRequirements.tls{/lang}

-- 2.20.1