Merge pull request #19580 from nextcloud/debt/noid/outdated-check

Update check for outdated php version.
This commit is contained in:
Roeland Jago Douma 2020-03-10 20:10:54 +01:00 committed by GitHub
commit c8a360cd7a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 13 deletions

View file

@ -262,12 +262,8 @@ class CheckSetupController extends Controller {
*
* @return bool
*/
protected function isPhpOutdated() {
if (version_compare(PHP_VERSION, '7.1.0', '<')) {
return true;
}
return false;
protected function isPhpOutdated(): bool {
return PHP_VERSION_ID < 70300;
}
/**
@ -276,7 +272,7 @@ class CheckSetupController extends Controller {
*
* @return array
*/
private function isPhpSupported() {
private function isPhpSupported(): array {
return ['eol' => $this->isPhpOutdated(), 'version' => PHP_VERSION];
}

View file

@ -264,17 +264,17 @@
type: OC.SetupChecks.MESSAGE_TYPE_WARNING
});
}
if(data.phpSupported && data.phpSupported.eol) {
if (data.phpSupported && data.phpSupported.eol) {
messages.push({
msg: t('core', 'You are currently running PHP {version}. Upgrade your PHP version to take advantage of <a target="_blank" rel="noreferrer noopener" href="{phpLink}">performance and security updates provided by the PHP Group</a> as soon as your distribution supports it.', {version: data.phpSupported.version, phpLink: 'https://secure.php.net/supported-versions.php'}),
msg: t('core', 'You are currently running PHP {version}. Upgrade your PHP version to take advantage of <a target="_blank" rel="noreferrer noopener" href="{phpLink}">performance and security updates provided by the PHP Group</a> as soon as your distribution supports it.', { version: data.phpSupported.version, phpLink: 'https://secure.php.net/supported-versions.php' }),
type: OC.SetupChecks.MESSAGE_TYPE_INFO
});
})
}
if(data.phpSupported && data.phpSupported.version.substr(0, 3) === '5.6') {
if (data.phpSupported && data.phpSupported.version.substr(0, 3) === '7.2') {
messages.push({
msg: t('core', 'You are currently running PHP 5.6. The current major version of Nextcloud is the last that is supported on PHP 5.6. It is recommended to upgrade the PHP version to 7.0+ to be able to upgrade to Nextcloud 14.'),
msg: t('core', 'Nextcloud 19 is the last release supporting PHP 7.2. Nextcloud 20 requires at least PHP 7.3.'),
type: OC.SetupChecks.MESSAGE_TYPE_INFO
});
})
}
if(!data.forwardedForHeadersWorking) {
messages.push({